CGUIWindowManager::OnAction(const CAction &action) const
{HandleAction(action);}
CGUIWindowManager::HandleAction(CAction const& action) const
{CGUIWindow* window = GetWindow(GetActiveWindow());
if (window)
return window->OnAction(action);}
CGUIWindow
{// OnAction() is called by our window manager. We should process any messages
// that should be handled at the window level in the derived classes, and any
// unhandled messages should be dropped through to here where we send the message
// on to the currently focused control. Returns true if the action has been handled
// and does not need to be passed further down the line (to our global action handlers)}
CGUIWindowVideoBase:CGUIMediaWindow:CGUIWindow
CGUIWindowVideoBase::PlayItem(int iItem, const std::string &player)
{CServiceBroker::GetPlaylistPlayer().ClearPlaylist(PLAYLIST_VIDEO);
CServiceBroker::GetPlaylistPlayer().Reset();
CServiceBroker::GetPlaylistPlayer().Add(PLAYLIST_VIDEO, queuedItems);
CServiceBroker::GetPlaylistPlayer().SetCurrentPlaylist(PLAYLIST_VIDEO);
CServiceBroker::GetPlaylistPlayer().Play();}
CGUIWindowVideoBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{OnPlayMedia(itemNumber);}
CGUIWindowVideoBase::OnPlayMedia(int iItem, const std::string &player) override CGUIMediaWindow
{PlayMovie(&item, player);}
CGUIWindowVideoBase::PlayMovie(const CFileItem *item, const std::string &player)
{CServiceBroker::GetPlaylistPlayer().Play(std::make_shared<CFileItem>(*item), player);}
CPlayListPlayer::Play(const CFileItemPtr &pItem, std::string player)
{g_application.PlayFile(*item, player, bAutoPlay);}
PLAYLIST::CPlayListPlayer &CServiceBroker::GetPlaylistPlayer()
{
return g_application.m_ServiceManager->GetPlaylistPlayer();
}
CServiceManager
{std::unique_ptr<PLAYLIST::CPlayListPlayer> m_playlistPlayer;}
CApplication
{std::unique_ptr<CServiceManager> m_ServiceManager;}
CApplication::Create(const CAppParamParser ¶ms)
{m_ServiceManager.reset(new CServiceManager());
m_ServiceManager->InitStageOne()}
CServiceManager::InitStageOne()
{m_playlistPlayer.reset(new PLAYLIST::CPlayListPlayer());}
CApplication
{CApplicationPlayer m_appPlayer;}
CApplication::PlayFile(CFileItem item, const std::string& player, bool bRestart)
{m_appPlayer.OpenFile(item, options, m_ServiceManager->GetPlayerCoreFactory(), player, *this);}
CApplicationPlayer::OpenFile(const CFileItem& item, const CPlayerOptions& options,
const CPlayerCoreFactory &factory,
const std::string &playerName, IPlayerCallback& callback) //callback is CApplication
{player = CreatePlayer(factory, newPlayer, callback);
player->OpenFile(item, options);
}
CApplicationPlayer::CreatePlayer(const CPlayerCoreFactory &factory, const std::string &player, IPlayerCallback& callback)
{m_pPlayer.reset(factory.CreatePlayer(player, callback));}
CApplicationPlayer
{std::shared_ptr<IPlayer> m_pPlayer;}
IPlayer* CPlayerCoreFactory::CreatePlayer(const std::string& nameId, IPlayerCallback& callback) const
{return m_vecPlayerConfigs[idx]->CreatePlayer(callback);}
CPlayerCoreConfig
{IPlayer* CreatePlayer(IPlayerCallback& callback) const
{pPlayer = new CVideoPlayer(callback);}
}