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 "cores/IPlayer.h"
24 #include "threads/Thread.h"
28 class CExternalPlayer : public IPlayer, public CThread
31 enum WARP_CURSOR { WARP_NONE = 0, WARP_TOP_LEFT, WARP_TOP_RIGHT, WARP_BOTTOM_RIGHT, WARP_BOTTOM_LEFT, WARP_CENTER };
33 CExternalPlayer(IPlayerCallback& callback);
34 virtual ~CExternalPlayer();
35 virtual bool Initialize(TiXmlElement* pConfig);
36 virtual void RegisterAudioCallback(IAudioCallback* pCallback) {}
37 virtual void UnRegisterAudioCallback() {}
38 virtual bool OpenFile(const CFileItem& file, const CPlayerOptions &options);
39 virtual bool CloseFile();
40 virtual bool IsPlaying() const;
42 virtual bool IsPaused() const;
43 virtual bool HasVideo() const;
44 virtual bool HasAudio() const;
45 virtual void ToggleOSD() { }; // empty
46 virtual void SwitchToNextLanguage();
47 virtual void ToggleSubtitles();
48 virtual bool CanSeek();
49 virtual void Seek(bool bPlus, bool bLargeStep, bool bChapterOverride);
50 virtual void SeekPercentage(float iPercent);
51 virtual float GetPercentage();
52 virtual void SetVolume(float volume) {}
53 virtual void SetDynamicRangeCompression(long drc) {}
54 virtual void SetContrast(bool bPlus) {}
55 virtual void SetBrightness(bool bPlus) {}
56 virtual void SetHue(bool bPlus) {}
57 virtual void SetSaturation(bool bPlus) {}
58 virtual void GetAudioInfo(CStdString& strAudioInfo);
59 virtual void GetVideoInfo(CStdString& strVideoInfo);
60 virtual void GetGeneralInfo( CStdString& strVideoInfo);
61 virtual void SwitchToNextAudioLanguage();
62 virtual bool CanRecord() { return false; }
63 virtual bool IsRecording() { return false; }
64 virtual bool Record(bool bOnOff) { return false; }
65 virtual void SetAVDelay(float fValue = 0.0f);
66 virtual float GetAVDelay();
68 virtual void SetSubTitleDelay(float fValue = 0.0f);
69 virtual float GetSubTitleDelay();
71 virtual void SeekTime(int64_t iTime);
72 virtual int64_t GetTime();
73 virtual int64_t GetTotalTime();
74 virtual void ToFFRW(int iSpeed);
75 virtual void ShowOSD(bool bOnoff);
76 virtual void DoAudioWork() {}
78 virtual CStdString GetPlayerState();
79 virtual bool SetPlayerState(CStdString state);
81 #if defined(TARGET_WINDOWS)
82 virtual BOOL ExecuteAppW32(const char* strPath, const char* strSwitches);
83 //static void CALLBACK AppFinished(void* closure, BOOLEAN TimerOrWaitFired);
84 #elif defined(TARGET_ANDROID)
85 virtual BOOL ExecuteAppAndroid(const char* strSwitches,const char* strPath);
86 #elif defined(TARGET_POSIX)
87 virtual BOOL ExecuteAppLinux(const char* strSwitches);
91 void GetCustomRegexpReplacers(TiXmlElement *pRootElement, CStdStringArray& settings);
92 virtual void Process();
97 int64_t m_playbackStartTime;
101 CStdString m_launchFilename;
103 #if defined(TARGET_WINDOWS)
105 PROCESS_INFORMATION m_processInfo;
107 CGUIDialogOK* m_dialog;
110 CStdString m_filename;
115 bool m_playOneStackItem;
116 WARP_CURSOR m_warpcursor;
117 int m_playCountMinTime;
118 CStdStringArray m_filenameReplacers;