1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-17 09:07:41 +02:00

Rename 'chain' to 'macro' in history and comments.

This commit is contained in:
James Crook 2018-03-16 18:47:39 +00:00
parent 2d62013fac
commit 205b7d6a02
4 changed files with 23 additions and 31 deletions

View File

@ -10,8 +10,8 @@
********************************************************************//*! ********************************************************************//*!
\class MacroCommands \class MacroCommands
\brief Maintains the chain of commands used in batch processing. \brief Maintains the list of commands for batch/macro
See also MacroCommandDialog and ApplyMacroDialog. processing. See also MacrosWindow and ApplyMacroDialog.
*//*******************************************************************/ *//*******************************************************************/
@ -157,13 +157,13 @@ int MacroCommands::GetCount()
return (int)mCommandMacro.GetCount(); return (int)mCommandMacro.GetCount();
} }
bool MacroCommands::ReadMacro(const wxString & chain) bool MacroCommands::ReadMacro(const wxString & macro)
{ {
// Clear any previous chain // Clear any previous macro
ResetMacro(); ResetMacro();
// Build the filename // Build the filename
wxFileName name(FileNames::MacroDir(), chain, wxT("txt")); wxFileName name(FileNames::MacroDir(), macro, wxT("txt"));
// Set the file name // Set the file name
wxTextFile tf(name.GetFullPath()); wxTextFile tf(name.GetFullPath());
@ -203,10 +203,10 @@ bool MacroCommands::ReadMacro(const wxString & chain)
} }
bool MacroCommands::WriteMacro(const wxString & chain) bool MacroCommands::WriteMacro(const wxString & macro)
{ {
// Build the filename // Build the filename
wxFileName name(FileNames::MacroDir(), chain, wxT("txt")); wxFileName name(FileNames::MacroDir(), macro, wxT("txt"));
// Set the file name // Set the file name
wxTextFile tf(name.GetFullPath()); wxTextFile tf(name.GetFullPath());
@ -233,7 +233,7 @@ bool MacroCommands::WriteMacro(const wxString & chain)
tf.AddLine(mCommandMacro[i] + wxT(":") + mParamsMacro[ i ]); tf.AddLine(mCommandMacro[i] + wxT(":") + mParamsMacro[ i ]);
} }
// Write the chain // Write the macro
tf.Write(); tf.Write();
// Done with the file // Done with the file
@ -242,10 +242,10 @@ bool MacroCommands::WriteMacro(const wxString & chain)
return true; return true;
} }
bool MacroCommands::AddMacro(const wxString & chain) bool MacroCommands::AddMacro(const wxString & macro)
{ {
// Build the filename // Build the filename
wxFileName name(FileNames::MacroDir(), chain, wxT("txt")); wxFileName name(FileNames::MacroDir(), macro, wxT("txt"));
// Set the file name // Set the file name
wxTextFile tf(name.GetFullPath()); wxTextFile tf(name.GetFullPath());
@ -254,26 +254,26 @@ bool MacroCommands::AddMacro(const wxString & chain)
return tf.Create(); return tf.Create();
} }
bool MacroCommands::DeleteMacro(const wxString & chain) bool MacroCommands::DeleteMacro(const wxString & macro)
{ {
// Build the filename // Build the filename
wxFileName name(FileNames::MacroDir(), chain, wxT("txt")); wxFileName name(FileNames::MacroDir(), macro, wxT("txt"));
// Delete it...wxRemoveFile will display errors // Delete it...wxRemoveFile will display errors
auto result = wxRemoveFile(name.GetFullPath()); auto result = wxRemoveFile(name.GetFullPath());
// Delete any legacy chain that it shadowed // Delete any legacy chain that it shadowed
auto oldPath = wxFileName{ FileNames::LegacyChainDir(), chain, wxT("txt") }; auto oldPath = wxFileName{ FileNames::LegacyChainDir(), macro, wxT("txt") };
wxRemoveFile(oldPath.GetFullPath()); // Don't care about this return value wxRemoveFile(oldPath.GetFullPath()); // Don't care about this return value
return result; return result;
} }
bool MacroCommands::RenameMacro(const wxString & oldchain, const wxString & newchain) bool MacroCommands::RenameMacro(const wxString & oldmacro, const wxString & newmacro)
{ {
// Build the filenames // Build the filenames
wxFileName oname(FileNames::MacroDir(), oldchain, wxT("txt")); wxFileName oname(FileNames::MacroDir(), oldmacro, wxT("txt"));
wxFileName nname(FileNames::MacroDir(), newchain, wxT("txt")); wxFileName nname(FileNames::MacroDir(), newmacro, wxT("txt"));
// Rename it...wxRenameFile will display errors // Rename it...wxRenameFile will display errors
return wxRenameFile(oname.GetFullPath(), nname.GetFullPath()); return wxRenameFile(oname.GetFullPath(), nname.GetFullPath());
@ -808,7 +808,7 @@ bool MacroCommands::ApplyCommandInBatchMode( const wxString &friendlyCommand,
static int MacroReentryCount = 0; static int MacroReentryCount = 0;
// ApplyMacro returns true on success, false otherwise. // ApplyMacro returns true on success, false otherwise.
// Any error reporting to the user in setting up the chain // Any error reporting to the user in setting up the macro
// has already been done. // has already been done.
bool MacroCommands::ApplyMacro( bool MacroCommands::ApplyMacro(
const MacroCommandsCatalog &catalog, const wxString & filename) const MacroCommandsCatalog &catalog, const wxString & filename)
@ -861,13 +861,13 @@ bool MacroCommands::ApplyMacro(
if (name.IsEmpty()) if (name.IsEmpty())
{ {
/* i18n-hint: active verb in past tense */ /* i18n-hint: active verb in past tense */
longDesc = _("Applied batch chain"); longDesc = _("Applied macro");
shortDesc = _("Apply chain"); shortDesc = _("Apply macro");
} }
else else
{ {
/* i18n-hint: active verb in past tense */ /* i18n-hint: active verb in past tense */
longDesc = wxString::Format(_("Applied batch chain '%s'"), name); longDesc = wxString::Format(_("Applied macro '%s'"), name);
shortDesc = wxString::Format(_("Apply '%s'"), name); shortDesc = wxString::Format(_("Apply '%s'"), name);
} }

View File

@ -48,7 +48,7 @@ private:
Entries mCommands; Entries mCommands;
}; };
// Stores information for one chain // Stores information for one macro
class MacroCommands final { class MacroCommands final {
public: public:
// constructors and destructors // constructors and destructors

View File

@ -123,9 +123,6 @@ private:
void OnDown(wxCommandEvent &event); void OnDown(wxCommandEvent &event);
void OnDefaults(wxCommandEvent &event); void OnDefaults(wxCommandEvent &event);
//void OnApplyToProject(wxCommandEvent &event);
//void OnApplyToFiles(wxCommandEvent &event);
void OnOK(wxCommandEvent &event); void OnOK(wxCommandEvent &event);
void OnKeyDown(wxKeyEvent &event); void OnKeyDown(wxKeyEvent &event);
@ -133,11 +130,6 @@ private:
void InsertCommandAt(int item); void InsertCommandAt(int item);
bool SaveChanges(); bool SaveChanges();
// These are already provided by ApplyMacroDialog
//wxListCtrl *mList; /// List of commands in current command chain.
//MacroCommands mMacroCommands; /// Provides list of available commands.
//wxListCtrl *mMacros; /// List of chains.
wxButton *mRemove; wxButton *mRemove;
wxButton *mRename; wxButton *mRename;
wxButton *mDefaults; wxButton *mDefaults;

View File

@ -372,14 +372,14 @@ bool EffectEqualization::LoadFactoryDefaults()
bool EffectEqualization::ValidateUI() bool EffectEqualization::ValidateUI()
{ {
// If editing a batch chain, we don't want to be using the unnamed curve so // If editing a macro, we don't want to be using the unnamed curve so
// we offer to save it. // we offer to save it.
if (mDisallowCustom && mCurveName.IsSameAs(wxT("unnamed"))) if (mDisallowCustom && mCurveName.IsSameAs(wxT("unnamed")))
{ {
// PRL: This is unreachable. mDisallowCustom is always false. // PRL: This is unreachable. mDisallowCustom is always false.
Effect::MessageBox(_("To use this EQ curve in a batch chain, please choose a new name for it.\nChoose the 'Save/Manage Curves...' button and rename the 'unnamed' curve, then use that one."), Effect::MessageBox(_("To use this EQ curve in a macro, please choose a new name for it.\nChoose the 'Save/Manage Curves...' button and rename the 'unnamed' curve, then use that one."),
wxOK | wxCENTRE, wxOK | wxCENTRE,
_("EQ Curve needs a different name")); _("EQ Curve needs a different name"));
return false; return false;