actions: replace bare readKey with prompt everywhere
This commit is contained in:
@@ -1968,14 +1968,12 @@ void ToggleReplayGainMode::run()
|
|||||||
char rgm = 0;
|
char rgm = 0;
|
||||||
{
|
{
|
||||||
Statusbar::ScopedLock lock;
|
Statusbar::ScopedLock lock;
|
||||||
Statusbar::put() << "Replay gain mode? [" << NC::Format::Bold << 'o' << NC::Format::NoBold << "ff/" << NC::Format::Bold << 't' << NC::Format::NoBold << "rack/" << NC::Format::Bold << 'a' << NC::Format::NoBold << "lbum]";
|
Statusbar::put() << "Replay gain mode? "
|
||||||
wFooter->refresh();
|
<< "[" << NC::Format::Bold << 'o' << NC::Format::NoBold << "ff"
|
||||||
do
|
<< "/" << NC::Format::Bold << 't' << NC::Format::NoBold << "rack"
|
||||||
{
|
<< "/" << NC::Format::Bold << 'a' << NC::Format::NoBold << "lbum"
|
||||||
Status::trace();
|
<< "] ";
|
||||||
rgm = wFooter->readKey();
|
rgm = Statusbar::Helpers::promptReturnOneOf({"t", "a", "o"})[0];
|
||||||
}
|
|
||||||
while (rgm != 't' && rgm != 'a' && rgm != 'o');
|
|
||||||
}
|
}
|
||||||
switch (rgm)
|
switch (rgm)
|
||||||
{
|
{
|
||||||
@@ -2039,18 +2037,15 @@ void ToggleBitrateVisibility::run()
|
|||||||
void AddRandomItems::run()
|
void AddRandomItems::run()
|
||||||
{
|
{
|
||||||
using Global::wFooter;
|
using Global::wFooter;
|
||||||
// FIXME: generalize this type of prompt
|
|
||||||
char rnd_type = 0;
|
char rnd_type = 0;
|
||||||
{
|
{
|
||||||
Statusbar::ScopedLock lock;
|
Statusbar::ScopedLock lock;
|
||||||
Statusbar::put() << "Add random? [" << NC::Format::Bold << 's' << NC::Format::NoBold << "ongs/" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtists/al" << NC::Format::Bold << 'b' << NC::Format::NoBold << "ums] ";
|
Statusbar::put() << "Add random? "
|
||||||
wFooter->refresh();
|
<< "[" << NC::Format::Bold << 's' << NC::Format::NoBold << "ongs"
|
||||||
do
|
<< "/" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtists"
|
||||||
{
|
<< "/" << "al" << NC::Format::Bold << 'b' << NC::Format::NoBold << "ums"
|
||||||
Status::trace();
|
<< "] ";
|
||||||
rnd_type = wFooter->readKey();
|
rnd_type = Statusbar::Helpers::promptReturnOneOf({"s", "a", "b"})[0];
|
||||||
}
|
|
||||||
while (rnd_type != 's' && rnd_type != 'a' && rnd_type != 'b');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mpd_tag_type tag_type = MPD_TAG_ARTIST;
|
mpd_tag_type tag_type = MPD_TAG_ARTIST;
|
||||||
@@ -2123,14 +2118,15 @@ void ToggleLibraryTagType::run()
|
|||||||
char tag_type = 0;
|
char tag_type = 0;
|
||||||
{
|
{
|
||||||
Statusbar::ScopedLock lock;
|
Statusbar::ScopedLock lock;
|
||||||
Statusbar::put() << "Tag type? [" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtist/album" << NC::Format::Bold << 'A' << NC::Format::NoBold << "rtist/" << NC::Format::Bold << 'y' << NC::Format::NoBold << "ear/" << NC::Format::Bold << 'g' << NC::Format::NoBold << "enre/" << NC::Format::Bold << 'c' << NC::Format::NoBold << "omposer/" << NC::Format::Bold << 'p' << NC::Format::NoBold << "erformer] ";
|
Statusbar::put() << "Tag type? "
|
||||||
wFooter->refresh();
|
<< "[" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtist"
|
||||||
do
|
<< "/" << "album" << NC::Format::Bold << 'A' << NC::Format::NoBold << "rtist"
|
||||||
{
|
<< "/" << NC::Format::Bold << 'y' << NC::Format::NoBold << "ear"
|
||||||
Status::trace();
|
<< "/" << NC::Format::Bold << 'g' << NC::Format::NoBold << "enre"
|
||||||
tag_type = wFooter->readKey();
|
<< "/" << NC::Format::Bold << 'c' << NC::Format::NoBold << "omposer"
|
||||||
}
|
<< "/" << NC::Format::Bold << 'p' << NC::Format::NoBold << "erformer"
|
||||||
while (tag_type != 'a' && tag_type != 'A' && tag_type != 'y' && tag_type != 'g' && tag_type != 'c' && tag_type != 'p');
|
<< "] ";
|
||||||
|
tag_type = Statusbar::Helpers::promptReturnOneOf({"a", "A", "y", "g", "c", "p"})[0];
|
||||||
}
|
}
|
||||||
mpd_tag_type new_tagitem = charToTagType(tag_type);
|
mpd_tag_type new_tagitem = charToTagType(tag_type);
|
||||||
if (new_tagitem != Config.media_lib_primary_tag)
|
if (new_tagitem != Config.media_lib_primary_tag)
|
||||||
|
|||||||
Reference in New Issue
Block a user