Ticket #10710: mythmusic_add_menu.patch

File mythmusic_add_menu.patch, 1.7 KB (added by trebor_s@…, 8 years ago)

Adds a menu to add/replace files and play them directly

  • mythplugins/mythmusic/mythmusic/musiccommon.cpp

    diff --git a/mythplugins/mythmusic/mythmusic/musiccommon.cpp b/mythplugins/mythmusic/mythmusic/musiccommon.cpp
    index 91b54b7..13378f7 100644
    a b void MusicCommon::customEvent(QEvent *event) 
    13871387                m_playlistOptions.insertPLOption = PL_REPLACE;
    13881388                doUpdatePlaylist();
    13891389            }
     1390            else if (resulttext == tr("Replace Tracks and Play"))
     1391            {
     1392                int trackCount = gPlayer->getPlaylist()->getSongs().count();
     1393                m_playlistOptions.insertPLOption = PL_REPLACE;
     1394                doUpdatePlaylist();
     1395                gPlayer->setCurrentTrackPos(trackCount);
     1396            }
    13901397            else if (resulttext == tr("Add Tracks"))
    13911398            {
    13921399                m_playlistOptions.insertPLOption = PL_INSERTATEND;
    13931400                doUpdatePlaylist();
    13941401            }
     1402            else if (resulttext == tr("Add Tracks and Play"))
     1403            {
     1404                int trackCount = gPlayer->getPlaylist()->getSongs().count();
     1405                m_playlistOptions.insertPLOption = PL_INSERTATEND;
     1406                doUpdatePlaylist();
     1407                gPlayer->setCurrentTrackPos(trackCount);
     1408            }
    13951409        }
    13961410        else if (resultid == "visualizermenu")
    13971411        {
    MythMenu* MusicCommon::createPlaylistOptionsMenu(void) 
    21822196    MythMenu *menu = new MythMenu(label, this, "playlistoptionsmenu");
    21832197
    21842198    menu->AddItem(tr("Replace Tracks"));
     2199    menu->AddItem(tr("Replace Tracks and Play"));
    21852200    menu->AddItem(tr("Add Tracks"));
     2201    menu->AddItem(tr("Add Tracks and Play"));
    21862202
    21872203    return menu;
    21882204}