Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
Player.h
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "AddonCallback.h"
12#include "AddonString.h"
13#include "Alternative.h"
14#include "Exception.h"
15#include "InfoTagGame.h"
16#include "InfoTagMusic.h"
17#include "InfoTagRadioRDS.h"
18#include "InfoTagVideo.h"
19#include "ListItem.h"
20#include "PlayList.h"
21#include "cores/IPlayerCallback.h"
22#include "swighelper.h"
23
24#include <vector>
25
26namespace XBMCAddon
27{
28 namespace xbmc
29 {
30 XBMCCOMMONS_STANDARD_EXCEPTION(PlayerException);
31
32 typedef Alternative<String, const PlayList* > PlayParameter;
33
34 // This class is a merge of what was previously in xbmcmodule/player.h
35 // and xbmcmodule/PythonPlayer.h without the python references. The
36 // queuing and handling of asynchronous callbacks is done internal to
37 // this class.
38
39 //
59 //
60 class Player : public AddonCallback, public IPlayerCallback
61 {
62 private:
63 int iPlayList;
64
65 void playStream(const String& item = emptyString, const XBMCAddon::xbmcgui::ListItem* listitem = NULL, bool windowed = false);
66 void playPlaylist(const PlayList* playlist = NULL,
67 bool windowed = false, int startpos=-1);
68 void playCurrent(bool windowed = false);
69
70 public:
71#if !defined SWIG && !defined DOXYGEN_SHOULD_SKIP_THIS
72 static PlayParameter defaultPlayParameter;
73#endif
74
75#ifndef DOXYGEN_SHOULD_SKIP_THIS
76 // Construct a Player proxying the given generated binding. The
77 // construction of a Player needs to identify whether or not any
78 // callbacks will be executed asynchronously or not.
79 explicit Player();
80 ~Player(void) override;
81#endif
82
83#ifdef DOXYGEN_SHOULD_USE_THIS
124 play(...);
125#else
126 void play(const PlayParameter& item = Player::defaultPlayParameter,
127 const XBMCAddon::xbmcgui::ListItem* listitem = NULL, bool windowed = false, int startpos = -1);
128#endif
129
130#ifdef DOXYGEN_SHOULD_USE_THIS
137#else
138 void stop();
139#endif
140
141#ifdef DOXYGEN_SHOULD_USE_THIS
148#else
149 void pause();
150#endif
151
152#ifdef DOXYGEN_SHOULD_USE_THIS
159#else
160 void playnext();
161#endif
162
163#ifdef DOXYGEN_SHOULD_USE_THIS
170#else
171 void playprevious();
172#endif
173
174#ifdef DOXYGEN_SHOULD_USE_THIS
183#else
184 void playselected(int selected);
185#endif
186
187 //
198 //
199
200#ifdef DOXYGEN_SHOULD_USE_THIS
213#else
214 virtual void onPlayBackStarted();
215#endif
216
217
218#ifdef DOXYGEN_SHOULD_USE_THIS
230#else
231 virtual void onAVStarted();
232#endif
233
234
235#ifdef DOXYGEN_SHOULD_USE_THIS
247#else
248 virtual void onAVChange();
249#endif
250
251#ifdef DOXYGEN_SHOULD_USE_THIS
260#else
261 virtual void onPlayBackEnded();
262#endif
263
264#ifdef DOXYGEN_SHOULD_USE_THIS
273#else
274 virtual void onPlayBackStopped();
275#endif
276
277#ifdef DOXYGEN_SHOULD_USE_THIS
286#else
287 virtual void onPlayBackError();
288#endif
289
290#ifdef DOXYGEN_SHOULD_USE_THIS
299#else
300 virtual void onPlayBackPaused();
301#endif
302
303#ifdef DOXYGEN_SHOULD_USE_THIS
312#else
313 virtual void onPlayBackResumed();
314#endif
315
316#ifdef DOXYGEN_SHOULD_USE_THIS
325#else
326 virtual void onQueueNextItem();
327#endif
328
329#ifdef DOXYGEN_SHOULD_USE_THIS
343#else
344 virtual void onPlayBackSpeedChanged(int speed);
345#endif
346
347#ifdef DOXYGEN_SHOULD_USE_THIS
359#else
360 virtual void onPlayBackSeek(int time, int seekOffset);
361#endif
362
363#ifdef DOXYGEN_SHOULD_USE_THIS
374#else
375 virtual void onPlayBackSeekChapter(int chapter);
376#endif
378
379#ifdef DOXYGEN_SHOULD_USE_THIS
388#else
389 bool isPlaying();
390#endif
391
392#ifdef DOXYGEN_SHOULD_USE_THIS
401#else
402 bool isPlayingAudio();
403#endif
404
405#ifdef DOXYGEN_SHOULD_USE_THIS
414#else
415 bool isPlayingVideo();
416#endif
417
418#ifdef DOXYGEN_SHOULD_USE_THIS
428#else
429 bool isPlayingRDS();
430#endif
431
432#ifdef DOXYGEN_SHOULD_USE_THIS
444#else
445 bool isPlayingGame();
446#endif
447
448#ifdef DOXYGEN_SHOULD_USE_THIS
462#else
463 bool isExternalPlayer();
464#endif
465
466#ifdef DOXYGEN_SHOULD_USE_THIS
479#else
480 String getPlayingFile();
481#endif
482
483#ifdef DOXYGEN_SHOULD_USE_THIS
496#else
498#endif
499
500#ifdef DOXYGEN_SHOULD_USE_THIS
513#else
514 double getTime();
515#endif
516
517#ifdef DOXYGEN_SHOULD_USE_THIS
531#else
532 void seekTime(double seekTime);
533#endif
534
535#ifdef DOXYGEN_SHOULD_USE_THIS
544#else
545 void setSubtitles(const char* subtitleFile);
546#endif
547
548#ifdef DOXYGEN_SHOULD_USE_THIS
567#else
568 void showSubtitles(bool bVisible);
569#endif
570
571#ifdef DOXYGEN_SHOULD_USE_THIS
580#else
581 String getSubtitles();
582#endif
583
584#ifdef DOXYGEN_SHOULD_USE_THIS
593#else
594 std::vector<String> getAvailableSubtitleStreams();
595#endif
596
597#ifdef DOXYGEN_SHOULD_USE_THIS
616#else
617 void setSubtitleStream(int iStream);
618#endif
619
620 // Player_UpdateInfoTag
621#ifdef DOXYGEN_SHOULD_USE_THIS
644#else
646#endif
647
648#ifdef DOXYGEN_SHOULD_USE_THIS
664#else
666#endif
667
668#ifdef DOXYGEN_SHOULD_USE_THIS
681#else
683#endif
684
685 // Player_GetMusicInfoTag
686#ifdef DOXYGEN_SHOULD_USE_THIS
699#else
701#endif
702
703#ifdef DOXYGEN_SHOULD_USE_THIS
717#else
719#endif
720
721#ifdef DOXYGEN_SHOULD_USE_THIS
734#else
735 double getTotalTime();
736#endif
737
738#ifdef DOXYGEN_SHOULD_USE_THIS
747#else
748 std::vector<String> getAvailableAudioStreams();
749#endif
750
751#ifdef DOXYGEN_SHOULD_USE_THIS
770#else
771 void setAudioStream(int iStream);
772#endif
773
774#ifdef DOXYGEN_SHOULD_USE_THIS
783#else
784 std::vector<String> getAvailableVideoStreams();
785#endif
786
787#ifdef DOXYGEN_SHOULD_USE_THIS
806#else
807 void setVideoStream(int iStream);
808#endif
809
810#if !defined SWIG && !defined DOXYGEN_SHOULD_SKIP_THIS
811 void OnPlayBackStarted(const CFileItem& file) override;
812 void OnAVStarted(const CFileItem& file) override;
813 void OnAVChange() override;
814 void OnPlayBackEnded() override;
815 void OnPlayBackStopped() override;
816 void OnPlayBackError() override;
817 void OnPlayBackPaused() override;
818 void OnPlayBackResumed() override;
819 void OnQueueNextItem() override;
820 void OnPlayBackSpeedChanged(int iSpeed) override;
821 void OnPlayBackSeek(int64_t iTime, int64_t seekOffset) override;
822 void OnPlayBackSeekChapter(int iChapter) override;
823#endif
824
825 protected:
826 };
827 }
828}
829
Definition InfoTagGame.h:49
Definition InfoTagMusic.h:48
Definition InfoTagRadioRDS.h:53
Definition InfoTagVideo.h:859
Definition PlayList.h:50
Definition Player.h:61
Definition ListItem.h:54
onPlayBackSeekChapter(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackPaused()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackStopped()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackError()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onAVStarted()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackResumed()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onAVChange()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackSeek(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackStarted()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackEnded()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onQueueNextItem()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
onPlayBackSpeedChanged(int speed)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getVideoInfoTag()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
setSubtitles(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getAvailableVideoStreams()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getMusicInfoTag()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
isPlayingGame()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
isExternalPlayer()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
playselected(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
isPlayingVideo()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
showSubtitles(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
isPlayingAudio()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
isPlaying()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getTime()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
setVideoStream(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
setAudioStream(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getGameInfoTag()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getAvailableAudioStreams()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
updateInfoTag()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
play(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
stop()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getRadioRDSInfoTag()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
pause()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
setSubtitleStream(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
seekTime(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getPlayingItem()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getTotalTime()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getSubtitles()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
playprevious()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
playnext()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getAvailableSubtitleStreams()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
isPlayingRDS()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...
getPlayingFile()
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...