get rid of global mpd status object

This commit is contained in:
Andrzej Rybczak
2013-04-07 17:28:10 +02:00
parent d451731562
commit 2184fb7c73
11 changed files with 321 additions and 209 deletions

View File

@@ -23,6 +23,7 @@
#include "status.h"
#include "statusbar.h"
#include "bindings.h"
#include "playlist.h"
#include "utility/wide_string.h"
using Global::wFooter;
@@ -122,10 +123,10 @@ void Statusbar::unlock()
else
progressbarBlockUpdate = false;
}
if (MpdStatus.playerState() == MPD::psStop)
if (Status::State::player() == MPD::psStop)
{
if (Config.new_design)
Progressbar::draw(MpdStatus.elapsedTime(), MpdStatus.totalTime());
Progressbar::draw(Status::State::elapsedTime(), myPlaylist->currentSongLength());
else
put() << wclrtoeol;
wFooter->refresh();
@@ -150,12 +151,12 @@ void Statusbar::tryRedraw()
else
progressbarBlockUpdate = !statusbarAllowUnlock;
if (MpdStatus.playerState() != MPD::psStop && !statusbarBlockUpdate && !progressbarBlockUpdate)
if (Status::State::player() != MPD::psStop && !statusbarBlockUpdate && !progressbarBlockUpdate)
{
if (Config.new_design)
Progressbar::draw(MpdStatus.elapsedTime(), MpdStatus.totalTime());
Progressbar::draw(Status::State::elapsedTime(), myPlaylist->currentSongLength());
else
Status::Changes::elapsedTime();
Status::Changes::elapsedTime(false);
wFooter->refresh();
}
}