Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv32454/src
Modified Files:
AudacityApp.h AutoRecovery.cpp Benchmark.cpp Experimental.h
Menus.cpp Project.cpp Sequence.cpp Sequence.h
Log Message:
-Checklist fixes
Index: AudacityApp.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityApp.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- AudacityApp.h 27 May 2007 21:11:30 -0000 1.35
+++ AudacityApp.h 24 Jul 2007 10:45:34 -0000 1.36
@@ -38,6 +38,36 @@
DECLARE_EVENT_TYPE(EVT_RELEASE_KEYBOARD, -1);
DECLARE_EVENT_TYPE(EVT_CAPTURE_KEY, -1);
+// Flags used in command handling.
+
+// These flags represent the majority of the states that affect
+// whether or not items in menus are enabled or disabled.
+enum {
+ AudioIONotBusyFlag = 0x00000001,
+ TimeSelectedFlag = 0x00000002,
+ TracksSelectedFlag = 0x00000004,
+ TracksExistFlag = 0x00000008,
+ LabelTracksExistFlag = 0x00000010,
+ WaveTracksSelectedFlag = 0x00000020,
+ ClipboardFlag = 0x00000040,
+ TextClipFlag = 0x00000040, // Same as Clipboard flag for now.
+ UnsavedChangesFlag = 0x00000080,
+ HasLastEffectFlag = 0x00000100,
+ UndoAvailableFlag = 0x00000200,
+ RedoAvailableFlag = 0x00000400,
+ ZoomInAvailableFlag = 0x00000800,
+ ZoomOutAvailableFlag = 0x00001000,
+ StereoRequiredFlag = 0x00002000, //lda
+ TopDockHasFocus = 0x00004000, //lll
+ TrackPanelHasFocus = 0x00008000, //lll
+ BotDockHasFocus = 0x00010000, //lll
+ LabelsSelectedFlag = 0x00020000,
+ AudioIOBusyFlag = 0x00040000, //lll
+ PlayRegionLockedFlag = 0x00080000, //msmeyer
+ PlayRegionNotLockedFlag= 0x00100000, //msmeyer
+ CutCopyAvailableFlag = 0x00200000
+};
+
class AudacityApp:public wxApp {
public:
virtual bool OnInit(void);
Index: Sequence.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Sequence.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- Sequence.h 23 Sep 2006 02:28:04 -0000 1.13
+++ Sequence.h 24 Jul 2007 10:45:36 -0000 1.14
@@ -42,6 +42,7 @@
//
static void SetMaxDiskBlockSize(int bytes);
+ static int GetMaxDiskBlockSize();
//
// Constructor / Destructor / Duplicator
Index: Benchmark.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Benchmark.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- Benchmark.cpp 3 Jul 2007 08:40:38 -0000 1.26
+++ Benchmark.cpp 24 Jul 2007 10:45:34 -0000 1.27
@@ -308,7 +308,6 @@
// This code will become part of libaudacity,
// and this class will be phased out.
-
long blockSize, numEdits, dataSize, randSeed;
mBlockSizeStr.ToLong(&blockSize);
@@ -335,6 +334,8 @@
gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
gPrefs->Write(wxT("/GUI/EditClipCanMove"), false);
+ // Rememebr the old blocksize, so that we can restore it later.
+ int oldBlockSize = Sequence::GetMaxDiskBlockSize();
Sequence::SetMaxDiskBlockSize(blockSize * 1024);
wxBusyCursor busy;
@@ -350,24 +351,28 @@
srand(randSeed);
- int len, scale;
- //scale = 7500 + (rand() % 1000);
- scale = 200 + (rand() % 100);
- len = (dataSize * 1048576) / (scale*sizeof(short));
- while(len < 20 || scale > (blockSize*1024)/4) {
- scale = (scale / 2) + (rand() % 100);
- len = (dataSize * 1048576) / (scale*sizeof(short));
+ int nChunks, chunkSize;
+ //chunkSize = 7500 + (rand() % 1000);
+ chunkSize = 200 + (rand() % 100);
+ nChunks = (dataSize * 1048576) / (chunkSize*sizeof(short));
+ while(nChunks < 20 || chunkSize > (blockSize*1024)/4) {
+ chunkSize = (chunkSize / 2) + (rand() % 100);
+ nChunks = (dataSize * 1048576) / (chunkSize*sizeof(short));
}
- Printf(wxT("Using %d blocks of %d samples each, for a total of ")
+ // The chunks are the pieces we move around in the test.
+ // They are (and are supposed to be) a different size to
+ // the blocks that make the blockfiles. That way we get to
+ // do some testing of when edit chunks cross blockfile boundaries.
+ Printf(wxT("Using %d chunks of %d samples each, for a total of ")
wxT("%.1f MB.\n"),
- len, scale, len*scale*sizeof(short)/1048576.0);
+ nChunks, chunkSize, nChunks*chunkSize*sizeof(short)/1048576.0);
int trials = numEdits;
- short *small1 = new short[len];
- short *small2 = new short[len];
- short *block = new short[scale];
+ short *small1 = new short[nChunks];
+ short *small2 = new short[nChunks];
+ short *block = new short[chunkSize];
Printf(wxT("Preparing...\n"));
@@ -381,13 +386,13 @@
wxString tempStr;
wxStopWatch timer;
- for (i = 0; i < len; i++) {
+ for (i = 0; i < nChunks; i++) {
v = short(rand());
small1[i] = v;
- for (b = 0; b < scale; b++)
+ for (b = 0; b < chunkSize; b++)
block[b] = v;
- t->Append((samplePtr)block, int16Sample, scale);
+ t->Append((samplePtr)block, int16Sample, chunkSize);
}
t->Flush();
@@ -396,8 +401,8 @@
// as we're about to do).
t->GetEndTime();
- if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() !=
(sampleCount)len * scale) {
- Printf(wxT("Expected len %d, track len %d.\n"), len * scale,
+ if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() !=
(sampleCount)nChunks * chunkSize) {
+ Printf(wxT("Expected len %d, track len %d.\n"), nChunks * chunkSize,
t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
goto fail;
}
@@ -409,30 +414,30 @@
timer.Start();
for (z = 0; z < trials; z++) {
- int x0 = rand() % len;
- int xlen = 1 + (rand() % (len - x0));
+ int x0 = rand() % nChunks;
+ int xlen = 1 + (rand() % (nChunks - x0));
if (mEditDetail)
- Printf(wxT("Cut: %d - %d \n"), x0 * scale, (x0 + xlen) * scale);
+ Printf(wxT("Cut: %d - %d \n"), x0 * chunkSize, (x0 + xlen) *
chunkSize);
- t->Cut(double (x0 * scale), double ((x0 + xlen) * scale), &tmp);
+ t->Cut(double (x0 * chunkSize), double ((x0 + xlen) * chunkSize), &tmp);
if (!tmp) {
Printf(wxT("Trial %d\n"), z);
- Printf(wxT("Cut (%d, %d) failed.\n"), (x0 * scale),
- (x0 + xlen) * scale);
- Printf(wxT("Expected len %d, track len %d.\n"), len * scale,
+ Printf(wxT("Cut (%d, %d) failed.\n"), (x0 * chunkSize),
+ (x0 + xlen) * chunkSize);
+ Printf(wxT("Expected len %d, track len %d.\n"), nChunks * chunkSize,
t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
goto fail;
}
- int y0 = rand() % (len - xlen);
+ int y0 = rand() % (nChunks - xlen);
if (mEditDetail)
- Printf(wxT("Paste: %d\n"), y0 * scale);
+ Printf(wxT("Paste: %d\n"), y0 * chunkSize);
- t->Paste(double (y0 * scale), tmp);
+ t->Paste(double (y0 * chunkSize), tmp);
- if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() !=
(sampleCount) len * scale) {
+ if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() !=
(sampleCount) nChunks * chunkSize) {
Printf(wxT("Trial %d\n"), z);
- Printf(wxT("Expected len %d, track len %d.\n"), len * scale,
+ Printf(wxT("Expected len %d, track len %d.\n"), nChunks * chunkSize,
t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
goto fail;
}
@@ -440,11 +445,11 @@
for (i = 0; i < xlen; i++)
small2[i] = small1[x0 + i];
// Delete
- for (i = 0; i < (len - x0 - xlen); i++)
+ for (i = 0; i < (nChunks - x0 - xlen); i++)
small1[x0 + i] = small1[x0 + xlen + i];
// Insert
- for (i = 0; i < (len - xlen - y0); i++)
- small1[len - i - 1] = small1[len - i - 1 - xlen];
+ for (i = 0; i < (nChunks - xlen - y0); i++)
+ small1[nChunks - i - 1] = small1[nChunks - i - 1 - xlen];
// Paste
for (i = 0; i < xlen; i++)
small1[y0 + i] = small2[i];
@@ -474,21 +479,21 @@
bad = 0;
timer.Start();
- for (i = 0; i < len; i++) {
+ for (i = 0; i < nChunks; i++) {
v = small1[i];
- t->Get((samplePtr)block, int16Sample, i * scale, scale);
- for (b = 0; b < scale; b++)
+ t->Get((samplePtr)block, int16Sample, i * chunkSize, chunkSize);
+ for (b = 0; b < chunkSize; b++)
if (block[b] != v) {
bad++;
if (bad < 10)
- Printf(wxT("Bad: block %d sample %d\n"), i, b);
- b = scale;
+ Printf(wxT("Bad: chunk %d sample %d\n"), i, b);
+ b = chunkSize;
}
}
if (bad == 0)
Printf(wxT("Passed correctness check!\n"));
else
- Printf(wxT("Errors in %d/%d blocks\n"), bad, len);
+ Printf(wxT("Errors in %d/%d chunks\n"), bad, nChunks);
elapsed = timer.Time();
@@ -500,10 +505,10 @@
timer.Start();
- for (i = 0; i < len; i++) {
+ for (i = 0; i < nChunks; i++) {
v = small1[i];
- t->Get((samplePtr)block, int16Sample, i * scale, scale);
- for (b = 0; b < scale; b++)
+ t->Get((samplePtr)block, int16Sample, i * chunkSize, chunkSize);
+ for (b = 0; b < chunkSize; b++)
if (block[b] != v)
bad++;
}
@@ -514,7 +519,7 @@
Printf(wxT("At 44100 Hz, 16-bits per sample, the estimated number of\n")
wxT("simultaneous tracks that could be played at once: %.1f\n"),
- (len*scale/44100.0)/(elapsed/1000.0));
+ (nChunks*chunkSize/44100.0)/(elapsed/1000.0));
goto success;
@@ -534,7 +539,7 @@
delete fact;
d->Deref();
- Sequence::SetMaxDiskBlockSize(1048576);
+ Sequence::SetMaxDiskBlockSize(oldBlockSize);
HoldPrint(false);
gPrefs->Write(wxT("/GUI/EditClipCanMove"), editClipCanMove);
Index: Experimental.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Experimental.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Experimental.h 5 Jul 2007 11:55:35 -0000 1.11
+++ Experimental.h 24 Jul 2007 10:45:34 -0000 1.12
@@ -43,6 +43,7 @@
#define EXPERIMENTAL_SMART_RECORD
#endif
+//#define EXPERIMENTAL_ROLL_UP_DIALOG
//#define RIGHT_ALIGNED_TEXTBOXES
//#define EXPERIMENTAL_VOICE_DETECTION
//#define EXPERIMENTAL_SMART_RECORD
Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -d -r1.331 -r1.332
--- Menus.cpp 24 Jul 2007 07:15:01 -0000 1.331
+++ Menus.cpp 24 Jul 2007 10:45:34 -0000 1.332
@@ -137,34 +137,6 @@
audCommandListFunction mCommandListFunction;
};
-// These flags represent the majority of the states that affect
-// whether or not items in menus are enabled or disabled.
-enum {
- AudioIONotBusyFlag = 0x00000001,
- TimeSelectedFlag = 0x00000002,
- TracksSelectedFlag = 0x00000004,
- TracksExistFlag = 0x00000008,
- LabelTracksExistFlag = 0x00000010,
- WaveTracksSelectedFlag = 0x00000020,
- ClipboardFlag = 0x00000040,
- TextClipFlag = 0x00000040, // Same as Clipboard flag for now.
- UnsavedChangesFlag = 0x00000080,
- HasLastEffectFlag = 0x00000100,
- UndoAvailableFlag = 0x00000200,
- RedoAvailableFlag = 0x00000400,
- ZoomInAvailableFlag = 0x00000800,
- ZoomOutAvailableFlag = 0x00001000,
- StereoRequiredFlag = 0x00002000, //lda
- TopDockHasFocus = 0x00004000, //lll
- TrackPanelHasFocus = 0x00008000, //lll
- BotDockHasFocus = 0x00010000, //lll
- LabelsSelectedFlag = 0x00020000,
- AudioIOBusyFlag = 0x00040000, //lll
- PlayRegionLockedFlag = 0x00080000, //msmeyer
- PlayRegionNotLockedFlag= 0x00100000, //msmeyer
- CutCopyAvailableFlag = 0x00200000
-};
-
#define FN(X) new AudacityProjectCommandFunctor(this, &AudacityProject:: X )
/// CreateMenusAndCommands builds the menus, and also rebuilds them after
@@ -1172,8 +1144,10 @@
return;
mLastFlags = flags;
- mCommandManager.EnableUsingFlags(flags, 0xFFFFFFFF);
-
+ //mCommandManager.EnableUsingFlags(flags, 0xFFFFFFFF);
+ // JKC change to grey out effects less often...
+ mCommandManager.EnableUsingFlags(flags | AudioIONotBusyFlag |
TimeSelectedFlag | WaveTracksSelectedFlag,
+ 0xFFFFFFFF);
if (flags & CutCopyAvailableFlag) {
mCommandManager.Enable(wxT("Copy"), true);
mCommandManager.Enable(wxT("Cut"), true);
Index: Sequence.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Sequence.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- Sequence.cpp 29 Mar 2007 18:17:25 -0000 1.43
+++ Sequence.cpp 24 Jul 2007 10:45:35 -0000 1.44
@@ -1232,7 +1232,12 @@
if (format != mSampleFormat)
DeleteSamples(temp);
+// JKC: During generate we use Append again and again.
+// If generating a long sequence this test would give O(n^2)
+// performance - not good!
+#ifdef VERY_SLOW_CHECKING
ConsistencyCheck(wxT("Append"));
+#endif
return true;
}
@@ -1540,6 +1545,11 @@
sMaxDiskBlockSize = bytes;
}
+int Sequence::GetMaxDiskBlockSize()
+{
+ return sMaxDiskBlockSize;
+}
+
void Sequence::AppendBlockFile(BlockFile* blockFile)
{
SeqBlock *w = new SeqBlock();
@@ -1548,7 +1558,9 @@
mBlock->Add(w);
mNumSamples += blockFile->GetLength();
+#ifdef VERY_SLOW_CHECKING
ConsistencyCheck(wxT("AppendBlockFile"));
+#endif
}
Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.316
retrieving revision 1.317
diff -u -d -r1.316 -r1.317
--- Project.cpp 5 Jul 2007 11:55:35 -0000 1.316
+++ Project.cpp 24 Jul 2007 10:45:34 -0000 1.317
@@ -53,6 +53,7 @@
#include <stdio.h>
#include <iostream>
#include <wx/wxprec.h>
+#include <wx/apptrait.h>
#include <wx/defs.h>
#include <wx/app.h>
@@ -107,6 +108,7 @@
#include "DirManager.h"
#include "effects/Effect.h"
#include "prefs/PrefsDialog.h"
+#include "widgets/ErrorDialog.h"
#include "widgets/Ruler.h"
#include "widgets/Warning.h"
#include "xml/XMLFileReader.h"
@@ -806,7 +808,7 @@
void AudacityProject::UpdateBatchPrefs()
{
- gPrefs->Read(wxT("/Batch/EmptyCanBeDirty"), &mEmptyCanBeDirty, false );
+ gPrefs->Read(wxT("/Batch/EmptyCanBeDirty"), &mEmptyCanBeDirty, true );
gPrefs->Read(wxT("/Batch/CleanSpeechMode"), &mCleanSpeechMode, false);
gPrefs->Read(wxT("/Batch/ShowId3Dialog"), &mShowId3Dialog, false);
gPrefs->Read(wxT("/Batch/NormalizeOnLoad"),&mNormalizeOnLoad, false);
@@ -2520,9 +2522,14 @@
return;
if (numTracks <= 0) {
+// Old code, without the help button.
+#if 0
wxMessageBox(errorMessage,
_("Error importing"),
wxOK | wxCENTRE, this);
+#endif
+ ShowErrorDialog(this, _("Error importing"),
+ errorMessage,
wxT("http://audacity.sourceforge.net/help/faq?s=files&i=wma-proprietary"));
return;
}
@@ -3290,7 +3297,11 @@
WriteXML(saveFile);
}
- saveFile.Close();
+ // JKC Calling XMLFileWriter::Close will close the <project> scope.
+ // We certainly don't want to do that, if we're doing recordingrecovery,
+ // because the recordingrecovery tags need to be inside <project></project>
+ // So instead we close the file directly.
+ saveFile.wxFFile::Close();
// Now that we have a new auto-save file, delete the old one
DeleteCurrentAutoSaveFile();
@@ -3364,6 +3375,8 @@
// the last three wxProgressDialogs displayed. This gives Jaws a chance
to get the
// last update without accessing freed storage.
+static void *cookie = NULL;
+
void AudacityProject::ProgressShow(const wxString &title, const wxString
&message)
{
if (mProgressDialog[mProgressCurrent]) {
@@ -3379,9 +3392,17 @@
mProgressDialog[mProgressCurrent] = NULL;
}
+#if 0
+ wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
+ wxASSERT( traits );//"no wxAppTraits in RunInThread()?"
+ // disable all app windows while waiting for the child process to finish
+ cookie = traits->BeforeChildWaitLoop();
+#endif
+
wxStartTimer();
wxBeginBusyCursor();
wxSafeYield(this, true);
+// wxSafeYield( mProgressDialog[mProgressCurrent] ); //Only progress dialog
active - for the cancel button?
}
void AudacityProject::ProgressHide()
@@ -3393,6 +3414,15 @@
if (wxIsBusy()) {
wxEndBusyCursor();
}
+#if 0
+ if( cookie != NULL )
+ {
+ wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
+ wxASSERT( traits );//"no wxAppTraits in RunInThread()?"
+ traits->AfterChildWaitLoop(cookie);
+ cookie=NULL;
+ }
+#endif
}
bool AudacityProject::ProgressUpdate(int value, const wxString &message)
Index: AutoRecovery.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AutoRecovery.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- AutoRecovery.cpp 12 Mar 2007 09:23:05 -0000 1.8
+++ AutoRecovery.cpp 24 Jul 2007 10:45:34 -0000 1.9
@@ -1,3 +1,17 @@
+/**********************************************************************
+
+ Audacity: A Digital Audio Editor
+
+ AutoRecovery.cpp
+
+*******************************************************************//**
+
+\class AutoRecoveryDialog
+\brief The AutoRecoveryDialog prompts the user whether to
+recover previous Audacity projects that were closed incorrectly.
+
+*//********************************************************************/
+
#include "AutoRecovery.h"
#include "Audacity.h"
#include "AudacityApp.h"
@@ -307,7 +321,7 @@
if (!XMLValueChecker::IsGoodInt(strValue) ||
!strValue.ToLong(&nValue) ||
(nValue < 1))
return false;
- mChannel = nValue;
+ mNumChannels = nValue;
}
}
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs