1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

Merge branch 'master' into warnings

This commit is contained in:
Paul Licameli 2016-09-19 11:47:21 -04:00
commit dcf114426f
10 changed files with 23 additions and 11 deletions

View File

@ -269,6 +269,7 @@ writing audio.
#include "AudioIO.h"
#include "float_cast.h"
#include <cfloat>
#include <math.h>
#include <stdlib.h>
#include <algorithm>

View File

@ -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

View File

@ -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();

View File

@ -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;

View File

@ -13,6 +13,7 @@
#include "Experimental.h"
#include "MixerBoard.h"
#include <cfloat>
#include <math.h>
#include <wx/dcmemory.h>

View File

@ -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);

View File

@ -303,7 +303,7 @@ void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(even
AudacityProject* pProject = GetActiveProject();
// If project already exits then abort - we do not allow users to overwrite an existing project
// If project already exists then abort - we do not allow users to overwrite an existing project
// unless it is the current project.
if (wxFileExists(fName) && (pProject->GetFileName() != fName)) {
wxMessageDialog m(

View File

@ -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;

View File

@ -1069,7 +1069,7 @@ void ProgressDialog::Init()
}
// Add a new text column each time this is called.
void ProgressDialog::AddMessageAsColumn(wxBoxSizer * pSizer, const wxString & sText) {
void ProgressDialog::AddMessageAsColumn(wxBoxSizer * pSizer, const wxString & sText, bool bFirstColumn) {
// Assuming that we don't want empty columns, bail out if there is no text.
if (sText.IsEmpty())
@ -1086,6 +1086,12 @@ void ProgressDialog::AddMessageAsColumn(wxBoxSizer * pSizer, const wxString & sT
wxALIGN_LEFT);
oText->SetName(sText); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
// If this is the first column then set the mMessage pointer so non-TimerRecord usages
// will still work correctly
if (bFirstColumn) {
mMessage = oText;
}
pSizer->Add(oText, 1, wxEXPAND | wxALL, 5);
}
@ -1125,7 +1131,8 @@ bool ProgressDialog::Create(const wxString & title,
auto colSizer = uColSizer.get();
for (size_t column = 0; column < arMessages.GetCount(); column++) {
AddMessageAsColumn(colSizer, arMessages[column]);
bool bFirstCol = (column == 0);
AddMessageAsColumn(colSizer, arMessages[column], bFirstCol);
}
// and put message column(s) into a main vertical sizer.

View File

@ -113,7 +113,7 @@ private:
const wxString & sTitle,
int iButtonID = -1);
void AddMessageAsColumn(wxBoxSizer * pSizer, const wxString & sText);
void AddMessageAsColumn(wxBoxSizer * pSizer, const wxString & sText, bool bFirstColumn);
private:
// This guarantees we have an active event loop...possible during OnInit()