4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
23 #include <boost/shared_ptr.hpp>
24 #include "threads/SingleLock.h"
25 #include "cores/playercorefactory/PlayerCoreFactory.h"
29 PLAYBACK_CANCELED = -1,
44 struct SPlayerAudioStreamInfo;
45 struct SPlayerVideoStreamInfo;
46 struct SPlayerSubtitleStreamInfo;
47 struct TextCacheStruct_t;
49 class CApplicationPlayer
51 boost::shared_ptr<IPlayer> m_pPlayer;
52 unsigned int m_iPlayerOPSeq; // used to detect whether an OpenFile request on player is canceled by us.
53 PLAYERCOREID m_eCurrentPlayer;
55 CCriticalSection m_player_lock;
65 void ClosePlayerGapless(PLAYERCOREID newCore);
66 void CreatePlayer(PLAYERCOREID newCore, IPlayerCallback& callback);
67 PLAYERCOREID GetCurrentPlayer() const { return m_eCurrentPlayer; }
68 boost::shared_ptr<IPlayer> GetInternal() const;
69 int GetPlaySpeed() const;
70 bool HasPlayer() const;
71 PlayBackRet OpenFile(const CFileItem& item, const CPlayerOptions& options);
72 void ResetPlayer() { m_eCurrentPlayer = EPC_NONE; }
73 void SetPlaySpeed(int iSpeed, bool bApplicationMuted);
76 int AddSubtitle(const CStdString& strSubPath);
80 bool ControlsVolume() const;
82 void GetAudioCapabilities(std::vector<int> &audioCaps);
83 void GetAudioInfo( CStdString& strAudioInfo);
85 int GetAudioStreamCount();
86 void GetAudioStreamInfo(int index, SPlayerAudioStreamInfo &info);
87 int GetBitsPerSample();
88 int GetCacheLevel() const;
89 float GetCachePercentage() const;
90 int GetChapterCount();
92 void GetChapterName(CStdString& strChapterName);
93 void GetDeinterlaceMethods(std::vector<int> &deinterlaceMethods);
94 void GetDeinterlaceModes(std::vector<int> &deinterlaceModes);
95 bool GetCurrentSubtitle(CStdString& strSubtitle);
96 void GetGeneralInfo( CStdString& strVideoInfo);
97 float GetPercentage() const;
98 int GetPictureHeight();
99 int GetPictureWidth();
100 CStdString GetPlayerState();
101 CStdString GetPlayingTitle();
102 void GetRenderFeatures(std::vector<int> &renderFeatures);
104 void GetScalingMethods(std::vector<int> &scalingMethods);
105 bool GetStreamDetails(CStreamDetails &details);
107 void GetSubtitleCapabilities(std::vector<int> &subCaps);
108 int GetSubtitleCount();
109 void GetSubtitleStreamInfo(int index, SPlayerSubtitleStreamInfo &info);
110 bool GetSubtitleVisible();
111 TextCacheStruct_t* GetTeletextCache();
112 int64_t GetTime() const;
113 int64_t GetTotalTime() const;
114 void GetVideoInfo( CStdString& strVideoInfo);
115 void GetVideoStreamInfo(SPlayerVideoStreamInfo &info);
116 bool HasAudio() const;
117 bool HasMenu() const;
118 bool HasVideo() const;
119 bool IsCaching() const;
120 bool IsInMenu() const;
121 bool IsPaused() const;
122 bool IsPausedPlayback() const;
123 bool IsPassthrough() const;
124 bool IsPlaying() const;
125 bool IsPlayingAudio() const;
126 bool IsPlayingVideo() const;
127 bool IsRecording() const;
128 void LoadPage(int p, int sp, unsigned char* buffer);
129 bool OnAction(const CAction &action);
130 void OnNothingToQueueNotify();
132 bool QueueNextFile(const CFileItem &file);
133 bool Record(bool bOnOff);
134 void RegisterAudioCallback(IAudioCallback* pCallback);
135 void Seek(bool bPlus = true, bool bLargeStep = false, bool bChapterOverride = false);
136 int SeekChapter(int iChapter);
137 void SeekPercentage(float fPercent = 0);
138 bool SeekScene(bool bPlus = true);
139 void SeekTime(int64_t iTime = 0);
140 void SetAudioStream(int iStream);
141 void SetAVDelay(float fValue = 0.0f);
142 void SetDynamicRangeCompression(long drc);
143 void SetMute(bool bOnOff);
144 bool SetPlayerState(CStdString state);
145 void SetSubtitle(int iStream);
146 void SetSubTitleDelay(float fValue = 0.0f);
147 void SetSubtitleVisible(bool bVisible);
148 void SetVolume(float volume);
149 bool SwitchChannel(const PVR::CPVRChannel &channel);
150 void ToFFRW(int iSpeed = 0);
151 void UnRegisterAudioCallback();