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 void GetGeneralInfo( CStdString& strVideoInfo);
96 float GetPercentage() const;
97 int GetPictureHeight();
98 int GetPictureWidth();
99 CStdString GetPlayerState();
100 CStdString GetPlayingTitle();
101 void GetRenderFeatures(std::vector<int> &renderFeatures);
103 void GetScalingMethods(std::vector<int> &scalingMethods);
104 bool GetStreamDetails(CStreamDetails &details);
106 void GetSubtitleCapabilities(std::vector<int> &subCaps);
107 int GetSubtitleCount();
108 void GetSubtitleStreamInfo(int index, SPlayerSubtitleStreamInfo &info);
109 bool GetSubtitleVisible();
110 TextCacheStruct_t* GetTeletextCache();
111 int64_t GetTime() const;
112 int64_t GetTotalTime() const;
113 void GetVideoInfo( CStdString& strVideoInfo);
114 void GetVideoStreamInfo(SPlayerVideoStreamInfo &info);
115 bool HasAudio() const;
116 bool HasMenu() const;
117 bool HasVideo() const;
118 bool IsCaching() const;
119 bool IsInMenu() const;
120 bool IsPaused() const;
121 bool IsPausedPlayback() const;
122 bool IsPassthrough() const;
123 bool IsPlaying() const;
124 bool IsPlayingAudio() const;
125 bool IsPlayingVideo() const;
126 bool IsRecording() const;
127 void LoadPage(int p, int sp, unsigned char* buffer);
128 bool OnAction(const CAction &action);
129 void OnNothingToQueueNotify();
131 bool QueueNextFile(const CFileItem &file);
132 bool Record(bool bOnOff);
133 void RegisterAudioCallback(IAudioCallback* pCallback);
134 void Seek(bool bPlus = true, bool bLargeStep = false, bool bChapterOverride = false);
135 int SeekChapter(int iChapter);
136 void SeekPercentage(float fPercent = 0);
137 bool SeekScene(bool bPlus = true);
138 void SeekTime(int64_t iTime = 0);
139 void SetAudioStream(int iStream);
140 void SetAVDelay(float fValue = 0.0f);
141 void SetDynamicRangeCompression(long drc);
142 void SetMute(bool bOnOff);
143 bool SetPlayerState(CStdString state);
144 void SetSubtitle(int iStream);
145 void SetSubTitleDelay(float fValue = 0.0f);
146 void SetSubtitleVisible(bool bVisible);
147 void SetVolume(float volume);
148 bool SwitchChannel(const PVR::CPVRChannel &channel);
149 void ToFFRW(int iSpeed = 0);
150 void UnRegisterAudioCallback();