Merge pull request #4630 from Red-F/gotham-resume-pvr-lastplayedposition
[vuplus_xbmc] / xbmc / ApplicationPlayer.cpp
index 63ca272..83aa875 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "ApplicationPlayer.h"
 #include "cores/IPlayer.h"
+#include "Application.h"
 
 #define VOLUME_MINIMUM 0.0f        // -60dB
 #define VOLUME_MAXIMUM 1.0f        // 0dB
@@ -48,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);
   }
 }
 
@@ -80,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);
   }
 }
 
@@ -222,11 +223,11 @@ void CApplicationPlayer::SetVolume(float volume)
     player->SetVolume(volume);
 }
 
-void CApplicationPlayer::Seek(bool bPlus, bool bLargeStep)
+void CApplicationPlayer::Seek(bool bPlus, bool bLargeStep, bool bChapterOverride)
 {
   boost::shared_ptr<IPlayer> player = GetInternal();
   if (player)
-    player->Seek(bPlus, bLargeStep);
+    player->Seek(bPlus, bLargeStep, bChapterOverride);
 }
 
 void CApplicationPlayer::SeekPercentage(float fPercent)
@@ -279,33 +280,6 @@ int64_t CApplicationPlayer::GetTime() const
     return 0;
 }
 
-int CApplicationPlayer::GetPictureHeight()
-{
-  boost::shared_ptr<IPlayer> player = GetInternal();
-  if (player)
-    return player->GetPictureHeight();
-  else
-    return 0;
-}
-
-int CApplicationPlayer::GetPictureWidth()
-{
-  boost::shared_ptr<IPlayer> player = GetInternal();
-  if (player)
-    return player->GetPictureWidth();
-  else
-    return 0;
-}
-
-int CApplicationPlayer::GetSampleRate()
-{
-  boost::shared_ptr<IPlayer> player = GetInternal();
-  if (player)
-    return player->GetSampleRate();
-  else
-    return 0;
-}
-
 bool CApplicationPlayer::IsCaching() const
 {
   boost::shared_ptr<IPlayer> player = GetInternal();
@@ -342,15 +316,6 @@ int CApplicationPlayer::GetSubtitleCount()
     return 0;
 }
 
-int CApplicationPlayer::GetBitsPerSample()
-{
-  boost::shared_ptr<IPlayer> player = GetInternal();
-  if (player)
-    return player->GetBitsPerSample();
-  else
-    return 0;
-}
-
 int CApplicationPlayer::GetAudioStream()
 {
   boost::shared_ptr<IPlayer> player = GetInternal();
@@ -618,12 +583,6 @@ void CApplicationPlayer::GetGeneralInfo( CStdString& strVideoInfo)
     player->GetGeneralInfo(strVideoInfo);
 }
 
-bool CApplicationPlayer::GetCurrentSubtitle(CStdString& strSubtitle)
-{
-  boost::shared_ptr<IPlayer> player = GetInternal();
-  return (player && player->GetCurrentSubtitle(strSubtitle));
-}
-
 int  CApplicationPlayer::SeekChapter(int iChapter)
 {
   boost::shared_ptr<IPlayer> player = GetInternal();
@@ -693,7 +652,7 @@ void CApplicationPlayer::SetPlaySpeed(int iSpeed, bool bApplicationMuted)
   {
     if (m_iPlaySpeed == 1)
     { // restore volume
-      player->SetVolume(VOLUME_MAXIMUM);
+      player->SetVolume(g_application.GetVolume(false));
     }
     else
     { // mute volume