mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
Fix Fade-Ends MacroCommands
- Split parameters from command name. - Improve test for 'fixed Macros'.
This commit is contained in:
parent
4dfac323c0
commit
153da3a94d
@ -87,19 +87,13 @@ static const std::pair<const wxChar*, const wxChar*> SpecialCommands[] = {
|
|||||||
};
|
};
|
||||||
// end CLEANSPEECH remnant
|
// end CLEANSPEECH remnant
|
||||||
|
|
||||||
static const wxString MP3Conversion = wxT("MP3 Conversion");
|
|
||||||
static const wxString FadeEnds = wxT("Fade Ends");
|
|
||||||
|
|
||||||
MacroCommands::MacroCommands()
|
MacroCommands::MacroCommands()
|
||||||
{
|
{
|
||||||
mMessage = "";
|
mMessage = "";
|
||||||
ResetMacro();
|
ResetMacro();
|
||||||
|
|
||||||
wxArrayString names = GetNames();
|
wxArrayString names = GetNames();
|
||||||
|
wxArrayString defaults = GetNamesOfDefaultMacros();
|
||||||
wxArrayString defaults;
|
|
||||||
defaults.Add( MP3Conversion );
|
|
||||||
defaults.Add( FadeEnds );
|
|
||||||
|
|
||||||
for( size_t i = 0;i<defaults.Count();i++){
|
for( size_t i = 0;i<defaults.Count();i++){
|
||||||
wxString name = defaults[i];
|
wxString name = defaults[i];
|
||||||
@ -111,6 +105,18 @@ MacroCommands::MacroCommands()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const wxString MP3Conversion = wxT("MP3 Conversion");
|
||||||
|
static const wxString FadeEnds = wxT("Fade Ends");
|
||||||
|
|
||||||
|
|
||||||
|
wxArrayString MacroCommands::GetNamesOfDefaultMacros()
|
||||||
|
{
|
||||||
|
wxArrayString defaults;
|
||||||
|
defaults.Add( MP3Conversion );
|
||||||
|
defaults.Add( FadeEnds );
|
||||||
|
return defaults;
|
||||||
|
}
|
||||||
|
|
||||||
void MacroCommands::RestoreMacro(const wxString & name)
|
void MacroCommands::RestoreMacro(const wxString & name)
|
||||||
{
|
{
|
||||||
// TIDY-ME: Effects change their name with localisation.
|
// TIDY-ME: Effects change their name with localisation.
|
||||||
@ -120,11 +126,11 @@ void MacroCommands::RestoreMacro(const wxString & name)
|
|||||||
AddToMacro( wxT("Normalize") );
|
AddToMacro( wxT("Normalize") );
|
||||||
AddToMacro( wxT("ExportMP3") );
|
AddToMacro( wxT("ExportMP3") );
|
||||||
} else if (name == FadeEnds ){
|
} else if (name == FadeEnds ){
|
||||||
AddToMacro( wxT("Select: Start=\"0\" End=\"1\"") );
|
AddToMacro( wxT("Select"), wxT("Start=\"0\" End=\"1\"") );
|
||||||
AddToMacro( wxT("FadeIn") );
|
AddToMacro( wxT("FadeIn") );
|
||||||
AddToMacro( wxT("Select: Start=\"0\" End=\"1\" FromEnd=\"1\"") );
|
AddToMacro( wxT("Select"), wxT("Start=\"0\" End=\"1\" FromEnd=\"1\"") );
|
||||||
AddToMacro( wxT("FadeOut") );
|
AddToMacro( wxT("FadeOut") );
|
||||||
AddToMacro( wxT("Select: Start=\"0\" End=\"0\"") );
|
AddToMacro( wxT("Select"), wxT("Start=\"0\" End=\"0\"") );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -877,13 +883,12 @@ wxArrayString MacroCommands::GetNames()
|
|||||||
|
|
||||||
bool MacroCommands::IsFixed(const wxString & name)
|
bool MacroCommands::IsFixed(const wxString & name)
|
||||||
{
|
{
|
||||||
if (name == MP3Conversion)
|
wxArrayString defaults = GetNamesOfDefaultMacros();
|
||||||
|
if( defaults.Index( name ) != wxNOT_FOUND )
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MacroCommands::Split(const wxString & str, wxString & command, wxString & param)
|
void MacroCommands::Split(const wxString & str, wxString & command, wxString & param)
|
||||||
{
|
{
|
||||||
int splitAt;
|
int splitAt;
|
||||||
|
@ -42,6 +42,7 @@ class MacroCommands final {
|
|||||||
|
|
||||||
// These commands do not depend on the command list.
|
// These commands do not depend on the command list.
|
||||||
static wxArrayString GetNames();
|
static wxArrayString GetNames();
|
||||||
|
static wxArrayString GetNamesOfDefaultMacros();
|
||||||
|
|
||||||
// A triple of user-visible name, internal string identifier and type/help string.
|
// A triple of user-visible name, internal string identifier and type/help string.
|
||||||
using CommandName = std::tuple<wxString, wxString, wxString>;
|
using CommandName = std::tuple<wxString, wxString, wxString>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user