|
|
|
@ -473,7 +473,7 @@ void MouseEvent::Run() |
|
|
|
&& itsMouseEvent.y == LINES-(Config.statusbar_visibility ? 2 : 1) |
|
|
|
&& itsMouseEvent.y == LINES-(Config.statusbar_visibility ? 2 : 1) |
|
|
|
) // progressbar
|
|
|
|
) // progressbar
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!myPlaylist->isPlaying()) |
|
|
|
if (!Mpd.isPlaying()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
Mpd.Seek(Mpd.GetTotalTime()*itsMouseEvent.x/double(COLS)); |
|
|
|
Mpd.Seek(Mpd.GetTotalTime()*itsMouseEvent.x/double(COLS)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1087,7 +1087,7 @@ void Add::Run() |
|
|
|
|
|
|
|
|
|
|
|
bool SeekForward::canBeRun() const |
|
|
|
bool SeekForward::canBeRun() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return myPlaylist->NowPlayingSong() && Mpd.GetTotalTime() > 0; |
|
|
|
return Mpd.isPlaying() && Mpd.GetTotalTime() > 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SeekForward::Run() |
|
|
|
void SeekForward::Run() |
|
|
|
@ -1097,7 +1097,7 @@ void SeekForward::Run() |
|
|
|
|
|
|
|
|
|
|
|
bool SeekBackward::canBeRun() const |
|
|
|
bool SeekBackward::canBeRun() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return myPlaylist->NowPlayingSong() && Mpd.GetTotalTime() > 0; |
|
|
|
return Mpd.isPlaying() && Mpd.GetTotalTime() > 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SeekBackward::Run() |
|
|
|
void SeekBackward::Run() |
|
|
|
@ -1202,8 +1202,8 @@ void TogglePlayingSongCentering::Run() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Config.autocenter_mode = !Config.autocenter_mode; |
|
|
|
Config.autocenter_mode = !Config.autocenter_mode; |
|
|
|
ShowMessage("Centering playing song: %s", Config.autocenter_mode ? "On" : "Off"); |
|
|
|
ShowMessage("Centering playing song: %s", Config.autocenter_mode ? "On" : "Off"); |
|
|
|
if (Config.autocenter_mode && myPlaylist->isPlaying() && !myPlaylist->Items->isFiltered()) |
|
|
|
if (Config.autocenter_mode && Mpd.isPlaying() && !myPlaylist->Items->isFiltered()) |
|
|
|
myPlaylist->Items->highlight(myPlaylist->NowPlaying); |
|
|
|
myPlaylist->Items->highlight(Mpd.GetCurrentlyPlayingSongPos()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UpdateDatabase::Run() |
|
|
|
void UpdateDatabase::Run() |
|
|
|
@ -1223,23 +1223,21 @@ bool JumpToPlayingSong::canBeRun() const |
|
|
|
return ((myScreen == myPlaylist && !myPlaylist->isFiltered()) |
|
|
|
return ((myScreen == myPlaylist && !myPlaylist->isFiltered()) |
|
|
|
|| myScreen == myBrowser |
|
|
|
|| myScreen == myBrowser |
|
|
|
|| myScreen == myLibrary) |
|
|
|
|| myScreen == myLibrary) |
|
|
|
&& myPlaylist->isPlaying(); |
|
|
|
&& Mpd.isPlaying(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void JumpToPlayingSong::Run() |
|
|
|
void JumpToPlayingSong::Run() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (myScreen == myPlaylist) |
|
|
|
if (myScreen == myPlaylist) |
|
|
|
myPlaylist->Items->highlight(myPlaylist->NowPlaying); |
|
|
|
myPlaylist->Items->highlight(Mpd.GetCurrentlyPlayingSongPos()); |
|
|
|
else if (myScreen == myBrowser) |
|
|
|
else if (myScreen == myBrowser) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const MPD::Song *s = myPlaylist->NowPlayingSong(); |
|
|
|
myBrowser->LocateSong(myPlaylist->nowPlayingSong()); |
|
|
|
myBrowser->LocateSong(*s); |
|
|
|
|
|
|
|
DrawHeader(); |
|
|
|
DrawHeader(); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (myScreen == myLibrary) |
|
|
|
else if (myScreen == myLibrary) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const MPD::Song *s = myPlaylist->NowPlayingSong(); |
|
|
|
myLibrary->LocateSong(myPlaylist->nowPlayingSong()); |
|
|
|
myLibrary->LocateSong(*s); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1668,14 +1666,14 @@ void JumpToTagEditor::Run() |
|
|
|
|
|
|
|
|
|
|
|
bool JumpToPositionInSong::canBeRun() const |
|
|
|
bool JumpToPositionInSong::canBeRun() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return myPlaylist->NowPlayingSong() && Mpd.GetTotalTime() > 0; |
|
|
|
return Mpd.isPlaying() && Mpd.GetTotalTime() > 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void JumpToPositionInSong::Run() |
|
|
|
void JumpToPositionInSong::Run() |
|
|
|
{ |
|
|
|
{ |
|
|
|
using Global::wFooter; |
|
|
|
using Global::wFooter; |
|
|
|
|
|
|
|
|
|
|
|
const MPD::Song *s = myPlaylist->NowPlayingSong(); |
|
|
|
const MPD::Song s = myPlaylist->nowPlayingSong(); |
|
|
|
|
|
|
|
|
|
|
|
LockStatusbar(); |
|
|
|
LockStatusbar(); |
|
|
|
Statusbar() << "Position to go (in %/mm:ss/seconds(s)): "; |
|
|
|
Statusbar() << "Position to go (in %/mm:ss/seconds(s)): "; |
|
|
|
@ -1692,7 +1690,7 @@ void JumpToPositionInSong::Run() |
|
|
|
if (newpos >= 0 && newpos <= Mpd.GetTotalTime()) |
|
|
|
if (newpos >= 0 && newpos <= Mpd.GetTotalTime()) |
|
|
|
Mpd.Seek(newpos); |
|
|
|
Mpd.Seek(newpos); |
|
|
|
else |
|
|
|
else |
|
|
|
ShowMessage("Out of bounds, 0:00-%s possible for mm:ss, %s given", s->getLength().c_str(), MPD::Song::ShowTime(newpos).c_str()); |
|
|
|
ShowMessage("Out of bounds, 0:00-%s possible for mm:ss, %s given", s.getLength().c_str(), MPD::Song::ShowTime(newpos).c_str()); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (position.find('s') != std::string::npos) // probably position in seconds
|
|
|
|
else if (position.find('s') != std::string::npos) // probably position in seconds
|
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -1700,7 +1698,7 @@ void JumpToPositionInSong::Run() |
|
|
|
if (newpos >= 0 && newpos <= Mpd.GetTotalTime()) |
|
|
|
if (newpos >= 0 && newpos <= Mpd.GetTotalTime()) |
|
|
|
Mpd.Seek(newpos); |
|
|
|
Mpd.Seek(newpos); |
|
|
|
else |
|
|
|
else |
|
|
|
ShowMessage("Out of bounds, 0-%d possible for seconds, %d given", s->getDuration(), newpos); |
|
|
|
ShowMessage("Out of bounds, 0-%d possible for seconds, %d given", s.getDuration(), newpos); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
|