1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-06 06:31:07 +01:00

Lower DoEditMetadata into Exporter

This commit is contained in:
Paul Licameli
2019-06-06 19:46:14 -04:00
parent 684a948fd2
commit 8db51416bc
4 changed files with 39 additions and 39 deletions

View File

@@ -11,7 +11,6 @@
#include "../ProjectSettings.h"
#include "../ProjectWindow.h"
#include "../SelectUtilities.h"
#include "../Tags.h"
#include "../TimeTrack.h"
#include "../TrackPanel.h"
#include "../UndoManager.h"
@@ -20,6 +19,7 @@
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"
#include "../commands/ScreenshotCommand.h"
#include "../export/Export.h"
#include "../prefs/PrefsDialog.h"
#include "../prefs/SpectrogramSettings.h"
#include "../prefs/WaveformSettings.h"
@@ -206,35 +206,6 @@ void DoReloadPreferences( AudacityProject &project )
}
}
bool DoEditMetadata
(AudacityProject &project,
const wxString &title, const wxString &shortUndoDescription, bool force)
{
auto &settings = ProjectSettings::Get( project );
auto &tags = Tags::Get( project );
// Back up my tags
// Tags (artist name, song properties, MP3 ID3 info, etc.)
// The structure may be shared with undo history entries
// To keep undo working correctly, always replace this with a NEW duplicate
// BEFORE doing any editing of it!
auto newTags = tags.Duplicate();
if (newTags->ShowEditDialog(&GetProjectFrame( project ), title, force)) {
if (tags != *newTags) {
// Commit the change to project state only now.
Tags::Set( project, newTags );
ProjectHistory::Get( project ).PushState(title, shortUndoDescription);
}
bool bShowInFuture;
gPrefs->Read(wxT("/AudioFiles/ShowId3Dialog"), &bShowInFuture, true);
settings.SetShowId3Dialog( bShowInFuture );
return true;
}
return false;
}
// Menu handler functions
struct Handler : CommandHandlerObject {
@@ -1012,7 +983,7 @@ void OnDisjoin(const CommandContext &context)
void OnEditMetadata(const CommandContext &context)
{
auto &project = context.project;
(void)DoEditMetadata( project,
(void)Exporter::DoEditMetadata( project,
_("Edit Metadata Tags"), _("Metadata Tags"), true);
}