add crop function (removes all song from playlist except the playing one) + some fixes
This commit is contained in:
@@ -44,8 +44,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_TAGLIB_H
|
#ifdef HAVE_TAGLIB_H
|
||||||
|
const string tag_screen = "Tag editor";
|
||||||
const string tag_screen_keydesc = "\tE e : Edit song's tags\n";
|
const string tag_screen_keydesc = "\tE e : Edit song's tags\n";
|
||||||
#else
|
#else
|
||||||
|
const string tag_screen = "Tag info";
|
||||||
const string tag_screen_keydesc = "\tE e : Show song's tags\n";
|
const string tag_screen_keydesc = "\tE e : Show song's tags\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -218,7 +220,8 @@ int main(int argc, char *argv[])
|
|||||||
sHelp->Add(" [b]Keys - Playlist screen\n -----------------------------------------[/b]\n");
|
sHelp->Add(" [b]Keys - Playlist screen\n -----------------------------------------[/b]\n");
|
||||||
sHelp->Add("\tEnter : Play\n");
|
sHelp->Add("\tEnter : Play\n");
|
||||||
sHelp->Add("\tDelete : Delete song from playlist\n");
|
sHelp->Add("\tDelete : Delete song from playlist\n");
|
||||||
sHelp->Add("\tc : Clear playlist\n");
|
sHelp->Add("\tc : Clear whole playlist\n");
|
||||||
|
sHelp->Add("\tC : Clear playlist but hold currently playing song\n");
|
||||||
sHelp->Add("\tm : Move song up\n");
|
sHelp->Add("\tm : Move song up\n");
|
||||||
sHelp->Add("\tn : Move song down\n");
|
sHelp->Add("\tn : Move song down\n");
|
||||||
sHelp->Add("\tS : Save playlist\n");
|
sHelp->Add("\tS : Save playlist\n");
|
||||||
@@ -239,8 +242,13 @@ int main(int argc, char *argv[])
|
|||||||
sHelp->Add("\tEnter : Select and play song/album/artist's songs\n");
|
sHelp->Add("\tEnter : Select and play song/album/artist's songs\n");
|
||||||
sHelp->Add("\tSpace : Select song/album/artist's songs\n\n\n");
|
sHelp->Add("\tSpace : Select song/album/artist's songs\n\n\n");
|
||||||
|
|
||||||
sHelp->Add(" [b]Keys - Tag Editor\n -----------------------------------------[/b]\n");
|
# ifdef HAVE_TAGLIB_H
|
||||||
|
sHelp->Add(" [b]Keys - Tag editor\n -----------------------------------------[/b]\n");
|
||||||
sHelp->Add("\tEnter : Change option\n");
|
sHelp->Add("\tEnter : Change option\n");
|
||||||
|
# else
|
||||||
|
sHelp->Add(" [b]Keys - Tag info\n -----------------------------------------[/b]\n");
|
||||||
|
sHelp->Add("\tEnter : Return\n");
|
||||||
|
# endif
|
||||||
|
|
||||||
if (Config.header_visibility)
|
if (Config.header_visibility)
|
||||||
{
|
{
|
||||||
@@ -299,11 +307,7 @@ int main(int argc, char *argv[])
|
|||||||
title = "Browse: ";
|
title = "Browse: ";
|
||||||
break;
|
break;
|
||||||
case csTagEditor:
|
case csTagEditor:
|
||||||
# ifdef HAVE_TAGLIB_H
|
title = tag_screen;
|
||||||
title = "Tag editor";
|
|
||||||
# else
|
|
||||||
title = "Tag info";
|
|
||||||
# endif
|
|
||||||
break;
|
break;
|
||||||
case csSearcher:
|
case csSearcher:
|
||||||
title = "Search engine";
|
title = "Search engine";
|
||||||
@@ -670,9 +674,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
wFooter->WriteXY(0, 1, "[b]New year:[/b] ", 1);
|
wFooter->WriteXY(0, 1, "[b]New year:[/b] ", 1);
|
||||||
if (s.GetYear() == EMPTY_TAG)
|
if (s.GetYear() == EMPTY_TAG)
|
||||||
s.SetDate(wFooter->GetString(4, TraceMpdStatus));
|
s.SetYear(wFooter->GetString(4, TraceMpdStatus));
|
||||||
else
|
else
|
||||||
s.SetDate(wFooter->GetString(s.GetYear(), 4, TraceMpdStatus));
|
s.SetYear(wFooter->GetString(s.GetYear(), 4, TraceMpdStatus));
|
||||||
mTagEditor->UpdateOption(option, "[b]Year:[/b] " + s.GetYear());
|
mTagEditor->UpdateOption(option, "[b]Year:[/b] " + s.GetYear());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -811,9 +815,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
wFooter->WriteXY(0, 1, "[b]Year:[/b] ", 1);
|
wFooter->WriteXY(0, 1, "[b]Year:[/b] ", 1);
|
||||||
if (s.GetYear() == EMPTY_TAG)
|
if (s.GetYear() == EMPTY_TAG)
|
||||||
s.SetDate(wFooter->GetString(4, TraceMpdStatus));
|
s.SetYear(wFooter->GetString(4, TraceMpdStatus));
|
||||||
else
|
else
|
||||||
s.SetDate(wFooter->GetString(s.GetYear(), 4, TraceMpdStatus));
|
s.SetYear(wFooter->GetString(s.GetYear(), 4, TraceMpdStatus));
|
||||||
mSearcher->UpdateOption(option, "[b]Year:[/b] " + s.GetYear());
|
mSearcher->UpdateOption(option, "[b]Year:[/b] " + s.GetYear());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1435,6 +1439,8 @@ int main(int argc, char *argv[])
|
|||||||
current_screen = csTagEditor;
|
current_screen = csTagEditor;
|
||||||
prev_screen = csLibrary;
|
prev_screen = csLibrary;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ShowMessage("Cannot read file!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -1457,8 +1463,25 @@ int main(int argc, char *argv[])
|
|||||||
UNBLOCK_STATUSBAR_UPDATE;
|
UNBLOCK_STATUSBAR_UPDATE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'C': // clear playlist but holds currently playing song
|
||||||
|
{
|
||||||
|
if (now_playing < 0)
|
||||||
|
{
|
||||||
|
ShowMessage("Nothing is playing now!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (vector<Song *>::iterator it = vPlaylist.begin(); it != vPlaylist.begin()+now_playing; it++)
|
||||||
|
mpd_playlist_queue_delete_id(conn, (*it)->GetID());
|
||||||
|
for (vector<Song *>::iterator it = vPlaylist.begin()+now_playing+1; it != vPlaylist.end(); it++)
|
||||||
|
mpd_playlist_queue_delete_id(conn, (*it)->GetID());
|
||||||
|
ShowMessage("Deleting all songs except now playing one...");
|
||||||
|
mpd_playlist_queue_commit(conn);
|
||||||
|
ShowMessage("Songs deleted!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'c': // clear playlist
|
case 'c': // clear playlist
|
||||||
{
|
{
|
||||||
|
ShowMessage("Clearing playlist...");
|
||||||
mpd_playlist_clear(conn);
|
mpd_playlist_clear(conn);
|
||||||
ShowMessage("Cleared playlist!");
|
ShowMessage("Cleared playlist!");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ class Song
|
|||||||
void SetArtist(string str) { itsArtist = str; }
|
void SetArtist(string str) { itsArtist = str; }
|
||||||
void SetTitle(string str) { itsTitle = str; }
|
void SetTitle(string str) { itsTitle = str; }
|
||||||
void SetAlbum(string str) { itsAlbum = str; }
|
void SetAlbum(string str) { itsAlbum = str; }
|
||||||
void SetTrack(string str) { itsTrack = str; }
|
void SetTrack(string str) { itsTrack = IntoStr(StrToInt(str)); }
|
||||||
void SetDate(string str) { itsYear = str; }
|
void SetYear(string str) { itsYear = IntoStr(StrToInt(str)); }
|
||||||
void SetGenre(string str) { itsGenre = str; }
|
void SetGenre(string str) { itsGenre = str; }
|
||||||
void SetComment(string str) { itsComment = str; }
|
void SetComment(string str) { itsComment = str; }
|
||||||
void SetPosition(int pos) { itsPosition = pos; }
|
void SetPosition(int pos) { itsPosition = pos; }
|
||||||
|
|||||||
Reference in New Issue
Block a user