2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
12 #include "cores/IPlayer.h"
13 #include "threads/Thread.h"
21 class CExternalPlayer
: public IPlayer
, public CThread
24 enum WARP_CURSOR
{ WARP_NONE
= 0, WARP_TOP_LEFT
, WARP_TOP_RIGHT
, WARP_BOTTOM_RIGHT
, WARP_BOTTOM_LEFT
, WARP_CENTER
};
26 explicit CExternalPlayer(IPlayerCallback
& callback
);
27 ~CExternalPlayer() override
;
28 bool Initialize(TiXmlElement
* pConfig
) override
;
29 bool OpenFile(const CFileItem
& file
, const CPlayerOptions
&options
) override
;
30 bool CloseFile(bool reopen
= false) override
;
31 bool IsPlaying() const override
;
32 void Pause() override
;
33 bool HasVideo() const override
;
34 bool HasAudio() const override
;
35 bool CanSeek() const override
;
36 void Seek(bool bPlus
, bool bLargeStep
, bool bChapterOverride
) override
;
37 void SeekPercentage(float iPercent
) override
;
38 void SetVolume(float volume
) override
{}
39 void SetDynamicRangeCompression(long drc
) override
{}
40 void SetAVDelay(float fValue
= 0.0f
) override
;
41 float GetAVDelay() override
;
43 void SetSubTitleDelay(float fValue
= 0.0f
) override
;
44 float GetSubTitleDelay() override
;
46 void SeekTime(int64_t iTime
) override
;
47 void SetSpeed(float speed
) override
;
49 bool SetPlayerState(const std::string
& state
) override
;
51 #if defined(TARGET_WINDOWS_DESKTOP)
52 bool ExecuteAppW32(const char* strPath
, const char* strSwitches
);
53 //static void CALLBACK AppFinished(void* closure, BOOLEAN TimerOrWaitFired);
54 #elif defined(TARGET_ANDROID)
55 bool ExecuteAppAndroid(const char* strSwitches
,const char* strPath
);
56 #elif defined(TARGET_POSIX)
57 bool ExecuteAppLinux(const char* strSwitches
);
61 void GetCustomRegexpReplacers(TiXmlElement
*pRootElement
, std::vector
<std::string
>& settings
);
62 void Process() override
;
66 std::chrono::time_point
<std::chrono::steady_clock
> m_playbackStartTime
;
69 std::string m_launchFilename
;
70 #if defined(TARGET_WINDOWS_DESKTOP)
72 PROCESS_INFORMATION m_processInfo
;
74 CGUIDialogOK
* m_dialog
;
75 #if defined(TARGET_WINDOWS_DESKTOP)
79 std::string m_filename
;
84 bool m_playOneStackItem
;
85 WARP_CURSOR m_warpcursor
;
86 int m_playCountMinTime
;
87 std::vector
<std::string
> m_filenameReplacers
;