changed: Add logic to properly handle subtitles for stacked files
[vuplus_xbmc] / xbmc / cores / ExternalPlayer / ExternalPlayer.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
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)
10  *  any later version.
11  *
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.
16  *
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/>.
20  *
21  */
22
23 #include "cores/IPlayer.h"
24 #include "threads/Thread.h"
25
26 class CGUIDialogOK;
27
28 class CExternalPlayer : public IPlayer, public CThread
29 {
30 public:
31   enum WARP_CURSOR { WARP_NONE = 0, WARP_TOP_LEFT, WARP_TOP_RIGHT, WARP_BOTTOM_RIGHT, WARP_BOTTOM_LEFT, WARP_CENTER };
32
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;
41   virtual void Pause();
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();
67
68   virtual void SetSubTitleDelay(float fValue = 0.0f);
69   virtual float GetSubTitleDelay();
70
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()                                    {}
77   
78   virtual CStdString GetPlayerState();
79   virtual bool SetPlayerState(CStdString state);
80   
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);
88 #endif
89
90 private:
91   void GetCustomRegexpReplacers(TiXmlElement *pRootElement, CStdStringArray& settings);
92   virtual void Process();
93
94   bool m_bAbortRequest;
95   bool m_bIsPlaying;
96   bool m_paused;
97   int64_t m_playbackStartTime;
98   int m_speed;
99   int m_totalTime;
100   int m_time;
101   CStdString m_launchFilename;
102   HWND m_hwndXbmc; 
103 #if defined(TARGET_WINDOWS)
104   POINT m_ptCursorpos;
105   PROCESS_INFORMATION m_processInfo;
106 #endif 
107   CGUIDialogOK* m_dialog;
108   int m_xPos;
109   int m_yPos;
110   CStdString m_filename;
111   CStdString m_args;
112   bool m_hideconsole;
113   bool m_hidexbmc;
114   bool m_islauncher;
115   bool m_playOneStackItem;
116   WARP_CURSOR m_warpcursor;
117   int m_playCountMinTime;
118   CStdStringArray m_filenameReplacers;
119 };