#include "ApplicationPlayer.h"
#include "cores/IPlayer.h"
+#include "Application.h"
#define VOLUME_MINIMUM 0.0f // -60dB
#define VOLUME_MAXIMUM 1.0f // 0dB
}
}
-void CApplicationPlayer::CloseFile()
+void CApplicationPlayer::CloseFile(bool reopen)
{
boost::shared_ptr<IPlayer> player = GetInternal();
if (player)
{
++m_iPlayerOPSeq;
- player->CloseFile();
+ player->CloseFile(reopen);
}
}
// 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);
}
}
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)
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();
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();
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();
{
if (m_iPlaySpeed == 1)
{ // restore volume
- player->SetVolume(VOLUME_MAXIMUM);
+ player->SetVolume(g_application.GetVolume(false));
}
else
{ // mute volume