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
583#else
584 String getSubtitles();
585#endif
586
587#ifdef DOXYGEN_SHOULD_USE_THIS
599#else
600 std::vector<String> getAvailableSubtitleStreams();
601#endif
602
603#ifdef DOXYGEN_SHOULD_USE_THIS
622#else
623 void setSubtitleStream(int iStream);
624#endif
625
626 // Player_UpdateInfoTag
627#ifdef DOXYGEN_SHOULD_USE_THIS
650#else
652#endif
653
654#ifdef DOXYGEN_SHOULD_USE_THIS
670#else
672#endif
673
674#ifdef DOXYGEN_SHOULD_USE_THIS
687#else
689#endif
690
691 // Player_GetMusicInfoTag
692#ifdef DOXYGEN_SHOULD_USE_THIS
705#else
707#endif
708
709#ifdef DOXYGEN_SHOULD_USE_THIS
723#else
725#endif
726
727#ifdef DOXYGEN_SHOULD_USE_THIS
740#else
741 double getTotalTime();
742#endif
743
744#ifdef DOXYGEN_SHOULD_USE_THIS
756#else
757 std::vector<String> getAvailableAudioStreams();
758#endif
759
760#ifdef DOXYGEN_SHOULD_USE_THIS
779#else
780 void setAudioStream(int iStream);
781#endif
782
783#ifdef DOXYGEN_SHOULD_USE_THIS
795#else
796 std::vector<String> getAvailableVideoStreams();
797#endif
798
799#ifdef DOXYGEN_SHOULD_USE_THIS
818#else
819 void setVideoStream(int iStream);
820#endif
821
822#if !defined SWIG && !defined DOXYGEN_SHOULD_SKIP_THIS
823 void OnPlayBackStarted(const CFileItem& file) override;
824 void OnAVStarted(const CFileItem& file) override;
825 void OnAVChange() override;
826 void OnPlayBackEnded() override;
827 void OnPlayBackStopped() override;
828 void OnPlayBackError() override;
829 void OnPlayBackPaused() override;
830 void OnPlayBackResumed() override;
831 void OnQueueNextItem() override;
832 void OnPlayBackSpeedChanged(int iSpeed) override;
833 void OnPlayBackSeek(int64_t iTime, int64_t seekOffset) override;
834 void OnPlayBackSeekChapter(int iChapter) override;
835#endif
836
837 protected:
838 };
839 }
840}
841
Definition InfoTagGame.h:49
Definition InfoTagMusic.h:48
Definition InfoTagRadioRDS.h:53
Definition InfoTagVideo.h:860
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...