stopplay_waiting_thread.cpp 768 B

123456789101112131415161718192021222324252627282930
  1. // ***********************************************************/
  2. // stopplay_waiting_thread.cpp
  3. //
  4. // Copy Right @ Steven Huang. All rights reserved.
  5. //
  6. // Waiting play-stop thread
  7. // ***********************************************************/
  8. #include "stopplay_waiting_thread.h"
  9. #include "playercontroller.h"
  10. StopWaitingThread::StopWaitingThread(QObject* parent, const QString& file)
  11. : QThread(parent)
  12. , m_file(file)
  13. {}
  14. StopWaitingThread::~StopWaitingThread() {}
  15. void StopWaitingThread::run()
  16. {
  17. PlayerController* pMainWnd = (PlayerController*) parent();
  18. emit stopPlay();
  19. while (pMainWnd && pMainWnd->isPlaying()) {
  20. msleep(2);
  21. }
  22. emit startPlay(m_file);
  23. qDebug("-------- stopplay waiting thread exit.");
  24. return;
  25. }