put check for playlist filtering in macro
This commit is contained in:
@@ -46,6 +46,13 @@
|
|||||||
#include "status.h"
|
#include "status.h"
|
||||||
#include "tag_editor.h"
|
#include "tag_editor.h"
|
||||||
|
|
||||||
|
#define CHECK_PLAYLIST_FOR_FILTERING \
|
||||||
|
if (myPlaylist->Main()->isFiltered()) \
|
||||||
|
{ \
|
||||||
|
ShowMessage("%s", MPD::Message::FunctionDisabledFilteringEnabled); \
|
||||||
|
continue; \
|
||||||
|
}
|
||||||
|
|
||||||
#define CHECK_MPD_MUSIC_DIR \
|
#define CHECK_MPD_MUSIC_DIR \
|
||||||
if (Config.mpd_music_dir.empty()) \
|
if (Config.mpd_music_dir.empty()) \
|
||||||
{ \
|
{ \
|
||||||
@@ -602,12 +609,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
||||||
{
|
{
|
||||||
if (myPlaylist->Main()->isFiltered())
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
{
|
|
||||||
ShowMessage("%s", MPD::Message::FunctionDisabledFilteringEnabled);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Playlist::BlockUpdate = 1;
|
Playlist::BlockUpdate = 1;
|
||||||
myPlaylist->Main()->SetTimeout(50);
|
myPlaylist->Main()->SetTimeout(50);
|
||||||
if (myPlaylist->Main()->hasSelected())
|
if (myPlaylist->Main()->hasSelected())
|
||||||
@@ -717,12 +719,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
if (myScreen == myPlaylist && !myPlaylist->Main()->Empty())
|
||||||
{
|
{
|
||||||
if (myPlaylist->Main()->isFiltered())
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
{
|
|
||||||
ShowMessage("%s", MPD::Message::FunctionDisabledFilteringEnabled);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Playlist::BlockUpdate = 1;
|
Playlist::BlockUpdate = 1;
|
||||||
myPlaylist->Main()->SetTimeout(50);
|
myPlaylist->Main()->SetTimeout(50);
|
||||||
if (myPlaylist->Main()->hasSelected())
|
if (myPlaylist->Main()->hasSelected())
|
||||||
@@ -831,11 +828,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (Keypressed(input, Key.MoveTo) && myScreen == myPlaylist)
|
else if (Keypressed(input, Key.MoveTo) && myScreen == myPlaylist)
|
||||||
{
|
{
|
||||||
if (myPlaylist->Main()->isFiltered())
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
{
|
|
||||||
ShowMessage("%s", MPD::Message::FunctionDisabledFilteringEnabled);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!myPlaylist->Main()->hasSelected())
|
if (!myPlaylist->Main()->hasSelected())
|
||||||
{
|
{
|
||||||
ShowMessage("No selected items to move!");
|
ShowMessage("No selected items to move!");
|
||||||
@@ -1036,11 +1029,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (myScreen == myPlaylist && myPlaylist->isPlaying())
|
if (myScreen == myPlaylist && myPlaylist->isPlaying())
|
||||||
{
|
{
|
||||||
if (myPlaylist->Main()->isFiltered())
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
{
|
|
||||||
ShowMessage("%s", MPD::Message::FunctionDisabledFilteringEnabled);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
myPlaylist->Main()->Highlight(myPlaylist->NowPlaying);
|
myPlaylist->Main()->Highlight(myPlaylist->NowPlaying);
|
||||||
}
|
}
|
||||||
else if (myScreen == myBrowser)
|
else if (myScreen == myBrowser)
|
||||||
@@ -1450,11 +1439,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (Keypressed(input, Key.Crop))
|
else if (Keypressed(input, Key.Crop))
|
||||||
{
|
{
|
||||||
if (myPlaylist->Main()->isFiltered())
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
{
|
|
||||||
ShowMessage("%s", MPD::Message::FunctionDisabledFilteringEnabled);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (myPlaylist->Main()->hasSelected())
|
if (myPlaylist->Main()->hasSelected())
|
||||||
{
|
{
|
||||||
Mpd->StartCommandsList();
|
Mpd->StartCommandsList();
|
||||||
@@ -1508,6 +1493,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (Keypressed(input, Key.SortPlaylist) && myScreen == myPlaylist)
|
else if (Keypressed(input, Key.SortPlaylist) && myScreen == myPlaylist)
|
||||||
{
|
{
|
||||||
|
CHECK_PLAYLIST_FOR_FILTERING;
|
||||||
myPlaylist->Sort();
|
myPlaylist->Sort();
|
||||||
myPlaylist->EnableHighlighting();
|
myPlaylist->EnableHighlighting();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user