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

Modified Files:
        Nyquist.cpp 
Log Message:
Several effects defined their own GetSamples() method, but they
were all the same, so I moved it to the Effect class and removed
it from the others.

Many effects defined a GetEffectFlags() method, but rather than
incur the extra class overhead for it, I removed the method and
replaced it with a call to SetEffectFlags().  This also put the
handling of the Effect flags into one class (Effect).


Index: Nyquist.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/nyquist/Nyquist.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- Nyquist.cpp 20 May 2009 06:05:38 -0000      1.76
+++ Nyquist.cpp 20 May 2009 06:22:49 -0000      1.77
@@ -72,7 +72,7 @@
 {
    mAction = _("Applying Nyquist Effect...");
    mCmd = wxEmptyString;
-   mFlags = HIDDEN_EFFECT;
+   SetEffectFlags(HIDDEN_EFFECT);
    mInteractive = false;
    mExternal = false;
    mCompiler = false;
@@ -89,7 +89,7 @@
       mOK = true;
       mInteractive = true;
       mName = _("Nyquist Prompt...");
-      mFlags = PROCESS_EFFECT | BUILTIN_EFFECT | ADVANCED_EFFECT;
+      SetEffectFlags(PROCESS_EFFECT | BUILTIN_EFFECT | ADVANCED_EFFECT);
       return;
    }
 
@@ -195,13 +195,13 @@
 
    if (len >= 2 && tokens[0] == wxT("type")) {
       if (tokens[1] == wxT("process")) {
-         mFlags = PROCESS_EFFECT | PLUGIN_EFFECT;
+         SetEffectFlags(PROCESS_EFFECT | PLUGIN_EFFECT);
       }
       else if (tokens[1] == wxT("generate")) {
-         mFlags = INSERT_EFFECT | PLUGIN_EFFECT;
+         SetEffectFlags(INSERT_EFFECT | PLUGIN_EFFECT);
       }
       else if (tokens[1] == wxT("analyze")) {
-         mFlags = ANALYZE_EFFECT | PLUGIN_EFFECT;
+         SetEffectFlags(ANALYZE_EFFECT | PLUGIN_EFFECT);
       }
       return;
    }
@@ -309,7 +309,7 @@
       return;
 
    mCmd = wxT("");
-   mFlags = PROCESS_EFFECT | PLUGIN_EFFECT;
+   SetEffectFlags(PROCESS_EFFECT | PLUGIN_EFFECT);
    mOK = false;
    mIsSal = false;
    mControls.Clear();
@@ -333,7 +333,7 @@
    mExternal = true;
    mInteractive = false;
    mCmd = wxT("");
-   mFlags = INSERT_EFFECT | HIDDEN_EFFECT;
+   SetEffectFlags(INSERT_EFFECT | HIDDEN_EFFECT);
    mOK = false;
    mIsSal = false;
    mControls.Clear();
@@ -496,7 +496,7 @@
    mProgressIn = 0;
    mProgressOut = 0;
    mProgressTot = 0;
-   mScale = (mFlags & PROCESS_EFFECT ? 0.5 : 1.0) / GetNumWaveGroups();
+   mScale = (GetEffectFlags() & PROCESS_EFFECT ? 0.5 : 1.0) / 
GetNumWaveGroups();
 
    mStop = false;
    mBreak = false;
@@ -572,7 +572,7 @@
 {
    nyx_rval rval;
 
-   if (mFlags & INSERT_EFFECT) {
+   if (GetEffectFlags() & INSERT_EFFECT) {
       nyx_set_audio_params(mCurTrack[0]->GetRate(), 0);
    }
    else {
@@ -932,7 +932,7 @@
 
    wxFlexGridSizer *grid = new wxFlexGridSizer(4, 0, 0);
 
-   for(unsigned int i=0; i<mControls->GetCount(); i++) {
+   for (size_t i = 0; i < mControls->GetCount(); i++) {
       wxControl  *item;
       NyqControl *ctrl = &((*mControls)[i]);
 
@@ -1029,7 +1029,7 @@
 
    mInHandler = true;
 
-   for (unsigned int i=0; i < mControls->GetCount(); i++) {
+   for (size_t i = 0; i < mControls->GetCount(); i++) {
       NyqControl *ctrl = &((*mControls)[i]);
 
       if (ctrl->type == NYQ_CTRL_STRING || ctrl->type == NYQ_CTRL_CHOICE) {


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to