outputs: replace enterPressed with toggleOutput

This commit is contained in:
Andrzej Rybczak
2015-09-27 14:24:30 +02:00
parent c6506d77fd
commit 0ee09fb109
8 changed files with 48 additions and 22 deletions

View File

@@ -69,20 +69,6 @@ std::wstring Outputs::title()
return L"Outputs";
}
void Outputs::enterPressed()
{
if (w.current()->value().enabled())
{
Mpd.DisableOutput(w.choice());
Statusbar::printf("Output \"%s\" disabled", w.current()->value().name());
}
else
{
Mpd.EnableOutput(w.choice());
Statusbar::printf("Output \"%s\" enabled", w.current()->value().name());
}
}
void Outputs::mouseButtonPressed(MEVENT me)
{
if (w.empty() || !w.hasCoords(me.x, me.y) || size_t(me.y) >= w.size())
@@ -97,7 +83,7 @@ void Outputs::mouseButtonPressed(MEVENT me)
Screen<WindowType>::mouseButtonPressed(me);
}
void Outputs::FetchList()
void Outputs::fetchList()
{
w.clear();
for (MPD::OutputIterator out = Mpd.GetOutputs(), end; out != end; ++out)
@@ -111,5 +97,18 @@ void Outputs::FetchList()
w.refresh();
}
#endif // ENABLE_OUTPUTS
void Outputs::toggleOutput()
{
if (w.current()->value().enabled())
{
Mpd.DisableOutput(w.choice());
Statusbar::printf("Output \"%s\" disabled", w.current()->value().name());
}
else
{
Mpd.EnableOutput(w.choice());
Statusbar::printf("Output \"%s\" enabled", w.current()->value().name());
}
}
#endif // ENABLE_OUTPUTS