mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 19:55:46 -04:00
CDImage: Support sub-images, use subimages for m3u
This commit is contained in:
@ -914,8 +914,8 @@ void QtHostInterface::changeDiscFromPlaylist(quint32 index)
|
||||
if (System::IsShutdown())
|
||||
return;
|
||||
|
||||
if (!System::SwitchMediaFromPlaylist(index))
|
||||
ReportFormattedError("Failed to switch to playlist index %u", index);
|
||||
if (!System::SwitchMediaSubImage(index))
|
||||
ReportFormattedError("Failed to switch to subimage %u", index);
|
||||
}
|
||||
|
||||
static QString FormatTimestampForSaveStateMenu(u64 timestamp)
|
||||
@ -1063,15 +1063,15 @@ void QtHostInterface::populateGameListContextMenu(const GameListEntry* entry, QW
|
||||
|
||||
void QtHostInterface::populatePlaylistEntryMenu(QMenu* menu)
|
||||
{
|
||||
if (!System::IsValid())
|
||||
if (!System::IsValid() || !System::HasMediaSubImages())
|
||||
return;
|
||||
|
||||
QActionGroup* ag = new QActionGroup(menu);
|
||||
const u32 count = System::GetMediaPlaylistCount();
|
||||
const u32 current = System::GetMediaPlaylistIndex();
|
||||
const u32 count = System::GetMediaSubImageCount();
|
||||
const u32 current = System::GetMediaSubImageIndex();
|
||||
for (u32 i = 0; i < count; i++)
|
||||
{
|
||||
QAction* action = ag->addAction(QString::fromStdString(System::GetMediaPlaylistPath(i)));
|
||||
QAction* action = ag->addAction(QString::fromStdString(System::GetMediaSubImageTitle(i)));
|
||||
action->setCheckable(true);
|
||||
action->setChecked(i == current);
|
||||
connect(action, &QAction::triggered, [this, i]() { changeDiscFromPlaylist(i); });
|
||||
|
Reference in New Issue
Block a user