Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15972

Modified Files:
      Tag: Audacity_1_3_5-Camp_Jam
        BatchCommandDialog.cpp BatchCommands.cpp BatchCommands.h 
Log Message:
Refactor Effect results to Effect class.

Index: BatchCommands.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/BatchCommands.cpp,v
retrieving revision 1.30
retrieving revision 1.30.2.1
diff -u -d -r1.30 -r1.30.2.1
--- BatchCommands.cpp   16 Nov 2007 00:32:04 -0000      1.30
+++ BatchCommands.cpp   3 Nov 2008 05:23:37 -0000       1.30.2.1
@@ -292,29 +292,9 @@
 }
 
 
-Effect * BatchCommands::GetEffectFromCommandName(wxString inCommand)
-{
-   unsigned int i;
-   wxString command;
-   Effect * f;
-   EffectArray * effects = Effect::GetEffects( ALL_EFFECTS );
-   for(i=0; i<effects->GetCount(); i++) {
-      f = (*effects)[i];
-      command=f->GetEffectIdentifier();
-      if( command.IsSameAs( inCommand ))
-      {  
-         delete effects;
-         return f;
-      }
-   }
-   delete effects;
-   return NULL;
-}
-
 wxString BatchCommands::GetCurrentParamsFor(wxString command)
 {
-   Effect * f;
-   f=GetEffectFromCommandName( command );
+   Effect * f = Effect::GetEffectByIdentifier( command );
    if( f==NULL )
       return wxT("");// effect not found.
    ShuttleCli shuttle;
@@ -328,8 +308,7 @@
 
 bool BatchCommands::PromptForParamsFor(wxString command)
 {
-   Effect * f;
-   f=GetEffectFromCommandName( command );
+   Effect * f = Effect::GetEffectByIdentifier(command);
    if( f==NULL )
       return false;
 
@@ -470,7 +449,7 @@
       return WriteMp3File(filename, 56);
    } else if (command == wxT("StereoToMono")) {
       // StereoToMono is an effect masquerading as a menu item.
-      Effect * f = GetEffectFromCommandName(wxT("StereoToMono"));
+      Effect * f = Effect::GetEffectByIdentifier(wxT("StereoToMono"));
       if (f != NULL) {
          return ApplyEffectCommand(f, command, params);
       }
@@ -572,8 +551,7 @@
    }
    
    // Test for an effect.
-   Effect * f;
-   f=GetEffectFromCommandName( command );
+   Effect * f = Effect::GetEffectByIdentifier( command );
    if( f!=NULL )
       return ApplyEffectCommand( f, command, params );
 

Index: BatchCommandDialog.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/BatchCommandDialog.cpp,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- BatchCommandDialog.cpp      29 Jul 2007 19:52:04 -0000      1.12
+++ BatchCommandDialog.cpp      3 Nov 2008 05:23:37 -0000       1.12.2.1
@@ -167,7 +167,7 @@
    mCommand->SetValue( command );
    wxString params = BatchCommands::GetCurrentParamsFor( command );
    mParameters->SetValue( params );
-   Effect * f = BatchCommands::GetEffectFromCommandName( command );
+   Effect * f = Effect::GetEffectByIdentifier( command );
    mEditParams->Enable( f != NULL );
 }
 
@@ -175,7 +175,7 @@
 {
    wxString command = mCommand->GetValue();
    wxString params  = mParameters->GetValue();
-   Effect * f = BatchCommands::GetEffectFromCommandName( command );
+   Effect * f = Effect::GetEffectByIdentifier( command );
    if( f==NULL )
       return;
    BatchCommands::SetCurrentParametersFor( f, command, params );

Index: BatchCommands.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/BatchCommands.h,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- BatchCommands.h     7 May 2007 21:05:06 -0000       1.9
+++ BatchCommands.h     3 Nov 2008 05:23:37 -0000       1.9.2.1
@@ -41,7 +41,6 @@
    // These commands do not depend on the command list.
    wxArrayString GetNames();
    static bool PromptForParamsFor( wxString command );
-   static Effect * GetEffectFromCommandName( wxString command );
    static wxString GetCurrentParamsFor( wxString command );
    static bool SetCurrentParametersFor( Effect * f, const wxString command, 
const wxString params);
    static wxArrayString GetAllCommands();


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to