add support for renaming in tiny tag editor
This commit is contained in:
@@ -1027,6 +1027,18 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
wFooter->WriteXY(0, Config.statusbar_visibility, "[.b]Filename:[/b] ", 1);
|
||||
string filename = s.GetNewName().empty() ? s.GetName() : s.GetNewName();
|
||||
int dot = filename.find_last_of(".");
|
||||
string extension = filename.substr(dot);
|
||||
filename = filename.substr(0, dot);
|
||||
string new_name = wFooter->GetString(filename);
|
||||
s.SetNewName(new_name + extension);
|
||||
mTagEditor->UpdateOption(option, "[.b]Filename:[/b] " + (s.GetNewName().empty() ? s.GetName() : s.GetNewName()));
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
ShowMessage("Updating tags...");
|
||||
if (WriteTags(s))
|
||||
@@ -1038,7 +1050,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
ShowMessage("Error writing tags!");
|
||||
}
|
||||
case 9:
|
||||
case 10:
|
||||
{
|
||||
wCurrent->Clear();
|
||||
wCurrent = wPrev;
|
||||
|
||||
@@ -113,6 +113,8 @@ bool GetSongTags(Song &s)
|
||||
mTagEditor->AddOption("[.b]Genre:[/b] " + s.GetGenre());
|
||||
mTagEditor->AddOption("[.b]Comment:[/b] " + s.GetComment());
|
||||
mTagEditor->AddSeparator();
|
||||
mTagEditor->AddOption("[.b]Filename:[/b] " + s.GetName());
|
||||
mTagEditor->AddSeparator();
|
||||
mTagEditor->AddOption("Save");
|
||||
mTagEditor->AddOption("Cancel");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user