mirror of
https://github.com/AxioDL/amuse.git
synced 2025-06-06 22:53:36 +00:00
Add conditional song prompt
This commit is contained in:
parent
08de4873f4
commit
44204d7b08
@ -696,9 +696,41 @@ struct AppCallback : boo::IApplicationCallback
|
|||||||
#else
|
#else
|
||||||
const char* utf8Path = m_argv[2];
|
const char* utf8Path = m_argv[2];
|
||||||
#endif
|
#endif
|
||||||
|
songs = amuse::ContainerRegistry::LoadSongs(utf8Path);
|
||||||
|
}
|
||||||
|
else
|
||||||
songs = amuse::ContainerRegistry::LoadSongs(utf8Path);
|
songs = amuse::ContainerRegistry::LoadSongs(utf8Path);
|
||||||
|
|
||||||
|
if (songs.size())
|
||||||
|
{
|
||||||
|
bool play = true;
|
||||||
|
if (m_argc <= 2)
|
||||||
|
{
|
||||||
|
bool prompt = true;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (prompt)
|
||||||
|
{
|
||||||
|
printf("Play Song? (Y/N): ");
|
||||||
|
prompt = false;
|
||||||
|
}
|
||||||
|
char userSel;
|
||||||
|
if (scanf("%c", &userSel) <= 0 || userSel == '\n')
|
||||||
|
continue;
|
||||||
|
userSel = tolower(userSel);
|
||||||
|
if (userSel == 'n')
|
||||||
|
play = false;
|
||||||
|
else if (userSel != 'y')
|
||||||
|
{
|
||||||
|
prompt = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (play)
|
||||||
|
{
|
||||||
/* Get song selection from user */
|
/* Get song selection from user */
|
||||||
if (songs.size() > 1)
|
if (songs.size() > 1)
|
||||||
{
|
{
|
||||||
@ -738,6 +770,7 @@ struct AppCallback : boo::IApplicationCallback
|
|||||||
m_setupId = m_arrData->m_setupId;
|
m_setupId = m_arrData->m_setupId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Get group selection from user */
|
/* Get group selection from user */
|
||||||
if (m_groupId != -1)
|
if (m_groupId != -1)
|
||||||
@ -859,6 +892,8 @@ struct AppCallback : boo::IApplicationCallback
|
|||||||
SFXLoop(*sfxIndex);
|
SFXLoop(*sfxIndex);
|
||||||
else
|
else
|
||||||
SongLoop(*songIndex);
|
SongLoop(*songIndex);
|
||||||
|
|
||||||
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user