Skip to content

Commit

Permalink
addons: deprecate plugin/script ability to set player.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Fields committed Sep 15, 2012
1 parent aaf9804 commit e3d19a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 39 deletions.
11 changes: 7 additions & 4 deletions xbmc/interfaces/legacy/ModuleXbmc.cpp
Expand Up @@ -485,10 +485,13 @@ namespace XBMCAddon

int getPLAYLIST_MUSIC() { return PLAYLIST_MUSIC; }
int getPLAYLIST_VIDEO() { return PLAYLIST_VIDEO; }
int getPLAYER_CORE_AUTO() { return EPC_NONE; }
int getPLAYER_CORE_DVDPLAYER() { return EPC_DVDPLAYER; }
int getPLAYER_CORE_MPLAYER() { return EPC_MPLAYER; }
int getPLAYER_CORE_PAPLAYER() { return EPC_PAPLAYER; }

// deprecated/ignored for Frodo. Remove for Frodo+1.
int getPLAYER_CORE_AUTO() { return 0; }
int getPLAYER_CORE_DVDPLAYER() { return -1; }
int getPLAYER_CORE_MPLAYER() { return -1; }
int getPLAYER_CORE_PAPLAYER() { return -1; }

int getTRAY_OPEN() { return TRAY_OPEN; }
int getDRIVE_NOT_READY() { return DRIVE_NOT_READY; }
int getTRAY_CLOSED_NO_MEDIA() { return TRAY_CLOSED_NO_MEDIA; }
Expand Down
26 changes: 2 additions & 24 deletions xbmc/interfaces/legacy/Player.cpp
Expand Up @@ -39,12 +39,8 @@ namespace XBMCAddon
{
iPlayList = PLAYLIST_MUSIC;

if (_playerCore == EPC_DVDPLAYER ||
_playerCore == EPC_MPLAYER ||
_playerCore == EPC_PAPLAYER)
playerCore = (EPLAYERCORES)_playerCore;
else
playerCore = EPC_NONE;
if (_playerCore != 0)
CLog::Log(LOGERROR, "xbmc.Player: Requested non-default player. This behavior is deprecated, plugins may no longer specify a player", _playerCore);

// now that we're done, register hook me into the system
if (languageHook)
Expand All @@ -68,9 +64,6 @@ namespace XBMCAddon
// set fullscreen or windowed
g_settings.m_bStartVideoWindowed = windowed;

// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;

const AddonClass::Ref<xbmcgui::ListItem> listitem(plistitem);

if (listitem.isSet())
Expand All @@ -95,9 +88,6 @@ namespace XBMCAddon
// set fullscreen or windowed
g_settings.m_bStartVideoWindowed = windowed;

// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;

// play current file in playlist
if (g_playlistPlayer.GetCurrentPlaylist() != iPlayList)
g_playlistPlayer.SetCurrentPlaylist(iPlayList);
Expand All @@ -112,9 +102,6 @@ namespace XBMCAddon
// set fullscreen or windowed
g_settings.m_bStartVideoWindowed = windowed;

// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;

// play a python playlist (a playlist from playlistplayer.cpp)
iPlayList = playlist->getPlayListId();
g_playlistPlayer.SetCurrentPlaylist(iPlayList);
Expand All @@ -139,27 +126,18 @@ namespace XBMCAddon
void Player::playnext()
{
TRACE;
// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;

CApplicationMessenger::Get().PlayListPlayerNext();
}

void Player::playprevious()
{
TRACE;
// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;

CApplicationMessenger::Get().PlayListPlayerPrevious();
}

void Player::playselected(int selected)
{
TRACE;
// force a playercore before playing
g_application.m_eForcedNextPlayer = playerCore;

if (g_playlistPlayer.GetCurrentPlaylist() != iPlayList)
{
g_playlistPlayer.SetCurrentPlaylist(iPlayList);
Expand Down
15 changes: 4 additions & 11 deletions xbmc/interfaces/legacy/Player.h
Expand Up @@ -21,8 +21,6 @@

#pragma once

#include "cores/playercorefactory/PlayerCoreFactory.h"

#include "ListItem.h"
#include "PlayList.h"
#include "InfoTagVideo.h"
Expand All @@ -45,11 +43,7 @@ namespace XBMCAddon
*
* Player([core]) -- Creates a new Player with as default the xbmc music playlist.
*
* core : (optional) Use a specified playcore instead of letting xbmc decide the playercore to use.
* - xbmc.PLAYER_CORE_AUTO
* - xbmc.PLAYER_CORE_DVDPLAYER
* - xbmc.PLAYER_CORE_MPLAYER
* - xbmc.PLAYER_CORE_PAPLAYER
* core : (ignored) Use a specified playcore instead of letting xbmc decide the playercore to use.
*
* This class is a merge of what was previously in xbmcmodule/player.h
* and xbmcmodule/PythonPlayer.h without the python references. The
Expand All @@ -60,15 +54,14 @@ namespace XBMCAddon
{
private:
int iPlayList;
EPLAYERCORES playerCore;

public:
/**
* Construct a Player proxying the given generated binding. The
* construction of a Player needs to identify whether or not any
* callbacks will be executed asynchronously or not.
*/
Player(int playerCore = EPC_NONE);
Player(int playerCore = 0);
virtual ~Player(void);

/**
Expand All @@ -87,7 +80,7 @@ namespace XBMCAddon
* example:
* - listitem = xbmcgui.ListItem('Ironman')
* - listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})
* - xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play(url, listitem, windowed)\n
* - xbmc.Player().play(url, listitem, windowed)\n
*/
void playStream(const String& item = emptyString, const XBMCAddon::xbmcgui::ListItem* listitem = NULL, bool windowed = false);

Expand All @@ -113,7 +106,7 @@ namespace XBMCAddon
* windowed : [opt] bool - true=play video windowed, false=play users preference.(default)
*
* example:
* - xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play()
* - xbmc.Player().play()
*/
void playCurrent(bool windowed = false);

Expand Down

0 comments on commit e3d19a0

Please sign in to comment.