IPlayer: let player know on close if it will be reopened
authorRainer Hochecker <fernetmenta@online.de>
Thu, 5 Dec 2013 12:38:56 +0000 (13:38 +0100)
committerRainer Hochecker <fernetmenta@online.de>
Tue, 10 Dec 2013 06:58:27 +0000 (07:58 +0100)
13 files changed:
xbmc/ApplicationPlayer.cpp
xbmc/ApplicationPlayer.h
xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
xbmc/cores/ExternalPlayer/ExternalPlayer.h
xbmc/cores/IPlayer.h
xbmc/cores/dvdplayer/DVDPlayer.cpp
xbmc/cores/dvdplayer/DVDPlayer.h
xbmc/cores/omxplayer/OMXPlayer.cpp
xbmc/cores/omxplayer/OMXPlayer.h
xbmc/cores/paplayer/PAPlayer.cpp
xbmc/cores/paplayer/PAPlayer.h
xbmc/network/upnp/UPnPPlayer.cpp
xbmc/network/upnp/UPnPPlayer.h

index 1dd8df6..83aa875 100644 (file)
@@ -49,13 +49,13 @@ void CApplicationPlayer::ClosePlayer()
   }
 }
 
-void CApplicationPlayer::CloseFile()
+void CApplicationPlayer::CloseFile(bool reopen)
 {
   boost::shared_ptr<IPlayer> player = GetInternal();
   if (player)
   {
     ++m_iPlayerOPSeq;
-    player->CloseFile();
+    player->CloseFile(reopen);
   }
 }
 
@@ -81,7 +81,7 @@ void CApplicationPlayer::ClosePlayerGapless(PLAYERCOREID newCore)
     // but if we do not stop it, we can not distingush callbacks from previous
     // item and current item, it will confused us then we can not make correct delay
     // callback after the starting state.
-    CloseFile();
+    CloseFile(true);
   }
 }
 
index 212389f..21a0b7a 100644 (file)
@@ -60,7 +60,7 @@ public:
   int m_iPlaySpeed;
 
   // player management
-  void CloseFile();
+  void CloseFile(bool reopen = false);
   void ClosePlayer();
   void ClosePlayerGapless(PLAYERCOREID newCore);
   void CreatePlayer(PLAYERCOREID newCore, IPlayerCallback& callback);
index 4301a23..81b717e 100644 (file)
@@ -120,7 +120,7 @@ bool CExternalPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &opti
   }
 }
 
-bool CExternalPlayer::CloseFile()
+bool CExternalPlayer::CloseFile(bool reopen)
 {
   m_bAbortRequest = true;
 
index 11a32a5..f30352b 100644 (file)
@@ -36,7 +36,7 @@ public:
   virtual void RegisterAudioCallback(IAudioCallback* pCallback) {}
   virtual void UnRegisterAudioCallback()                        {}
   virtual bool OpenFile(const CFileItem& file, const CPlayerOptions &options);
-  virtual bool CloseFile();
+  virtual bool CloseFile(bool reopen = false);
   virtual bool IsPlaying() const;
   virtual void Pause();
   virtual bool IsPaused() const;
index 21345ae..62cd1be 100644 (file)
@@ -133,7 +133,7 @@ public:
   virtual bool OpenFile(const CFileItem& file, const CPlayerOptions& options){ return false;}
   virtual bool QueueNextFile(const CFileItem &file) { return false; }
   virtual void OnNothingToQueueNotify() {}
-  virtual bool CloseFile(){ return true;}
+  virtual bool CloseFile(bool reopen = false) = 0;
   virtual bool IsPlaying() const { return false;}
   virtual bool CanPause() { return true; };
   virtual void Pause() = 0;
index f9375c6..a698b8f 100644 (file)
@@ -590,7 +590,7 @@ bool CDVDPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options)
   }
 }
 
-bool CDVDPlayer::CloseFile()
+bool CDVDPlayer::CloseFile(bool reopen)
 {
   CLog::Log(LOGNOTICE, "CDVDPlayer::CloseFile()");
 
index 5ae5f9f..dfe679f 100644 (file)
@@ -181,7 +181,7 @@ public:
   CDVDPlayer(IPlayerCallback& callback);
   virtual ~CDVDPlayer();
   virtual bool OpenFile(const CFileItem& file, const CPlayerOptions &options);
-  virtual bool CloseFile();
+  virtual bool CloseFile(bool reopen = false);
   virtual bool IsPlaying() const;
   virtual void Pause();
   virtual bool IsPaused() const;
index 5e77059..9cccaac 100644 (file)
@@ -636,7 +636,7 @@ bool COMXPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
   }
 }
 
-bool COMXPlayer::CloseFile()
+bool COMXPlayer::CloseFile(bool reopen)
 {
   CLog::Log(LOGDEBUG, "COMXPlayer::CloseFile");
 
index 96eed11..f34764d 100644 (file)
@@ -177,7 +177,7 @@ public:
   virtual ~COMXPlayer();
   
   virtual bool  OpenFile(const CFileItem &file, const CPlayerOptions &options);
-  virtual bool  CloseFile();
+  virtual bool  CloseFile(bool reopen = false);
   virtual bool  IsPlaying() const;
   virtual void  Pause();
   virtual bool  IsPaused() const;
index 1785b73..13339f4 100644 (file)
@@ -509,7 +509,7 @@ inline bool PAPlayer::PrepareStream(StreamInfo *si)
   return true;
 }
 
-bool PAPlayer::CloseFile()
+bool PAPlayer::CloseFile(bool reopen)
 {
   if (!m_isPaused)
     SoftStop(true, true);
index 8321ce2..6ae110a 100644 (file)
@@ -46,7 +46,7 @@ public:
   virtual bool OpenFile(const CFileItem& file, const CPlayerOptions &options);
   virtual bool QueueNextFile(const CFileItem &file);
   virtual void OnNothingToQueueNotify();
-  virtual bool CloseFile();
+  virtual bool CloseFile(bool reopen = false);
   virtual bool IsPlaying() const;
   virtual void Pause();
   virtual bool IsPaused() const;
index b78f97b..a5712c4 100644 (file)
@@ -357,7 +357,7 @@ failed:
   return false;
 }
 
-bool CUPnPPlayer::CloseFile()
+bool CUPnPPlayer::CloseFile(bool reopen)
 {
   NPT_CHECK_POINTER_LABEL_SEVERE(m_delegate, failed);
   NPT_CHECK_LABEL(m_control->Stop(m_delegate->m_device
index 61e31ee..b8c721c 100644 (file)
@@ -37,7 +37,7 @@ public:
 
   virtual bool OpenFile(const CFileItem& file, const CPlayerOptions& options);
   virtual bool QueueNextFile(const CFileItem &file);
-  virtual bool CloseFile();
+  virtual bool CloseFile(bool reopen = false);
   virtual bool IsPlaying() const;
   virtual void Pause();
   virtual bool IsPaused() const;