mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-03 22:19:07 +02:00
Merge branch 'gcc_warning_fixes' by andheh
Thanks andheh.
This commit is contained in:
commit
d5dd9ff7c6
@ -2,7 +2,16 @@
|
||||
// Indirectly include Allegro header so that we can disable warnings about unused parameters
|
||||
// when compiling Audacity itself.
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// If this is compiled with MSVC (Visual Studio)
|
||||
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4100)
|
||||
#include "../portsmf/allegro.h"
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
|
||||
#else //_MSC_VER
|
||||
|
||||
#include "../portsmf/allegro.h"
|
||||
|
||||
#endif //_MSC_VER
|
||||
|
@ -2,7 +2,15 @@
|
||||
// Indirectly include SBSMS header so that we can disable warnings about unused parameters
|
||||
// when compiling Audacity itself.
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// If this is compiled with MSVC (Visual Studio)
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4100)
|
||||
#include "../sbsms/include/sbsms.h"
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
|
||||
#else //_MSC_VER
|
||||
|
||||
#include "../sbsms/include/sbsms.h"
|
||||
|
||||
#endif //_MSC_VER
|
||||
|
@ -1064,8 +1064,11 @@ void AudacityApp::OnFatalException()
|
||||
}
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// If this is compiled with MSVC (Visual Studio)
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4702) // unreachable code warning.
|
||||
#endif //_MSC_VER
|
||||
|
||||
bool AudacityApp::OnExceptionInMainLoop()
|
||||
{
|
||||
@ -1109,7 +1112,9 @@ bool AudacityApp::OnExceptionInMainLoop()
|
||||
// Shouldn't ever reach this line
|
||||
return false;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( pop )
|
||||
#endif //_MSC_VER
|
||||
|
||||
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
||||
void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)
|
||||
|
@ -551,8 +551,8 @@ struct AudioIO::ScrubQueue
|
||||
, mLeadingIdx(1)
|
||||
, mRate(rate)
|
||||
, mLastScrubTimeMillis(startClockMillis)
|
||||
, mUpdating()
|
||||
, mMaxDebt { maxDebt }
|
||||
, mUpdating()
|
||||
{
|
||||
const auto s0 = std::max(options.minSample, std::min(options.maxSample,
|
||||
sampleCount(lrint(t0 * mRate))
|
||||
@ -4020,7 +4020,7 @@ void AudioIO::FillBuffers()
|
||||
AutoSaveFile blockFileLog;
|
||||
auto numChannels = mCaptureTracks.size();
|
||||
|
||||
for( i = 0; (int)i < numChannels; i++ )
|
||||
for( i = 0; i < numChannels; i++ )
|
||||
{
|
||||
auto avail = commonlyAvail;
|
||||
sampleFormat trackFormat = mCaptureTracks[i]->GetSampleFormat();
|
||||
|
@ -206,7 +206,7 @@ wxString ApplyMacroDialog::MacroIdOfName( const wxString & MacroName )
|
||||
// Does nothing if not found, rather than returning an error.
|
||||
void ApplyMacroDialog::ApplyMacroToProject( const wxString & MacroID, bool bHasGui )
|
||||
{
|
||||
for( size_t i=0;i<mMacros->GetItemCount();i++){
|
||||
for( int i=0;i<mMacros->GetItemCount();i++){
|
||||
wxString name = mMacros->GetItemText(i);
|
||||
if( MacroIdOfName( name ) == MacroID ){
|
||||
ApplyMacroToProject( i, bHasGui );
|
||||
|
@ -1638,8 +1638,8 @@ void LabelTrack::HandleTextClick(const wxMouseEvent & evt,
|
||||
const wxRect & r, const ZoomInfo &zoomInfo,
|
||||
SelectedRegion *newSel)
|
||||
{
|
||||
r;//compiler food.
|
||||
zoomInfo;//compiler food.
|
||||
static_cast<void>(r);//compiler food.
|
||||
static_cast<void>(zoomInfo);//compiler food.
|
||||
if (evt.ButtonDown())
|
||||
{
|
||||
|
||||
@ -2166,6 +2166,7 @@ void LabelTrack::ShowContextMenu()
|
||||
int x = 0;
|
||||
bool success = CalcCursorX(&x);
|
||||
wxASSERT(success);
|
||||
static_cast<void>(success); // Suppress unused variable warning if debug mode is disabled
|
||||
|
||||
parent->PopupMenu(&menu, x, ls->y + (mIconHeight / 2) - 1);
|
||||
}
|
||||
|
@ -2286,7 +2286,7 @@ CommandFlag AudacityProject::GetUpdateFlags(bool checkActive)
|
||||
if (!EffectManager::Get().RealtimeIsActive())
|
||||
flags |= IsRealtimeNotActiveFlag;
|
||||
|
||||
if (!mIsCapturing)
|
||||
if (!mIsCapturing)
|
||||
flags |= CaptureNotBusyFlag;
|
||||
|
||||
ControlToolBar *bar = GetControlToolBar();
|
||||
@ -7272,11 +7272,11 @@ void AudacityProject::HandleMixAndRender(bool toNewTrack)
|
||||
if (t->GetLinked() || !t->GetLink())
|
||||
selectedCount++;
|
||||
|
||||
if (!toNewTrack) {
|
||||
t = iter.RemoveCurrent();
|
||||
} else {
|
||||
t = iter.Next();
|
||||
};
|
||||
if (!toNewTrack) {
|
||||
t = iter.RemoveCurrent();
|
||||
} else {
|
||||
t = iter.Next();
|
||||
};
|
||||
}
|
||||
else
|
||||
t = iter.Next();
|
||||
|
@ -914,6 +914,8 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
const wxPoint & pos,
|
||||
const wxSize & size)
|
||||
: wxFrame(parent, id, _TS("Audacity"), pos, size),
|
||||
mViewInfo(0.0, 1.0, ZoomInfo::GetDefaultZoom()),
|
||||
mbLoadedFromAup( false ),
|
||||
mRate((double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), AudioIO::GetOptimalSupportedSampleRate())),
|
||||
mDefaultFormat((sampleFormat) gPrefs->
|
||||
Read(wxT("/SamplingRate/DefaultProjectSampleFormat"), floatSample)),
|
||||
@ -921,9 +923,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
mSelectionFormat(gPrefs->Read(wxT("/SelectionFormat"), wxT(""))),
|
||||
mFrequencySelectionFormatName(gPrefs->Read(wxT("/FrequencySelectionFormatName"), wxT(""))),
|
||||
mBandwidthSelectionFormatName(gPrefs->Read(wxT("/BandwidthSelectionFormatName"), wxT(""))),
|
||||
mUndoManager(std::make_unique<UndoManager>()),
|
||||
mViewInfo(0.0, 1.0, ZoomInfo::GetDefaultZoom()),
|
||||
mbLoadedFromAup( false )
|
||||
mUndoManager(std::make_unique<UndoManager>())
|
||||
{
|
||||
mTracks = TrackList::Create();
|
||||
|
||||
@ -4490,14 +4490,16 @@ void AudacityProject::InitialState()
|
||||
|
||||
bool AudacityProject::UndoAvailable()
|
||||
{
|
||||
TrackList* trackList = GetTracks();
|
||||
return GetUndoManager()->UndoAvailable() &&
|
||||
!GetTracks()->HasPendingTracks();
|
||||
!(trackList != nullptr && trackList->HasPendingTracks());
|
||||
}
|
||||
|
||||
bool AudacityProject::RedoAvailable()
|
||||
{
|
||||
TrackList* trackList = GetTracks();
|
||||
return GetUndoManager()->RedoAvailable() &&
|
||||
!GetTracks()->HasPendingTracks();
|
||||
!(trackList != nullptr && trackList->HasPendingTracks());
|
||||
}
|
||||
|
||||
void AudacityProject::PushState(const wxString &desc, const wxString &shortDesc)
|
||||
|
@ -861,7 +861,7 @@ bool Sequence::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
||||
// The check intended here was already done in DirManager::HandleXMLTag(), where
|
||||
// it let the block be built, then checked against mMaxSamples, and deleted the block
|
||||
// if the size of the block is bigger than mMaxSamples.
|
||||
if (nValue > mMaxSamples)
|
||||
if (static_cast<unsigned long long>(nValue) > mMaxSamples)
|
||||
{
|
||||
mErrorOpening = true;
|
||||
return false;
|
||||
|
@ -332,9 +332,11 @@ bool ShuttleParams::ExchangeWithMaster(const wxString & WXUNUSED(Name))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// If this is compiled with MSVC (Visual Studio)
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable: 4100 ) // unused parameters.
|
||||
#endif //_MSC_VER
|
||||
|
||||
|
||||
// The ShouldSet and CouldGet functions have an important side effect
|
||||
@ -698,7 +700,10 @@ void ShuttleGetDefinition::DefineEnum( int&var, const wxChar * key, const int vd
|
||||
EndStruct();
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// If this is compiled with MSVC (Visual Studio)
|
||||
#pragma warning( pop )
|
||||
#endif //_MSC_VER
|
||||
|
||||
|
||||
|
||||
|
@ -2171,7 +2171,7 @@ AColor::ColorGradientChoice ChooseColorSet( float bin0, float bin1, float selBin
|
||||
if ((selBinLo < 0 || selBinLo < bin1) && (selBinHi < 0 || selBinHi > bin0))
|
||||
return AColor::ColorGradientTimeAndFrequencySelected;
|
||||
|
||||
return AColor::ColorGradientTimeSelected;
|
||||
return AColor::ColorGradientTimeSelected;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3200,8 +3200,8 @@ void TrackInfo::DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected,
|
||||
bool bHasMuteSolo, const int labelw, const int vrul) const
|
||||
{
|
||||
//compiler food.
|
||||
bHasMuteSolo;
|
||||
vrul;
|
||||
static_cast<void>(bHasMuteSolo);
|
||||
static_cast<void>(vrul);
|
||||
|
||||
// fill in label
|
||||
wxRect fill = rect;
|
||||
|
@ -263,7 +263,7 @@ WaveTrack::WaveTrackDisplay WaveTrack::FindDefaultViewMode()
|
||||
// Prefer the NEW preference key if it is present
|
||||
|
||||
WaveTrack::WaveTrackDisplay viewMode;
|
||||
gPrefs->Read(wxT("/GUI/DefaultViewModeNew"), (int*)&viewMode, -1);
|
||||
gPrefs->Read(wxT("/GUI/DefaultViewModeNew"), &viewMode, -1);
|
||||
|
||||
// Default to the old key only if not, default the value if it's not there either
|
||||
wxASSERT(WaveTrack::MinDisplay >= 0);
|
||||
|
@ -527,7 +527,9 @@ private:
|
||||
// and will be taken out of the WaveTrack class:
|
||||
//
|
||||
|
||||
enum WaveTrackDisplay {
|
||||
|
||||
typedef int WaveTrackDisplay;
|
||||
enum WaveTrackDisplayValues : int {
|
||||
|
||||
// DO NOT REORDER OLD VALUES! Replace obsoletes with placeholders.
|
||||
|
||||
|
@ -155,6 +155,7 @@ bool AudacityCommand::GetAutomationParameters(wxString & parms)
|
||||
S.mpEap = &eap;
|
||||
bool bResult = DefineParams( S );
|
||||
wxASSERT_MSG( bResult, "You did not define DefineParameters() for this command" );
|
||||
static_cast<void>(bResult); // fix unused variable warning in release mode
|
||||
|
||||
return eap.GetParameters(parms);
|
||||
}
|
||||
@ -169,6 +170,7 @@ bool AudacityCommand::SetAutomationParameters(const wxString & parms)
|
||||
S.SetForWriting( &eap );
|
||||
bool bResult = DefineParams( S );
|
||||
wxASSERT_MSG( bResult, "You did not define DefineParameters() for this command" );
|
||||
static_cast<void>(bResult); // fix unused variable warning in release mode
|
||||
if (!S.bOK)
|
||||
{
|
||||
AudacityCommand::MessageBox(
|
||||
|
@ -416,7 +416,7 @@ and may be recursive. 'Send' is the top level.
|
||||
*******************************************************************/
|
||||
|
||||
void GetInfoCommand::ExploreMenu( const CommandContext &context, wxMenu * pMenu, int Id, int depth ){
|
||||
Id;//compiler food.
|
||||
static_cast<void>(Id);//compiler food.
|
||||
if( !pMenu )
|
||||
return;
|
||||
|
||||
@ -572,7 +572,7 @@ void GetInfoCommand::ExploreTrackPanel( const CommandContext &context,
|
||||
void GetInfoCommand::ExploreWindows( const CommandContext &context,
|
||||
wxPoint P, wxWindow * pWin, int Id, int depth )
|
||||
{
|
||||
Id;//Compiler food.
|
||||
static_cast<void>(Id);//Compiler food.
|
||||
|
||||
if( pWin->GetName() == "Track Panel" )
|
||||
{
|
||||
|
@ -7,11 +7,11 @@
|
||||
Dominic Mazzoni
|
||||
James Crook
|
||||
|
||||
/**************************************************************************//**
|
||||
**************************************************************************//**
|
||||
\class BuiltinCommandsModule
|
||||
\brief Internal module to auto register all built in commands. It is closely
|
||||
modelled on BuiltinEffectsModule
|
||||
********************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "../Prefs.h"
|
||||
@ -271,7 +271,7 @@ unsigned BuiltinCommandsModule::DiscoverPluginsAtPath(
|
||||
bool BuiltinCommandsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||
{
|
||||
// bFast is unused as checking in the list is fast.
|
||||
bFast;
|
||||
static_cast<void>(bFast); // avoid unused variable warning
|
||||
return mNames.Index(path) != wxNOT_FOUND;
|
||||
}
|
||||
|
||||
|
@ -371,10 +371,11 @@ bool ScreenshotCommand::CaptureDock(
|
||||
return Capture(context, mFileName, win, wxRect(x, y, width, height));
|
||||
}
|
||||
|
||||
void ExploreMenu(
|
||||
void ExploreMenu(
|
||||
const CommandContext & context,
|
||||
wxMenu * pMenu, int Id, int depth ){
|
||||
Id;//compiler food.
|
||||
static_cast<void>(Id);//compiler food.
|
||||
|
||||
if( !pMenu )
|
||||
return;
|
||||
|
||||
@ -482,7 +483,7 @@ void ScreenshotCommand::CapturePreferences(
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenshotCommand::CaptureEffects(
|
||||
void ScreenshotCommand::CaptureEffects(
|
||||
const CommandContext & context,
|
||||
AudacityProject * pProject, const wxString &mFileName )
|
||||
{
|
||||
|
@ -50,7 +50,6 @@ private:
|
||||
bool mbBringToTop;
|
||||
bool bHasBackground;
|
||||
bool bHasBringToTop;
|
||||
friend class ScreenshotCommand;
|
||||
friend class ScreenFrame;
|
||||
|
||||
public:
|
||||
|
@ -167,7 +167,7 @@ bool SetTrackCommand::Apply(const CommandContext & context)
|
||||
bool bIsSecondChannel = false;
|
||||
while (t )
|
||||
{
|
||||
bool bThisTrack =
|
||||
bool bThisTrack =
|
||||
(bHasTrackIndex && (i==mTrackIndex)) ||
|
||||
(bHasChannelIndex && (j==mChannelIndex ) ) ||
|
||||
(!bHasTrackIndex && !bHasChannelIndex) ;
|
||||
@ -191,9 +191,9 @@ bool SetTrackCommand::Apply(const CommandContext & context)
|
||||
|
||||
if( wt && bHasDisplayType )
|
||||
wt->SetDisplay(
|
||||
(mDisplayType == kWaveform) ?
|
||||
WaveTrack::WaveTrackDisplay::Waveform
|
||||
: WaveTrack::WaveTrackDisplay::Spectrum
|
||||
(mDisplayType == kWaveform) ?
|
||||
WaveTrack::WaveTrackDisplayValues::Waveform
|
||||
: WaveTrack::WaveTrackDisplayValues::Spectrum
|
||||
);
|
||||
if( wt && bHasScaleType )
|
||||
wt->GetIndependentWaveformSettings().scaleType =
|
||||
|
@ -775,7 +775,7 @@ inline long TrapLong(long x, long min, long max)
|
||||
static const type SCL_ ## name = (scale);
|
||||
|
||||
#define ReadParam(type, name) \
|
||||
type name; \
|
||||
type name = DEF_ ## name; \
|
||||
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, MIN_ ## name, MAX_ ## name)) \
|
||||
return false;
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
Dominic Mazzoni
|
||||
|
||||
/**************************************************************************//**
|
||||
**************************************************************************//**
|
||||
\class BuiltinEffectsModule
|
||||
\brief Internal module to auto register all built in effects.
|
||||
********************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "../Prefs.h"
|
||||
@ -334,7 +334,7 @@ unsigned BuiltinEffectsModule::DiscoverPluginsAtPath(
|
||||
bool BuiltinEffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||
{
|
||||
// bFast is unused as checking in the list is fast.
|
||||
bFast;
|
||||
static_cast<void>(bFast);
|
||||
return mNames.Index(path) != wxNOT_FOUND;
|
||||
}
|
||||
|
||||
|
@ -419,8 +419,8 @@ PaulStretch::PaulStretch(float rap_, size_t in_bufsize_, float samplerate_ )
|
||||
, in_pool { poolsize, true }
|
||||
, remained_samples { 0.0 }
|
||||
, fft_smps { poolsize, true }
|
||||
, fft_s { poolsize, true }
|
||||
, fft_c { poolsize, true }
|
||||
, fft_s { poolsize, true }
|
||||
, fft_freq { poolsize, true }
|
||||
, fft_tmp { poolsize }
|
||||
{
|
||||
|
@ -192,7 +192,7 @@ bool LadspaEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm)
|
||||
wxArrayString files;
|
||||
wxString ignoredErrMsg;
|
||||
|
||||
for (int i = 0; i < WXSIZEOF(kShippedEffects); i++)
|
||||
for (int i = 0; i < (int)WXSIZEOF(kShippedEffects); i++)
|
||||
{
|
||||
files.Clear();
|
||||
pm.FindFilesInPathList(kShippedEffects[i], pathList, files);
|
||||
|
@ -250,7 +250,7 @@ bool NyquistEffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||
{
|
||||
// Ignores bFast parameter, since checking file exists is fast enough for
|
||||
// the small number of Nyquist plug-ins that we have.
|
||||
bFast;
|
||||
static_cast<void>(bFast);
|
||||
if((path == NYQUIST_PROMPT_ID) || (path == NYQUIST_TOOLS_PROMPT_ID))
|
||||
return true;
|
||||
|
||||
|
@ -274,7 +274,7 @@ bool VampEffect::SetAutomationParameters(CommandParameters & parms)
|
||||
!mParameters[p].valueNames.empty())
|
||||
{
|
||||
wxArrayString choices;
|
||||
int val;
|
||||
int val = 0;
|
||||
|
||||
for (size_t i = 0, cnt = mParameters[p].valueNames.size(); i < cnt; i++)
|
||||
{
|
||||
|
@ -810,7 +810,7 @@ public:
|
||||
};
|
||||
|
||||
MP3Exporter();
|
||||
virtual ~MP3Exporter();
|
||||
~MP3Exporter();
|
||||
|
||||
#ifndef DISABLE_DYNAMIC_LOADING_LAME
|
||||
bool FindLibrary(wxWindow *parent);
|
||||
@ -1625,7 +1625,7 @@ private:
|
||||
int FindValue(CHOICES *choices, int cnt, int needle, int def);
|
||||
wxString FindName(CHOICES *choices, int cnt, int needle);
|
||||
int AskResample(int bitrate, int rate, int lowrate, int highrate);
|
||||
int AddTags(AudacityProject *project, ArrayOf<char> &buffer, bool *endOfFile, const Tags *tags);
|
||||
id3_length_t AddTags(AudacityProject *project, ArrayOf<char> &buffer, bool *endOfFile, const Tags *tags);
|
||||
#ifdef USE_LIBID3TAG
|
||||
void AddFrame(struct id3_tag *tp, const wxString & n, const wxString & v, const char *name);
|
||||
#endif
|
||||
@ -1806,11 +1806,10 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
|
||||
}
|
||||
|
||||
ArrayOf<char> id3buffer;
|
||||
int id3len;
|
||||
bool endOfFile;
|
||||
id3len = AddTags(project, id3buffer, &endOfFile, metadata);
|
||||
id3_length_t id3len = AddTags(project, id3buffer, &endOfFile, metadata);
|
||||
if (id3len && !endOfFile) {
|
||||
if (id3len > (int)outFile.Write(id3buffer.get(), id3len)) {
|
||||
if (id3len > outFile.Write(id3buffer.get(), id3len)) {
|
||||
// TODO: more precise message
|
||||
AudacityMessageBox(_("Unable to export"));
|
||||
return ProgressResult::Cancelled;
|
||||
@ -1819,7 +1818,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
|
||||
|
||||
wxFileOffset pos = outFile.Tell();
|
||||
auto updateResult = ProgressResult::Success;
|
||||
long bytes;
|
||||
int bytes = 0;
|
||||
|
||||
size_t bufferSize = std::max(0, exporter.GetOutBufferSize());
|
||||
if (bufferSize <= 0) {
|
||||
@ -2058,7 +2057,7 @@ using id3_tag_holder = std::unique_ptr<id3_tag, id3_tag_deleter>;
|
||||
#endif
|
||||
|
||||
// returns buffer len; caller frees
|
||||
int ExportMP3::AddTags(AudacityProject *WXUNUSED(project), ArrayOf<char> &buffer, bool *endOfFile, const Tags *tags)
|
||||
id3_length_t ExportMP3::AddTags(AudacityProject *WXUNUSED(project), ArrayOf<char> &buffer, bool *endOfFile, const Tags *tags)
|
||||
{
|
||||
#ifdef USE_LIBID3TAG
|
||||
id3_tag_holder tp { id3_tag_new() };
|
||||
|
@ -133,7 +133,7 @@ ExportPCMOptions::ExportPCMOptions(wxWindow *parent, int selformat)
|
||||
{
|
||||
int format;
|
||||
|
||||
if (selformat < 0 || selformat >= WXSIZEOF(kFormats))
|
||||
if (selformat < 0 || static_cast<unsigned int>(selformat) >= WXSIZEOF(kFormats))
|
||||
{
|
||||
format = ReadExportFormatPref();
|
||||
}
|
||||
@ -405,7 +405,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
|
||||
const TrackList *tracks = project->GetTracks();
|
||||
int sf_format;
|
||||
|
||||
if (subformat < 0 || subformat >= WXSIZEOF(kFormats))
|
||||
if (subformat < 0 || static_cast<unsigned int>(subformat) >= WXSIZEOF(kFormats))
|
||||
{
|
||||
sf_format = ReadExportFormatPref();
|
||||
}
|
||||
@ -501,7 +501,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
|
||||
|
||||
while (updateResult == ProgressResult::Success) {
|
||||
sf_count_t samplesWritten;
|
||||
auto numSamples = mixer->Process(maxBlockLen);
|
||||
size_t numSamples = mixer->Process(maxBlockLen);
|
||||
|
||||
if (numSamples == 0)
|
||||
break;
|
||||
@ -513,7 +513,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
|
||||
else
|
||||
samplesWritten = SFCall<sf_count_t>(sf_writef_float, sf.get(), (float *)mixed, numSamples);
|
||||
|
||||
if (samplesWritten != numSamples) {
|
||||
if (static_cast<size_t>(samplesWritten) != numSamples) {
|
||||
char buffer2[1000];
|
||||
sf_error_str(sf.get(), buffer2, 1000);
|
||||
AudacityMessageBox(wxString::Format(
|
||||
@ -871,7 +871,7 @@ wxWindow *ExportPCM::OptionsCreate(wxWindow *parent, int format)
|
||||
{
|
||||
wxASSERT(parent); // to justify safenew
|
||||
// default, full user control
|
||||
if (format < 0 || format >= WXSIZEOF(kFormats))
|
||||
if (format < 0 || static_cast<unsigned int>(format) >= WXSIZEOF(kFormats))
|
||||
{
|
||||
return safenew ExportPCMOptions(parent, format);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ extern "C" {
|
||||
|
||||
#include "../WaveTrack.h"
|
||||
|
||||
#define INPUT_BUFFER_SIZE 65535u
|
||||
#define INPUT_BUFFER_SIZE 65535
|
||||
#define PROGRESS_SCALING_FACTOR 100000
|
||||
|
||||
/* this is a private structure we can use for whatever we like, and it will get
|
||||
@ -94,7 +94,7 @@ extern "C" {
|
||||
* things. */
|
||||
struct private_data {
|
||||
wxFile *file; /* the file containing the mp3 data we're feeding the encoder */
|
||||
ArrayOf<unsigned char> inputBuffer{ INPUT_BUFFER_SIZE };
|
||||
ArrayOf<unsigned char> inputBuffer{ static_cast<unsigned int>(INPUT_BUFFER_SIZE) };
|
||||
int inputBufferFill; /* amount of data in inputBuffer */
|
||||
TrackFactory *trackFactory;
|
||||
TrackHolders channels;
|
||||
@ -535,7 +535,7 @@ enum mad_flow output_cb(void *_data,
|
||||
floatSample,
|
||||
samples);
|
||||
|
||||
return MAD_FLOW_CONTINUE;
|
||||
return MAD_FLOW_CONTINUE;
|
||||
}, MakeSimpleGuard(MAD_FLOW_BREAK) );
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,8 @@ public:
|
||||
// Do not assume that this enumeration will remain the
|
||||
// same as NumberScaleType in future. That enum may become
|
||||
// more general purpose.
|
||||
enum ScaleType {
|
||||
typedef int ScaleType;
|
||||
enum ScaleTypeValues : int {
|
||||
stLinear,
|
||||
stLogarithmic,
|
||||
stMel,
|
||||
@ -131,7 +132,8 @@ public:
|
||||
bool spectralSelection; // But should this vary per track? -- PRL
|
||||
#endif
|
||||
|
||||
enum Algorithm {
|
||||
typedef int Algorithm;
|
||||
enum AlgorithmValues : int {
|
||||
algSTFT = 0,
|
||||
algReassignment,
|
||||
algPitchEAC,
|
||||
|
@ -176,7 +176,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
S.StartTwoColumn();
|
||||
{
|
||||
S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")),
|
||||
*(int*)&mTempSettings.scaleType,
|
||||
mTempSettings.scaleType,
|
||||
&mScaleChoices);
|
||||
|
||||
mMinFreq =
|
||||
@ -226,7 +226,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
{
|
||||
mAlgorithmChoice =
|
||||
S.Id(ID_ALGORITHM).TieChoice(_("A&lgorithm") + wxString(wxT(":")),
|
||||
*(int*)&mTempSettings.algorithm,
|
||||
mTempSettings.algorithm,
|
||||
&mAlgorithmChoices);
|
||||
|
||||
S.Id(ID_WINDOW_SIZE).TieChoice(_("Window &size:"),
|
||||
|
@ -92,12 +92,12 @@ void WaveformPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
{
|
||||
mScaleChoice =
|
||||
S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")),
|
||||
*(int*)&mTempSettings.scaleType,
|
||||
mTempSettings.scaleType,
|
||||
&mScaleChoices);
|
||||
|
||||
mRangeChoice =
|
||||
S.Id(ID_RANGE).TieChoice(_("Waveform dB &range") + wxString(wxT(":")),
|
||||
*(int*)&mTempSettings.dBRange,
|
||||
mTempSettings.dBRange,
|
||||
&mRangeChoices);
|
||||
S.SetSizeHints(mRangeChoices);
|
||||
}
|
||||
|
@ -50,7 +50,8 @@ public:
|
||||
void NextLowerDBRange();
|
||||
void NextHigherDBRange();
|
||||
|
||||
enum ScaleType {
|
||||
typedef int ScaleType;
|
||||
enum ScaleTypeValues : int {
|
||||
stLinear,
|
||||
stLogarithmic,
|
||||
|
||||
|
@ -125,13 +125,13 @@ END_EVENT_TABLE()
|
||||
|
||||
SelectionBar::SelectionBar()
|
||||
: ToolBar(SelectionBarID, _("Selection"), wxT("Selection")),
|
||||
mListener(NULL), mRate(0.0),
|
||||
mListener(NULL), mRate(0.0),
|
||||
mStart(0.0), mEnd(0.0), mLength(0.0), mCenter(0.0), mAudio(0.0),
|
||||
mStartTime(NULL), mEndTime(NULL), mLengthTime(NULL), mCenterTime(NULL),
|
||||
mAudioTime(NULL),
|
||||
mChoice(NULL),
|
||||
mDrive1( StartTimeID), mDrive2( EndTimeID ),
|
||||
mSelectionMode(0)
|
||||
mSelectionMode(0),
|
||||
mStartTime(NULL), mCenterTime(NULL), mLengthTime(NULL), mEndTime(NULL),
|
||||
mAudioTime(NULL),
|
||||
mChoice(NULL)
|
||||
{
|
||||
// Make sure we have a valid rate as the NumericTextCtrl()s
|
||||
// created in Populate()
|
||||
|
@ -26,9 +26,9 @@ Paul Licameli split from TrackPanel.cpp
|
||||
LabelGlyphHandle::LabelGlyphHandle
|
||||
(const std::shared_ptr<LabelTrack> &pLT,
|
||||
const wxRect &rect, const LabelTrackHit &hit)
|
||||
: mpLT{ pLT }
|
||||
: mHit{ hit }
|
||||
, mpLT{ pLT }
|
||||
, mRect{ rect }
|
||||
, mHit{ hit }
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,7 @@ namespace
|
||||
|
||||
NoteTrackVZoomHandle::NoteTrackVZoomHandle
|
||||
(const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect, int y)
|
||||
: mZoomStart(y), mZoomEnd(y), mRect(rect)
|
||||
, mpTrack{ pTrack }
|
||||
: mpTrack{ pTrack } , mZoomStart(y), mZoomEnd(y), mRect(rect)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -66,11 +66,11 @@ public:
|
||||
bool StopsOnKeystroke() override { return true; }
|
||||
|
||||
private:
|
||||
std::shared_ptr<WaveTrack> mpTrack{};
|
||||
enum Operation { Merge, Expand, Remove };
|
||||
Operation mOperation{ Merge };
|
||||
double mStartTime{}, mEndTime{};
|
||||
WaveTrackLocation mLocation {};
|
||||
std::shared_ptr<WaveTrack> mpTrack{};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -49,8 +49,7 @@ bool IsDragZooming(int zoomStart, int zoomEnd)
|
||||
|
||||
WaveTrackVZoomHandle::WaveTrackVZoomHandle
|
||||
(const std::shared_ptr<WaveTrack> &pTrack, const wxRect &rect, int y)
|
||||
: mZoomStart(y), mZoomEnd(y), mRect(rect)
|
||||
, mpTrack{ pTrack }
|
||||
: mpTrack{ pTrack } , mZoomStart(y), mZoomEnd(y), mRect(rect)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,8 @@ void Scrubber::ScrubPoller::Notify()
|
||||
}
|
||||
|
||||
Scrubber::Scrubber(AudacityProject *project)
|
||||
: mScrubToken(-1)
|
||||
: mInOneShotMode( false )
|
||||
, mScrubToken(-1)
|
||||
, mPaused(true)
|
||||
, mScrubSpeedDisplayCountdown(0)
|
||||
, mScrubStartPosition(-1)
|
||||
@ -195,7 +196,6 @@ Scrubber::Scrubber(AudacityProject *project)
|
||||
, mProject(project)
|
||||
, mPoller { std::make_unique<ScrubPoller>(*this) }
|
||||
, mOptions {}
|
||||
, mInOneShotMode( false )
|
||||
|
||||
{
|
||||
if (wxTheApp)
|
||||
|
@ -411,6 +411,8 @@ UIHandlePtr SelectHandle::HitTest
|
||||
wxInt64 rightSel = viewInfo.TimeToPosition(viewInfo.selectedRegion.t1(), rect.x);
|
||||
// Something is wrong if right edge comes before left edge
|
||||
wxASSERT(!(rightSel < leftSel));
|
||||
static_cast<void>(leftSel); // Suppress unused variable warnings if not in debug-mode
|
||||
static_cast<void>(rightSel);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -18,9 +18,9 @@ Paul Licameli
|
||||
|
||||
SliderHandle::SliderHandle
|
||||
( SliderFn sliderFn, const wxRect &rect, const std::shared_ptr<Track> &pTrack )
|
||||
: mSliderFn{ sliderFn }
|
||||
: mpTrack{ pTrack }
|
||||
, mRect{ rect }
|
||||
, mpTrack{ pTrack }
|
||||
, mSliderFn{ sliderFn }
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user