Permalink
Browse files

FIX: Add missing "Play with" to playlist viewers

  • Loading branch information...
1 parent d9b5eee commit b4f7f28afe89589a925cbe6eb4cd78d8e794e9fc @koying committed Oct 26, 2012
Showing with 57 additions and 1 deletion.
  1. +21 −0 xbmc/music/windows/GUIWindowMusicPlaylist.cpp
  2. +36 −1 xbmc/video/windows/GUIWindowVideoPlaylist.cpp
@@ -514,6 +514,12 @@ void CGUIWindowMusicPlayList::GetContextButtons(int itemNumber, CContextButtons
}
else
{ // aren't in a move
+ // check what players we have, if we have multiple display play with option
+ VECPLAYERCORES vecCores;
+ CPlayerCoreFactory::GetPlayers(*item, vecCores);
+ if (vecCores.size() > 1)
+ buttons.Add(CONTEXT_BUTTON_PLAY_WITH, 15213); // Play With...
+
if (!item->IsLastFM())
buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
if (CFavourites::IsFavourite(item.get(), GetID()))
@@ -542,6 +548,21 @@ bool CGUIWindowMusicPlayList::OnContextButton(int itemNumber, CONTEXT_BUTTON but
{
switch (button)
{
+ case CONTEXT_BUTTON_PLAY_WITH:
+ {
+ CFileItemPtr item;
+ if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
+ item = m_vecItems->Get(itemNumber);
+ if (!item)
+ break;
+
+ VECPLAYERCORES vecCores;
+ CPlayerCoreFactory::GetPlayers(*item, vecCores);
+ g_application.m_eForcedNextPlayer = CPlayerCoreFactory::SelectPlayerDialog(vecCores);
+ if( g_application.m_eForcedNextPlayer != EPC_NONE )
+ OnClick(itemNumber);
+ return true;
+ }
case CONTEXT_BUTTON_MOVE_ITEM:
m_movingFrom = itemNumber;
return true;
@@ -393,7 +393,20 @@ void CGUIWindowVideoPlaylist::GetContextButtons(int itemNumber, CContextButtons
{
if (itemNumber > -1)
{
- if (CFavourites::IsFavourite(m_vecItems->Get(itemNumber).get(), GetID()))
+ CFileItemPtr item = m_vecItems->Get(itemNumber);
+ // check what players we have, if we have multiple display play with option
+ VECPLAYERCORES vecCores;
+ if (item->IsVideoDb())
+ {
+ CFileItem item2(item->GetVideoInfoTag()->m_strFileNameAndPath, false);
+ CPlayerCoreFactory::GetPlayers(item2, vecCores);
+ }
+ else
+ CPlayerCoreFactory::GetPlayers(*item, vecCores);
+ if (vecCores.size() > 1)
+ buttons.Add(CONTEXT_BUTTON_PLAY_WITH, 15213); // Play With...
+
+ if (CFavourites::IsFavourite(item.get(), GetID()))
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14077); // Remove Favourite
else
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076); // Add To Favourites;
@@ -419,6 +432,28 @@ bool CGUIWindowVideoPlaylist::OnContextButton(int itemNumber, CONTEXT_BUTTON but
{
switch (button)
{
+ case CONTEXT_BUTTON_PLAY_WITH:
+ {
+ CFileItemPtr item;
+ if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
+ item = m_vecItems->Get(itemNumber);
+ if (!item)
+ break;
+
+ VECPLAYERCORES vecCores;
+ if (item->IsVideoDb())
+ {
+ CFileItem item2(*item->GetVideoInfoTag());
+ CPlayerCoreFactory::GetPlayers(item2, vecCores);
+ }
+ else
+ CPlayerCoreFactory::GetPlayers(*item, vecCores);
+ g_application.m_eForcedNextPlayer = CPlayerCoreFactory::SelectPlayerDialog(vecCores);
+ if (g_application.m_eForcedNextPlayer != EPC_NONE)
+ OnClick(itemNumber);
+ return true;
+ }
+
case CONTEXT_BUTTON_MOVE_ITEM:
m_movingFrom = itemNumber;
return true;

0 comments on commit b4f7f28

Please sign in to comment.