tag editor: add support for numerating tracks using xx/xx format

This commit is contained in:
Andrzej Rybczak
2009-11-14 03:42:21 +01:00
parent 07099d4dc0
commit 0dc076742f
5 changed files with 17 additions and 1 deletions

View File

@@ -290,6 +290,8 @@
#
#empty_tag_marker = "<empty>"
#
#tag_editor_extended_numeration = "no"
#
#enable_window_title = "yes"
#
##

View File

@@ -246,6 +246,9 @@ If enabled, ncmpcpp will be able to delete files using its browser screen.
.B allow_physical_directories_deletion = yes/no
If enabled, ncmpcpp will be able to delete directories using its browser screen.
.TP
.B tag_editor_extended_numeration = yes/no
If enabled, tag editor will number tracks using format xx/yy (where xx is the current track and yy is total amount of all numbered tracks), not plain xx.
.TP
.B enable_window_title = yes/no
If enabled, ncmpcpp will override current window title with its own one.
.TP

View File

@@ -320,6 +320,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
conf.new_design = false;
conf.visualizer_use_wave = true;
conf.browser_sort_by_mtime = false;
conf.tag_editor_extended_numeration = false;
conf.set_window_title = true;
conf.mpd_port = 6600;
conf.mpd_connection_timeout = 15;
@@ -853,6 +854,10 @@ void ReadConfiguration(ncmpcpp_config &conf)
{
conf.new_design = v == "alternative";
}
else if (cl.find("tag_editor_extended_numeration") != std::string::npos)
{
conf.tag_editor_extended_numeration = v == "yes";
}
else if (cl.find("enable_window_title") != std::string::npos)
{
conf.set_window_title = v == "yes";

View File

@@ -213,6 +213,7 @@ struct ncmpcpp_config
bool new_design;
bool visualizer_use_wave;
bool browser_sort_by_mtime;
bool tag_editor_extended_numeration;
int mpd_port;
int mpd_connection_timeout;

View File

@@ -547,7 +547,12 @@ void TagEditor::EnterPressed()
{
MPD::SongList::iterator it = EditedSongs.begin();
for (unsigned i = 1; i <= EditedSongs.size(); ++i, ++it)
(*it)->SetTrack(i);
{
if (Config.tag_editor_extended_numeration)
(*it)->SetTrack(IntoStr(i) + "/" + IntoStr(EditedSongs.size()));
else
(*it)->SetTrack(i);
}
ShowMessage("Tracks numbered!");
}
else