mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 16:20:05 +02:00
Use DBL_MAX, not arbitrary 1000000000.0, as "infinite" time interval
This commit is contained in:
parent
ce1f587feb
commit
0eb2f85bfb
@ -269,6 +269,7 @@ writing audio.
|
||||
#include "AudioIO.h"
|
||||
#include "float_cast.h"
|
||||
|
||||
#include <cfloat>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
|
@ -70,7 +70,8 @@ bool ValidateDeviceNames();
|
||||
|
||||
class AudioIOListener;
|
||||
|
||||
#define BAD_STREAM_TIME -1000000000.0
|
||||
// #include <cfloat> if you need this constant
|
||||
#define BAD_STREAM_TIME (-DBL_MAX)
|
||||
|
||||
#define MAX_MIDI_BUFFER_SIZE 5000
|
||||
#define DEFAULT_SYNTH_LATENCY 5
|
||||
|
@ -421,7 +421,7 @@ void Lyrics::Update(double t)
|
||||
{
|
||||
if (t < 0.0)
|
||||
{
|
||||
// TrackPanel::OnTimer passes gAudioIO->GetStreamTime(), which is -1000000000 if !IsStreamActive().
|
||||
// TrackPanel::OnTimer passes gAudioIO->GetStreamTime(), which is -DBL_MAX if !IsStreamActive().
|
||||
// In that case, use the selection start time.
|
||||
AudacityProject* pProj = GetActiveProject();
|
||||
mT = pProj->GetSel0();
|
||||
|
@ -5888,7 +5888,7 @@ void AudacityProject::HandleAlign(int index, bool moveSel)
|
||||
wxString action;
|
||||
wxString shortAction;
|
||||
double offset;
|
||||
double minOffset = 1000000000.0;
|
||||
double minOffset = DBL_MAX;
|
||||
double maxEndOffset = 0.0;
|
||||
double leftOffset = 0.0;
|
||||
bool bRightChannel = false;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "Experimental.h"
|
||||
#include "MixerBoard.h"
|
||||
|
||||
#include <cfloat>
|
||||
#include <math.h>
|
||||
|
||||
#include <wx/dcmemory.h>
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "Audacity.h"
|
||||
#include "TimeTrack.h"
|
||||
|
||||
#include <cfloat>
|
||||
#include <wx/intl.h>
|
||||
#include "AColor.h"
|
||||
#include "widgets/Ruler.h"
|
||||
@ -44,7 +45,7 @@ TimeTrack::TimeTrack(const std::shared_ptr<DirManager> &projDirManager, const Zo
|
||||
mDisplayLog = false;
|
||||
|
||||
mEnvelope = std::make_unique<Envelope>();
|
||||
mEnvelope->SetTrackLen(1000000000.0);
|
||||
mEnvelope->SetTrackLen(DBL_MAX);
|
||||
mEnvelope->SetInterpolateDB(true);
|
||||
mEnvelope->Flatten(1.0);
|
||||
mEnvelope->Mirror(false);
|
||||
@ -71,7 +72,7 @@ TimeTrack::TimeTrack(const TimeTrack &orig):
|
||||
|
||||
///@TODO: Give Envelope:: a copy-constructor instead of this?
|
||||
mEnvelope = std::make_unique<Envelope>();
|
||||
mEnvelope->SetTrackLen(1000000000.0);
|
||||
mEnvelope->SetTrackLen(DBL_MAX);
|
||||
SetInterpolateLog(orig.GetInterpolateLog()); // this calls Envelope::SetInterpolateDB
|
||||
mEnvelope->Flatten(1.0);
|
||||
mEnvelope->Mirror(false);
|
||||
|
@ -33,6 +33,7 @@
|
||||
*//*******************************************************************/
|
||||
|
||||
#include <algorithm>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "../Experimental.h"
|
||||
@ -891,7 +892,7 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
|
||||
double t0 = p->GetSel0();
|
||||
double t1 = p->GetSel1();
|
||||
if (t1 == t0)
|
||||
t1 = 1000000000.0; // record for a long, long time (tens of years)
|
||||
t1 = DBL_MAX; // record for a long, long time
|
||||
|
||||
/* TODO: set up stereo tracks if that is how the user has set up
|
||||
* their preferences, and choose sample format based on prefs */
|
||||
@ -985,7 +986,7 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
|
||||
}
|
||||
}
|
||||
|
||||
t1 = 1000000000.0; // record for a long, long time (tens of years)
|
||||
t1 = DBL_MAX; // record for a long, long time
|
||||
}
|
||||
else {
|
||||
bool recordingNameCustom, useTrackNumber, useDateStamp, useTimeStamp;
|
||||
|
Loading…
x
Reference in New Issue
Block a user