Campbell Barton's further patch to turn many, many tabs to our 3-space convenbtion

This commit is contained in:
v.audacity 2013-02-23 04:33:20 +00:00
parent 2479a13187
commit c26b3c6b49
74 changed files with 1891 additions and 1891 deletions

View File

@ -61,231 +61,231 @@ bool CrossFader::GetSamples(samplePtr buffer, sampleFormat format,
bool CrossFader::CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount start, sampleCount len)
{
std::cout << "Crossfading from " << start << " to " << len+start << std::endl;
std::cout << "Crossfading from " << start << " to " << len+start << std::endl;
// start refers to the position in the wave.
// start refers to the position in the wave.
//just mix the right things together.
//For each relevant clip, we need to construct a buffer.
//we should use one of the size len, because this has already
//been determined to be good in Mixer
//Get a pointer to the sequence in each clip.
WaveClip * tmpclip = NULL;
Sequence * tmp = NULL;
WaveClipList::compatibility_iterator it;
//Go through each clip, adding it to the total in the appropriate way.
//this could be 'optimized' by getting all of the sequences and then
//iterating through each of them.
int numclips = mClips.GetCount();
//create vectors to store the important info for each clip.
std::vector<sampleCount> clipStart(numclips);
std::vector<sampleCount> clipLength(numclips);
std::vector<Sequence*> tmpSequence(numclips);
//just mix the right things together.
unsigned int i = 0;
//Now, go through the clips and load up the vectors.
for(it = mClips.GetFirst(); it; it = it->GetNext())
{
//For each relevant clip, we need to construct a buffer.
//we should use one of the size len, because this has already
//been determined to be good in Mixer
tmpclip = it->GetData();
tmpSequence[i] = tmpclip->GetSequence();
//Get a pointer to the sequence in each clip.
WaveClip * tmpclip = NULL;
Sequence * tmp = NULL;
//start is the position of the beginning of the buffer
//relative to the beginning of the clip. It could be negative.
clipStart[i]= start - tmpclip->GetStartSample();
WaveClipList::compatibility_iterator it;
//Go through each clip, adding it to the total in the appropriate way.
//this could be 'optimized' by getting all of the sequences and then
//iterating through each of them.
int numclips = mClips.GetCount();
//create vectors to store the important info for each clip.
std::vector<sampleCount> clipStart(numclips);
std::vector<sampleCount> clipLength(numclips);
std::vector<Sequence*> tmpSequence(numclips);
unsigned int i = 0;
//Now, go through the clips and load up the vectors.
for(it = mClips.GetFirst(); it; it = it->GetNext())
{
tmpclip = it->GetData();
tmpSequence[i] = tmpclip->GetSequence();
//start is the position of the beginning of the buffer
//relative to the beginning of the clip. It could be negative.
clipStart[i]= start - tmpclip->GetStartSample();
//determine the index of the last sample to get, relative to the start of the clip
//determine the index of the last sample to get, relative to the start of the clip
//it will be no longer than the clip itself.
clipLength[i] = tmpclip->GetNumSamples()-clipStart[i];
//it will be no longer than the clip itself.
clipLength[i] = tmpclip->GetNumSamples()-clipStart[i];
std::cout << "X:" << " " << clipLength[i] << " " << tmpclip->GetStartSample() << " ";
//if the buffer ends before the clip does, adjust the length
if(clipStart[i] + len < clipLength[i])
{
clipLength[i] = len + clipStart[i];
}
std::cout << clipStart[i] << " " << clipLength[i] << " " << clipLength[i] - clipStart[i] << std::endl;
}
std::cout << "-------------\n";
std::cout << "X:" << " " << clipLength[i] << " " << tmpclip->GetStartSample() << " ";
//if the buffer ends before the clip does, adjust the length
if(clipStart[i] + len < clipLength[i])
{
clipLength[i] = len + clipStart[i];
}
std::cout << clipStart[i] << " " << clipLength[i] << " " << clipLength[i] - clipStart[i] << std::endl;
}
std::cout << "-------------\n";
//Now, determine the sample format:
switch(format) {
case int16Sample:
{
std::cout << "int\n";
short *dest = (short *)buffer;
vector<short*> shortSeq;
//Copy the sequences over to the new vector, casting as you go.
for(int i = 0; i < numclips; i++)
shortSeq.push_back((short*)tmpSequence[i]);
//Now, determine the sample format:
switch(format) {
case int16Sample:
{
std::cout << "int\n";
short *dest = (short *)buffer;
vector<short*> shortSeq;
//Copy the sequences over to the new vector, casting as you go.
for(int i = 0; i < numclips; i++)
shortSeq.push_back((short*)tmpSequence[i]);
int clips;
double f;
//now, shortSeq contains the samples to mix together.
for (int j = 0; j < len; j++)
{
int clips;
double f;
//now, shortSeq contains the samples to mix together.
for (int j = 0; j < len; j++)
{
//Go through each clip
for(int i = 0; i < numclips; i++)
{
clips = 0;
f = 0;
if(j + clipStart[i] >= 0 &&
clipStart[i]+len < clipLength[i])//only copy if we are within the clip
{
f += shortSeq[i][j+ clipStart[i]];
clips++;
}
//Go through each clip
for(int i = 0; i < numclips; i++)
{
clips = 0;
f = 0;
if(j + clipStart[i] >= 0 &&
clipStart[i]+len < clipLength[i])//only copy if we are within the clip
{
f += shortSeq[i][j+ clipStart[i]];
clips++;
}
f/= clips;
//Do bounds-checking
if (f > 32767)
f = 32767;
if (f < -32768)
f = -32768;
f/= clips;
//Set value
*dest = (short)f;
}
dest++;
}
}
break;
//Do bounds-checking
if (f > 32767)
f = 32767;
if (f < -32768)
f = -32768;
//Set value
*dest = (short)f;
}
dest++;
}
}
break;
case int24Sample:
{
std::cout << "int24\n";
int *dest = (int *)buffer;
vector<int *> intSeq;
//Copy the sequences over to the new vector, casting as you go.
for(int i = 0; i < numclips; i++)
intSeq.push_back((int*)tmpSequence[i]);
int clips=0;
double f;
//Go through each sample position
for (int j = 0; j < len; j++) {
//go through each clip.
for(int i= 0; i < numclips; i++)
{
clips = 0;
f = 0;
//only copy if we are within the clip
if(j + clipStart[i] >= 0 && clipStart[i] + len < clipLength[i])
{
f+= intSeq[i][j+clipStart[i]];
clips++;
}
f /= clips;
if (f > 8388607)
f = 8388607;
if (f < -8388608)
f = -8388608;
*dest = (int)f;
}
dest ++;
}
}
break;
case int24Sample:
{
std::cout << "int24\n";
int *dest = (int *)buffer;
vector<int *> intSeq;
case floatSample: {
std::cout << "float\n";
float *dest = (float *)buffer;
vector<float*> floatSeq;
//Copy the sequences over to the new vector, casting as you go.
for(int i = 0; i < numclips; i++)
{
float * tmp;
//tmpSequence[i]->GetSamples(tmp,format,0,tmpSequence[i]->GetNumSamples());
//floatSeq.push_back(tmp);
}
int clips = 0;
float f;
//Copy the sequences over to the new vector, casting as you go.
for(int i = 0; i < numclips; i++)
intSeq.push_back((int*)tmpSequence[i]);
//go through each sample position
for (int j = 0; j < len; j++) {
int clips=0;
double f;
//Go through each sample position
for (int j = 0; j < len; j++) {
//go through each clip.
for(int i= 0; i < numclips; i++)
{
clips = 0;
f = 0;
//only copy if we are within the clip
if(j + clipStart[i] >= 0 && clipStart[i] + len < clipLength[i])
{
f+= intSeq[i][j+clipStart[i]];
clips++;
}
f /= clips;
if (f > 8388607)
f = 8388607;
if (f < -8388608)
f = -8388608;
*dest = (int)f;
}
dest ++;
}
}
break;
clips = 0;
f = 0;
case floatSample: {
std::cout << "float\n";
float *dest = (float *)buffer;
vector<float*> floatSeq;
for(int i = 0; i < numclips; i++)
{
//Copy the sequences over to the new vector, casting as you go.
for(int i = 0; i < numclips; i++)
{
float * tmp;
//tmpSequence[i]->GetSamples(tmp,format,0,tmpSequence[i]->GetNumSamples());
//floatSeq.push_back(tmp);
}
int clips = 0;
float f;
cout << numclips << " " ;
cout <<f << " " ;
if(j + clipStart[i] >= 0 &&
clipStart[i] + j < clipLength[i])//only copy if we are within the clip
{
f += floatSeq[i][j + clipStart[i]];
clips++;
}
cout << f << " "<< i << " "<< floatSeq[i][j+clipStart[i]] << "|";
}
if(clips == 0)
*dest = 0.0f;
else
{
f /= clips;
cout << f << "--";
// MM: XXX Should probably go outside the loop
if (f > 1.0f)
*dest = 1.0f;
else if (f < -1.0f)
*dest = -1.0f;
else
*dest = (float)f;
//go through each sample position
for (int j = 0; j < len; j++) {
}
cout << *dest << endl;
dest++;
}
} break;
} // switch
return true;
clips = 0;
f = 0;
for(int i = 0; i < numclips; i++)
{
cout << numclips << " " ;
cout <<f << " " ;
if(j + clipStart[i] >= 0 &&
clipStart[i] + j < clipLength[i])//only copy if we are within the clip
{
f += floatSeq[i][j + clipStart[i]];
clips++;
}
cout << f << " "<< i << " "<< floatSeq[i][j+clipStart[i]] << "|";
}
if(clips == 0)
*dest = 0.0f;
else
{
f /= clips;
cout << f << "--";
// MM: XXX Should probably go outside the loop
if (f > 1.0f)
*dest = 1.0f;
else if (f < -1.0f)
*dest = -1.0f;
else
*dest = (float)f;
}
cout << *dest << endl;
dest++;
}
} break;
} // switch
return true;
}
void CrossFader::AddClip( WaveClip * clip)
{
mClips.Append(clip);
mClips.Append(clip);
}
void CrossFader::ClearClips()
{
if(mClips.GetCount())
mClips.Clear();
if(mClips.GetCount())
mClips.Clear();
}

View File

@ -79,7 +79,7 @@ static void LinearInterpolateAudio(float *buffer, int len,
// Here's the main interpolate function, using
// Least Squares AutoRegression (LSAR):
void InterpolateAudio(float *buffer, int len,
int firstBad, int numBad)
int firstBad, int numBad)
{
int N = len;
int i, row, col;

View File

@ -19,32 +19,32 @@
Note: The info below is very outdated and incomplete
Preference field specification:
/
Version - Audacity Version that created these prefs
DefaultOpenPath - Default directory for new file selector
/FileFormats
CopyOrEditUncompressedData - Copy data from uncompressed files or
[ "copy", "edit"] - edit in place?
ExportFormat_SF1 - Format to export PCM data in
/
Version - Audacity Version that created these prefs
DefaultOpenPath - Default directory for new file selector
/FileFormats
CopyOrEditUncompressedData - Copy data from uncompressed files or
[ "copy", "edit"] - edit in place?
ExportFormat_SF1 - Format to export PCM data in
(this number is a libsndfile1.0 format)
/SamplingRate
DefaultProjectSampleRate- New projects will have this rate
[ 8000, 11025, 16000, 22050, 44100, 48000 ]
/AudioIO
PlaybackDevice - device to use for playback
RecordingDevice - device to use for recording
(these are device names understood by PortAudio)
/Display
WaveformColor - 0xRRGGBB --since it will be stored in
ShadowColor - decimal, it will be somewhat
SpectrumLowColor - non-intuitive to edit, but
SpectrumHighColor - much easier to parse.
/Locale
Language - two-letter language code for translations
(*): wxGTK
(+): wxWin
($): wxMac
/SamplingRate
DefaultProjectSampleRate- New projects will have this rate
[ 8000, 11025, 16000, 22050, 44100, 48000 ]
/AudioIO
PlaybackDevice - device to use for playback
RecordingDevice - device to use for recording
(these are device names understood by PortAudio)
/Display
WaveformColor - 0xRRGGBB --since it will be stored in
ShadowColor - decimal, it will be somewhat
SpectrumLowColor - non-intuitive to edit, but
SpectrumHighColor - much easier to parse.
/Locale
Language - two-letter language code for translations
(*): wxGTK
(+): wxWin
($): wxMac
\endverbatim
*//*******************************************************************/

View File

@ -952,8 +952,8 @@ void Sequence::HandleXMLEndTag(const wxChar *tag)
if (len > mMaxSamples)
{
// This could be why the blockfile failed, so limit
// the silent replacement to mMaxSamples.
// This could be why the blockfile failed, so limit
// the silent replacement to mMaxSamples.
wxLogWarning(
wxT(" Sequence has missing block file with length %s > mMaxSamples %s.\n Setting length to mMaxSamples. This will likely cause some block files to be considered orphans."),
Internat::ToString(((wxLongLong)len).ToDouble(), 0).c_str(),

View File

@ -235,11 +235,11 @@ bool TimerRecordDialog::RunWaitDialog()
else
{
// Record for specified time.
AudacityProject* pProject = GetActiveProject();
AudacityProject* pProject = GetActiveProject();
pProject->OnRecord();
bool bIsRecording = true;
wxString strMsg =
wxString strMsg =
_("Recording start") + (wxString)wxT(":\t\t")
+ GetDisplayDate(m_DateTime_Start) + wxT("\n") + _("Recording end")
+ wxT(":\t\t") + GetDisplayDate(m_DateTime_End) + wxT("\n")

View File

@ -211,7 +211,7 @@ void ODDecodeBlockFile::SaveXML(XMLWriter &xmlFile)
xmlFile.EndTag(wxT("oddecodeblockfile"));
}
UnlockRead();
UnlockRead();
}
/// Constructs a ODPCMAliasBlockFile from the xml output of WriteXML.

View File

@ -239,11 +239,11 @@ BlockFile *PCMAliasBlockFile::BuildFromXML(DirManager &dm, const wxChar **attrs)
max = nValue;
else if (!wxStricmp(attr, wxT("rms")) && (nValue >= 0))
rms = nValue;
}
// mchinen: the min/max can be (are?) doubles as well, so handle those cases.
// Vaughan: The code to which I added the XMLValueChecker checks
// used wxAtoi to convert the string to an int.
// So it's possible some prior project formats used ints (?), so am keeping
}
// mchinen: the min/max can be (are?) doubles as well, so handle those cases.
// Vaughan: The code to which I added the XMLValueChecker checks
// used wxAtoi to convert the string to an int.
// So it's possible some prior project formats used ints (?), so am keeping
// those above, but yes, we need to handle floats.
else if (XMLValueChecker::IsGoodString(strValue) && Internat::CompatibleToDouble(strValue, &dblValue))
{ // double parameters

View File

@ -332,9 +332,9 @@ void AmplifyDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview, because we didn't do OK.
float oldRatio = mEffect->ratio;
float oldPeak = mEffect->peak;
// Save & restore parameters around Preview, because we didn't do OK.
float oldRatio = mEffect->ratio;
float oldPeak = mEffect->peak;
mEffect->ratio = ratio;
if (noclip && ratio*peak > 1.0)

View File

@ -83,8 +83,8 @@ class AmplifyDialog:public EffectDialog
bool TransferDataFromWindow();
bool Validate();
private:
// handlers
private:
// handlers
void OnAmpText(wxCommandEvent & event);
void OnPeakText(wxCommandEvent & event);
void OnAmpSlider(wxCommandEvent & event);

File diff suppressed because it is too large Load Diff

View File

@ -23,12 +23,12 @@
class iAVCBufferList
{
public:
// The following 4 values describe the buffers that still need output values inserted
iAVCBufferList * mpNext;
void * mpLeftBuffer;
void * mpRightBuffer;
sampleCount mnLen; // number of entries in buffers
sampleCount mnNext; // next output position in buffers
// The following 4 values describe the buffers that still need output values inserted
iAVCBufferList * mpNext;
void * mpLeftBuffer;
void * mpRightBuffer;
sampleCount mnLen; // number of entries in buffers
sampleCount mnNext; // next output position in buffers
};
class wxString;
@ -47,9 +47,9 @@ class WaveTrack;
class AvcCompressorDialog; // defined later in this file
#ifdef IAVC_FLOAT
#define AVCCOMPSAMPLETYPE floatSample
#define AVCCOMPSAMPLETYPE floatSample
#else
#define AVCCOMPSAMPLETYPE int16Sample
#define AVCCOMPSAMPLETYPE int16Sample
#endif
//typedef for IAVCSAMPLETYPE is in iAVC.h
@ -82,18 +82,18 @@ protected:
virtual bool Init(); // invoked by Effect
// invoked by SimplePairedTwoTrack
bool ProcessSimplePairedTwoTrack ( /*IAVCSAMPLETYPE*/ void *bufferLeft,
/*IAVCSAMPLETYPE*/ void *bufferRight, // may be 0
sampleCount len);
AutoVolCtrl mAutoVolCtrl; // iAVC class (LGPL license)
long mnChangeWindow;
bool ProcessSimplePairedTwoTrack ( /*IAVCSAMPLETYPE*/ void *bufferLeft,
/*IAVCSAMPLETYPE*/ void *bufferRight, // may be 0
sampleCount len);
AutoVolCtrl mAutoVolCtrl; // iAVC class (LGPL license)
long mnChangeWindow;
iAVCBufferList * mpBufferList;
iAVCBufferList * mpBufferPrevious;
iAVCBufferList * mpBufferList;
iAVCBufferList * mpBufferPrevious;
long mnDelay; // delay between when sample set and when it got.
long mnDelay; // delay between when sample set and when it got.
AvcCompressorDialog* mpDialog;
AvcCompressorDialog* mpDialog;
private:
void OutputSample ( IAVCSAMPLETYPE left, IAVCSAMPLETYPE right );
@ -134,11 +134,11 @@ public:
long style = wxDEFAULT_DIALOG_STYLE );
~AvcCompressorDialog();
long GetAdjusterWindow() { return mnAdjWin; };
long GetDelay() { return mnDelay; };
long GetChangeWindow() { return mnChangeWin; };
long GetMinimumPercent() { return mnMinPct; };
void GetTransformArray( unsigned short int nTransform[MULTIPLY_PCT_ARRAY_SIZE] );
long GetAdjusterWindow() { return mnAdjWin; };
long GetDelay() { return mnDelay; };
long GetChangeWindow() { return mnChangeWin; };
long GetMinimumPercent() { return mnMinPct; };
void GetTransformArray( unsigned short int nTransform[MULTIPLY_PCT_ARRAY_SIZE] );
//wxButton *mRemoveNoiseButton;
//wxSlider *mSlider;
@ -147,46 +147,46 @@ private:
DECLARE_EVENT_TABLE()
protected:
wxSizer *MakeAvcCompressorDialog( wxWindow *parent, bool call_fit = TRUE,
bool set_sizer = TRUE );
void OnCancel( wxCommandEvent &event );
void OnOK(wxCommandEvent &event);
void OnRestoreDefaults(wxCommandEvent &event);
void OnCheckBox(wxCommandEvent & event);
void ReadPrefs();
void WritePrefs();
wxSizer *MakeAvcCompressorDialog( wxWindow *parent, bool call_fit = TRUE,
bool set_sizer = TRUE );
void OnCancel( wxCommandEvent &event );
void OnOK(wxCommandEvent &event);
void OnRestoreDefaults(wxCommandEvent &event);
void OnCheckBox(wxCommandEvent & event);
void ReadPrefs();
void WritePrefs();
bool LongRangeCheck ( wxWindow *window,
const long nValue,
const long nMin,
const long nMax );
bool LongRangeCheck ( wxWindow *window,
const long nValue,
const long nMin,
const long nMax );
// Values for Adjustment Settings
wxTextCtrl *mctlAdjWin;
wxTextCtrl *mctlDelay;
wxTextCtrl *mctlChangeWin;
wxTextCtrl *mctlMinPct;
// Values for Adjustment Settings
wxTextCtrl *mctlAdjWin;
wxTextCtrl *mctlDelay;
wxTextCtrl *mctlChangeWin;
wxTextCtrl *mctlMinPct;
wxString mstrAdjWin;
wxString mstrDelay;
wxString mstrChangeWin;
wxString mstrMinPct;
wxString mstrAdjWin;
wxString mstrDelay;
wxString mstrChangeWin;
wxString mstrMinPct;
long mnAdjWin;
long mnDelay;
long mnChangeWin;
long mnMinPct;
long mnAdjWin;
long mnDelay;
long mnChangeWin;
long mnMinPct;
// Values for Amplification Settings
wxCheckBox *mctlCheckBoxes[NUM_CURVE_POINTS];
wxTextCtrl *mctlXAxis[NUM_CURVE_POINTS];
wxTextCtrl *mctlYAxis[NUM_CURVE_POINTS];
// Values for Amplification Settings
wxCheckBox *mctlCheckBoxes[NUM_CURVE_POINTS];
wxTextCtrl *mctlXAxis[NUM_CURVE_POINTS];
wxTextCtrl *mctlYAxis[NUM_CURVE_POINTS];
wxString mstrXAxis[NUM_CURVE_POINTS];
wxString mstrYAxis[NUM_CURVE_POINTS];
wxString mstrXAxis[NUM_CURVE_POINTS];
wxString mstrYAxis[NUM_CURVE_POINTS];
long mnXAxis[NUM_CURVE_POINTS];
long mnYAxis[NUM_CURVE_POINTS];
long mnXAxis[NUM_CURVE_POINTS];
long mnYAxis[NUM_CURVE_POINTS];
};
#endif

View File

@ -99,7 +99,7 @@ BEGIN_EVENT_TABLE(ChangeLengthDialog,wxDialog)
EVT_BUTTON( wxID_OK, ChangeLengthDialog::OnOk )
EVT_BUTTON( wxID_CANCEL, ChangeLengthDialog::OnCancel )
EVT_TEXT(ID_CHANGE_LENGTH_TO_TEXT, ChangeLengthDialog::OnText_ToLength)
EVT_BUTTON(ID_BUTTON_RECALCULATE, ChangeLengthDialog::OnRecalculate)
EVT_BUTTON(ID_BUTTON_RECALCULATE, ChangeLengthDialog::OnRecalculate)
END_EVENT_TABLE()
ChangeLengthDialog::ChangeLengthDialog(wxWindow *parent, wxWindowID id, const wxString &title) :
@ -108,71 +108,71 @@ ChangeLengthDialog::ChangeLengthDialog(wxWindow *parent, wxWindowID id, const wx
// wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer * pBoxSizer_Dialog = new wxBoxSizer(wxVERTICAL);
wxStaticText *statText = new wxStaticText(this, -1,
wxT("Change Length by Lynn Allan\n"
"Make shorter or longer by up to +/- 10%\n"
"to fit certain number of minutes\n"));
wxT("Change Length by Lynn Allan\n"
"Make shorter or longer by up to +/- 10%\n"
"to fit certain number of minutes\n"));
pBoxSizer_Dialog->Add(statText, 0, wxALIGN_CENTRE | wxALL, 5);
pBoxSizer_Dialog->Add(0, 4, 0); // spacer
wxBoxSizer * pBoxSizer_ToLength = new wxBoxSizer(wxHORIZONTAL);
statText = new wxStaticText(this, -1, wxT("Desired Length (minutes): "),
wxDefaultPosition, wxDefaultSize, 0);
pBoxSizer_ToLength->Add(statText, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 4);
wxDefaultPosition, wxDefaultSize, 0);
pBoxSizer_ToLength->Add(statText, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 4);
m_pTextCtrl_ToLength =
new wxTextCtrl(this, ID_CHANGE_LENGTH_TO_TEXT, wxT("0.0"),
wxDefaultPosition, wxSize(48, -1), 0,
wxTextValidator(wxFILTER_NUMERIC));
pBoxSizer_ToLength->Add(m_pTextCtrl_ToLength, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
new wxTextCtrl(this, ID_CHANGE_LENGTH_TO_TEXT, wxT("0.0"),
wxDefaultPosition, wxSize(48, -1), 0,
wxTextValidator(wxFILTER_NUMERIC));
pBoxSizer_ToLength->Add(m_pTextCtrl_ToLength, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
pBoxSizer_Dialog->Add(pBoxSizer_ToLength, 0, wxALIGN_CENTER | wxALL, 4);
wxStaticBoxSizer *infoGroup = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("Information")), wxVERTICAL);
wxBoxSizer * pBoxSizer_FromLength = new wxBoxSizer(wxHORIZONTAL);
statText = new wxStaticText(this, -1, wxT("Current Length (minutes): "),
wxDefaultPosition, wxDefaultSize, 0);
wxDefaultPosition, wxDefaultSize, 0);
pBoxSizer_FromLength->Add(statText, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 4);
m_pTextCtrl_FromLength =
new wxTextCtrl(this, ID_CHANGE_LENGTH_FROM_TEXT, wxT("0.0"),
wxDefaultPosition, wxSize(48, -1),
wxTE_READONLY); // Read only because it's from the selection.
// No validator because it's read only.
pBoxSizer_FromLength->Add(m_pTextCtrl_FromLength, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
m_pTextCtrl_FromLength =
new wxTextCtrl(this, ID_CHANGE_LENGTH_FROM_TEXT, wxT("0.0"),
wxDefaultPosition, wxSize(48, -1),
wxTE_READONLY); // Read only because it's from the selection.
// No validator because it's read only.
pBoxSizer_FromLength->Add(m_pTextCtrl_FromLength, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
infoGroup->Add(pBoxSizer_FromLength, 0, wxALIGN_CENTER | wxALL, 4);
infoGroup->Add(0, 4, 0); // spacer
wxBoxSizer * pBoxSizer_Range = new wxBoxSizer(wxHORIZONTAL);
statText = new wxStaticText(this, -1, wxT("Allowed Range: "),
wxDefaultPosition, wxDefaultSize, 0);
wxDefaultPosition, wxDefaultSize, 0);
pBoxSizer_Range->Add(statText, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 4);
m_pTextCtrl_ToRange =
new wxTextCtrl(this, ID_TO_RANGE_TEXT, wxT("90% to 110%"),
wxDefaultPosition, wxSize(90, -1),
wxTE_READONLY); // Read only because it's from the selection.
// No validator because it's read only.
pBoxSizer_Range->Add(m_pTextCtrl_ToRange, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
m_pTextCtrl_ToRange =
new wxTextCtrl(this, ID_TO_RANGE_TEXT, wxT("90% to 110%"),
wxDefaultPosition, wxSize(90, -1),
wxTE_READONLY); // Read only because it's from the selection.
// No validator because it's read only.
pBoxSizer_Range->Add(m_pTextCtrl_ToRange, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
infoGroup->Add(pBoxSizer_Range, 0, wxALIGN_CENTER | wxALL, 4);
infoGroup->Add(0, 4, 0); // spacer
// Group percent controls with spacers,
// rather than static box, so they don't look isolated.
// Group percent controls with spacers,
// rather than static box, so they don't look isolated.
pBoxSizer_Dialog->Add(0, 4, 0); // spacer
wxBoxSizer * pBoxSizer_PercentChange = new wxBoxSizer(wxHORIZONTAL);
statText = new wxStaticText(this, -1, wxT("Percent Change:"),
wxDefaultPosition, wxDefaultSize, 0);
pBoxSizer_PercentChange->Add(statText, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 4);
m_pTextCtrl_PercentChange =
new wxTextCtrl(this, ID_PERCENT_CHANGE_TEXT, wxT("0.0"),
wxDefaultPosition, wxSize(40, -1), wxTE_READONLY);
pBoxSizer_PercentChange->Add(m_pTextCtrl_PercentChange, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
wxDefaultPosition, wxDefaultSize, 0);
pBoxSizer_PercentChange->Add(statText, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 4);
m_pTextCtrl_PercentChange =
new wxTextCtrl(this, ID_PERCENT_CHANGE_TEXT, wxT("0.0"),
wxDefaultPosition, wxSize(40, -1), wxTE_READONLY);
pBoxSizer_PercentChange->Add(m_pTextCtrl_PercentChange, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 4);
infoGroup->Add(pBoxSizer_PercentChange, 0, wxALIGN_CENTER | wxALL, 4);
pBoxSizer_Dialog->Add(infoGroup, 0, wxALIGN_CENTER | wxALL, 4);
@ -230,9 +230,9 @@ void ChangeLengthDialog::OnText_ToLength(wxCommandEvent & event)
wxString str = m_pTextCtrl_ToLength->GetValue();
double newValue = 0.0;
str.ToDouble(&newValue);
mToLength = newValue;
mToLength = newValue;
mPercentChange = ((mToLength - mFromLength) / mFromLength) * 100.0;
mPercentChange = ((mToLength - mFromLength) / mFromLength) * 100.0;
}
}

View File

@ -51,28 +51,28 @@ class EffectChangePitch : public EffectSoundTouch {
virtual bool Init();
// DeduceFrequencies is Dominic's extremely cool trick (Vaughan sez so!)
// to set deduce m_FromFrequency from the samples at the beginning of
// the selection. Then we set some other params accordingly.
virtual void DeduceFrequencies();
// DeduceFrequencies is Dominic's extremely cool trick (Vaughan sez so!)
// to set deduce m_FromFrequency from the samples at the beginning of
// the selection. Then we set some other params accordingly.
virtual void DeduceFrequencies();
virtual bool PromptUser();
virtual bool TransferParameters( Shuttle & shuttle );
virtual bool CheckWhetherSkipEffect() { return (m_PercentChange == 0.0); }
virtual bool Process();
private:
int m_FromPitchIndex; // pitch index, per PitchIndex
bool m_bWantPitchDown; // up to ToPitchNum if false (default), else down
int m_ToPitchIndex; // pitch index, per PitchIndex
double m_SemitonesChange; // how many semitones to change pitch
float m_FromFrequency; // starting frequency of selection
float m_ToFrequency; // target frequency of selection
private:
int m_FromPitchIndex; // pitch index, per PitchIndex
bool m_bWantPitchDown; // up to ToPitchNum if false (default), else down
int m_ToPitchIndex; // pitch index, per PitchIndex
double m_PercentChange; // percent change to apply to pitch
double m_SemitonesChange; // how many semitones to change pitch
float m_FromFrequency; // starting frequency of selection
float m_ToFrequency; // target frequency of selection
double m_PercentChange; // percent change to apply to pitch
friend class ChangePitchDialog;
};
@ -95,70 +95,70 @@ class ChangePitchDialog:public EffectDialog {
bool TransferDataFromWindow();
private:
// calculations
void Calc_ToFrequency(); // Update m_ToFrequency from m_FromFrequency & m_PercentChange.
void Calc_ToPitchIndex(); // Update m_ToPitchIndex from new m_SemitonesChange.
void Calc_SemitonesChange_fromPitches(); // Update m_SemitonesChange from new m_*PitchIndex-es.
void Calc_SemitonesChange_fromPercentChange(); // Update m_SemitonesChange from new m_PercentChange.
void Calc_PercentChange(); // Update m_PercentChange based on new m_SemitonesChange.
// calculations
void Calc_ToFrequency(); // Update m_ToFrequency from m_FromFrequency & m_PercentChange.
void Calc_ToPitchIndex(); // Update m_ToPitchIndex from new m_SemitonesChange.
void Calc_SemitonesChange_fromPitches(); // Update m_SemitonesChange from new m_*PitchIndex-es.
void Calc_SemitonesChange_fromPercentChange(); // Update m_SemitonesChange from new m_PercentChange.
void Calc_PercentChange(); // Update m_PercentChange based on new m_SemitonesChange.
// handlers
void OnChoice_FromPitch(wxCommandEvent & event);
void OnRadioButton_PitchUpDown(wxCommandEvent & event);
void OnChoice_ToPitch(wxCommandEvent & event);
// handlers
void OnChoice_FromPitch(wxCommandEvent & event);
void OnRadioButton_PitchUpDown(wxCommandEvent & event);
void OnChoice_ToPitch(wxCommandEvent & event);
void OnText_SemitonesChange(wxCommandEvent & event);
void OnText_FromFrequency(wxCommandEvent & event);
void OnText_ToFrequency(wxCommandEvent & event);
void OnText_SemitonesChange(wxCommandEvent & event);
void OnText_PercentChange(wxCommandEvent & event);
void OnText_FromFrequency(wxCommandEvent & event);
void OnText_ToFrequency(wxCommandEvent & event);
void OnText_PercentChange(wxCommandEvent & event);
void OnSlider_PercentChange(wxCommandEvent & event);
void OnPreview( wxCommandEvent &event );
// helper fns for controls
void Update_RadioButton_PitchUpDown();
void Update_Choice_ToPitch();
// helper fns for controls
void Update_RadioButton_PitchUpDown();
void Update_Choice_ToPitch();
void Update_Text_SemitonesChange();
void Update_Text_ToFrequency();
void Update_Text_SemitonesChange();
void Update_Text_PercentChange(); // Update control per current m_PercentChange.
void Update_Text_ToFrequency();
void Update_Text_PercentChange(); // Update control per current m_PercentChange.
void Update_Slider_PercentChange(); // Update control per current m_PercentChange.
private:
EffectChangePitch * mEffect;
EffectChangePitch * mEffect;
bool m_bLoopDetect;
// controls
wxChoice * m_pChoice_FromPitch;
wxRadioButton *m_pRadioButton_PitchUp;
wxRadioButton *m_pRadioButton_PitchDown;
wxChoice * m_pChoice_ToPitch;
wxTextCtrl * m_pTextCtrl_SemitonesChange;
wxChoice * m_pChoice_FromPitch;
wxRadioButton *m_pRadioButton_PitchUp;
wxRadioButton *m_pRadioButton_PitchDown;
wxChoice * m_pChoice_ToPitch;
wxTextCtrl * m_pTextCtrl_FromFrequency;
wxTextCtrl * m_pTextCtrl_ToFrequency;
wxTextCtrl * m_pTextCtrl_PercentChange;
wxSlider * m_pSlider_PercentChange;
wxTextCtrl * m_pTextCtrl_SemitonesChange;
wxTextCtrl * m_pTextCtrl_FromFrequency;
wxTextCtrl * m_pTextCtrl_ToFrequency;
wxTextCtrl * m_pTextCtrl_PercentChange;
wxSlider * m_pSlider_PercentChange;
public:
// effect parameters
int m_FromPitchIndex; // pitch index, per PitchIndex
bool m_bWantPitchDown; // up to ToPitchNum if false (default), else down
int m_ToPitchIndex; // pitch index, per PitchIndex
// effect parameters
int m_FromPitchIndex; // pitch index, per PitchIndex
bool m_bWantPitchDown; // up to ToPitchNum if false (default), else down
int m_ToPitchIndex; // pitch index, per PitchIndex
double m_SemitonesChange; // how many semitones to change pitch
float m_FromFrequency; // starting frequency of selection
float m_ToFrequency; // target frequency of selection
double m_SemitonesChange; // how many semitones to change pitch
double m_PercentChange; // percent change to apply to pitch
// Slider is (-100, 200], but textCtrls can set higher.
float m_FromFrequency; // starting frequency of selection
float m_ToFrequency; // target frequency of selection
double m_PercentChange; // percent change to apply to pitch
// Slider is (-100, 200], but textCtrls can set higher.
private:
DECLARE_EVENT_TABLE()

View File

@ -61,18 +61,18 @@ class EffectChangeSpeed : public Effect
bool ProcessLabelTrack(Track *t);
private:
// track related
// track related
int mCurTrackNum;
double mMaxNewLength;
double mCurT0;
double mCurT1;
// control values
double mPercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit.
// Slider is (-100, 200], but textCtrls can set higher.
int mFromVinyl; // from standard vinyl speed (RPM) enum
int mToVinyl; // to standard vinyl speed (RPM) enum
// control values
double mPercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit.
// Slider is (-100, 200], but textCtrls can set higher.
int mFromVinyl; // from standard vinyl speed (RPM) enum
int mToVinyl; // to standard vinyl speed (RPM) enum
double mFactor; // scale factor calculated from percent change
friend class ChangeSpeedDialog;
@ -83,30 +83,30 @@ class ChangeSpeedDialog : public EffectDialog
{
public:
ChangeSpeedDialog(EffectChangeSpeed * effect,
wxWindow * parent);
wxWindow * parent);
void PopulateOrExchange(ShuttleGui& S);
bool TransferDataToWindow();
bool TransferDataFromWindow();
private:
// handlers
void OnText_PercentChange(wxCommandEvent & event);
// handlers
void OnText_PercentChange(wxCommandEvent & event);
void OnSlider_PercentChange(wxCommandEvent & event);
void OnChoice_FromVinyl(wxCommandEvent & event);
void OnChoice_ToVinyl(wxCommandEvent & event);
void OnChoice_FromVinyl(wxCommandEvent & event);
void OnChoice_ToVinyl(wxCommandEvent & event);
void OnPreview(wxCommandEvent &event);
// helper fns
void Update_Text_PercentChange(); // Update control per current mPercentChange.
// helper fns
void Update_Text_PercentChange(); // Update control per current mPercentChange.
void Update_Slider_PercentChange(); // Update control per current mPercentChange.
void Update_Vinyl(); // Update Vinyl controls for new percent change.
void Update_PercentChange(); // Update percent change controls for new Vinyl values.
void Update_Vinyl(); // Update Vinyl controls for new percent change.
void Update_PercentChange(); // Update percent change controls for new Vinyl values.
private:
EffectChangeSpeed * mEffect;
bool mbLoopDetect;
EffectChangeSpeed * mEffect;
bool mbLoopDetect;
// controls
wxTextCtrl * mpTextCtrl_PercentChange;
@ -115,12 +115,12 @@ class ChangeSpeedDialog : public EffectDialog
wxChoice * mpChoice_ToVinyl;
public:
// effect parameters
double mPercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit.
// Slider is (-100, 200], but textCtrls can set higher.
int mFromVinyl; // from standard vinyl speed (RPM)
int mToVinyl; // to standard vinyl speed (RPM)
// effect parameters
double mPercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit.
// Slider is (-100, 200], but textCtrls can set higher.
int mFromVinyl; // from standard vinyl speed (RPM)
int mToVinyl; // to standard vinyl speed (RPM)
private:
DECLARE_EVENT_TABLE()

View File

@ -44,11 +44,11 @@
EffectChangeTempo::EffectChangeTempo()
{
m_PercentChange = 0.0;
m_FromBPM = 0; // indicates not yet set
m_ToBPM = 0; // indicates not yet set
m_FromLength = 0.0;
m_ToLength = 0.0;
m_PercentChange = 0.0;
m_FromBPM = 0; // indicates not yet set
m_ToBPM = 0; // indicates not yet set
m_FromLength = 0.0;
m_ToLength = 0.0;
}
double EffectChangeTempo::CalcPreviewInputLength(double previewLength)
@ -57,22 +57,22 @@ double EffectChangeTempo::CalcPreviewInputLength(double previewLength)
}
wxString EffectChangeTempo::GetEffectDescription() {
// Note: This is useful only after change amount has been set.
return wxString::Format(_("Applied effect: %s %.1f%%"),
this->GetEffectName().c_str(),
m_PercentChange);
// Note: This is useful only after change amount has been set.
return wxString::Format(_("Applied effect: %s %.1f%%"),
this->GetEffectName().c_str(),
m_PercentChange);
}
bool EffectChangeTempo::Init()
{
// The selection might have changed since the last time EffectChangeTempo
// was invoked, so recalculate the Length parameters.
m_FromLength = mT1 - mT0;
m_ToLength = (m_FromLength * 100.0) / (100.0 + m_PercentChange);
// The selection might have changed since the last time EffectChangeTempo
// was invoked, so recalculate the Length parameters.
m_FromLength = mT1 - mT0;
m_ToLength = (m_FromLength * 100.0) / (100.0 + m_PercentChange);
mSoundTouch = NULL;
return true;
return true;
}
bool EffectChangeTempo::PromptUser()
@ -83,15 +83,15 @@ bool EffectChangeTempo::PromptUser()
dlog.m_ToBPM = m_ToBPM;
dlog.m_FromLength = m_FromLength;
dlog.m_ToLength = m_ToLength;
// Don't need to call TransferDataToWindow, although other
// Audacity dialogs (from which I derived this one) do it, because
// ShowModal calls stuff that eventually calls wxWindowBase::OnInitDialog,
// which calls dlog.TransferDataToWindow();
// Don't need to call TransferDataToWindow, although other
// Audacity dialogs (from which I derived this one) do it, because
// ShowModal calls stuff that eventually calls wxWindowBase::OnInitDialog,
// which calls dlog.TransferDataToWindow();
dlog.CentreOnParent();
dlog.ShowModal();
if (dlog.GetReturnCode() == wxID_CANCEL)
return false;
if (dlog.GetReturnCode() == wxID_CANCEL)
return false;
m_PercentChange = dlog.m_PercentChange;
m_FromBPM = dlog.m_FromBPM;
@ -152,22 +152,22 @@ ChangeTempoDialog::ChangeTempoDialog(EffectChangeTempo *effect, wxWindow *parent
{
m_bLoopDetect = false;
// NULL out these control members because there are some cases where the
// event table handlers get called during this method, and those handlers that
// can cause trouble check for NULL.
// NULL out these control members because there are some cases where the
// event table handlers get called during this method, and those handlers that
// can cause trouble check for NULL.
m_pTextCtrl_PercentChange = NULL;
m_pSlider_PercentChange = NULL;
m_pTextCtrl_FromBPM = NULL;
m_pTextCtrl_ToBPM = NULL;
m_pTextCtrl_FromLength = NULL;
m_pTextCtrl_ToLength = NULL;
// effect parameters
m_PercentChange = 0.0;
m_FromBPM = 0; // indicates not yet set
m_ToBPM = 0; // indicates not yet set
m_FromLength = 0.0;
m_ToLength = 0.0;
// effect parameters
m_PercentChange = 0.0;
m_FromBPM = 0; // indicates not yet set
m_ToBPM = 0; // indicates not yet set
m_FromLength = 0.0;
m_ToLength = 0.0;
Init();
}
@ -246,78 +246,78 @@ bool ChangeTempoDialog::TransferDataToWindow()
{
m_bLoopDetect = true;
// percent change controls
this->Update_Text_PercentChange();
this->Update_Slider_PercentChange();
// percent change controls
this->Update_Text_PercentChange();
this->Update_Slider_PercentChange();
// from/to BPM controls
wxString str;
if (m_pTextCtrl_FromBPM) {
if (m_FromBPM != 0)
str.Printf(wxT("%d"), m_FromBPM);
else
str = wxT("");
m_pTextCtrl_FromBPM->SetValue(str);
}
if (m_pTextCtrl_ToBPM) {
if (m_ToBPM != 0)
str.Printf(wxT("%d"), m_ToBPM);
else
str = wxT("");
m_pTextCtrl_ToBPM->SetValue(str);
}
// from/to BPM controls
wxString str;
if (m_pTextCtrl_FromBPM) {
if (m_FromBPM != 0)
str.Printf(wxT("%d"), m_FromBPM);
else
str = wxT("");
m_pTextCtrl_FromBPM->SetValue(str);
}
if (m_pTextCtrl_ToBPM) {
if (m_ToBPM != 0)
str.Printf(wxT("%d"), m_ToBPM);
else
str = wxT("");
m_pTextCtrl_ToBPM->SetValue(str);
}
// from/to Length controls
if (m_pTextCtrl_FromLength) {
str.Printf(wxT("%.2f"), m_FromLength);
m_pTextCtrl_FromLength->SetValue(str);
m_pTextCtrl_FromLength->Enable(false); // Disable because the value comes from the user selection.
}
if (m_pTextCtrl_ToLength) {
str.Printf(wxT("%.2f"), m_ToLength);
m_pTextCtrl_ToLength->SetValue(str);
}
// from/to Length controls
if (m_pTextCtrl_FromLength) {
str.Printf(wxT("%.2f"), m_FromLength);
m_pTextCtrl_FromLength->SetValue(str);
m_pTextCtrl_FromLength->Enable(false); // Disable because the value comes from the user selection.
}
if (m_pTextCtrl_ToLength) {
str.Printf(wxT("%.2f"), m_ToLength);
m_pTextCtrl_ToLength->SetValue(str);
}
m_bLoopDetect = false;
return true;
return true;
}
bool ChangeTempoDialog::TransferDataFromWindow()
{
wxString str;
wxString str;
// percent change controls
// percent change controls
if (m_pTextCtrl_PercentChange) {
str = m_pTextCtrl_PercentChange->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PercentChange = newValue;
}
m_PercentChange = newValue;
}
// Ignore Slider_PercentChange because TextCtrl_PercentChange
// always tracks it & is more precise (decimal points).
// Ignore Slider_PercentChange because TextCtrl_PercentChange
// always tracks it & is more precise (decimal points).
// from/to BPM controls
// from/to BPM controls
long newLong;
if (m_pTextCtrl_FromBPM) {
str = m_pTextCtrl_FromBPM->GetValue();
str.ToLong(&newLong);
m_FromBPM = (unsigned int)(newLong);
}
m_FromBPM = (unsigned int)(newLong);
}
if (m_pTextCtrl_ToBPM) {
str = m_pTextCtrl_ToBPM->GetValue();
str.ToLong(&newLong);
m_ToBPM = (unsigned int)(newLong);
}
m_ToBPM = (unsigned int)(newLong);
}
// from/to Length controls
// from/to Length controls
// Don't do m_pTextCtrl_ToLength. It's disabled.
if (m_pTextCtrl_ToLength) {
str = m_pTextCtrl_ToLength->GetValue();
str.ToLong(&newLong);
m_ToLength = (int)(newLong);
}
m_ToLength = (int)(newLong);
}
return true;
}
@ -333,12 +333,12 @@ void ChangeTempoDialog::OnText_PercentChange(wxCommandEvent & event)
wxString str = m_pTextCtrl_PercentChange->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PercentChange = newValue;
m_PercentChange = newValue;
m_bLoopDetect = true;
this->Update_Slider_PercentChange();
this->Update_Text_ToBPM();
this->Update_Text_ToLength();
this->Update_Slider_PercentChange();
this->Update_Text_ToBPM();
this->Update_Text_ToLength();
m_bLoopDetect = false;
FindWindow(wxID_OK)->Enable(m_PercentChange > -100.0);
@ -350,18 +350,18 @@ void ChangeTempoDialog::OnSlider_PercentChange(wxCommandEvent & event)
if (m_bLoopDetect)
return;
if (m_pSlider_PercentChange) {
m_PercentChange = (double)(m_pSlider_PercentChange->GetValue());
// Warp positive values to actually go up faster & further than negatives.
if (m_PercentChange > 0.0)
m_PercentChange = pow(m_PercentChange, PERCENTCHANGE_SLIDER_WARP);
if (m_pSlider_PercentChange) {
m_PercentChange = (double)(m_pSlider_PercentChange->GetValue());
// Warp positive values to actually go up faster & further than negatives.
if (m_PercentChange > 0.0)
m_PercentChange = pow(m_PercentChange, PERCENTCHANGE_SLIDER_WARP);
m_bLoopDetect = true;
this->Update_Text_PercentChange();
this->Update_Text_ToBPM();
this->Update_Text_ToLength();
m_bLoopDetect = false;
}
m_bLoopDetect = true;
this->Update_Text_PercentChange();
this->Update_Text_ToBPM();
this->Update_Text_ToLength();
m_bLoopDetect = false;
}
}
void ChangeTempoDialog::OnText_FromBPM(wxCommandEvent & event)
@ -373,11 +373,11 @@ void ChangeTempoDialog::OnText_FromBPM(wxCommandEvent & event)
wxString str = m_pTextCtrl_FromBPM->GetValue();
long newValue;
str.ToLong(&newValue);
m_FromBPM = (unsigned int)(newValue);
m_FromBPM = (unsigned int)(newValue);
m_bLoopDetect = true;
this->Update_Text_ToBPM();
this->Update_Text_ToBPM();
m_bLoopDetect = false;
}
@ -392,19 +392,19 @@ void ChangeTempoDialog::OnText_ToBPM(wxCommandEvent & event)
wxString str = m_pTextCtrl_ToBPM->GetValue();
long newValue;
str.ToLong(&newValue);
m_ToBPM = (unsigned int)(newValue);
m_ToBPM = (unsigned int)(newValue);
m_bLoopDetect = true;
// If FromBPM has already been set, then there's a new percent change.
if (m_FromBPM != 0) {
m_PercentChange = (((double)(m_ToBPM) * 100.0) / (double)(m_FromBPM)) - 100.0;
// If FromBPM has already been set, then there's a new percent change.
if (m_FromBPM != 0) {
m_PercentChange = (((double)(m_ToBPM) * 100.0) / (double)(m_FromBPM)) - 100.0;
this->Update_Text_PercentChange();
this->Update_Slider_PercentChange();
this->Update_Text_PercentChange();
this->Update_Slider_PercentChange();
this->Update_Text_ToLength();
}
this->Update_Text_ToLength();
}
m_bLoopDetect = false;
}
@ -419,16 +419,16 @@ void ChangeTempoDialog::OnText_ToLength(wxCommandEvent & event)
wxString str = m_pTextCtrl_ToLength->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_ToLength = newValue;
m_ToLength = newValue;
m_PercentChange = ((m_FromLength * 100.0) / m_ToLength) - 100.0;
m_PercentChange = ((m_FromLength * 100.0) / m_ToLength) - 100.0;
m_bLoopDetect = true;
this->Update_Text_PercentChange();
this->Update_Slider_PercentChange();
this->Update_Text_PercentChange();
this->Update_Slider_PercentChange();
this->Update_Text_ToBPM();
this->Update_Text_ToBPM();
m_bLoopDetect = false;
}
@ -438,69 +438,69 @@ void ChangeTempoDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview, because we didn't do OK.
double oldPercentChange = mEffect->m_PercentChange;
// Save & restore parameters around Preview, because we didn't do OK.
double oldPercentChange = mEffect->m_PercentChange;
if( m_PercentChange < -99.0)
{
m_PercentChange = -99.0;
this->Update_Text_PercentChange();
}
mEffect->m_PercentChange = m_PercentChange;
mEffect->Preview();
mEffect->m_PercentChange = oldPercentChange;
mEffect->m_PercentChange = m_PercentChange;
mEffect->Preview();
mEffect->m_PercentChange = oldPercentChange;
}
// helper fns
void ChangeTempoDialog::Update_Text_PercentChange()
{
if (m_pTextCtrl_PercentChange) {
wxString str;
str.Printf(wxT("%.3f"), m_PercentChange);
m_pTextCtrl_PercentChange->SetValue(str);
if (m_pTextCtrl_PercentChange) {
wxString str;
str.Printf(wxT("%.3f"), m_PercentChange);
m_pTextCtrl_PercentChange->SetValue(str);
FindWindow(wxID_OK)->Enable(m_PercentChange > -100.0);
}
}
}
void ChangeTempoDialog::Update_Slider_PercentChange()
{
if (m_pSlider_PercentChange) {
double unwarped = m_PercentChange;
if (unwarped > 0.0)
// Un-warp values above zero to actually go up to PERCENTCHANGE_MAX.
unwarped = pow(m_PercentChange, (1.0 / PERCENTCHANGE_SLIDER_WARP));
double unwarped = m_PercentChange;
if (unwarped > 0.0)
// Un-warp values above zero to actually go up to PERCENTCHANGE_MAX.
unwarped = pow(m_PercentChange, (1.0 / PERCENTCHANGE_SLIDER_WARP));
// Add 0.5 to unwarped so trunc -> round.
m_pSlider_PercentChange->SetValue((int)(unwarped + 0.5));
}
// Add 0.5 to unwarped so trunc -> round.
m_pSlider_PercentChange->SetValue((int)(unwarped + 0.5));
}
}
void ChangeTempoDialog::Update_Text_ToBPM()
// Use m_FromBPM & m_PercentChange to set new m_ToBPM & control.
{
// Update ToBPM iff FromBPM has been set.
if (m_FromBPM == 0)
return;
if (m_FromBPM == 0)
return;
m_ToBPM = (unsigned int)((((double)(m_FromBPM) *
(100.0 + m_PercentChange)) / 100.0) +
0.5); // Add 0.5 so trunc -> round.
if (m_pTextCtrl_ToBPM) {
wxString str;
str.Printf(wxT("%d"), m_ToBPM);
m_pTextCtrl_ToBPM->SetValue(str);
}
m_ToBPM = (unsigned int)((((double)(m_FromBPM) *
(100.0 + m_PercentChange)) / 100.0) +
0.5); // Add 0.5 so trunc -> round.
if (m_pTextCtrl_ToBPM) {
wxString str;
str.Printf(wxT("%d"), m_ToBPM);
m_pTextCtrl_ToBPM->SetValue(str);
}
}
void ChangeTempoDialog::Update_Text_ToLength()
// Use m_FromLength & m_PercentChange to set new m_ToLength & control.
{
m_ToLength = (m_FromLength * 100.0) / (100.0 + m_PercentChange);
if (m_pTextCtrl_ToLength) {
wxString str;
str.Printf(wxT("%.2f"), m_ToLength);
m_pTextCtrl_ToLength->SetValue(str);
}
m_ToLength = (m_FromLength * 100.0) / (100.0 + m_PercentChange);
if (m_pTextCtrl_ToLength) {
wxString str;
str.Printf(wxT("%.2f"), m_ToLength);
m_pTextCtrl_ToLength->SetValue(str);
}
}
#endif // USE_SOUNDTOUCH

View File

@ -63,12 +63,12 @@ class EffectChangeTempo : public EffectSoundTouch {
double CalcPreviewInputLength(double previewLength);
private:
double m_PercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit
unsigned int m_FromBPM; // user-set beats-per-minute. Zero means not yet set.
unsigned int m_ToBPM; // Zero value means not yet set.
double m_FromLength; // starting length of selection
double m_ToLength; // target length of selection
double m_PercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit
unsigned int m_FromBPM; // user-set beats-per-minute. Zero means not yet set.
unsigned int m_ToBPM; // Zero value means not yet set.
double m_FromLength; // starting length of selection
double m_ToLength; // target length of selection
friend class ChangeTempoDialog;
};
@ -79,31 +79,31 @@ friend class ChangeTempoDialog;
class ChangeTempoDialog:public EffectDialog {
public:
ChangeTempoDialog(EffectChangeTempo * effect,
wxWindow * parent);
ChangeTempoDialog(EffectChangeTempo * effect,
wxWindow * parent);
void PopulateOrExchange(ShuttleGui & S);
bool TransferDataToWindow();
bool TransferDataFromWindow();
private:
// handlers
void OnText_PercentChange(wxCommandEvent & event);
// handlers
void OnText_PercentChange(wxCommandEvent & event);
void OnSlider_PercentChange(wxCommandEvent & event);
void OnText_FromBPM(wxCommandEvent & event);
void OnText_ToBPM(wxCommandEvent & event);
void OnText_ToLength(wxCommandEvent & event);
void OnText_FromBPM(wxCommandEvent & event);
void OnText_ToBPM(wxCommandEvent & event);
void OnText_ToLength(wxCommandEvent & event);
void OnPreview( wxCommandEvent &event );
// helper fns
void Update_Text_PercentChange(); // Update control per current m_PercentChange.
// helper fns
void Update_Text_PercentChange(); // Update control per current m_PercentChange.
void Update_Slider_PercentChange(); // Update control per current m_PercentChange.
void Update_Text_ToBPM(); // Use m_FromBPM & m_PercentChange to set new m_ToBPM & control.
void Update_Text_ToLength(); // Use m_FromLength & m_PercentChange to set new m_ToLength & control.
void Update_Text_ToBPM(); // Use m_FromBPM & m_PercentChange to set new m_ToBPM & control.
void Update_Text_ToLength(); // Use m_FromLength & m_PercentChange to set new m_ToLength & control.
private:
EffectChangeTempo * mEffect;
EffectChangeTempo * mEffect;
bool m_bLoopDetect;
// controls
@ -115,14 +115,14 @@ class ChangeTempoDialog:public EffectDialog {
wxTextCtrl * m_pTextCtrl_ToLength;
public:
// effect parameters
double m_PercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit.
// Slider is (-100, 200], but textCtrls can set higher.
unsigned int m_FromBPM; // user-set beats-per-minute. Zero means not yet set.
unsigned int m_ToBPM; // Zero value means not yet set.
double m_FromLength; // starting length of selection
double m_ToLength; // target length of selection
// effect parameters
double m_PercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit.
// Slider is (-100, 200], but textCtrls can set higher.
unsigned int m_FromBPM; // user-set beats-per-minute. Zero means not yet set.
unsigned int m_ToBPM; // Zero value means not yet set.
double m_FromLength; // starting length of selection
double m_ToLength; // target length of selection
private:
DECLARE_EVENT_TABLE()

View File

@ -60,10 +60,10 @@ EffectCompressor::EffectCompressor()
mThresholdDB = -12.0;
mNoiseFloorDB = -40.0;
mNoiseFloor = 0.01;
mCircle = NULL;
mFollow1 = NULL;
mFollow2 = NULL;
mFollowLen = 0;
mCircle = NULL;
mFollow1 = NULL;
mFollow2 = NULL;
mFollowLen = 0;
}
bool EffectCompressor::Init()
@ -87,12 +87,12 @@ EffectCompressor::~EffectCompressor()
mCircle = NULL;
}
if(mFollow1!=NULL) {
delete[] mFollow1;
mFollow1 = NULL;
delete[] mFollow1;
mFollow1 = NULL;
}
if(mFollow2!=NULL) {
delete[] mFollow2;
mFollow2 = NULL;
delete[] mFollow2;
mFollow2 = NULL;
}
}
@ -179,31 +179,31 @@ bool EffectCompressor::InitPass1()
{
mMax=0.0;
if (!mNormalize)
DisableSecondPass();
DisableSecondPass();
// Find the maximum block length required for any track
sampleCount maxlen=0;
SelectedTrackListOfKindIterator iter(Track::Wave, mTracks);
WaveTrack *track = (WaveTrack *) iter.First();
while (track) {
sampleCount len=track->GetMaxBlockSize();
if(len > maxlen)
maxlen = len;
//Iterate to the next track
sampleCount len=track->GetMaxBlockSize();
if(len > maxlen)
maxlen = len;
//Iterate to the next track
track = (WaveTrack *) iter.Next();
}
if(mFollow1!=NULL) {
delete[] mFollow1;
mFollow1 = NULL;
delete[] mFollow1;
mFollow1 = NULL;
}
if(mFollow2!=NULL) {
delete[] mFollow2;
mFollow2 = NULL;
delete[] mFollow2;
mFollow2 = NULL;
}
// Allocate buffers for the envelope
if(maxlen > 0) {
mFollow1 = new float[maxlen];
mFollow2 = new float[maxlen];
mFollow1 = new float[maxlen];
mFollow2 = new float[maxlen];
}
mFollowLen = maxlen;
@ -221,68 +221,68 @@ bool EffectCompressor::InitPass2()
// buffer2 will be passed as buffer1 on the next call
bool EffectCompressor::TwoBufferProcessPass1(float *buffer1, sampleCount len1, float *buffer2, sampleCount len2)
{
int i;
int i;
// If buffers are bigger than allocated, then abort
// (this should never happen, but if it does, we don't want to crash)
if((len1 > mFollowLen) || (len2 > mFollowLen))
return false;
// If buffers are bigger than allocated, then abort
// (this should never happen, but if it does, we don't want to crash)
if((len1 > mFollowLen) || (len2 > mFollowLen))
return false;
// This makes sure that the initial value is well-chosen
// buffer1 == NULL on the first and only the first call
if (buffer1 == NULL) {
// Initialize the mLastLevel to the peak level in the first buffer
// This avoids problems with large spike events near the beginning of the track
mLastLevel = mThreshold;
for(i=0; i<len2; i++) {
if(mLastLevel < fabs(buffer2[i]))
mLastLevel = fabs(buffer2[i]);
}
}
// This makes sure that the initial value is well-chosen
// buffer1 == NULL on the first and only the first call
if (buffer1 == NULL) {
// Initialize the mLastLevel to the peak level in the first buffer
// This avoids problems with large spike events near the beginning of the track
mLastLevel = mThreshold;
for(i=0; i<len2; i++) {
if(mLastLevel < fabs(buffer2[i]))
mLastLevel = fabs(buffer2[i]);
}
}
// buffer2 is NULL on the last and only the last call
if(buffer2 != NULL) {
Follow(buffer2, mFollow2, len2, mFollow1, len1);
}
// buffer2 is NULL on the last and only the last call
if(buffer2 != NULL) {
Follow(buffer2, mFollow2, len2, mFollow1, len1);
}
if(buffer1 != NULL) {
for (i = 0; i < len1; i++) {
buffer1[i] = DoCompression(buffer1[i], mFollow1[i]);
}
}
if(buffer1 != NULL) {
for (i = 0; i < len1; i++) {
buffer1[i] = DoCompression(buffer1[i], mFollow1[i]);
}
}
#if 0
// Copy the envelope over the track data (for debug purposes)
memcpy(buffer1, mFollow1, len1*sizeof(float));
// Copy the envelope over the track data (for debug purposes)
memcpy(buffer1, mFollow1, len1*sizeof(float));
#endif
// Rotate the buffer pointers
float *tmpfloat = mFollow1;
mFollow1 = mFollow2;
mFollow2 = tmpfloat;
// Rotate the buffer pointers
float *tmpfloat = mFollow1;
mFollow1 = mFollow2;
mFollow2 = tmpfloat;
return true;
return true;
}
bool EffectCompressor::ProcessPass2(float *buffer, sampleCount len)
{
if (mMax != 0)
{
for (int i = 0; i < len; i++)
buffer[i] /= mMax;
}
return true;
if (mMax != 0)
{
for (int i = 0; i < len; i++)
buffer[i] /= mMax;
}
return true;
}
void EffectCompressor::FreshenCircle()
{
// Recompute the RMS sum periodically to prevent accumulation of rounding errors
// during long waveforms
mRMSSum = 0;
for(int i=0; i<mCircleSize; i++)
mRMSSum += mCircle[i];
// Recompute the RMS sum periodically to prevent accumulation of rounding errors
// during long waveforms
mRMSSum = 0;
for(int i=0; i<mCircleSize; i++)
mRMSSum += mCircle[i];
}
float EffectCompressor::AvgCircle(float value)
@ -336,82 +336,82 @@ void EffectCompressor::Follow(float *buffer, float *env, int len, float *previou
The value has a lower limit of floor to make sure value has a
reasonable positive value from which to begin an attack.
*/
int i;
double level,last;
int i;
double level,last;
if(!mUsePeak) {
// Update RMS sum directly from the circle buffer
// to avoid accumulation of rounding errors
FreshenCircle();
// Update RMS sum directly from the circle buffer
// to avoid accumulation of rounding errors
FreshenCircle();
}
// First apply a peak detect with the requested decay rate
last = mLastLevel;
for(i=0; i<len; i++) {
// First apply a peak detect with the requested decay rate
last = mLastLevel;
for(i=0; i<len; i++) {
if(mUsePeak)
level = fabs(buffer[i]);
else // use RMS
level = AvgCircle(buffer[i]);
level = AvgCircle(buffer[i]);
// Don't increase gain when signal is continuously below the noise floor
if(level < mNoiseFloor) {
mNoiseCounter++;
} else {
mNoiseCounter = 0;
}
if(mNoiseCounter < 100) {
last *= mDecayFactor;
if(last < mThreshold)
last = mThreshold;
if(level > last)
last = level;
}
env[i] = last;
}
mLastLevel = last;
if(mNoiseCounter < 100) {
last *= mDecayFactor;
if(last < mThreshold)
last = mThreshold;
if(level > last)
last = level;
}
env[i] = last;
}
mLastLevel = last;
// Next do the same process in reverse direction to get the requested attack rate
last = mLastLevel;
for(i=len-1; i>=0; i--) {
last *= mAttackInverseFactor;
if(last < mThreshold)
last = mThreshold;
if(env[i] < last)
env[i] = last;
else
last = env[i];
}
// Next do the same process in reverse direction to get the requested attack rate
last = mLastLevel;
for(i=len-1; i>=0; i--) {
last *= mAttackInverseFactor;
if(last < mThreshold)
last = mThreshold;
if(env[i] < last)
env[i] = last;
else
last = env[i];
}
if((previous != NULL) && (previous_len > 0)) {
// If the previous envelope was passed, propagate the rise back until we intersect
for(i=previous_len-1; i>0; i--) {
last *= mAttackInverseFactor;
if(last < mThreshold)
last = mThreshold;
if(previous[i] < last)
previous[i] = last;
else // Intersected the previous envelope buffer, so we are finished
return;
}
// If we can't back up far enough, project the starting level forward
// until we intersect the desired envelope
last = previous[0];
for(i=1; i<previous_len; i++) {
last *= mAttackFactor;
if(previous[i] > last)
previous[i] = last;
else // Intersected the desired envelope, so we are finished
return;
}
// If we still didn't intersect, then continue ramp up into current buffer
for(i=0; i<len; i++) {
last *= mAttackFactor;
if(buffer[i] > last)
buffer[i] = last;
else // Finally got an intersect
return;
}
// If we still didn't intersect, then reset mLastLevel
mLastLevel = last;
}
if((previous != NULL) && (previous_len > 0)) {
// If the previous envelope was passed, propagate the rise back until we intersect
for(i=previous_len-1; i>0; i--) {
last *= mAttackInverseFactor;
if(last < mThreshold)
last = mThreshold;
if(previous[i] < last)
previous[i] = last;
else // Intersected the previous envelope buffer, so we are finished
return;
}
// If we can't back up far enough, project the starting level forward
// until we intersect the desired envelope
last = previous[0];
for(i=1; i<previous_len; i++) {
last *= mAttackFactor;
if(previous[i] > last)
previous[i] = last;
else // Intersected the desired envelope, so we are finished
return;
}
// If we still didn't intersect, then continue ramp up into current buffer
for(i=0; i<len; i++) {
last *= mAttackFactor;
if(buffer[i] > last)
buffer[i] = last;
else // Finally got an intersect
return;
}
// If we still didn't intersect, then reset mLastLevel
mLastLevel = last;
}
}
float EffectCompressor::DoCompression(float value, double env)
@ -427,7 +427,7 @@ float EffectCompressor::DoCompression(float value, double env)
// Retain the maximum value for use in the normalization pass
if(mMax < fabs(out))
mMax = fabs(out);
mMax = fabs(out);
return out;
}
@ -766,7 +766,7 @@ void CompressorDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview, because we didn't do OK.
// Save & restore parameters around Preview, because we didn't do OK.
double oldAttackTime = mEffect->mAttackTime;
double oldDecayTime = mEffect->mDecayTime;
double oldThresholdDB = mEffect->mThresholdDB;

View File

@ -174,15 +174,15 @@ EchoDialog::EchoDialog(EffectEcho * effect, wxWindow * parent)
: EffectDialog(parent, _("Echo"))
{
m_bLoopDetect = false;
m_pEffect = effect;
m_pEffect = effect;
// NULL out these control members because there are some cases where the
// event table handlers get called during this method, and those handlers that
// can cause trouble check for NULL.
// NULL out these control members because there are some cases where the
// event table handlers get called during this method, and those handlers that
// can cause trouble check for NULL.
m_pTextCtrl_Delay = NULL;
m_pTextCtrl_Decay = NULL;
// effect parameters
// effect parameters
delay = float(1.0);
decay = float(0.5);
@ -225,34 +225,34 @@ bool EchoDialog::TransferDataToWindow()
{
m_bLoopDetect = true;
wxString str;
if (m_pTextCtrl_Delay) {
str.Printf(wxT("%g"), delay);
m_pTextCtrl_Delay->SetValue(str);
}
if (m_pTextCtrl_Decay) {
str.Printf(wxT("%g"), decay);
m_pTextCtrl_Decay->SetValue(str);
}
wxString str;
if (m_pTextCtrl_Delay) {
str.Printf(wxT("%g"), delay);
m_pTextCtrl_Delay->SetValue(str);
}
if (m_pTextCtrl_Decay) {
str.Printf(wxT("%g"), decay);
m_pTextCtrl_Decay->SetValue(str);
}
m_bLoopDetect = false;
return true;
m_bLoopDetect = false;
return true;
}
bool EchoDialog::TransferDataFromWindow()
{
double newValue;
wxString str;
wxString str;
if (m_pTextCtrl_Delay) {
str = m_pTextCtrl_Delay->GetValue();
str.ToDouble(&newValue);
delay = (float)(newValue);
}
delay = (float)(newValue);
}
if (m_pTextCtrl_Decay) {
str = m_pTextCtrl_Decay->GetValue();
str.ToDouble(&newValue);
decay = (float)(newValue);
}
decay = (float)(newValue);
}
return true;
}
@ -262,9 +262,9 @@ void EchoDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview, because we didn't do OK.
float oldDelay = m_pEffect->delay;
float oldDecay = m_pEffect->decay;
// Save & restore parameters around Preview, because we didn't do OK.
float oldDelay = m_pEffect->delay;
float oldDecay = m_pEffect->decay;
m_pEffect->delay = delay;
m_pEffect->decay = decay;

View File

@ -79,19 +79,19 @@ class EchoDialog:public EffectDialog {
bool TransferDataFromWindow();
private:
// handlers
// handlers
void OnPreview( wxCommandEvent &event );
private:
bool m_bLoopDetect;
EffectEcho * m_pEffect;
bool m_bLoopDetect;
EffectEcho * m_pEffect;
// controls
wxTextCtrl * m_pTextCtrl_Delay;
wxTextCtrl * m_pTextCtrl_Decay;
wxTextCtrl * m_pTextCtrl_Delay;
wxTextCtrl * m_pTextCtrl_Decay;
public:
// effect parameters
// effect parameters
float delay;
float decay;

View File

@ -418,7 +418,7 @@ bool EffectEqualization::ProcessOne(int count, WaveTrack * t,
lastWindow[i] = 0;
TrackProgress(count, 0.);
bool bLoopSuccess = true;
bool bLoopSuccess = true;
int wcopy = 0;
int offset = (mM - 1)/2;
@ -459,9 +459,9 @@ bool EffectEqualization::ProcessOne(int count, WaveTrack * t,
if (TrackProgress(count, (s-start)/(double)originalLen))
{
bLoopSuccess = false;
break;
}
bLoopSuccess = false;
break;
}
}
if(bLoopSuccess)

View File

@ -46,12 +46,12 @@ bool Generator::Process()
//if we can't move clips, and we're generating into an empty space,
//make sure there's room.
if (!editClipCanMove &&
track->IsEmpty(mT0, mT1+1.0/track->GetRate()) &&
track->IsEmpty(mT0, mT1+1.0/track->GetRate()) &&
!track->IsEmpty(mT0, mT0+mDuration-(mT1-mT0)-1.0/track->GetRate()))
{
wxMessageBox(
_("There is not enough room available to generate the audio"),
_("Error"), wxICON_STOP);
{
wxMessageBox(
_("There is not enough room available to generate the audio"),
_("Error"), wxICON_STOP);
Failure();
return false;
}

View File

@ -273,7 +273,7 @@ void LevellerDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview
// Save & restore parameters around Preview
int oldLevellerDbChoiceIndex = mEffect->mLevellerDbChoiceIndex;
int oldLevellerNumPasses = mEffect->mLevellerNumPasses;
@ -282,7 +282,7 @@ void LevellerDialog::OnPreview(wxCommandEvent &event)
mEffect->Preview();
mEffect->mLevellerDbChoiceIndex = oldLevellerDbChoiceIndex;
mEffect->mLevellerDbChoiceIndex = oldLevellerDbChoiceIndex;
mEffect->mLevellerNumPasses = oldLevellerNumPasses;
}

View File

@ -75,7 +75,7 @@ class LevellerDialog: public EffectDialog
// bool TransferDataFromWindow();
private:
// handlers
// handlers
void OnPreview( wxCommandEvent &event );
private:

View File

@ -242,10 +242,10 @@ void LoadEffects()
em.RegisterEffect(new EffectAutoDuck());
em.RegisterEffect(new EffectBassTreble());
em.RegisterEffect(new EffectChangeSpeed());
#ifdef USE_SOUNDTOUCH
em.RegisterEffect(new EffectChangePitch());
em.RegisterEffect(new EffectChangeTempo());
#endif
#ifdef USE_SOUNDTOUCH
em.RegisterEffect(new EffectChangePitch());
em.RegisterEffect(new EffectChangeTempo());
#endif
em.RegisterEffect(new EffectClickRemoval());
em.RegisterEffect(new EffectCompressor());
em.RegisterEffect(new EffectEcho());

View File

@ -101,10 +101,10 @@ bool EffectNormalize::CheckWhetherSkipEffect()
void EffectNormalize::End()
{
bool bValidate;
gPrefs->Read(wxT("/Validate/Enabled"), &bValidate, false ); // this never get written! Why is this here? MJS
if( bValidate )
{
bool bValidate;
gPrefs->Read(wxT("/Validate/Enabled"), &bValidate, false ); // this never get written! Why is this here? MJS
if( bValidate )
{
int checkOffset = abs((int)(mOffset * 1000.0));
gPrefs->Write(wxT("/Validate/Norm_Offset"), checkOffset);
int checkMultiplier = abs((int)(mMult * 1000.0));
@ -112,7 +112,7 @@ void EffectNormalize::End()
int checkFrameSum = (int)gFrameSum;
gPrefs->Write(wxT("/Validate/Norm_FrameSum"), checkFrameSum);
gPrefs->Flush();
}
}
}
bool EffectNormalize::PromptUser()
@ -337,7 +337,7 @@ bool EffectNormalize::AnalyseDC(WaveTrack * track, wxString msg)
s += block;
//Update the Progress meter
if (TrackProgress(mCurTrackNum,
if (TrackProgress(mCurTrackNum,
((double)(s - start) / len)/2.0, msg)) {
rc = false; //lda .. break, not return, so that buffer is deleted
break;
@ -398,7 +398,7 @@ bool EffectNormalize::ProcessOne(WaveTrack * track, wxString msg)
s += block;
//Update the Progress meter
if (TrackProgress(mCurTrackNum,
if (TrackProgress(mCurTrackNum,
0.5+((double)(s - start) / len)/2.0, msg)) {
rc = false; //lda .. break, not return, so that buffer is deleted
break;
@ -574,7 +574,7 @@ void NormalizeDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview, because we didn't do OK.
// Save & restore parameters around Preview, because we didn't do OK.
bool oldGain = mEffect->mGain;
bool oldDC = mEffect->mDC;
double oldLevel = mEffect->mLevel;
@ -587,7 +587,7 @@ void NormalizeDialog::OnPreview(wxCommandEvent &event)
mEffect->Preview();
mEffect->mGain = oldGain;
mEffect->mGain = oldGain;
mEffect->mDC = oldDC;
mEffect->mLevel = oldLevel;
mEffect->mStereoInd = oldStereoInd;

View File

@ -98,7 +98,7 @@ class NormalizeDialog: public EffectDialog
bool TransferDataFromWindow();
private:
// handlers
// handlers
void OnUpdateUI(wxCommandEvent& evt);
void OnPreview(wxCommandEvent &event);

View File

@ -558,7 +558,7 @@ void PhaserDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview, because we didn't do OK.
// Save & restore parameters around Preview, because we didn't do OK.
float old_freq = mEffect->freq;
float old_startphase = mEffect->startphase;
float old_fb = mEffect->fb;

View File

@ -185,7 +185,7 @@ class PhaserDialog:public EffectDialog {
void OnPreview(wxCommandEvent &event);
private:
EffectPhaser * mEffect;
EffectPhaser * mEffect;
public:
float freq;

View File

@ -173,10 +173,10 @@ bool EffectRepeat::Process()
if (bGoodResult)
{
// Select the new bits + original bit
mT1 = maxDestLen;
mT1 = maxDestLen;
}
this->ReplaceProcessedTracks(bGoodResult);
this->ReplaceProcessedTracks(bGoodResult);
return bGoodResult;
}
@ -292,7 +292,7 @@ void RepeatDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
int oldRepeatCount = mEffect->repeatCount;
int oldRepeatCount = mEffect->repeatCount;
mEffect->repeatCount = repeatCount;

View File

@ -70,7 +70,7 @@ class RepeatDialog:public EffectDialog {
bool TransferDataFromWindow();
private:
// handlers
// handlers
void OnRepeatTextChange(wxCommandEvent & event);
void OnPreview( wxCommandEvent &event );

View File

@ -290,8 +290,8 @@ void TimeScaleDialog::PopulateOrExchange(ShuttleGui & S)
}
S.EndStatic();
S.EndMultiColumn();
return;
return;
}
bool TimeScaleDialog::TransferDataToWindow()

View File

@ -74,51 +74,51 @@ class EffectTimeScale : public EffectSBSMS {
class TimeScaleDialog:public EffectDialog {
public:
TimeScaleDialog(EffectTimeScale * effect,
wxWindow * parent);
TimeScaleDialog(EffectTimeScale * effect,
wxWindow * parent);
void PopulateOrExchange(ShuttleGui & S);
bool TransferDataToWindow();
bool TransferDataFromWindow();
void PopulateOrExchange(ShuttleGui & S);
bool TransferDataToWindow();
bool TransferDataFromWindow();
private:
// handlers
void OnText_RatePercentChangeStart(wxCommandEvent & event);
void OnText_RatePercentChangeEnd(wxCommandEvent & event);
void OnText_PitchPercentChangeStart(wxCommandEvent & event);
void OnText_PitchPercentChangeEnd(wxCommandEvent & event);
void OnText_PitchHalfStepsStart(wxCommandEvent & event);
void OnText_PitchHalfStepsEnd(wxCommandEvent & event);
void OnSlider_RatePercentChangeStart(wxCommandEvent & event);
void OnSlider_RatePercentChangeEnd(wxCommandEvent & event);
void OnCheckBox_PreAnalyze(wxCommandEvent & event);
// handlers
void OnText_RatePercentChangeStart(wxCommandEvent & event);
void OnText_RatePercentChangeEnd(wxCommandEvent & event);
void OnText_PitchPercentChangeStart(wxCommandEvent & event);
void OnText_PitchPercentChangeEnd(wxCommandEvent & event);
void OnText_PitchHalfStepsStart(wxCommandEvent & event);
void OnText_PitchHalfStepsEnd(wxCommandEvent & event);
void OnSlider_RatePercentChangeStart(wxCommandEvent & event);
void OnSlider_RatePercentChangeEnd(wxCommandEvent & event);
void OnCheckBox_PreAnalyze(wxCommandEvent & event);
// helper fns
bool CheckParameters();
void Update_Text_RatePercentChangeStart();
void Update_Text_RatePercentChangeEnd();
void Update_Text_PitchPercentChangeStart();
void Update_Text_PitchPercentChangeEnd();
void Update_Text_PitchHalfStepsStart();
void Update_Text_PitchHalfStepsEnd();
void Update_Slider_RatePercentChangeStart();
void Update_Slider_RatePercentChangeEnd();
void Update_CheckBox_PreAnalyze();
// helper fns
bool CheckParameters();
void Update_Text_RatePercentChangeStart();
void Update_Text_RatePercentChangeEnd();
void Update_Text_PitchPercentChangeStart();
void Update_Text_PitchPercentChangeEnd();
void Update_Text_PitchHalfStepsStart();
void Update_Text_PitchHalfStepsEnd();
void Update_Slider_RatePercentChangeStart();
void Update_Slider_RatePercentChangeEnd();
void Update_CheckBox_PreAnalyze();
private:
EffectTimeScale *mEffect;
bool m_bLoopDetect;
// controls
wxTextCtrl *m_pTextCtrl_RatePercentChangeStart;
wxTextCtrl *m_pTextCtrl_RatePercentChangeEnd;
wxSlider *m_pSlider_RatePercentChangeStart;
wxSlider *m_pSlider_RatePercentChangeEnd;
wxTextCtrl *m_pTextCtrl_PitchHalfStepsStart;
wxTextCtrl *m_pTextCtrl_PitchHalfStepsEnd;
wxTextCtrl *m_pTextCtrl_PitchPercentChangeStart;
wxTextCtrl *m_pTextCtrl_PitchPercentChangeEnd;
wxCheckBox *m_pCheckBox_PreAnalyze;
EffectTimeScale *mEffect;
bool m_bLoopDetect;
// controls
wxTextCtrl *m_pTextCtrl_RatePercentChangeStart;
wxTextCtrl *m_pTextCtrl_RatePercentChangeEnd;
wxSlider *m_pSlider_RatePercentChangeStart;
wxSlider *m_pSlider_RatePercentChangeEnd;
wxTextCtrl *m_pTextCtrl_PitchHalfStepsStart;
wxTextCtrl *m_pTextCtrl_PitchHalfStepsEnd;
wxTextCtrl *m_pTextCtrl_PitchPercentChangeStart;
wxTextCtrl *m_pTextCtrl_PitchPercentChangeEnd;
wxCheckBox *m_pCheckBox_PreAnalyze;
public:
double m_RatePercentChangeStart;

View File

@ -95,7 +95,7 @@ bool EffectTwoPassSimpleMono::ProcessPass()
//ProcessOne() takes a track, transforms it to bunch of buffer-blocks,
//and executes ProcessSimpleMono on these blocks
bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
sampleCount start, sampleCount end)
sampleCount start, sampleCount end)
{
bool ret;
sampleCount s, samples1, samples2, tmpcount;
@ -103,7 +103,7 @@ bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
//Get the length of the buffer (as double). len is
//used simple to calculate a progress meter, so it is easier
//to make it a double now than it is to do it later
//to make it a double now than it is to do it later
double len = (double)(end - start);
sampleCount maxblock = track->GetMaxBlockSize();
@ -113,26 +113,26 @@ bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
float *buffer2 = new float[maxblock];
samples1 = track->GetBestBlockSize(start);
if(start + samples1 > end)
samples1 = end - start;
samples1 = end - start;
if(samples1 > maxblock)
samples1 = maxblock;
samples1 = maxblock;
//Get the samples from the track and put them in the buffer
track->Get((samplePtr) buffer1, floatSample, start, samples1);
//Get the samples from the track and put them in the buffer
track->Get((samplePtr) buffer1, floatSample, start, samples1);
// Process the first buffer with a NULL previous buffer
if (mPass == 0)
ret = TwoBufferProcessPass1(NULL, 0, buffer1, samples1);
else
ret = TwoBufferProcessPass2(NULL, 0, buffer1, samples1);
if (!ret) {
delete[]buffer1;
delete[]buffer2;
// Process the first buffer with a NULL previous buffer
if (mPass == 0)
ret = TwoBufferProcessPass1(NULL, 0, buffer1, samples1);
else
ret = TwoBufferProcessPass2(NULL, 0, buffer1, samples1);
if (!ret) {
delete[]buffer1;
delete[]buffer2;
//Return false because the effect failed.
return false;
}
//Return false because the effect failed.
return false;
}
//Go through the track one buffer at a time. s counts which
//sample the current buffer starts at.
@ -141,8 +141,8 @@ bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
//Get a block of samples (smaller than the size of the buffer)
samples2 = track->GetBestBlockSize(s);
if(samples2 > maxblock)
samples2 = maxblock;
if(samples2 > maxblock)
samples2 = maxblock;
//Adjust the block size if it is the final block in the track
if (s + samples2 > end)
@ -157,13 +157,13 @@ bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
else
ret = TwoBufferProcessPass2(buffer1, samples1, buffer2, samples2);
if (!ret) {
delete[]buffer1;
delete[]buffer2;
delete[]buffer1;
delete[]buffer2;
//Return false because the effect failed.
return false;
}
//Processing succeeded. copy the newly-changed samples back
//Processing succeeded. copy the newly-changed samples back
//onto the track.
track->Set((samplePtr) buffer1, floatSample, s-samples1, samples1);
@ -173,41 +173,41 @@ bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
//Update the Progress meter
if (mSecondPassDisabled)
ret = TotalProgress((mCurTrackNum + (s-start)/len) / GetNumWaveTracks());
else
else
ret = TotalProgress((mCurTrackNum + (s-start)/len + GetNumWaveTracks()*mPass)/ (GetNumWaveTracks()*2));
if (ret) {
delete[]buffer1;
delete[]buffer2;
//Return false because the effect failed.
return false;
}
if (ret) {
delete[]buffer1;
delete[]buffer2;
//Return false because the effect failed.
return false;
}
// Rotate the buffers
tmpfloat = buffer1;
buffer1 = buffer2;
buffer2 = tmpfloat;
// Rotate the buffers
tmpfloat = buffer1;
buffer1 = buffer2;
buffer2 = tmpfloat;
tmpcount = samples1;
samples1 = samples2;
samples2 = tmpcount;
}
tmpcount = samples1;
samples1 = samples2;
samples2 = tmpcount;
}
// Send the last buffer with a NULL pointer for the current buffer
if (mPass == 0)
ret = TwoBufferProcessPass1(buffer1, samples1, NULL, 0);
else
ret = TwoBufferProcessPass2(buffer1, samples1, NULL, 0);
// Send the last buffer with a NULL pointer for the current buffer
if (mPass == 0)
ret = TwoBufferProcessPass1(buffer1, samples1, NULL, 0);
else
ret = TwoBufferProcessPass2(buffer1, samples1, NULL, 0);
if (!ret) {
delete[]buffer1;
delete[]buffer2;
//Return false because the effect failed.
return false;
}
if (!ret) {
delete[]buffer1;
delete[]buffer2;
//Return false because the effect failed.
return false;
}
//Processing succeeded. copy the newly-changed samples back
//onto the track.
track->Set((samplePtr) buffer1, floatSample, s-samples1, samples1);
//Processing succeeded. copy the newly-changed samples back
//onto the track.
track->Set((samplePtr) buffer1, floatSample, s-samples1, samples1);
//Clean up the buffer
delete[]buffer1;
@ -230,13 +230,13 @@ bool EffectTwoPassSimpleMono::NewTrackPass2()
//Initialisations before the first pass
bool EffectTwoPassSimpleMono::InitPass1()
{
return true;
return true;
}
//Initialisations before the second pass.
//Return true if you actually want the second pass to go ahead
bool EffectTwoPassSimpleMono::InitPass2()
{
return true;
return true;
}

View File

@ -949,19 +949,19 @@ wxString VSTEffectDialog::b64encode(const void *in, int len)
unsigned char *p = (unsigned char *) in;
wxString out;
unsigned long temp;
for (int i = 0; i < len / 3; i++) {
temp = (*p++) << 16; //Convert to big endian
temp += (*p++) << 8;
temp += (*p++);
out += cset[(temp & 0x00FC0000) >> 18];
out += cset[(temp & 0x0003F000) >> 12];
out += cset[(temp & 0x00000FC0) >> 6];
out += cset[(temp & 0x0000003F)];
}
unsigned long temp;
for (int i = 0; i < len / 3; i++) {
temp = (*p++) << 16; //Convert to big endian
temp += (*p++) << 8;
temp += (*p++);
out += cset[(temp & 0x00FC0000) >> 18];
out += cset[(temp & 0x0003F000) >> 12];
out += cset[(temp & 0x00000FC0) >> 6];
out += cset[(temp & 0x0000003F)];
}
switch (len % 3)
{
switch (len % 3)
{
case 1:
temp = (*p++) << 16; //Convert to big endian
out += cset[(temp & 0x00FC0000) >> 18];
@ -978,9 +978,9 @@ wxString VSTEffectDialog::b64encode(const void *in, int len)
out += cset[(temp & 0x00000FC0) >> 6];
out += padc;
break;
}
}
return out;
return out;
}
int VSTEffectDialog::b64decode(wxString in, void *out)
@ -988,8 +988,8 @@ int VSTEffectDialog::b64decode(wxString in, void *out)
int len = in.Length();
unsigned char *p = (unsigned char *) out;
if (len % 4) { //Sanity check
return 0;
if (len % 4) { //Sanity check
return 0;
}
int padding = 0;
@ -1004,7 +1004,7 @@ int VSTEffectDialog::b64decode(wxString in, void *out)
}
const char *a = in.mb_str();
//Setup a vector to hold the result
//Setup a vector to hold the result
unsigned long temp = 0; //Holds decoded quanta
int i = 0;
while (i < len) {
@ -1040,7 +1040,7 @@ int VSTEffectDialog::b64decode(wxString in, void *out)
}
}
i++;
}
}
*p++ = (temp >> 16) & 0x000000FF;
*p++ = (temp >> 8) & 0x000000FF;
*p++ = temp & 0x000000FF;

View File

@ -26,10 +26,10 @@
#ifndef _AEFFECTX_H
#define _AEFFECTX_H
#define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
( ( (int) b ) << 16 ) | \
( ( (int) c ) << 8 ) | \
( ( (int) d ) << 0 ) )
#define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
( ( (int) b ) << 16 ) | \
( ( (int) c ) << 8 ) | \
( ( (int) d ) << 0 ) )
const int audioMasterAutomate = 0;
const int audioMasterVersion = 1;
@ -140,28 +140,28 @@ class remoteVstPlugin;
class VstMidiEvent
{
public:
// 00
int type;
// 04
int byteSize;
// 08
int deltaFrames;
// 0c?
int flags;
// 10?
int noteLength;
// 14?
int noteOffset;
// 18
char midiData[4];
// 1c?
char detune;
// 1d?
char noteOffVelocity;
// 1e?
char reserved1;
// 1f?
char reserved2;
// 00
int type;
// 04
int byteSize;
// 08
int deltaFrames;
// 0c?
int flags;
// 10?
int noteLength;
// 14?
int noteOffset;
// 18
char midiData[4];
// 1c?
char detune;
// 1d?
char noteOffVelocity;
// 1e?
char reserved1;
// 1f?
char reserved2;
} ;
@ -170,7 +170,7 @@ public:
class VstEvent
{
char dump[sizeof( VstMidiEvent )];
char dump[sizeof( VstMidiEvent )];
} ;
@ -180,12 +180,12 @@ class VstEvent
class VstEvents
{
public:
// 00
int numEvents;
// 04
int reserved;
// 08
VstEvent * events;
// 00
int numEvents;
// 04
int reserved;
// 08
VstEvent * events;
} ;
@ -196,16 +196,16 @@ public:
class VstParameterProperties
{
public:
float stepFloat;
char label[64];
int flags;
int minInteger;
int maxInteger;
int stepInteger;
char shortLabel[8];
int category;
char categoryLabel[24];
char empty[128];
float stepFloat;
char label[64];
int flags;
int minInteger;
int maxInteger;
int stepInteger;
char shortLabel[8];
int category;
char categoryLabel[24];
char empty[128];
} ;
@ -215,43 +215,43 @@ public:
class AEffect
{
public:
// Never use virtual functions!!!
// 00-03
int magic;
// dispatcher 04-07
int (* dispatcher)( AEffect * , int , int , int , void * , float );
// process, quite sure 08-0b
void (* process)( AEffect * , float * * , float * * , int );
// setParameter 0c-0f
void (* setParameter)( AEffect * , int , float );
// getParameter 10-13
float (* getParameter)( AEffect * , int );
// programs 14-17
int numPrograms;
// Params 18-1b
int numParams;
// Input 1c-1f
int numInputs;
// Output 20-23
int numOutputs;
// flags 24-27
int flags;
// Fill somewhere 28-2b
void * user;
// Zeroes 2c-2f 30-33 34-37 38-3b
char empty3[4 + 4 + 4 + 4];
// 1.0f 3c-3f
float unkown_float;
// An object? pointer 40-43
char empty4[4];
// Zeroes 44-47
char empty5[4];
// Id 48-4b
int32_t uniqueID;
// Don't know 4c-4f
char unknown1[4];
// processReplacing 50-53
void (* processReplacing)( AEffect * , float * * , float * * , int );
// Never use virtual functions!!!
// 00-03
int magic;
// dispatcher 04-07
int (* dispatcher)( AEffect * , int , int , int , void * , float );
// process, quite sure 08-0b
void (* process)( AEffect * , float * * , float * * , int );
// setParameter 0c-0f
void (* setParameter)( AEffect * , int , float );
// getParameter 10-13
float (* getParameter)( AEffect * , int );
// programs 14-17
int numPrograms;
// Params 18-1b
int numParams;
// Input 1c-1f
int numInputs;
// Output 20-23
int numOutputs;
// flags 24-27
int flags;
// Fill somewhere 28-2b
void * user;
// Zeroes 2c-2f 30-33 34-37 38-3b
char empty3[4 + 4 + 4 + 4];
// 1.0f 3c-3f
float unkown_float;
// An object? pointer 40-43
char empty4[4];
// Zeroes 44-47
char empty5[4];
// Id 48-4b
int32_t uniqueID;
// Don't know 4c-4f
char unknown1[4];
// processReplacing 50-53
void (* processReplacing)( AEffect * , float * * , float * * , int );
} ;
@ -259,26 +259,26 @@ public:
class VstTimeInfo
{
public:
// 00
double samplePos;
// 08
double sampleRate;
// 00
double samplePos;
// 08
double sampleRate;
// 10
double nanoSeconds;
// unconfirmed 18
char empty1[8];
// 20?
double tempo;
// unconfirmed 28 30 38
char empty2[8 + 8 + 8];
// 40?
int timeSigNumerator;
// 44?
int timeSigDenominator;
// unconfirmed 48 4c 50
char empty3[4 + 4 + 4];
// 54
int flags;
double nanoSeconds;
// unconfirmed 18
char empty1[8];
// 20?
double tempo;
// unconfirmed 28 30 38
char empty2[8 + 8 + 8];
// 40?
int timeSigNumerator;
// 44?
int timeSigDenominator;
// unconfirmed 48 4c 50
char empty3[4 + 4 + 4];
// 54
int flags;
} ;
@ -286,7 +286,7 @@ public:
typedef long int (* audioMasterCallback)( AEffect * , long int , long int ,
long int , void * , float );
long int , void * , float );
// we don't use it, may be noise
#define VSTCALLBACK

View File

@ -498,10 +498,10 @@ void WahwahDialog::OnPreview(wxCommandEvent &event)
{
TransferDataFromWindow();
// Save & restore parameters around Preview, because we didn't do OK.
// Save & restore parameters around Preview, because we didn't do OK.
float old_freq = mEffect->freq;
float old_freqofs = mEffect->freqofs;
float old_startphase = mEffect->startphase;
float old_startphase = mEffect->startphase;
float old_res = mEffect->res;
float old_depth = mEffect->depth;

View File

@ -167,7 +167,7 @@ class WahwahDialog:public EffectDialog {
void OnPreview(wxCommandEvent &event);
private:
EffectWahwah * mEffect;
EffectWahwah * mEffect;
public:
float freq;

View File

@ -518,22 +518,22 @@ LadspaEffectDialog::LadspaEffectDialog(LadspaEffect *eff,
this->mData = data;
this->inputControls = inputControls;
this->sampleRate = sampleRate;
#ifdef __WXMSW__
// On Windows, for some reason, wxWidgets calls OnTextCtrl during creation
// of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText,
// which assumes all the fields have been initialized.
// This can give us a bad pointer crash, so manipulate inSlider to
// no-op HandleText during creation.
inSlider = true;
#else
inSlider = false;
#endif
#ifdef __WXMSW__
// On Windows, for some reason, wxWidgets calls OnTextCtrl during creation
// of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText,
// which assumes all the fields have been initialized.
// This can give us a bad pointer crash, so manipulate inSlider to
// no-op HandleText during creation.
inSlider = true;
#else
inSlider = false;
#endif
inText = false;
toggles = new wxCheckBox*[mData->PortCount];
sliders = new wxSlider*[mData->PortCount];
fields = new wxTextCtrl*[mData->PortCount];
labels = new wxStaticText*[mData->PortCount];
labels = new wxStaticText*[mData->PortCount];
ports = new unsigned long [mData->PortCount];
unsigned long p;
@ -695,7 +695,7 @@ LadspaEffectDialog::LadspaEffectDialog(LadspaEffect *eff,
// Set all of the sliders based on the value in the
// text fields
inSlider = false; // Now we're ready for HandleText to actually do something.
inSlider = false; // Now we're ready for HandleText to actually do something.
HandleText();
paramSizer->Add(gridSizer, 1, wxEXPAND | wxALL, 5);
@ -770,7 +770,7 @@ void LadspaEffectDialog::OnSlider(wxCommandEvent &event)
void LadspaEffectDialog::OnTextCtrl(wxCommandEvent & WXUNUSED(event))
{
HandleText();
HandleText();
}
void LadspaEffectDialog::HandleText()

View File

@ -743,16 +743,16 @@ LV2EffectDialog::LV2EffectDialog(LV2Effect *eff,
mLength = length;
this->mData = data;
this->sampleRate = sampleRate;
#ifdef __WXMSW__
// On Windows, for some reason, wxWindows calls OnTextCtrl during creation
// of the text control, and LV2EffectDialog::OnTextCtrl calls HandleText,
// which assumes all the fields have been initialized.
// This can give us a bad pointer crash, so manipulate inSlider to
// no-op HandleText during creation.
inSlider = true;
#else
inSlider = false;
#endif
#ifdef __WXMSW__
// On Windows, for some reason, wxWindows calls OnTextCtrl during creation
// of the text control, and LV2EffectDialog::OnTextCtrl calls HandleText,
// which assumes all the fields have been initialized.
// This can give us a bad pointer crash, so manipulate inSlider to
// no-op HandleText during creation.
inSlider = true;
#else
inSlider = false;
#endif
inText = false;
// Allocate memory for the user parameter controls

View File

@ -62,7 +62,7 @@ static const uint32_t LV2_EVENT_PPQN = 3136573440U;
* The type field defines the format of a given event's contents.
*
* This struct defines the header of an LV2 event. An LV2 event, as specified
* in this extension, is a single chunk of POD (plain old data), usually
* in this extension, is a single chunk of POD (plain old data), usually
* contained in a flat buffer (see LV2_EventBuffer below), that can be safely
* copied using a simple:
*
@ -72,49 +72,49 @@ static const uint32_t LV2_EVENT_PPQN = 3136573440U;
*/
typedef struct {
/** The frames portion of timestamp. The units used here can optionally
* be set for a port (with lv2ev:supportsTimeStamp and related
* properties), otherwise this is audio frames, corresponding to the
* sample_count parameter of the LV2 run method (e.g. frame 0 is the
* first frame for that call to run).
*/
uint32_t frames;
/** The frames portion of timestamp. The units used here can optionally
* be set for a port (with lv2ev:supportsTimeStamp and related
* properties), otherwise this is audio frames, corresponding to the
* sample_count parameter of the LV2 run method (e.g. frame 0 is the
* first frame for that call to run).
*/
uint32_t frames;
/** The sub-frames portion of timestamp. The units used here can
* optionally be set for a port (with lv2ev:supportsTimeStamp and
* related properties), otherwise this is 1/(2^32) of an audio frame.
*/
uint32_t subframes;
/** The type of this event, as a number which represents some URI
* defining an event type. This value MUST be some value previously
* returned from a call to the uri_to_id function defined in the LV2
* URI map extension (see lv2_uri_map.h).
*
* There are special rules which must be followed depending on the type
* of an event. If the plugin recognizes an event type, the definition
* of that event type will describe how to interpret the event, and
* any required behaviour. Otherwise, if the type is 0, this event is a
* non-POD event and lv2_event_unref MUST be called if the event is
* 'dropped' (see below). Even if the plugin does not understand an
* event, it may pass the event through to an output by simply copying
* (and NOT calling lv2_event_unref). These rules are designed to
* allow for generic event handling plugins and large non-POD events,
* but with minimal hassle on simple plugins that "don't care" about
* these more advanced features.
*
* Plugins should not interpret type 0 events in any way unless
* specified by another extension.
*/
uint16_t type;
/** The sub-frames portion of timestamp. The units used here can
* optionally be set for a port (with lv2ev:supportsTimeStamp and
* related properties), otherwise this is 1/(2^32) of an audio frame.
*/
uint32_t subframes;
/** The size of the data portion of this event in bytes, which
* immediately follows. The header size (12 bytes) is not included in
* this value.
*/
uint16_t size;
/** The type of this event, as a number which represents some URI
* defining an event type. This value MUST be some value previously
* returned from a call to the uri_to_id function defined in the LV2
* URI map extension (see lv2_uri_map.h).
*
* There are special rules which must be followed depending on the type
* of an event. If the plugin recognizes an event type, the definition
* of that event type will describe how to interpret the event, and
* any required behaviour. Otherwise, if the type is 0, this event is a
* non-POD event and lv2_event_unref MUST be called if the event is
* 'dropped' (see below). Even if the plugin does not understand an
* event, it may pass the event through to an output by simply copying
* (and NOT calling lv2_event_unref). These rules are designed to
* allow for generic event handling plugins and large non-POD events,
* but with minimal hassle on simple plugins that "don't care" about
* these more advanced features.
*
* Plugins should not interpret type 0 events in any way unless
* specified by another extension.
*/
uint16_t type;
/* size bytes of data follow here */
/** The size of the data portion of this event in bytes, which
* immediately follows. The header size (12 bytes) is not included in
* this value.
*/
uint16_t size;
/* size bytes of data follow here */
} LV2_Event;
@ -124,8 +124,8 @@ typedef struct {
*
* This struct is used as the port buffer for LV2 plugin ports that have the
* port class lv2ev:EventPort.
*
* The data member points to a buffer that contains an event header (defined
*
* The data member points to a buffer that contains an event header (defined
* by struct* LV2_Event), followed by that event's contents (padded to 64 bits),
* followed by another header, etc:
*
@ -134,71 +134,71 @@ typedef struct {
* |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ...
*/
typedef struct {
/** The contents of the event buffer. This may or may not reside in the
* same block of memory as this header, plugins must not assume either.
* The host guarantees this points to at least capacity bytes of
/** The contents of the event buffer. This may or may not reside in the
* same block of memory as this header, plugins must not assume either.
* The host guarantees this points to at least capacity bytes of
* allocated memory (though only size bytes of that are valid events).
*/
uint8_t* data;
*/
uint8_t* data;
/** The size of this event header in bytes (including everything).
*
* This is to allow for extending this header in the future without
* breaking binary compatibility. Whenever this header is copied,
* it MUST be done using this field (and NOT the sizeof this struct).
*/
uint16_t header_size;
/** The size of this event header in bytes (including everything).
*
* This is to allow for extending this header in the future without
* breaking binary compatibility. Whenever this header is copied,
* it MUST be done using this field (and NOT the sizeof this struct).
*/
uint16_t header_size;
/** The type of the time stamps for events in this buffer.
* As a special exception, '0' always means audio frames and subframes
* (1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate.
* INPUTS: The host must set this field to the numeric ID of some URI
* defining the meaning of the frames/subframes fields of contained
* events (obtained by the LV2 URI Map uri_to_id function with the URI
* of this extension as the 'map' argument, see lv2_uri_map.h).
* The host must never pass a plugin a buffer which uses a stamp type
* the plugin does not 'understand'. The value of this field must
* never change, except when connect_port is called on the input
* port, at which time the host MUST have set the stamp_type field to
* the value that will be used for all subsequent run calls.
* OUTPUTS: The plugin may set this to any value that has been returned
* from uri_to_id with the URI of this extension for a 'map' argument.
* When connected to a buffer with connect_port, output ports MUST set
* this field to the type of time stamp they will be writing. On any
* call to connect_port on an event input port, the plugin may change
* this field on any output port, it is the responsibility of the host
* to check if any of these values have changed and act accordingly.
*/
uint16_t stamp_type;
/** The type of the time stamps for events in this buffer.
* As a special exception, '0' always means audio frames and subframes
* (1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate.
* INPUTS: The host must set this field to the numeric ID of some URI
* defining the meaning of the frames/subframes fields of contained
* events (obtained by the LV2 URI Map uri_to_id function with the URI
* of this extension as the 'map' argument, see lv2_uri_map.h).
* The host must never pass a plugin a buffer which uses a stamp type
* the plugin does not 'understand'. The value of this field must
* never change, except when connect_port is called on the input
* port, at which time the host MUST have set the stamp_type field to
* the value that will be used for all subsequent run calls.
* OUTPUTS: The plugin may set this to any value that has been returned
* from uri_to_id with the URI of this extension for a 'map' argument.
* When connected to a buffer with connect_port, output ports MUST set
* this field to the type of time stamp they will be writing. On any
* call to connect_port on an event input port, the plugin may change
* this field on any output port, it is the responsibility of the host
* to check if any of these values have changed and act accordingly.
*/
uint16_t stamp_type;
/** The number of events in this buffer.
* INPUTS: The host must set this field to the number of events
* contained in the data buffer before calling run().
* The plugin must not change this field.
* OUTPUTS: The plugin must set this field to the number of events it
* has written to the buffer before returning from run().
* Any initial value should be ignored by the plugin.
*/
uint32_t event_count;
/** The number of events in this buffer.
* INPUTS: The host must set this field to the number of events
* contained in the data buffer before calling run().
* The plugin must not change this field.
* OUTPUTS: The plugin must set this field to the number of events it
* has written to the buffer before returning from run().
* Any initial value should be ignored by the plugin.
*/
uint32_t event_count;
/** The size of the data buffer in bytes.
* This is set by the host and must not be changed by the plugin.
* The host is allowed to change this between run() calls.
*/
uint32_t capacity;
/** The size of the data buffer in bytes.
* This is set by the host and must not be changed by the plugin.
* The host is allowed to change this between run() calls.
*/
uint32_t capacity;
/** The size of the initial portion of the data buffer containing data.
* INPUTS: The host must set this field to the number of bytes used
* by all events it has written to the buffer (including headers)
* before calling the plugin's run().
* The plugin must not change this field.
* OUTPUTS: The plugin must set this field to the number of bytes
* used by all events it has written to the buffer (including headers)
* before returning from run().
* Any initial value should be ignored by the plugin.
*/
uint32_t size;
/** The size of the initial portion of the data buffer containing data.
* INPUTS: The host must set this field to the number of bytes used
* by all events it has written to the buffer (including headers)
* before calling the plugin's run().
* The plugin must not change this field.
* OUTPUTS: The plugin must set this field to the number of bytes
* used by all events it has written to the buffer (including headers)
* before returning from run().
* Any initial value should be ignored by the plugin.
*/
uint32_t size;
} LV2_Event_Buffer;
@ -212,59 +212,59 @@ typedef void* LV2_Event_Callback_Data;
* To support this extension the host must pass an LV2_Feature struct to the
* plugin's instantiate method with URI "http://lv2plug.in/ns/ext/event"
* and data pointed to an instance of this struct. The plugin does not have
* to list that URI as a required or optional feature in its RDF data - the
* host MUST pass this LV2_Feature if the plugin has an port of class
* to list that URI as a required or optional feature in its RDF data - the
* host MUST pass this LV2_Feature if the plugin has an port of class
* lv2ev:EventPortthat the host connects to.
*/
typedef struct {
/** Opaque pointer to host data.
*
* The plugin MUST pass this to any call to functions in this struct.
* Otherwise, it must not be interpreted in any way.
*/
LV2_Event_Callback_Data callback_data;
/** Take a reference to a non-POD event.
*
* If a plugin receives an event with type 0, it means the event is a
* pointer to some object in memory and not a flat sequence of bytes
* in the buffer. When receiving a non-POD event, the plugin already
* has an implicit reference to the event. If the event is stored AND
* passed to an output, or passed to two outputs, lv2_event_ref MUST
* be called on that event.
* If the event is only stored OR passed through, this is not necessary
* (as the plugin already has 1 implicit reference).
*
* The host guarantees that this function is realtime safe if the
* plugin is.
*
* @param event An event received at an input that will be copied to
/** Opaque pointer to host data.
*
* The plugin MUST pass this to any call to functions in this struct.
* Otherwise, it must not be interpreted in any way.
*/
LV2_Event_Callback_Data callback_data;
/** Take a reference to a non-POD event.
*
* If a plugin receives an event with type 0, it means the event is a
* pointer to some object in memory and not a flat sequence of bytes
* in the buffer. When receiving a non-POD event, the plugin already
* has an implicit reference to the event. If the event is stored AND
* passed to an output, or passed to two outputs, lv2_event_ref MUST
* be called on that event.
* If the event is only stored OR passed through, this is not necessary
* (as the plugin already has 1 implicit reference).
*
* The host guarantees that this function is realtime safe if the
* plugin is.
*
* @param event An event received at an input that will be copied to
* more than one output or duplicated in some other way.
*
* PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS.
*/
uint32_t (*lv2_event_ref)(LV2_Event_Callback_Data callback_data,
LV2_Event* event);
/** Drop a reference to a non-POD event.
*
* If a plugin receives an event with type 0, it means the event is a
* pointer to some object in memory and not a flat sequence of bytes
* in the buffer. If the plugin does not pass the event through to
* an output or store it internally somehow, it MUST call this function
* on the event (more information on using non-POD events below).
*
* The host guarantees that this function is realtime safe if the
*
* PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS.
*/
uint32_t (*lv2_event_ref)(LV2_Event_Callback_Data callback_data,
LV2_Event* event);
/** Drop a reference to a non-POD event.
*
* If a plugin receives an event with type 0, it means the event is a
* pointer to some object in memory and not a flat sequence of bytes
* in the buffer. If the plugin does not pass the event through to
* an output or store it internally somehow, it MUST call this function
* on the event (more information on using non-POD events below).
*
* The host guarantees that this function is realtime safe if the
* plugin is.
*
* @param event An event received at an input that will not be copied to
* an output or stored in any way.
*
* PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS.
*/
uint32_t (*lv2_event_unref)(LV2_Event_Callback_Data callback_data,
LV2_Event* event);
*
* @param event An event received at an input that will not be copied to
* an output or stored in any way.
*
* PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS.
*/
uint32_t (*lv2_event_unref)(LV2_Event_Callback_Data callback_data,
LV2_Event* event);
} LV2_Event_Feature;

View File

@ -49,37 +49,37 @@ typedef void* LV2_URI_Map_Callback_Data;
* and data pointed to an instance of this struct.
*/
typedef struct {
/** Opaque pointer to host data.
*
* The plugin MUST pass this to any call to functions in this struct.
* Otherwise, it must not be interpreted in any way.
*/
LV2_URI_Map_Callback_Data callback_data;
/** Get the numeric ID of a URI from the host.
*
* @param callback_data Must be the callback_data member of this struct.
* @param map The 'context' of this URI. Certain extensions may define a
* URI that must be passed here with certain restrictions on the
* return value (e.g. limited range). This value may be NULL if
* the plugin needs an ID for a URI in general.
* @param uri The URI to be mapped to an integer ID.
*
* This function is referentially transparent - any number of calls with
* the same arguments is guaranteed to return the same value over the life
* of a plugin instance (though the same URI may return different values
* with a different map parameter). However, this function is not
* necessarily very fast: plugins should cache any IDs they might need in
* performance critical situations.
* The return value 0 is reserved and means an ID for that URI could not
* be created for whatever reason. Extensions may define more precisely
* what this means, but in general plugins should gracefully handle 0
* and consider whatever they wanted the URI for "unsupported".
*/
uint32_t (*uri_to_id)(LV2_URI_Map_Callback_Data callback_data,
const char* map,
const char* uri);
/** Opaque pointer to host data.
*
* The plugin MUST pass this to any call to functions in this struct.
* Otherwise, it must not be interpreted in any way.
*/
LV2_URI_Map_Callback_Data callback_data;
/** Get the numeric ID of a URI from the host.
*
* @param callback_data Must be the callback_data member of this struct.
* @param map The 'context' of this URI. Certain extensions may define a
* URI that must be passed here with certain restrictions on the
* return value (e.g. limited range). This value may be NULL if
* the plugin needs an ID for a URI in general.
* @param uri The URI to be mapped to an integer ID.
*
* This function is referentially transparent - any number of calls with
* the same arguments is guaranteed to return the same value over the life
* of a plugin instance (though the same URI may return different values
* with a different map parameter). However, this function is not
* necessarily very fast: plugins should cache any IDs they might need in
* performance critical situations.
* The return value 0 is reserved and means an ID for that URI could not
* be created for whatever reason. Extensions may define more precisely
* what this means, but in general plugins should gracefully handle 0
* and consider whatever they wanted the URI for "unsupported".
*/
uint32_t (*uri_to_id)(LV2_URI_Map_Callback_Data callback_data,
const char* map,
const char* uri);
} LV2_URI_Map_Feature;

View File

@ -837,8 +837,8 @@ bool EffectNyquist::ProcessOne()
}
int i;
for (i = 0; i < mCurNumChannels; i++) {
mCurBuffer[i] = NULL;
for (i = 0; i < mCurNumChannels; i++) {
mCurBuffer[i] = NULL;
}
rval = nyx_eval_expression(cmd.mb_str(wxConvUTF8));

View File

@ -1088,10 +1088,10 @@ found:
// ExportMixerDialog
//----------------------------------------------------------------------------
enum
enum
{
ID_MIXERPANEL = 10001,
ID_SLIDER_CHANNEL
ID_MIXERPANEL = 10001,
ID_SLIDER_CHANNEL
};
BEGIN_EVENT_TABLE( ExportMixerDialog,wxDialog )

View File

@ -253,11 +253,11 @@ int ExportFLAC::Export(AudacityProject *project,
sampleFormat format;
if (bitDepthPref == wxT("24")) {
format = int24Sample;
encoder.set_bits_per_sample(24);
format = int24Sample;
encoder.set_bits_per_sample(24);
} else { //convert float to 16 bits
format = int16Sample;
encoder.set_bits_per_sample(16);
format = int16Sample;
encoder.set_bits_per_sample(16);
}
// Duplicate the flac command line compression levels
@ -316,7 +316,7 @@ int ExportFLAC::Export(AudacityProject *project,
int i, j;
FLAC__int32 **tmpsmplbuf = new FLAC__int32*[numChannels];
for (i = 0; i < numChannels; i++) {
tmpsmplbuf[i] = (FLAC__int32 *) calloc(SAMPLES_PER_RUN, sizeof(FLAC__int32));
tmpsmplbuf[i] = (FLAC__int32 *) calloc(SAMPLES_PER_RUN, sizeof(FLAC__int32));
}
ProgressDialog *progress = new ProgressDialog(wxFileName(fName).GetName(),
@ -353,7 +353,7 @@ int ExportFLAC::Export(AudacityProject *project,
delete progress;
for (i = 0; i < numChannels; i++) {
free(tmpsmplbuf[i]);
free(tmpsmplbuf[i]);
}
delete mixer;

View File

@ -301,7 +301,7 @@ int ExportMP2::Export(AudacityProject *project,
delete mixer;
int mp2BufferNumBytes = twolame_encode_flush(
int mp2BufferNumBytes = twolame_encode_flush(
encodeOptions,
mp2Buffer,
mp2BufferSize);

View File

@ -751,31 +751,31 @@ typedef unsigned long beWriteInfoTag_t(lame_global_flags *, char *);
// so we can be more specific about why their library isn't acceptable.
typedef struct {
// BladeEnc DLL Version number
// BladeEnc DLL Version number
BYTE byDLLMajorVersion;
BYTE byDLLMinorVersion;
BYTE byDLLMajorVersion;
BYTE byDLLMinorVersion;
// BladeEnc Engine Version Number
// BladeEnc Engine Version Number
BYTE byMajorVersion;
BYTE byMinorVersion;
BYTE byMajorVersion;
BYTE byMinorVersion;
// DLL Release date
// DLL Release date
BYTE byDay;
BYTE byMonth;
WORD wYear;
BYTE byDay;
BYTE byMonth;
WORD wYear;
// BladeEnc Homepage URL
// BladeEnc Homepage URL
CHAR zHomepage[129];
CHAR zHomepage[129];
BYTE byAlphaLevel;
BYTE byBetaLevel;
BYTE byMMXEnabled;
BYTE byAlphaLevel;
BYTE byBetaLevel;
BYTE byMMXEnabled;
BYTE btReserved[125];
BYTE btReserved[125];
} be_version;
typedef void beVersion_t(be_version *);
#endif
@ -1467,89 +1467,89 @@ wxString MP3Exporter::GetLibraryTypeString()
// Debug routine from BladeMP3EncDLL.c in the libmp3lame distro
static void dump_config( lame_global_flags* gfp )
{
wxPrintf(wxT("\n\nLame_enc configuration options:\n"));
wxPrintf(wxT("==========================================================\n"));
wxPrintf(wxT("\n\nLame_enc configuration options:\n"));
wxPrintf(wxT("==========================================================\n"));
wxPrintf(wxT("version =%d\n"),lame_get_version( gfp ) );
wxPrintf(wxT("Layer =3\n"));
wxPrintf(wxT("mode ="));
switch ( lame_get_mode( gfp ) )
{
case STEREO: wxPrintf(wxT( "Stereo\n" )); break;
case JOINT_STEREO: wxPrintf(wxT( "Joint-Stereo\n" )); break;
case DUAL_CHANNEL: wxPrintf(wxT( "Forced Stereo\n" )); break;
case MONO: wxPrintf(wxT( "Mono\n" )); break;
case NOT_SET: /* FALLTROUGH */
default: wxPrintf(wxT( "Error (unknown)\n" )); break;
}
wxPrintf(wxT("version =%d\n"),lame_get_version( gfp ) );
wxPrintf(wxT("Layer =3\n"));
wxPrintf(wxT("mode ="));
switch ( lame_get_mode( gfp ) )
{
case STEREO: wxPrintf(wxT( "Stereo\n" )); break;
case JOINT_STEREO: wxPrintf(wxT( "Joint-Stereo\n" )); break;
case DUAL_CHANNEL: wxPrintf(wxT( "Forced Stereo\n" )); break;
case MONO: wxPrintf(wxT( "Mono\n" )); break;
case NOT_SET: /* FALLTROUGH */
default: wxPrintf(wxT( "Error (unknown)\n" )); break;
}
wxPrintf(wxT("Input sample rate =%.1f kHz\n"), lame_get_in_samplerate( gfp ) /1000.0 );
wxPrintf(wxT("Output sample rate =%.1f kHz\n"), lame_get_out_samplerate( gfp ) /1000.0 );
wxPrintf(wxT("Input sample rate =%.1f kHz\n"), lame_get_in_samplerate( gfp ) /1000.0 );
wxPrintf(wxT("Output sample rate =%.1f kHz\n"), lame_get_out_samplerate( gfp ) /1000.0 );
wxPrintf(wxT("bitrate =%d kbps\n"), lame_get_brate( gfp ) );
wxPrintf(wxT("Quality Setting =%d\n"), lame_get_quality( gfp ) );
wxPrintf(wxT("bitrate =%d kbps\n"), lame_get_brate( gfp ) );
wxPrintf(wxT("Quality Setting =%d\n"), lame_get_quality( gfp ) );
wxPrintf(wxT("Low pass frequency =%d\n"), lame_get_lowpassfreq( gfp ) );
wxPrintf(wxT("Low pass width =%d\n"), lame_get_lowpasswidth( gfp ) );
wxPrintf(wxT("Low pass frequency =%d\n"), lame_get_lowpassfreq( gfp ) );
wxPrintf(wxT("Low pass width =%d\n"), lame_get_lowpasswidth( gfp ) );
wxPrintf(wxT("High pass frequency =%d\n"), lame_get_highpassfreq( gfp ) );
wxPrintf(wxT("High pass width =%d\n"), lame_get_highpasswidth( gfp ) );
wxPrintf(wxT("High pass frequency =%d\n"), lame_get_highpassfreq( gfp ) );
wxPrintf(wxT("High pass width =%d\n"), lame_get_highpasswidth( gfp ) );
wxPrintf(wxT("No short blocks =%d\n"), lame_get_no_short_blocks( gfp ) );
wxPrintf(wxT("Force short blocks =%d\n"), lame_get_force_short_blocks( gfp ) );
wxPrintf(wxT("No short blocks =%d\n"), lame_get_no_short_blocks( gfp ) );
wxPrintf(wxT("Force short blocks =%d\n"), lame_get_force_short_blocks( gfp ) );
wxPrintf(wxT("de-emphasis =%d\n"), lame_get_emphasis( gfp ) );
wxPrintf(wxT("private flag =%d\n"), lame_get_extension( gfp ) );
wxPrintf(wxT("de-emphasis =%d\n"), lame_get_emphasis( gfp ) );
wxPrintf(wxT("private flag =%d\n"), lame_get_extension( gfp ) );
wxPrintf(wxT("copyright flag =%d\n"), lame_get_copyright( gfp ) );
wxPrintf(wxT("original flag =%d\n"), lame_get_original( gfp ) );
wxPrintf(wxT("CRC =%s\n"), lame_get_error_protection( gfp ) ? wxT("on") : wxT("off") );
wxPrintf(wxT("Fast mode =%s\n"), ( lame_get_quality( gfp ) )? wxT("enabled") : wxT("disabled") );
wxPrintf(wxT("Force mid/side stereo =%s\n"), ( lame_get_force_ms( gfp ) )?wxT("enabled"):wxT("disabled") );
wxPrintf(wxT("Padding Type =%d\n"), lame_get_padding_type( gfp ) );
wxPrintf(wxT("Disable Reservoir =%d\n"), lame_get_disable_reservoir( gfp ) );
wxPrintf(wxT("Allow diff-short =%d\n"), lame_get_allow_diff_short( gfp ) );
wxPrintf(wxT("Interchannel masking =%f\n"), lame_get_interChRatio( gfp ) );
wxPrintf(wxT("Strict ISO Encoding =%s\n"), ( lame_get_strict_ISO( gfp ) ) ?wxT("Yes"):wxT("No"));
wxPrintf(wxT("Scale =%5.2f\n"), lame_get_scale( gfp ) );
wxPrintf(wxT("copyright flag =%d\n"), lame_get_copyright( gfp ) );
wxPrintf(wxT("original flag =%d\n"), lame_get_original( gfp ) );
wxPrintf(wxT("CRC =%s\n"), lame_get_error_protection( gfp ) ? wxT("on") : wxT("off") );
wxPrintf(wxT("Fast mode =%s\n"), ( lame_get_quality( gfp ) )? wxT("enabled") : wxT("disabled") );
wxPrintf(wxT("Force mid/side stereo =%s\n"), ( lame_get_force_ms( gfp ) )?wxT("enabled"):wxT("disabled") );
wxPrintf(wxT("Padding Type =%d\n"), lame_get_padding_type( gfp ) );
wxPrintf(wxT("Disable Reservoir =%d\n"), lame_get_disable_reservoir( gfp ) );
wxPrintf(wxT("Allow diff-short =%d\n"), lame_get_allow_diff_short( gfp ) );
wxPrintf(wxT("Interchannel masking =%f\n"), lame_get_interChRatio( gfp ) );
wxPrintf(wxT("Strict ISO Encoding =%s\n"), ( lame_get_strict_ISO( gfp ) ) ?wxT("Yes"):wxT("No"));
wxPrintf(wxT("Scale =%5.2f\n"), lame_get_scale( gfp ) );
wxPrintf(wxT("VBR =%s, VBR_q =%d, VBR method ="),
( lame_get_VBR( gfp ) !=vbr_off ) ? wxT("enabled"): wxT("disabled"),
lame_get_VBR_q( gfp ) );
wxPrintf(wxT("VBR =%s, VBR_q =%d, VBR method ="),
( lame_get_VBR( gfp ) !=vbr_off ) ? wxT("enabled"): wxT("disabled"),
lame_get_VBR_q( gfp ) );
switch ( lame_get_VBR( gfp ) )
{
case vbr_off: wxPrintf(wxT( "vbr_off\n" )); break;
case vbr_mt : wxPrintf(wxT( "vbr_mt \n" )); break;
case vbr_rh : wxPrintf(wxT( "vbr_rh \n" )); break;
case vbr_mtrh: wxPrintf(wxT( "vbr_mtrh \n" )); break;
case vbr_abr:
wxPrintf(wxT( "vbr_abr (average bitrate %d kbps)\n"), lame_get_VBR_mean_bitrate_kbps( gfp ) );
break;
default:
wxPrintf(wxT("error, unknown VBR setting\n"));
break;
}
switch ( lame_get_VBR( gfp ) )
{
case vbr_off: wxPrintf(wxT( "vbr_off\n" )); break;
case vbr_mt : wxPrintf(wxT( "vbr_mt \n" )); break;
case vbr_rh : wxPrintf(wxT( "vbr_rh \n" )); break;
case vbr_mtrh: wxPrintf(wxT( "vbr_mtrh \n" )); break;
case vbr_abr:
wxPrintf(wxT( "vbr_abr (average bitrate %d kbps)\n"), lame_get_VBR_mean_bitrate_kbps( gfp ) );
break;
default:
wxPrintf(wxT("error, unknown VBR setting\n"));
break;
}
wxPrintf(wxT("Vbr Min bitrate =%d kbps\n"), lame_get_VBR_min_bitrate_kbps( gfp ) );
wxPrintf(wxT("Vbr Max bitrate =%d kbps\n"), lame_get_VBR_max_bitrate_kbps( gfp ) );
wxPrintf(wxT("Vbr Min bitrate =%d kbps\n"), lame_get_VBR_min_bitrate_kbps( gfp ) );
wxPrintf(wxT("Vbr Max bitrate =%d kbps\n"), lame_get_VBR_max_bitrate_kbps( gfp ) );
wxPrintf(wxT("Write VBR Header =%s\n"), ( lame_get_bWriteVbrTag( gfp ) ) ?wxT("Yes"):wxT("No"));
wxPrintf(wxT("VBR Hard min =%d\n"), lame_get_VBR_hard_min( gfp ) );
wxPrintf(wxT("Write VBR Header =%s\n"), ( lame_get_bWriteVbrTag( gfp ) ) ?wxT("Yes"):wxT("No"));
wxPrintf(wxT("VBR Hard min =%d\n"), lame_get_VBR_hard_min( gfp ) );
wxPrintf(wxT("ATH Only =%d\n"), lame_get_ATHonly( gfp ) );
wxPrintf(wxT("ATH short =%d\n"), lame_get_ATHshort( gfp ) );
wxPrintf(wxT("ATH no =%d\n"), lame_get_noATH( gfp ) );
wxPrintf(wxT("ATH type =%d\n"), lame_get_ATHtype( gfp ) );
wxPrintf(wxT("ATH lower =%f\n"), lame_get_ATHlower( gfp ) );
wxPrintf(wxT("ATH aa =%d\n"), lame_get_athaa_type( gfp ) );
wxPrintf(wxT("ATH aa loudapprox =%d\n"), lame_get_athaa_loudapprox( gfp ) );
wxPrintf(wxT("ATH aa sensitivity =%f\n"), lame_get_athaa_sensitivity( gfp ) );
wxPrintf(wxT("ATH Only =%d\n"), lame_get_ATHonly( gfp ) );
wxPrintf(wxT("ATH short =%d\n"), lame_get_ATHshort( gfp ) );
wxPrintf(wxT("ATH no =%d\n"), lame_get_noATH( gfp ) );
wxPrintf(wxT("ATH type =%d\n"), lame_get_ATHtype( gfp ) );
wxPrintf(wxT("ATH lower =%f\n"), lame_get_ATHlower( gfp ) );
wxPrintf(wxT("ATH aa =%d\n"), lame_get_athaa_type( gfp ) );
wxPrintf(wxT("ATH aa loudapprox =%d\n"), lame_get_athaa_loudapprox( gfp ) );
wxPrintf(wxT("ATH aa sensitivity =%f\n"), lame_get_athaa_sensitivity( gfp ) );
wxPrintf(wxT("Experimental nspsytune =%d\n"), lame_get_exp_nspsytune( gfp ) );
wxPrintf(wxT("Experimental X =%d\n"), lame_get_experimentalX( gfp ) );
wxPrintf(wxT("Experimental Y =%d\n"), lame_get_experimentalY( gfp ) );
wxPrintf(wxT("Experimental Z =%d\n"), lame_get_experimentalZ( gfp ) );
wxPrintf(wxT("Experimental nspsytune =%d\n"), lame_get_exp_nspsytune( gfp ) );
wxPrintf(wxT("Experimental X =%d\n"), lame_get_experimentalX( gfp ) );
wxPrintf(wxT("Experimental Y =%d\n"), lame_get_experimentalY( gfp ) );
wxPrintf(wxT("Experimental Z =%d\n"), lame_get_experimentalZ( gfp ) );
}
#endif

View File

@ -298,8 +298,8 @@ int ExportOGG::Export(AudacityProject *project,
// so do so (for however many pages are available).
while (!eos) {
int result = ogg_stream_pageout(&stream, &page);
if (!result) {
int result = ogg_stream_pageout(&stream, &page);
if (!result) {
break;
}
@ -309,7 +309,7 @@ int ExportOGG::Export(AudacityProject *project,
if (ogg_page_eos(&page)) {
eos = 1;
}
}
}
}
}
@ -320,11 +320,11 @@ int ExportOGG::Export(AudacityProject *project,
delete mixer;
ogg_stream_clear(&stream);
ogg_stream_clear(&stream);
vorbis_block_clear(&block);
vorbis_dsp_clear(&dsp);
vorbis_info_clear(&info);
vorbis_block_clear(&block);
vorbis_dsp_clear(&dsp);
vorbis_info_clear(&info);
vorbis_comment_clear(&comment);
outFile.Close();

View File

@ -31,8 +31,8 @@
#endif
#include <wx/defs.h>
#include <wx/intl.h> // needed for _("translated stings") even if we
// don't have libflac available
#include <wx/intl.h> // needed for _("translated stings") even if we
// don't have libflac available
#include "../Audacity.h"
#include "Import.h"
@ -120,7 +120,7 @@ class MyFLACFile : public FLAC::Decoder::File
wxArrayString mComments;
protected:
virtual FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame,
const FLAC__int32 * const buffer[]);
const FLAC__int32 * const buffer[]);
virtual void metadata_callback(const FLAC__StreamMetadata *metadata);
virtual void error_callback(FLAC__StreamDecoderErrorStatus status);
};
@ -207,14 +207,14 @@ void MyFLACFile::metadata_callback(const FLAC__StreamMetadata *metadata)
}
mFile->mStreamInfoDone=true;
break;
// handle the other types we do nothing with to avoid a warning
case FLAC__METADATA_TYPE_PADDING: // do nothing with padding
case FLAC__METADATA_TYPE_APPLICATION: // no idea what to do with this
case FLAC__METADATA_TYPE_SEEKTABLE: // don't need a seektable here
case FLAC__METADATA_TYPE_CUESHEET: // convert this to labels?
case FLAC__METADATA_TYPE_PICTURE: // ignore pictures
case FLAC__METADATA_TYPE_UNDEFINED: // do nothing with this either
break;
// handle the other types we do nothing with to avoid a warning
case FLAC__METADATA_TYPE_PADDING: // do nothing with padding
case FLAC__METADATA_TYPE_APPLICATION: // no idea what to do with this
case FLAC__METADATA_TYPE_SEEKTABLE: // don't need a seektable here
case FLAC__METADATA_TYPE_CUESHEET: // convert this to labels?
case FLAC__METADATA_TYPE_PICTURE: // ignore pictures
case FLAC__METADATA_TYPE_UNDEFINED: // do nothing with this either
break;
}
}
@ -241,7 +241,7 @@ void MyFLACFile::error_callback(FLAC__StreamDecoderErrorStatus status)
}
FLAC__StreamDecoderWriteStatus MyFLACFile::write_callback(const FLAC__Frame *frame,
const FLAC__int32 * const buffer[])
const FLAC__int32 * const buffer[])
{
short *tmp=new short[frame->header.blocksize];
@ -277,7 +277,7 @@ FLAC__StreamDecoderWriteStatus MyFLACFile::write_callback(const FLAC__Frame *fra
void GetFLACImportPlugin(ImportPluginList *importPluginList,
UnusableImportPluginList *unusableImportPluginList)
UnusableImportPluginList *unusableImportPluginList)
{
importPluginList->Append(new FLACImportPlugin);
}
@ -430,9 +430,9 @@ int FLACImportFileHandle::GetFileUncompressedBytes()
int FLACImportFileHandle::Import(TrackFactory *trackFactory,
Track ***outTracks,
int *outNumTracks,
Tags *tags)
Track ***outTracks,
int *outNumTracks,
Tags *tags)
{
wxASSERT(mStreamInfoDone);

View File

@ -15,7 +15,7 @@ class ImportPluginList;
class UnusableImportPluginList;
void GetFLACImportPlugin(ImportPluginList *importPluginList,
UnusableImportPluginList *unusableImportPluginList);
UnusableImportPluginList *unusableImportPluginList);
#endif

View File

@ -371,7 +371,7 @@ int PCMImportFileHandle::Import(TrackFactory *trackFactory,
int updateCounter = 0;
for (sampleCount i = 0; i < fileTotalFrames; i += maxBlockSize) {
sampleCount blockLen = maxBlockSize;
if (i + blockLen > fileTotalFrames)
blockLen = fileTotalFrames - i;

View File

@ -250,8 +250,8 @@ int QTImportFileHandle::Import(TrackFactory *trackFactory,
}
err = MovieAudioExtractionSetProperty(maer,
kQTPropertyClass_MovieAudioExtraction_Audio,
kQTMovieAudioExtractionAudioPropertyID_RenderQuality,
kQTPropertyClass_MovieAudioExtraction_Audio,
kQTMovieAudioExtractionAudioPropertyID_RenderQuality,
sizeof(quality),
&quality);
if (err != noErr) {

View File

@ -8,12 +8,12 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
@ -32,8 +32,8 @@ extern "C" {
/* encoding formats */
#define BE_CONFIG_MP3 0
#define BE_CONFIG_LAME 256
#define BE_CONFIG_MP3 0
#define BE_CONFIG_LAME 256
/* type definitions */
@ -85,7 +85,7 @@ typedef enum
VBR_METHOD_ABR = 4
} VBRMETHOD;
typedef enum
typedef enum
{
LQP_NOPRESET =-1,
@ -130,7 +130,7 @@ typedef struct {
DWORD dwSampleRate; // 48000, 44100 and 32000 allowed
BYTE byMode; // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
WORD wBitrate; // 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 allowed
BOOL bPrivate;
BOOL bPrivate;
BOOL bCRC;
BOOL bCopyright;
BOOL bOriginal;
@ -140,12 +140,12 @@ typedef struct {
struct
{
// STRUCTURE INFORMATION
DWORD dwStructVersion;
DWORD dwStructVersion;
DWORD dwStructSize;
// BASIC ENCODER SETTINGS
DWORD dwSampleRate; // SAMPLERATE OF INPUT FILE
DWORD dwReSampleRate; // DOWNSAMPLERATE, 0=ENCODER DECIDES
DWORD dwReSampleRate; // DOWNSAMPLERATE, 0=ENCODER DECIDES
LONG nMode; // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
DWORD dwBitrate; // CBR bitrate, VBR min bitrate
DWORD dwMaxBitrate; // CBR ignored, VBR Max bitrate
@ -159,7 +159,7 @@ typedef struct {
BOOL bCRC; // Insert CRC (TRUE/FALSE)
BOOL bCopyright; // Set Copyright Bit (TRUE/FALSE)
BOOL bOriginal; // Set Original Bit (TRUE/FALSE)
// VBR STUFF
BOOL bWriteVBRHeader; // WRITE XING VBR HEADER (TRUE/FALSE)
BOOL bEnableVBR; // USE VBR ENCODING (TRUE/FALSE)
@ -169,7 +169,7 @@ typedef struct {
BOOL bNoRes; // Disable Bit resorvoir (TRUE/FALSE)
BOOL bStrictIso; // Use strict ISO encoding rules (TRUE/FALSE)
BYTE btReserved[255-4*sizeof(DWORD)]; // FUTURE USE, SET TO 0
} LHV1; // LAME header version 1
@ -184,7 +184,7 @@ typedef struct {
} aac;
} format;
} BE_CONFIG, *PBE_CONFIG;
@ -208,7 +208,7 @@ typedef struct {
// BladeEnc Homepage URL
CHAR zHomepage[BE_MAX_HOMEPAGE + 1];
CHAR zHomepage[BE_MAX_HOMEPAGE + 1];
BYTE byAlphaLevel;
BYTE byBetaLevel;
@ -217,7 +217,7 @@ typedef struct {
BYTE btReserved[125];
} BE_VERSION, *PBE_VERSION;
} BE_VERSION, *PBE_VERSION;
#ifndef _BLADEDLL

View File

@ -501,7 +501,7 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define mad_f_scale64(hi, lo) \
((((mad_fixed_t) \
(((hi) << (32 - (MAD_F_SCALEBITS - 1))) | \
((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
# else
# define mad_f_scale64(hi, lo) \
((mad_fixed_t) \

View File

@ -71,14 +71,14 @@ void ODFLACFile::metadata_callback(const FLAC__StreamMetadata *metadata)
}
mDecoder->mStreamInfoDone=true;
break;
// handle the other types we do nothing with to avoid a warning
case FLAC__METADATA_TYPE_PADDING: // do nothing with padding
case FLAC__METADATA_TYPE_APPLICATION: // no idea what to do with this
case FLAC__METADATA_TYPE_SEEKTABLE: // don't need a seektable here
case FLAC__METADATA_TYPE_CUESHEET: // convert this to labels?
case FLAC__METADATA_TYPE_PICTURE: // ignore pictures
case FLAC__METADATA_TYPE_UNDEFINED: // do nothing with this either
break;
// handle the other types we do nothing with to avoid a warning
case FLAC__METADATA_TYPE_PADDING: // do nothing with padding
case FLAC__METADATA_TYPE_APPLICATION: // no idea what to do with this
case FLAC__METADATA_TYPE_SEEKTABLE: // don't need a seektable here
case FLAC__METADATA_TYPE_CUESHEET: // convert this to labels?
case FLAC__METADATA_TYPE_PICTURE: // ignore pictures
case FLAC__METADATA_TYPE_UNDEFINED: // do nothing with this either
break;
}
}
@ -181,7 +181,7 @@ int ODFlacDecoder::Decode(samplePtr & data, sampleFormat & format, sampleCount s
mDecodeBufferWritePosition=0;
mDecodeBufferLen = len;
data = NewSamples(len, mFormat);
mDecodeBuffer=data;
format = mFormat;
@ -241,7 +241,7 @@ bool ODFlacDecoder::ReadHeader()
return false;
}
//this will call the metadata_callback when it is done
//this will call the metadata_callback when it is done
mFile->process_until_end_of_metadata();
// not necessary to check state, error callback will catch errors, but here's how:
if (mFile->get_state() > FLAC__STREAM_DECODER_READ_FRAME) {
@ -276,7 +276,7 @@ ODFlacDecoder::~ODFlacDecoder(){
//compare to FLACImportPlugin::Open(wxString filename)
ODFileDecoder* ODDecodeFlacTask::CreateFileDecoder(const wxString & fileName)
{
// First check if it really is a FLAC file
// First check if it really is a FLAC file
/*
int cnt;
wxFile binaryFile;

View File

@ -84,7 +84,7 @@ class ODFLACFile : public FLAC::Decoder::File
protected:
virtual FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame,
const FLAC__int32 * const buffer[]);
const FLAC__int32 * const buffer[]);
virtual void metadata_callback(const FLAC__StreamMetadata *metadata);
virtual void error_callback(FLAC__StreamDecoderErrorStatus status);
};
@ -118,7 +118,7 @@ public:
private:
friend class FLACImportFileHandle;
sampleFormat mFormat;
sampleFormat mFormat;
ODFLACFile *mFile;
ODLock mFlacFileLock;//for mFile;
wxFFile mHandle;

View File

@ -284,7 +284,7 @@ int ODDecodeTask::GetNumFileDecoders()
///This should handle unicode converted to UTF-8 on mac/linux, but OD TODO:check on windows
ODFileDecoder::ODFileDecoder(const wxString & fName)
{
mFName = fName;
mFName = fName;
mInited = false;
}

View File

@ -102,39 +102,39 @@ public:
///This should handle unicode converted to UTF-8 on mac/linux, but OD TODO:check on windows
ODFileDecoder(const wxString& fName);
virtual ~ODFileDecoder();
///Read header. Subclasses must override. Probably should save the info somewhere.
///Ideally called once per decoding of a file. This complicates the task because
virtual bool ReadHeader()=0;
virtual bool Init(){return ReadHeader();}
///Ideally called once per decoding of a file. This complicates the task because
virtual bool ReadHeader()=0;
virtual bool Init(){return ReadHeader();}
virtual bool SeekingAllowed(){return true;}
///Decodes the samples for this blockfile from the real file into a float buffer.
///Decodes the samples for this blockfile from the real file into a float buffer.
///This is file specific, so subclasses must implement this only.
///the buffer should be created by the ODFileDecoder implementing this method.
///It should set the format parameter so that the client code can deal with it.
///This class should call ReadHeader() first, so it knows the length, and can prepare
///the file object if it needs to.
///It should set the format parameter so that the client code can deal with it.
///This class should call ReadHeader() first, so it knows the length, and can prepare
///the file object if it needs to.
///returns negative value for failure, 0 or positive value for success.
virtual int Decode(samplePtr & data, sampleFormat & format, sampleCount start, sampleCount len, unsigned int channel)=0;
wxString GetFileName(){return mFName;}
bool IsInitialized();
protected:
protected:
///Derived classes should call this after they have parsed the header.
void MarkInitialized();
bool mInited;
ODLock mInitedLock;
wxString mFName;
unsigned int mSampleRate;
unsigned int mNumSamples;//this may depend on the channel - so TODO: we should probably let the decoder create/modify the track info directly.
unsigned int mNumChannels;
unsigned int mSampleRate;
unsigned int mNumSamples;//this may depend on the channel - so TODO: we should probably let the decoder create/modify the track info directly.
unsigned int mNumChannels;
};
#endif

View File

@ -77,7 +77,7 @@ class ODTaskThread {
bool mDestroy;
pthread_t mThread;
ODTask* mTask;
ODTask* mTask;
};
class ODLock {
@ -125,30 +125,30 @@ protected:
#else
class ODTaskThread : public wxThread
class ODTaskThread : public wxThread
{
public:
///Constructs a ODTaskThread
///@param task the task to be launched as an
ODTaskThread(ODTask* task);
///@param task the task to be launched as an
ODTaskThread(ODTask* task);
protected:
///Executes a part of the task
virtual void* Entry();
ODTask* mTask;
ODTask* mTask;
};
//a wrapper for wxMutex.
class AUDACITY_DLL_API ODLock : public wxMutex
class AUDACITY_DLL_API ODLock : public wxMutex
{
public:
///Constructs a ODTaskThread
///@param task the task to be launched as an
ODLock(){}
virtual ~ODLock(){}
///@param task the task to be launched as an
ODLock(){}
virtual ~ODLock(){}
};
class ODCondition : public wxCondition

View File

@ -87,7 +87,7 @@ void EffectsPrefs::PopulateOrExchange(ShuttleGui & S)
true);
#endif
S.AddFixedText(_("Restart Audacity to apply changes."));
S.AddFixedText(_("Restart Audacity to apply changes."));
}
S.EndStatic();

View File

@ -28,12 +28,12 @@ class LibraryPrefs:public PrefsPanel
LibraryPrefs(wxWindow * parent);
~LibraryPrefs();
virtual bool Apply();
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void SetMP3VersionText(bool prompt = false);
void SetFFmpegVersionText();
void SetFFmpegVersionText();
void OnMP3FindButton(wxCommandEvent & e);
void OnMP3DownButton(wxCommandEvent & e);

View File

@ -76,28 +76,28 @@ END_EVENT_TABLE()
class wxTreebookExt : public wxTreebook
{
public:
wxTreebookExt( wxWindow *parent,
wxWindowID id) : wxTreebook( parent, id )
{;};
~wxTreebookExt(){;};
virtual int ChangeSelection(size_t n);
virtual int SetSelection(size_t n);
wxTreebookExt( wxWindow *parent,
wxWindowID id) : wxTreebook( parent, id )
{;};
~wxTreebookExt(){;};
virtual int ChangeSelection(size_t n);
virtual int SetSelection(size_t n);
};
int wxTreebookExt::ChangeSelection(size_t n) {
int i = wxTreebook::ChangeSelection(n);
wxString Temp = GetPageText( n );
((wxDialog*)GetParent())->SetTitle( Temp );
return i;
int i = wxTreebook::ChangeSelection(n);
wxString Temp = GetPageText( n );
((wxDialog*)GetParent())->SetTitle( Temp );
return i;
};
int wxTreebookExt::SetSelection(size_t n)
{
int i = wxTreebook::SetSelection(n);
wxString Temp = wxString(_("Preferences: ")) + GetPageText( n );
((wxDialog*)GetParent())->SetTitle( Temp );
return i;
int i = wxTreebook::SetSelection(n);
wxString Temp = wxString(_("Preferences: ")) + GetPageText( n );
((wxDialog*)GetParent())->SetTitle( Temp );
return i;
}

View File

@ -179,7 +179,7 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S)
mConverterLabels),
S.SetSizeHints(mConverterNames);
S.TieChoice(_("&Dither:"),
S.TieChoice(_("&Dither:"),
wxT("/Quality/DitherAlgorithm"),
Dither::none,
mDitherNames,
@ -201,7 +201,7 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S)
mConverterLabels),
S.SetSizeHints(mConverterNames);
S.TieChoice(_("Dit&her:"),
S.TieChoice(_("Dit&her:"),
wxT("/Quality/HQDitherAlgorithm"),
Dither::shaped,
mDitherNames,

View File

@ -155,10 +155,10 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
8);
mFrequencyGain =
S.TieNumericTextBox(_("Frequency g&ain (dB/dec):"),
wxT("/Spectrum/FrequencyGain"),
0,
4);
S.TieNumericTextBox(_("Frequency g&ain (dB/dec):"),
wxT("/Spectrum/FrequencyGain"),
0,
4);
}
S.EndTwoColumn();

View File

@ -107,7 +107,7 @@ void ThemePrefs::PopulateOrExchange(ShuttleGui & S)
S.EndStatic();
/* i18n-hint: && in here is an escape character to get a single & on screen,
* so keep it as is */
* so keep it as is */
S.StartStatic( _("Theme Cache - Images && Color"));
{
S.StartHorizontalLay(wxALIGN_LEFT);

View File

@ -104,7 +104,7 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
wxT("/GUI/SelectAllOnNone"),
true);
/* i18n-hint: cut-lines are a lines indicating where to cut.*/
S.TieCheckBox(_("Enable cu&t lines"),
S.TieCheckBox(_("Enable cu&t lines"),
wxT("/GUI/EnableCutLines"),
false);
S.TieCheckBox(_("Enable &dragging of left and right selection edges"),

View File

@ -219,14 +219,14 @@ void ToolDock::LayoutToolBars()
stack[ stkcnt ].SetHeight( stack[ stkcnt ].GetHeight() - th );
// Calc the next possible horizontal location.
int x = cpos.x + tw;
int x = cpos.x + tw;
// Add a new stack entry
stkcnt++;
stack[ stkcnt ].SetX( x );
stack[ stkcnt ].SetY( cpos.y );
stack[ stkcnt ].SetWidth( width - x );
stack[ stkcnt ].SetHeight( th );
stack[ stkcnt ].SetY( cpos.y );
stack[ stkcnt ].SetWidth( width - x );
stack[ stkcnt ].SetHeight( th );
// Position the previous toolbar
if( ndx > 0 )
@ -373,14 +373,14 @@ int ToolDock::PositionBar( ToolBar *t, wxPoint & pos, wxRect & rect )
stack[ stkcnt ].SetHeight( stack[ stkcnt ].GetHeight() - th );
// Calc the next possible horizontal location.
int x = cpos.x + tw;
int x = cpos.x + tw;
// Add a new stack entry
stkcnt++;
stack[ stkcnt ].SetX( x );
stack[ stkcnt ].SetY( cpos.y );
stack[ stkcnt ].SetWidth( width - x );
stack[ stkcnt ].SetHeight( th );
stack[ stkcnt ].SetY( cpos.y );
stack[ stkcnt ].SetWidth( width - x );
stack[ stkcnt ].SetHeight( th );
// Position the previous toolbar
if( ndx > 0 )

View File

@ -135,12 +135,12 @@ void ToolsToolBar::RegenerateToolsTooltips()
// to workaround the problem. The problem is not fully understood though
// (as of April 2003).
// Vaughan, October 2003: Now we're crashing on Win2K if
// "Quit when closing last window" is unchecked, when we come back
// through here, on either of the wxSafeYield calls.
// James confirms that commenting them out does not cause his original problem
// to reappear, so they're commented out now.
// wxSafeYield(); //Deal with some queued up messages...
// Vaughan, October 2003: Now we're crashing on Win2K if
// "Quit when closing last window" is unchecked, when we come back
// through here, on either of the wxSafeYield calls.
// James confirms that commenting them out does not cause his original problem
// to reappear, so they're commented out now.
// wxSafeYield(); //Deal with some queued up messages...
#if wxUSE_TOOLTIPS
mTool[selectTool]->SetToolTip(_("Selection Tool"));
@ -221,9 +221,9 @@ void ToolsToolBar::SetCurrentTool(int tool, bool show)
if (show)
mTool[mCurrentTool]->PushDown();
}
//JKC: ANSWER-ME: Why is this RedrawAllProjects() line required?
//msmeyer: I think it isn't, we leave it out for 1.3.1 (beta), and
// we'll see if anyone complains.
//JKC: ANSWER-ME: Why is this RedrawAllProjects() line required?
//msmeyer: I think it isn't, we leave it out for 1.3.1 (beta), and
// we'll see if anyone complains.
// RedrawAllProjects();
//msmeyer: But we instruct the projects to handle the cursor shape again

View File

@ -450,10 +450,10 @@ void TranscriptionToolBar::OnStartOn(wxCommandEvent &event)
SetButton(false,mButtons[TTB_StartOn]);
return;
}
mVk->AdjustThreshold(GetSensitivity());
AudacityProject *p = GetActiveProject();
TrackList *tl = p->GetTracks();
TrackListOfKindIterator iter(Track::Wave, tl);
@ -511,7 +511,7 @@ void TranscriptionToolBar::OnStartOff(wxCommandEvent &event)
void TranscriptionToolBar::OnEndOn(wxCommandEvent &event)
{
//If IO is busy, abort immediately
if (gAudioIO->IsBusy()){
SetButton(false,mButtons[TTB_EndOn]);
@ -548,7 +548,7 @@ void TranscriptionToolBar::OnEndOn(wxCommandEvent &event)
void TranscriptionToolBar::OnEndOff(wxCommandEvent &event)
{
//If IO is busy, abort immediately
if (gAudioIO->IsBusy()){
SetButton(false,mButtons[TTB_EndOff]);
@ -589,7 +589,7 @@ void TranscriptionToolBar::OnSelectSound(wxCommandEvent &event)
SetButton(false,mButtons[TTB_SelectSound]);
return;
}
mVk->AdjustThreshold(GetSensitivity());
AudacityProject *p = GetActiveProject();
@ -686,7 +686,7 @@ void TranscriptionToolBar::OnCalibrate(wxCommandEvent &event)
mVk->CalibrateNoise(*((WaveTrack*)t),start,len);
mVk->AdjustThreshold(3);
mButtons[TTB_StartOn]->Enable();
mButtons[TTB_StartOff]->Enable();
mButtons[TTB_EndOn]->Enable();
@ -716,13 +716,13 @@ void TranscriptionToolBar::OnCalibrate(wxCommandEvent &event)
void TranscriptionToolBar::OnAutomateSelection(wxCommandEvent &event)
{
//If IO is busy, abort immediately
if (gAudioIO->IsBusy())
{
SetButton(false,mButtons[TTB_EndOff]);
return;
}
{
SetButton(false,mButtons[TTB_EndOff]);
return;
}
wxBusyCursor busy;

View File

@ -39,14 +39,14 @@ BEGIN_EVENT_TABLE(AttachableScrollBar, wxScrollBar)
END_EVENT_TABLE()
AttachableScrollBar::AttachableScrollBar(
wxWindow* parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style) :
wxScrollBar( parent, id, pos, size, style )
wxWindow* parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style) :
wxScrollBar( parent, id, pos, size, style )
{
mpViewInfo = NULL;
mpViewInfo = NULL;
}
AttachableScrollBar::~AttachableScrollBar(void)
@ -98,7 +98,7 @@ void AttachableScrollBar::SetViewInfo( ViewInfo * view )
void AttachableScrollBar::OnScroll(wxScrollEvent & event)
{
if( mpViewInfo == NULL )
if( mpViewInfo == NULL )
{
event.Skip();
return;

View File

@ -22,24 +22,24 @@
struct ViewInfo;
class AUDACITY_DLL_API AttachableScrollBar :
public wxScrollBar
public wxScrollBar
{
public:
AttachableScrollBar(
wxWindow* parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL);
AttachableScrollBar(
wxWindow* parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL);
public:
~AttachableScrollBar(void);
void OnScroll(wxScrollEvent & event);
void SetViewInfo( ViewInfo * view );
~AttachableScrollBar(void);
void OnScroll(wxScrollEvent & event);
void SetViewInfo( ViewInfo * view );
void SetScrollBarFromViewInfo();
void SetViewInfoFromScrollBar();
ViewInfo * mpViewInfo;
ViewInfo * mpViewInfo;
DECLARE_EVENT_TABLE();
};

View File

@ -52,14 +52,14 @@ class ErrorDialog : public wxDialog
virtual ~ErrorDialog(){}
private:
wxString dhelpURL;
wxString dhelpURL;
bool dClose;
bool dModal;
void OnOk( wxCommandEvent &event );
void OnHelp( wxCommandEvent &event );
DECLARE_EVENT_TABLE()
};
// special case for alias missing dialog because we keep track of if it exists.
@ -137,14 +137,14 @@ ErrorDialog::ErrorDialog(
wxStaticText *statText = new wxStaticText(this, -1, message);
mainSizer->Add(statText, 0, wxALIGN_LEFT|wxALL, 5);
wxButton *help = new wxButton(this, wxID_HELP, _("Help"));
hSizer->Add(help, 0, wxALIGN_LEFT|wxALL, 5);
wxButton *ok = new wxButton(this, wxID_OK, _("OK"));
ok->SetDefault();
ok->SetFocus();
hSizer->Add(ok, 0, wxALIGN_RIGHT|wxALL, 5);
hSizer->Add(ok, 0, wxALIGN_RIGHT|wxALL, 5);
vSizer->Add(hSizer, 0, wxALIGN_CENTER|wxALL, 5);
@ -283,7 +283,7 @@ void ErrorDialog::OnHelp(wxCommandEvent &event)
}
OpenInDefaultBrowser( dhelpURL );
if(dClose)
EndModal(true);
EndModal(true);
}
void ShowErrorDialog(wxWindow *parent,

View File

@ -703,9 +703,9 @@ void Meter::OnMeterUpdate(wxTimerEvent &evt)
printf("%f@%f ", msg.peak[j], mT);
}
else {
discarded = true;
discarded = true;
printf("%f@%f discarded\n", msg.peak[j], mT);
}
}
#endif
}
} // while

View File

@ -1,4 +1,4 @@
/**********************************************************************
/**********************************************************************
Audacity: A Digital Audio Editor

View File

@ -61,7 +61,7 @@ bool XMLFileReader::Parse(XMLTagHandler *baseHandler,
done = (len < bufferSize);
if (!XML_Parse(mParser, buffer, len, done)) {
mErrorStr.Printf(_("Error: %hs at line %lu"),
XML_ErrorString(XML_GetErrorCode(mParser)),
XML_ErrorString(XML_GetErrorCode(mParser)),
(long unsigned int)XML_GetCurrentLineNumber(mParser));
theXMLFile.Close();
return false;