3 * Copyright (C) 2005-2008 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 * http://www.gnu.org/copyleft/gpl.html
23 #include "utils/XBMCTinyXML.h"
24 #include "cores/IPlayer.h"
25 #include "PlayerCoreFactory.h"
26 #include "cores/dvdplayer/DVDPlayer.h"
27 #include "cores/paplayer/PAPlayer.h"
28 #if defined(HAS_AMLPLAYER)
29 #include "cores/amlplayer/AMLPlayer.h"
31 #include "cores/ExternalPlayer/ExternalPlayer.h"
32 #include "utils/log.h"
34 class CPlayerCoreConfig
36 friend class CPlayerCoreFactory;
39 CPlayerCoreConfig(CStdString name, const EPLAYERCORES eCore, const TiXmlElement* pConfig)
43 m_bPlaysAudio = false;
44 m_bPlaysVideo = false;
48 m_config = (TiXmlElement*)pConfig->Clone();
49 const char *szAudio = pConfig->Attribute("audio");
50 const char *szVideo = pConfig->Attribute("video");
51 m_bPlaysAudio = szAudio && stricmp(szAudio, "true") == 0;
52 m_bPlaysVideo = szVideo && stricmp(szVideo, "true") == 0;
58 CLog::Log(LOGDEBUG, "CPlayerCoreConfig::<ctor>: created player %s for core %d", m_name.c_str(), m_eCore);
61 virtual ~CPlayerCoreConfig()
63 SAFE_DELETE(m_config);
66 const CStdString& GetName() const
71 IPlayer* CreatePlayer(IPlayerCallback& callback) const
77 case EPC_DVDPLAYER: pPlayer = new CDVDPlayer(callback); break;
78 case EPC_PAPLAYER: pPlayer = new PAPlayer(callback); break;
79 case EPC_EXTPLAYER: pPlayer = new CExternalPlayer(callback); break;
80 #if defined(HAS_AMLPLAYER)
81 case EPC_AMLPLAYER: pPlayer = new CAMLPlayer(callback); break;
86 if (pPlayer->Initialize(m_config))
101 EPLAYERCORES m_eCore;
102 TiXmlElement* m_config;