1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-29 14:48:39 +02:00

Merge branch 'master' into Escape-key

This commit is contained in:
Paul-Licameli 2015-04-09 22:15:52 -04:00
commit bcdcfc36cb
11 changed files with 65 additions and 32 deletions

3
.gitignore vendored
View File

@ -15,6 +15,7 @@
*.log
*.tlog
*.ipch
*.opensdf
# Precompiled Headers
*.gch
@ -40,3 +41,5 @@
*.out
*.app
win/resetPrefs.txt
src/RevisionIdent.h

View File

@ -1,6 +1,8 @@
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y libwxgtk2.8-dev
- git show -s --format="wxT(\"<a href=\\\"https://github.com/audacity/audacity/commit/%H\\\">%h</a> of %cd\")"
- git show -s --format="wxT(\"<a href=\\\"https://github.com/audacity/audacity/commit/%H\\\">%h</a> of %cd\")" > ./src/RevisionIdent.h
language: cpp
compiler:
- gcc

View File

@ -549,6 +549,10 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S )
// Current date
AddBuildinfoRow(&informationStr, _("Program build date: "), __TDATE__);
AddBuildinfoRow(&informationStr, _("Commit Id:"),
#include "RevisionIdent.h"
);
#ifdef __WXDEBUG__
AddBuildinfoRow(&informationStr, _("Build type:"), _("Debug build"));
#else

View File

@ -656,14 +656,14 @@ void Envelope::CollapseRegion(double t0, double t1)
// envelope point applies to the first sample, but the t=tracklen
// envelope point applies one-past the last actual sample.
// Rather than going to a .5-offset-index, we special case the framing.
void Envelope::Paste(double t0, Envelope *e)
void Envelope::Paste(double t0, const Envelope *e)
{
bool pointsAdded = false;
const bool wasEmpty = (this->mEnv.Count() == 0);
// JC: The old analysis of cases and the resulting code here is way more complex than needed.
// TODO: simplify the analysis and simplify the code.
// JC: The old analysis of cases and the resulting code here is way more complex than needed.
// TODO: simplify the analysis and simplify the code.
if (e->mEnv.Count() == 0 && this->mEnv.Count() == 0 && e->mDefaultValue == this->mDefaultValue)
if (e->mEnv.Count() == 0 && wasEmpty && e->mDefaultValue == this->mDefaultValue)
{
// msmeyer: The envelope is empty and has the same default value, so
// there is nothing that must be inserted, just return. This avoids
@ -672,16 +672,6 @@ void Envelope::Paste(double t0, Envelope *e)
mTrackLen += e->mTrackLen;
return;
}
if (this->mEnv.Count() != 0)
{
// inserting a clip with a possibly empty envelope into one with an envelope
// so add end points to e, in case they are not there
double leftval = e->GetValue(0+e->mOffset);
double rightval = e->GetValue(e->mTrackLen+e->mOffset);
e->Insert(0, leftval);
e->Insert(e->mTrackLen, rightval);
pointsAdded = true; // we need to delete them later so's not to corrupt 'e' for later use
}
t0 = wxMin(t0 - mOffset, mTrackLen); // t0 now has origin of zero
double deltat = e->mTrackLen;
@ -834,17 +824,24 @@ Old analysis of cases:
}
// Copy points from inside the selection
if (!wasEmpty) {
// Add end points in case they are not not in e.
// If they are in e, no harm, because the repeated Insert
// calls for the start and end times will have no effect.
const double leftval = e->GetValue(0 + e->mOffset);
const double rightval = e->GetValue(e->mTrackLen + e->mOffset);
Insert(t0, leftval);
Insert(t0 + e->mTrackLen, rightval);
}
len = e->mEnv.Count();
for (i = 0; i < len; i++)
pos=Insert(t0 + e->mEnv[i]->GetT(), e->mEnv[i]->GetVal());
Insert(t0 + e->mEnv[i]->GetT(), e->mEnv[i]->GetVal());
/* if(len != 0)
for (i = 0; i < mEnv.Count(); i++)
wxLogDebug(wxT("Fixed i %d when %.18f val %f"),i,mEnv[i]->GetT(),mEnv[i]->GetVal()); */
if(pointsAdded)
while(e->mEnv.Count() != 0)
e->Delete(0); // they were not there when we entered this
}
// Deletes 'unneeded' points, starting from the left.

View File

@ -140,7 +140,7 @@ class Envelope : public XMLTagHandler {
// Handling Cut/Copy/Paste events
void CollapseRegion(double t0, double t1);
void CopyFrom(const Envelope * e, double t0, double t1);
void Paste(double t0, Envelope *e);
void Paste(double t0, const Envelope *e);
void InsertSpace(double t0, double tlen);
void RemoveUnneededPoints(double time = -1, double tolerence = 0.001);

View File

@ -103,6 +103,7 @@ void InterpolateAudio(float *buffer, int len,
InterpolateAudio(buffer2, len, len-numBad, numBad);
for(i=0; i<len; i++)
buffer[len-1-i] = buffer2[i];
delete[] buffer2;
return;
}

28
src/RevisionIdent.h Normal file
View File

@ -0,0 +1,28 @@
/**********************************************************************
Audacity: A Digital Audio Editor
Audacity(R) is copyright (c) 1999-2015 Audacity Team.
License: GPL v2. See License.txt.
RevisionIdent.h
********************************************************************//*!
\file RevisionIdent.h
This entire file will be replaced by the revision identifier string
based on the branch SHA when the automated build system builds
Audacity. That striing will look something like:
"<a href=\"https://github.com/audacity/audacity/commit/
7f2e83995596367aeed69f3086ac9fd2039795a3\">7f2e839</a> of
Thu Apr 9 20:03:11 2015 +0100"
*//********************************************************************/
// The string below is what you get if
// the build system does not replace this file.
wxT("No revision identifier was provided")

View File

@ -1476,7 +1476,7 @@ void TrackPanel::HandleEscapeKey()
case IsVZooming:
SetCapturedTrack(NULL, IsUncaptured);
if (HasCapture())
ReleaseCapture();
ReleaseMouse();
return;
default:
return;

View File

@ -1734,7 +1734,7 @@ bool WaveTrack::GetRMS(float *rms, double t0, double t1)
}
}
}
*rms = sqrt(sumsq/length);
*rms = length > 0.0 ? sqrt(sumsq / length) : 0.0;
return result;
}

View File

@ -529,6 +529,7 @@
<ClInclude Include="..\..\..\src\import\MultiFormatReader.h" />
<ClInclude Include="..\..\..\src\import\SpecPowerMeter.h" />
<ClInclude Include="..\..\..\src\ModuleManager.h" />
<ClInclude Include="..\..\..\src\RevisionIdent.h" />
<ClInclude Include="..\..\..\src\SseMathFuncs.h" />
<ClInclude Include="..\..\..\src\toolbars\SpectralSelectionBar.h" />
<ClInclude Include="..\..\..\src\toolbars\SpectralSelectionBarListener.h" />

View File

@ -1670,6 +1670,9 @@
<ClInclude Include="..\..\..\src\AudioIOListener.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\RevisionIdent.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="..\..\audacity.ico">
@ -1684,15 +1687,6 @@
<ItemGroup>
<None Include="..\..\ny.rules" />
<None Include="..\..\po.rules" />
<None Include="..\..\..\nyquist\test.lsp">
<Filter>nyquist</Filter>
</None>
<None Include="..\..\..\nyquist\upic.sal">
<Filter>nyquist</Filter>
</None>
<None Include="..\..\..\nyquist\velocity.lsp">
<Filter>nyquist</Filter>
</None>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\..\nyquist\rawwaves\mand1.raw">
@ -1812,6 +1806,9 @@
<CustomBuild Include="..\..\..\nyquist\xm.lsp">
<Filter>nyquist</Filter>
</CustomBuild>
<CustomBuild Include="..\..\..\nyquist\test.lsp" />
<CustomBuild Include="..\..\..\nyquist\upic.sal" />
<CustomBuild Include="..\..\..\nyquist\velocity.lsp" />
</ItemGroup>
<ItemGroup>
<copy Include="..\..\..\plug-ins\adjustable-fade.ny">