From 991ba8cc6eb9baf42b42793bbfc59086960d2c3b Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 5 Jul 2015 01:55:40 -0400 Subject: [PATCH 1/8] Remove TimeTrack.h from other headers --- src/Mix.cpp | 1 + src/Mix.h | 1 - src/Track.cpp | 1 - src/export/Export.cpp | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Mix.cpp b/src/Mix.cpp index 50fc15614..c2a74860f 100644 --- a/src/Mix.cpp +++ b/src/Mix.cpp @@ -40,6 +40,7 @@ #include "Prefs.h" #include "Project.h" #include "Resample.h" +#include "TimeTrack.h" #include "float_cast.h" //TODO-MB: wouldn't it make more sense to delete the time track after 'mix and render'? diff --git a/src/Mix.h b/src/Mix.h index b4274d589..357d6d943 100644 --- a/src/Mix.h +++ b/src/Mix.h @@ -16,7 +16,6 @@ #include "SampleFormat.h" #include "WaveTrack.h" -#include "TimeTrack.h" #include "Resample.h" class DirManager; diff --git a/src/Track.cpp b/src/Track.cpp index ae91bd270..f25b20918 100644 --- a/src/Track.cpp +++ b/src/Track.cpp @@ -25,7 +25,6 @@ and TimeTrack. #include "NoteTrack.h" #include "LabelTrack.h" #include "Project.h" -#include "TimeTrack.h" #include "DirManager.h" #ifdef _MSC_VER diff --git a/src/export/Export.cpp b/src/export/Export.cpp index 206d007c8..6a02b36f0 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -75,7 +75,6 @@ #include "../WaveTrack.h" #include "../widgets/Warning.h" #include "../AColor.h" -#include "../TimeTrack.h" #include "../Dependencies.h" // Callback to display format options From b89c2a130cad1eb0cd618f6996c51f1657885b28 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 4 Jul 2015 20:49:03 -0400 Subject: [PATCH 2/8] Remove Track.h from other headers --- src/LabelDialog.cpp | 1 - src/Printing.cpp | 1 - src/Project.cpp | 1 - src/Snap.h | 3 ++- src/TrackArtist.cpp | 1 - src/TrackPanel.cpp | 1 - src/UndoManager.cpp | 1 - src/commands/GetProjectInfoCommand.h | 1 - src/effects/ChangeSpeed.h | 1 - src/export/ExportFFmpegDialogs.cpp | 2 -- src/export/ExportMultiple.cpp | 14 ++++++++------ src/export/ExportMultiple.h | 5 +++-- src/import/Import.cpp | 1 - src/widgets/NumericTextCtrl.h | 2 ++ 14 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 590781693..64624127c 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -35,7 +35,6 @@ #include "LabelTrack.h" #include "Prefs.h" #include "Project.h" -#include "Track.h" #include "ViewInfo.h" #include "widgets/NumericTextCtrl.h" diff --git a/src/Printing.cpp b/src/Printing.cpp index 3e9f8974d..18362f1e9 100644 --- a/src/Printing.cpp +++ b/src/Printing.cpp @@ -25,7 +25,6 @@ #include #include "AColor.h" -#include "Track.h" #include "TrackArtist.h" #include "ViewInfo.h" #include "WaveTrack.h" diff --git a/src/Project.cpp b/src/Project.cpp index 62966b248..df55c5c7e 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -113,7 +113,6 @@ scroll information. It also has some status flags. #include "Snap.h" #include "Tags.h" #include "TimeTrack.h" -#include "Track.h" #include "TrackPanel.h" #include "WaveTrack.h" #include "DirManager.h" diff --git a/src/Snap.h b/src/Snap.h index a3e9fe82c..e6aae41c5 100644 --- a/src/Snap.h +++ b/src/Snap.h @@ -18,9 +18,10 @@ #include #include -#include "Track.h" #include "widgets/NumericTextCtrl.h" +class Track; +class TrackList; class TrackClipArray; class ZoomInfo; diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index bf76082a0..17b4a7c04 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -169,7 +169,6 @@ audio tracks. #include "BlockFile.h" #include "Envelope.h" #include "NumberScale.h" -#include "Track.h" #include "WaveTrack.h" #include "LabelTrack.h" #include "TimeTrack.h" diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 861d58eef..a9f79f4d3 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -208,7 +208,6 @@ is time to refresh some aspect of the screen. #include "ShuttleGui.h" #include "Theme.h" #include "TimeTrack.h" -#include "Track.h" #include "TrackArtist.h" #include "TrackPanelAx.h" #include "ViewInfo.h" diff --git a/src/UndoManager.cpp b/src/UndoManager.cpp index 0c9ecfd9c..ba8ecbef9 100644 --- a/src/UndoManager.cpp +++ b/src/UndoManager.cpp @@ -28,7 +28,6 @@ UndoManager #include "Diags.h" #include "Internat.h" #include "Sequence.h" -#include "Track.h" #include "WaveTrack.h" // temp #include "NoteTrack.h" // for Sonify* function declarations #include "Diags.h" diff --git a/src/commands/GetProjectInfoCommand.h b/src/commands/GetProjectInfoCommand.h index 6f9942c15..df181a065 100644 --- a/src/commands/GetProjectInfoCommand.h +++ b/src/commands/GetProjectInfoCommand.h @@ -18,7 +18,6 @@ #include "Command.h" #include "CommandType.h" -#include "../Track.h" class GetProjectInfoCommandType : public CommandType { diff --git a/src/effects/ChangeSpeed.h b/src/effects/ChangeSpeed.h index 67a6c912b..3648b5a4a 100644 --- a/src/effects/ChangeSpeed.h +++ b/src/effects/ChangeSpeed.h @@ -19,7 +19,6 @@ #include #include -#include "../Track.h" #include "../WaveTrack.h" #include "../widgets/NumericTextCtrl.h" diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index aeb374f59..93de6aa88 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -61,8 +61,6 @@ #include "../Prefs.h" #include "../Project.h" #include "../Tags.h" -#include "../Track.h" -#include "../WaveTrack.h" #include "Export.h" diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index deeb7f30c..139be1666 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -104,6 +104,7 @@ END_EVENT_TABLE() ExportMultiple::ExportMultiple(AudacityProject *project) : wxDialog(project, wxID_ANY, wxString(_("Export Multiple"))) +, mIterator(new TrackListIterator) { SetName(GetTitle()); @@ -137,6 +138,7 @@ ExportMultiple::ExportMultiple(AudacityProject *project) ExportMultiple::~ExportMultiple() { + delete mIterator; } void ExportMultiple::CountTracksAndLabels() @@ -146,7 +148,7 @@ void ExportMultiple::CountTracksAndLabels() mNumWaveTracks = 0; Track* pTrack; - for (pTrack = mIterator.First(mTracks); pTrack != NULL; pTrack = mIterator.Next()) + for (pTrack = mIterator->First(mTracks); pTrack != NULL; pTrack = mIterator->Next()) { switch (pTrack->GetKind()) { @@ -731,7 +733,7 @@ int ExportMultiple::ExportMultipleByTrack(bool byName, wxString title; // un-messed-with title of file for tagging with /* Remember which tracks were selected, and set them to unselected */ - for (tr = mIterator.First(mTracks); tr != NULL; tr = mIterator.Next()) { + for (tr = mIterator->First(mTracks); tr != NULL; tr = mIterator->Next()) { if (tr->GetKind() != Track::Wave) { continue; } @@ -747,7 +749,7 @@ int ExportMultiple::ExportMultipleByTrack(bool byName, } /* Examine all tracks in turn, collecting export information */ - for (tr = mIterator.First(mTracks); tr != NULL; tr = mIterator.Next()) { + for (tr = mIterator->First(mTracks); tr != NULL; tr = mIterator->Next()) { // Want only non-muted wave tracks. if ((tr->GetKind() != Track::Wave) || tr->GetMute()) @@ -760,7 +762,7 @@ int ExportMultiple::ExportMultipleByTrack(bool byName, // Check for a linked track tr2 = NULL; if (tr->GetLinked()) { - tr2 = mIterator.Next(); + tr2 = mIterator->Next(); if (tr2) { // Make sure it gets included @@ -830,7 +832,7 @@ int ExportMultiple::ExportMultipleByTrack(bool byName, // loop int count = 0; // count the number of sucessful runs ExportKit activeSetting; // pointer to the settings in use for this export - for (tr = mIterator.First(mTracks); tr != NULL; tr = mIterator.Next()) { + for (tr = mIterator->First(mTracks); tr != NULL; tr = mIterator->Next()) { // Want only non-muted wave tracks. if ((tr->GetKind() != Track::Wave) || (tr->GetMute() == true)) { @@ -843,7 +845,7 @@ int ExportMultiple::ExportMultipleByTrack(bool byName, // Check for a linked track tr2 = NULL; if (tr->GetLinked()) { - tr2 = mIterator.Next(); + tr2 = mIterator->Next(); if (tr2) { // Select it also tr2->SetSelected(true); diff --git a/src/export/ExportMultiple.h b/src/export/ExportMultiple.h index a1cc8324a..06304cb86 100644 --- a/src/export/ExportMultiple.h +++ b/src/export/ExportMultiple.h @@ -17,7 +17,6 @@ #include #include "Export.h" -#include "../Track.h" #include "../Tags.h" // we need to know about the Tags class for metadata class wxButton; @@ -27,7 +26,9 @@ class wxRadioButton; class wxTextCtrl; class AudacityProject; +class LabelTrack; class ShuttleGui; +class TrackListIterator; class ExportMultiple : public wxDialog { @@ -107,7 +108,7 @@ private: AudacityProject *mProject; TrackList *mTracks; /**< The list of tracks in the project that is being exported */ - TrackListIterator mIterator; /**< Iterator used to work through all the + TrackListIterator *mIterator; /**< Iterator used to work through all the tracks in the project */ LabelTrack *mLabels; int mNumLabels; diff --git a/src/import/Import.cpp b/src/import/Import.cpp index eff3e380a..b211bf6f8 100644 --- a/src/import/Import.cpp +++ b/src/import/Import.cpp @@ -58,7 +58,6 @@ and ImportLOF.cpp. #include "ImportFLAC.h" #include "ImportFFmpeg.h" #include "ImportGStreamer.h" -#include "../Track.h" #include "../Prefs.h" WX_DEFINE_LIST(ImportPluginList); diff --git a/src/widgets/NumericTextCtrl.h b/src/widgets/NumericTextCtrl.h index 9e1e20aaa..be5c8d495 100644 --- a/src/widgets/NumericTextCtrl.h +++ b/src/widgets/NumericTextCtrl.h @@ -23,6 +23,8 @@ #include #include +#include "../Audacity.h" + #if wxUSE_ACCESSIBILITY #include #endif From d39eaa4e65c6f8d4682d7e746ed5851c06756bb4 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 3 Jul 2015 00:20:21 -0400 Subject: [PATCH 3/8] Remove WaveTrack.h from other headers --- src/AudioIO.cpp | 105 +++++++++--------- src/AudioIO.h | 9 +- src/AutoRecovery.cpp | 2 + src/BatchCommands.cpp | 3 +- src/BlockFile.cpp | 3 +- src/BlockFile.h | 6 +- src/Dependencies.cpp | 6 +- src/Dependencies.h | 1 + src/DirManager.cpp | 4 +- src/DirManager.h | 6 +- src/FreqWindow.cpp | 2 + src/Menus.cpp | 4 +- src/Mix.h | 5 +- src/MixerBoard.cpp | 5 +- src/Project.cpp | 9 +- src/Project.h | 15 ++- src/Screenshot.cpp | 2 + src/Snap.cpp | 1 + src/Spectrum.h | 1 - src/TimerRecordDialog.cpp | 1 + src/TrackArtist.cpp | 2 +- src/TrackPanel.cpp | 4 +- src/TrackPanel.h | 7 +- src/TrackPanelAx.cpp | 8 +- src/VoiceKey.cpp | 2 + src/VoiceKey.h | 10 +- src/WaveClip.cpp | 1 + src/WaveTrack.cpp | 4 +- src/WaveTrack.h | 23 +--- src/WaveTrackLocation.h | 32 ++++++ src/commands/CompareAudioCommand.cpp | 1 + src/commands/GetProjectInfoCommand.cpp | 21 +++- src/commands/GetProjectInfoCommand.h | 8 +- src/commands/GetTrackInfoCommand.cpp | 1 - src/commands/ImportExportCommands.cpp | 1 + src/commands/ScreenshotCommand.cpp | 1 + src/commands/SelectCommand.cpp | 1 + src/commands/SetProjectInfoCommand.cpp | 1 - src/effects/AutoDuck.cpp | 2 + src/effects/AutoDuck.h | 2 - src/effects/ChangeSpeed.cpp | 4 +- src/effects/ChangeSpeed.h | 1 - src/effects/ClickRemoval.cpp | 2 + src/effects/ClickRemoval.h | 1 - src/effects/Compressor.cpp | 2 + src/effects/Effect.cpp | 5 + src/effects/Effect.h | 9 +- src/effects/Equalization.cpp | 4 +- src/effects/Equalization.h | 1 - src/effects/FindClipping.cpp | 2 + src/effects/FindClipping.h | 1 - src/effects/Generator.cpp | 4 +- src/effects/NoiseReduction.cpp | 2 + src/effects/Normalize.cpp | 3 +- src/effects/Normalize.h | 2 - src/effects/Paulstretch.cpp | 2 + src/effects/Paulstretch.h | 2 - src/effects/Reverse.cpp | 4 +- src/effects/Reverse.h | 2 - src/effects/Silence.cpp | 1 + src/effects/Silence.h | 1 - src/effects/StereoToMono.cpp | 4 +- src/effects/TwoPassSimpleMono.cpp | 2 + src/effects/vamp/VampEffect.cpp | 2 + src/export/Export.cpp | 1 - src/export/ExportCL.cpp | 3 + src/export/ExportFFmpeg.cpp | 1 - src/export/ExportFLAC.cpp | 2 + src/export/ExportMP2.cpp | 2 +- src/export/ExportMP3.cpp | 2 +- src/export/ExportMultiple.cpp | 1 + src/export/ExportOGG.cpp | 1 + src/export/ExportPCM.cpp | 1 - src/import/ImportLOF.cpp | 1 - src/ondemand/ODComputeSummaryTask.cpp | 1 + src/ondemand/ODDecodeTask.cpp | 1 + src/prefs/KeyConfigPrefs.cpp | 4 +- src/prefs/KeyConfigPrefs.h | 2 + src/prefs/QualityPrefs.cpp | 3 +- src/prefs/WaveformPrefs.cpp | 1 + src/toolbars/ControlToolBar.cpp | 4 +- src/toolbars/EditToolBar.cpp | 1 + win/Projects/Audacity/Audacity.vcxproj | 1 + .../Audacity/Audacity.vcxproj.filters | 3 + 84 files changed, 269 insertions(+), 152 deletions(-) create mode 100644 src/WaveTrackLocation.h diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index b8c6c2906..5f5a27ae4 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -265,8 +265,9 @@ writing audio. *//*******************************************************************/ #include "Audacity.h" -#include "float_cast.h" #include "Experimental.h" +#include "AudioIO.h" +#include "float_cast.h" #include #include @@ -294,7 +295,6 @@ writing audio. #include #include "AudacityApp.h" -#include "AudioIO.h" #include "Mix.h" #include "MixerBoard.h" #include "Resample.h" @@ -856,6 +856,8 @@ bool AudioIO::ValidateDeviceNames(wxString play, wxString rec) AudioIO::AudioIO() { + mCaptureTracks = mPlaybackTracks = NULL; + mAudioThreadShouldCallFillBuffersOnce = false; mAudioThreadFillBuffersLoopRunning = false; mAudioThreadFillBuffersLoopActive = false; @@ -992,6 +994,9 @@ AudioIO::~AudioIO() #ifdef EXPERIMENTAL_SCRUBBING_SUPPORT delete mScrubQueue; #endif + + delete mCaptureTracks; + delete mPlaybackTracks; } void AudioIO::SetMixer(int inputSource) @@ -1542,8 +1547,8 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, mTime = t0; mSeek = 0; mLastRecordingOffset = 0; - mPlaybackTracks = playbackTracks; - mCaptureTracks = captureTracks; + mPlaybackTracks = new WaveTrackArray(playbackTracks); + mCaptureTracks = new WaveTrackArray(captureTracks); #ifdef EXPERIMENTAL_MIDI_OUT mMidiPlaybackTracks = midiPlaybackTracks; #endif @@ -1563,7 +1568,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, double minScrubStutter = options.minScrubStutter; if (scrubbing) { - if (mCaptureTracks.GetCount() > 0 || + if (mCaptureTracks->GetCount() > 0 || mPlayMode == PLAY_LOOPED || mTimeTrack != NULL || options.maxScrubSpeed < GetMinScrubSpeed()) @@ -1625,8 +1630,8 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, // Capacity of the playback buffer. mPlaybackRingBufferSecs = 10.0; - mCaptureRingBufferSecs = 4.5 + 0.5 * std::min(size_t(16), mCaptureTracks.GetCount()); - mMinCaptureSecsToCopy = 0.2 + 0.2 * std::min(size_t(16), mCaptureTracks.GetCount()); + mCaptureRingBufferSecs = 4.5 + 0.5 * std::min(size_t(16), mCaptureTracks->GetCount()); + mMinCaptureSecsToCopy = 0.2 + 0.2 * std::min(size_t(16), mCaptureTracks->GetCount()); unsigned int playbackChannels = 0; unsigned int captureChannels = 0; @@ -1641,7 +1646,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, if( captureTracks.GetCount() > 0 ) { // For capture, every input channel gets its own track - captureChannels = mCaptureTracks.GetCount(); + captureChannels = mCaptureTracks->GetCount(); // I don't deal with the possibility of the capture tracks // having different sample formats, since it will never happen // with the current code. This code wouldn't *break* if this @@ -1650,7 +1655,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, // we would set the sound card to capture in 16 bits and the second // track wouldn't get the benefit of all 24 bits the card is capable // of. - captureFormat = mCaptureTracks[0]->GetSampleFormat(); + captureFormat = (*mCaptureTracks)[0]->GetSampleFormat(); // Tell project that we are about to start recording if (mListener) @@ -1711,12 +1716,12 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, return 0; } - mPlaybackBuffers = new RingBuffer* [mPlaybackTracks.GetCount()]; - mPlaybackMixers = new Mixer* [mPlaybackTracks.GetCount()]; + mPlaybackBuffers = new RingBuffer* [mPlaybackTracks->GetCount()]; + mPlaybackMixers = new Mixer* [mPlaybackTracks->GetCount()]; // Set everything to zero in case we have to delete these due to a memory exception. - memset(mPlaybackBuffers, 0, sizeof(RingBuffer*)*mPlaybackTracks.GetCount()); - memset(mPlaybackMixers, 0, sizeof(Mixer*)*mPlaybackTracks.GetCount()); + memset(mPlaybackBuffers, 0, sizeof(RingBuffer*)*mPlaybackTracks->GetCount()); + memset(mPlaybackMixers, 0, sizeof(Mixer*)*mPlaybackTracks->GetCount()); const Mixer::WarpOptions &warpOptions = #ifdef EXPERIMENTAL_SCRUBBING_SUPPORT @@ -1724,12 +1729,12 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, #endif Mixer::WarpOptions(mTimeTrack); - for (unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++) + for (unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++) { mPlaybackBuffers[i] = new RingBuffer(floatSample, playbackBufferSize); // MB: use normal time for the end time, not warped time! - mPlaybackMixers[i] = new Mixer(1, &mPlaybackTracks[i], + mPlaybackMixers[i] = new Mixer(1, &(*mPlaybackTracks)[i], warpOptions, mT0, mT1, 1, playbackMixBufferSize, false, @@ -1753,17 +1758,17 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, return 0; } - mCaptureBuffers = new RingBuffer* [mCaptureTracks.GetCount()]; - mResample = new Resample* [mCaptureTracks.GetCount()]; + mCaptureBuffers = new RingBuffer* [mCaptureTracks->GetCount()]; + mResample = new Resample* [mCaptureTracks->GetCount()]; mFactor = sampleRate / mRate; // Set everything to zero in case we have to delete these due to a memory exception. - memset(mCaptureBuffers, 0, sizeof(RingBuffer*)*mCaptureTracks.GetCount()); - memset(mResample, 0, sizeof(Resample*)*mCaptureTracks.GetCount()); + memset(mCaptureBuffers, 0, sizeof(RingBuffer*)*mCaptureTracks->GetCount()); + memset(mResample, 0, sizeof(Resample*)*mCaptureTracks->GetCount()); - for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ ) + for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ ) { - mCaptureBuffers[i] = new RingBuffer( mCaptureTracks[i]->GetSampleFormat(), + mCaptureBuffers[i] = new RingBuffer( (*mCaptureTracks)[i]->GetSampleFormat(), captureBufferSize ); mResample[i] = new Resample(true, mFactor, mFactor); // constant rate resampling } @@ -1791,9 +1796,9 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, // group determination should mimic what is done in audacityAudioCallback() // when calling RealtimeProcess(). int group = 0; - for (size_t i = 0, cnt = mPlaybackTracks.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = mPlaybackTracks->GetCount(); i < cnt; i++) { - WaveTrack *vt = gAudioIO->mPlaybackTracks[i]; + WaveTrack *vt = (*gAudioIO->mPlaybackTracks)[i]; int chanCnt = 1; if (vt->GetLinked()) @@ -1815,7 +1820,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, // Calculate the new time position mTime = std::max(mT0, std::min(mT1, *options.pStartTime)); // Reset mixer positions for all playback tracks - unsigned numMixers = mPlaybackTracks.GetCount(); + unsigned numMixers = mPlaybackTracks->GetCount(); for (unsigned ii = 0; ii < numMixers; ++ii) mPlaybackMixers[ii]->Reposition(mTime); if(mTimeTrack) @@ -1919,7 +1924,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers) if(mPlaybackBuffers) { - for( unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++ ) + for( unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++ ) delete mPlaybackBuffers[i]; delete [] mPlaybackBuffers; mPlaybackBuffers = NULL; @@ -1927,7 +1932,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers) if(mPlaybackMixers) { - for( unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++ ) + for( unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++ ) delete mPlaybackMixers[i]; delete [] mPlaybackMixers; mPlaybackMixers = NULL; @@ -1935,7 +1940,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers) if(mCaptureBuffers) { - for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ ) + for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ ) delete mCaptureBuffers[i]; delete [] mCaptureBuffers; mCaptureBuffers = NULL; @@ -1943,7 +1948,7 @@ void AudioIO::StartStreamCleanup(bool bOnlyBuffers) if(mResample) { - for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ ) + for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ ) delete mResample[i]; delete [] mResample; mResample = NULL; @@ -2268,9 +2273,9 @@ void AudioIO::StopStream() // we allocated in StartStream() // - if( mPlaybackTracks.GetCount() > 0 ) + if( mPlaybackTracks->GetCount() > 0 ) { - for( unsigned int i = 0; i < mPlaybackTracks.GetCount(); i++ ) + for( unsigned int i = 0; i < mPlaybackTracks->GetCount(); i++ ) { delete mPlaybackBuffers[i]; delete mPlaybackMixers[i]; @@ -2283,7 +2288,7 @@ void AudioIO::StopStream() // // Offset all recorded tracks to account for latency // - if( mCaptureTracks.GetCount() > 0 ) + if( mCaptureTracks->GetCount() > 0 ) { // // We only apply latency correction when we actually played back @@ -2298,15 +2303,15 @@ void AudioIO::StopStream() double recordingOffset = mLastRecordingOffset + latencyCorrection / 1000.0; - for( unsigned int i = 0; i < mCaptureTracks.GetCount(); i++ ) + for( unsigned int i = 0; i < mCaptureTracks->GetCount(); i++ ) { delete mCaptureBuffers[i]; delete mResample[i]; - WaveTrack* track = mCaptureTracks[i]; + WaveTrack* track = (*mCaptureTracks)[i]; track->Flush(); - if (mPlaybackTracks.GetCount() > 0) + if (mPlaybackTracks->GetCount() > 0) { // only do latency correction if some tracks are being played back WaveTrackArray playbackTracks; AudacityProject *p = GetActiveProject(); @@ -2873,7 +2878,7 @@ int AudioIO::GetCommonlyAvailPlayback() int commonlyAvail = mPlaybackBuffers[0]->AvailForPut(); unsigned int i; - for( i = 1; i < mPlaybackTracks.GetCount(); i++ ) + for( i = 1; i < mPlaybackTracks->GetCount(); i++ ) { int thisBlockAvail = mPlaybackBuffers[i]->AvailForPut(); @@ -2889,7 +2894,7 @@ int AudioIO::GetCommonlyAvailCapture() int commonlyAvail = mCaptureBuffers[0]->AvailForGet(); unsigned int i; - for( i = 1; i < mCaptureTracks.GetCount(); i++ ) + for( i = 1; i < mCaptureTracks->GetCount(); i++ ) { int avail = mCaptureBuffers[i]->AvailForGet(); if( avail < commonlyAvail ) @@ -3266,7 +3271,7 @@ void AudioIO::FillBuffers() { unsigned int i; - if( mPlaybackTracks.GetCount() > 0 ) + if( mPlaybackTracks->GetCount() > 0 ) { // Though extremely unlikely, it is possible that some buffers // will have more samples available than others. This could happen @@ -3323,7 +3328,7 @@ void AudioIO::FillBuffers() mWarpedTime += deltat; } - for( i = 0; i < mPlaybackTracks.GetCount(); i++ ) + for( i = 0; i < mPlaybackTracks->GetCount(); i++ ) { // The mixer here isn't actually mixing: it's just doing // resampling, format conversion, and possibly time track @@ -3400,7 +3405,7 @@ void AudioIO::FillBuffers() startTime = startSample / mRate; endTime = endSample / mRate; speed = double(abs(endSample - startSample)) / mScrubDuration; - for (i = 0; i < mPlaybackTracks.GetCount(); i++) + for (i = 0; i < mPlaybackTracks->GetCount(); i++) mPlaybackMixers[i]->SetTimesAndSpeed(startTime, endTime, speed); } } @@ -3415,7 +3420,7 @@ void AudioIO::FillBuffers() // and if yes, restart from the beginning. if (mWarpedTime >= mWarpedLength) { - for (i = 0; i < mPlaybackTracks.GetCount(); i++) + for (i = 0; i < mPlaybackTracks->GetCount(); i++) mPlaybackMixers[i]->Restart(); mWarpedTime = 0.0; } @@ -3429,7 +3434,7 @@ void AudioIO::FillBuffers() } } // end of playback buffering - if( mCaptureTracks.GetCount() > 0 ) // start record buffering + if( mCaptureTracks->GetCount() > 0 ) // start record buffering { int commonlyAvail = GetCommonlyAvailCapture(); @@ -3444,12 +3449,12 @@ void AudioIO::FillBuffers() // Append captured samples to the end of the WaveTracks. // The WaveTracks have their own buffering for efficiency. AutoSaveFile blockFileLog; - int numChannels = mCaptureTracks.GetCount(); + int numChannels = mCaptureTracks->GetCount(); for( i = 0; (int)i < numChannels; i++ ) { int avail = commonlyAvail; - sampleFormat trackFormat = mCaptureTracks[i]->GetSampleFormat(); + sampleFormat trackFormat = (*mCaptureTracks)[i]->GetSampleFormat(); AutoSaveFile appendLog; @@ -3457,7 +3462,7 @@ void AudioIO::FillBuffers() { samplePtr temp = NewSamples(avail, trackFormat); mCaptureBuffers[i]->Get (temp, trackFormat, avail); - mCaptureTracks[i]-> Append(temp, trackFormat, avail, 1, + (*mCaptureTracks)[i]-> Append(temp, trackFormat, avail, 1, &appendLog); DeleteSamples(temp); } @@ -3473,7 +3478,7 @@ void AudioIO::FillBuffers() */ size = mResample[i]->Process(mFactor, (float *)temp1, avail, !IsStreamActive(), &size, (float *)temp2, size); - mCaptureTracks[i]-> Append(temp2, floatSample, size, 1, + (*mCaptureTracks)[i]-> Append(temp2, floatSample, size, 1, &appendLog); DeleteSamples(temp1); DeleteSamples(temp2); @@ -3482,7 +3487,7 @@ void AudioIO::FillBuffers() if (!appendLog.IsEmpty()) { blockFileLog.StartTag(wxT("recordingrecovery")); - blockFileLog.WriteAttr(wxT("id"), mCaptureTracks[i]->GetAutoSaveIdent()); + blockFileLog.WriteAttr(wxT("id"), (*mCaptureTracks)[i]->GetAutoSaveIdent()); blockFileLog.WriteAttr(wxT("channel"), (int)i); blockFileLog.WriteAttr(wxT("numchannels"), numChannels); blockFileLog.WriteSubTree(appendLog); @@ -3675,7 +3680,7 @@ bool AudioIO::SetHasSolo(bool hasSolo) void AudioIO::FillMidiBuffers() { bool hasSolo = false; - int numPlaybackTracks = gAudioIO->mPlaybackTracks.GetCount(); + int numPlaybackTracks = gAudioIO->mPlaybackTracks->GetCount(); int t; for(t = 0; t < numPlaybackTracks; t++ ) if( gAudioIO->mPlaybackTracks[t]->GetSolo() ) { @@ -3956,7 +3961,7 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer, const PaStreamCallbackFlags WXUNUSED(statusFlags), void * WXUNUSED(userData) ) { int numPlaybackChannels = gAudioIO->mNumPlaybackChannels; - int numPlaybackTracks = gAudioIO->mPlaybackTracks.GetCount(); + int numPlaybackTracks = gAudioIO->mPlaybackTracks->GetCount(); int numCaptureChannels = gAudioIO->mNumCaptureChannels; int callbackReturn = paContinue; void *tempBuffer = alloca(framesPerBuffer*sizeof(float)* @@ -4137,7 +4142,7 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer, int numSolo = 0; for( t = 0; t < numPlaybackTracks; t++ ) - if( gAudioIO->mPlaybackTracks[t]->GetSolo() ) + if( (*gAudioIO->mPlaybackTracks)[t]->GetSolo() ) numSolo++; #ifdef EXPERIMENTAL_MIDI_OUT int numMidiPlaybackTracks = gAudioIO->mMidiPlaybackTracks.GetCount(); @@ -4162,7 +4167,7 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer, int maxLen = 0; for (t = 0; t < numPlaybackTracks; t++) { - WaveTrack *vt = gAudioIO->mPlaybackTracks[t]; + WaveTrack *vt = (*gAudioIO->mPlaybackTracks)[t]; chans[chanCnt] = vt; diff --git a/src/AudioIO.h b/src/AudioIO.h index ad0655482..d6fcc3284 100644 --- a/src/AudioIO.h +++ b/src/AudioIO.h @@ -29,10 +29,10 @@ #include "portmixer.h" #endif +#include #include #include -#include "WaveTrack.h" #include "SampleFormat.h" class AudioIO; @@ -46,6 +46,9 @@ class SelectedRegion; class TimeTrack; class wxDialog; +class AudacityProject; +class WaveTrackArray; + extern AUDACITY_DLL_API AudioIO *gAudioIO; void InitAudioIO(); @@ -571,9 +574,9 @@ private: #endif Resample **mResample; RingBuffer **mCaptureBuffers; - WaveTrackArray mCaptureTracks; + WaveTrackArray *mCaptureTracks; RingBuffer **mPlaybackBuffers; - WaveTrackArray mPlaybackTracks; + WaveTrackArray *mPlaybackTracks; Mixer **mPlaybackMixers; volatile int mStreamToken; diff --git a/src/AutoRecovery.cpp b/src/AutoRecovery.cpp index 6b7976232..df1d903bc 100644 --- a/src/AutoRecovery.cpp +++ b/src/AutoRecovery.cpp @@ -27,6 +27,8 @@ recover previous Audacity projects that were closed incorrectly. #include #include +#include "WaveTrack.h" + enum { ID_RECOVER_ALL = 10000, ID_RECOVER_NONE, diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index 4023d2bad..f30e6ab88 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -17,6 +17,7 @@ See also BatchCommandDialog and BatchProcessDialog. #include "Audacity.h" +#include "BatchCommands.h" #include #include @@ -25,7 +26,6 @@ See also BatchCommandDialog and BatchProcessDialog. #include #include "Project.h" -#include "BatchCommands.h" #include "commands/CommandManager.h" #include "effects/EffectManager.h" #include "FileNames.h" @@ -41,6 +41,7 @@ See also BatchCommandDialog and BatchProcessDialog. #include "Theme.h" #include "AllThemeResources.h" +#include "Track.h" // KLUDGE: All commands should be on the same footing // however, for historical reasons we distinguish between diff --git a/src/BlockFile.cpp b/src/BlockFile.cpp index ed94a1a58..1c434a2df 100644 --- a/src/BlockFile.cpp +++ b/src/BlockFile.cpp @@ -42,6 +42,8 @@ out. *//*******************************************************************/ +#include "BlockFile.h" + #include #include @@ -51,7 +53,6 @@ out. #include #include -#include "BlockFile.h" #include "Internat.h" // msmeyer: Define this to add debug output via printf() diff --git a/src/BlockFile.h b/src/BlockFile.h index b8254cc43..8f8eb6c1f 100644 --- a/src/BlockFile.h +++ b/src/BlockFile.h @@ -16,11 +16,11 @@ #include #include -#include "WaveTrack.h" - #include "xml/XMLTagHandler.h" #include "xml/XMLWriter.h" +#include "SampleFormat.h" + class SummaryInfo { public: @@ -209,7 +209,7 @@ class AliasBlockFile : public BlockFile // // These methods are for advanced use only! // - wxFileName GetAliasedFileName() { return mAliasedFileName; }; + wxFileName GetAliasedFileName() { return mAliasedFileName; } void ChangeAliasedFileName(wxFileName newAliasedFile); virtual bool IsAlias() { return true; } diff --git a/src/Dependencies.cpp b/src/Dependencies.cpp index 8bff3a9cc..1b5b1a92e 100644 --- a/src/Dependencies.cpp +++ b/src/Dependencies.cpp @@ -21,6 +21,8 @@ **********************************************************************/ +#include "Dependencies.h" + #include #include #include @@ -30,13 +32,13 @@ #include #include "BlockFile.h" -#include "Dependencies.h" #include "DirManager.h" #include "Internat.h" #include "Prefs.h" #include "Project.h" #include "ShuttleGui.h" -#include "Track.h" +#include "WaveTrack.h" +#include "WaveClip.h" // Note, this #include must occur here, not up with the others! // It must be between the WX_DECLARE_OBJARRAY and WX_DEFINE_OBJARRAY. diff --git a/src/Dependencies.h b/src/Dependencies.h index c4bda4d57..70044b235 100644 --- a/src/Dependencies.h +++ b/src/Dependencies.h @@ -15,6 +15,7 @@ #define __AUDACITY_DEPENDENCIES__ #include +#include class AudacityProject; diff --git a/src/DirManager.cpp b/src/DirManager.cpp index 691915c5a..8d2a57031 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -62,6 +62,7 @@ #include "Audacity.h" +#include "DirManager.h" #include // to use time() for srand() @@ -94,7 +95,6 @@ #include "blockfile/PCMAliasBlockFile.h" #include "blockfile/ODPCMAliasBlockFile.h" #include "blockfile/ODDecodeBlockFile.h" -#include "DirManager.h" #include "Internat.h" #include "Project.h" #include "Prefs.h" @@ -103,6 +103,8 @@ #include "ondemand/ODManager.h" +#include "Track.h" + #if defined(__WXMAC__) #include #include diff --git a/src/DirManager.h b/src/DirManager.h index bcc10cac7..dc8af0fc8 100644 --- a/src/DirManager.h +++ b/src/DirManager.h @@ -15,8 +15,10 @@ #include #include #include +#include -#include "WaveTrack.h" +#include "audacity/Types.h" +#include "xml/XMLTagHandler.h" class wxHashTable; class BlockFile; @@ -105,7 +107,7 @@ class DirManager: public XMLTagHandler { void SetMaxSamples(sampleCount max) { mMaxSamples = max; } bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; } - void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); }; // This class only reads tags. + void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags. bool AssignFile(wxFileName &filename,wxString value,bool check); // Clean the temp dir. Note that now where we have auto recovery the temp diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index b98cccfaf..0d9a6f841 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -84,6 +84,8 @@ and in the spectrogram spectral selection. #include "FileDialog.h" +#include "WaveTrack.h" + #if defined(__WXGTK__) #define GSocket GSocketHack #include diff --git a/src/Menus.cpp b/src/Menus.cpp index 157fe7550..a1bba84e2 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -31,6 +31,7 @@ simplifies construction of menu items. *//*******************************************************************/ #include "Audacity.h" +#include "Project.h" #include #include @@ -53,7 +54,6 @@ simplifies construction of menu items. #include "effects/Contrast.h" #include "TrackPanel.h" -#include "Project.h" #include "effects/EffectManager.h" #include "AudacityApp.h" @@ -120,6 +120,8 @@ simplifies construction of menu items. #include "CaptureEvents.h" #include "Snap.h" +#include "WaveTrack.h" + #if defined(EXPERIMENTAL_CRASH_REPORT) #include #endif diff --git a/src/Mix.h b/src/Mix.h index 357d6d943..475ae6b31 100644 --- a/src/Mix.h +++ b/src/Mix.h @@ -15,10 +15,13 @@ #include #include "SampleFormat.h" -#include "WaveTrack.h" #include "Resample.h" class DirManager; +class TimeTrack; +class TrackFactory; +class TrackList; +class WaveTrack; /** @brief Mixes together all input tracks, applying any envelopes, amplitude * gain, panning, and real-time effects in the process. diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index ba3b7314a..9dd6ec7e4 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -10,8 +10,8 @@ **********************************************************************/ #include "Audacity.h" - #include "Experimental.h" +#include "MixerBoard.h" #include @@ -22,12 +22,11 @@ #include "AColor.h" #include "AudioIO.h" -#include "MixerBoard.h" #ifdef EXPERIMENTAL_MIDI_OUT #include "NoteTrack.h" #endif #include "Project.h" -#include "Track.h" +#include "WaveTrack.h" #include "../images/MusicalInstruments.h" diff --git a/src/Project.cpp b/src/Project.cpp index df55c5c7e..758476cdf 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -1215,6 +1215,11 @@ void AudacityProject::SetProjectTitle() SetName(name); // to make the nvda screen reader read the correct title } +bool AudacityProject::GetIsEmpty() +{ + return mTracks->IsEmpty(); +} + double AudacityProject::AS_GetRate() { return mRate; @@ -4420,7 +4425,7 @@ void AudacityProject::GetRegionsByLabel( Regions ®ions ) //If the function replaces the selection with audio of a different length, // bSyncLockedTracks should be set true to perform the same action on sync-lock selected // tracks. -void AudacityProject::EditByLabel( WaveTrack::EditFunction action, +void AudacityProject::EditByLabel( EditFunction action, bool bSyncLockedTracks ) { Regions regions; @@ -4469,7 +4474,7 @@ void AudacityProject::EditByLabel( WaveTrack::EditFunction action, //Functions copy the edited regions to clipboard, possibly in multiple tracks //This probably should not be called if *action() changes the timeline, because // the copy needs to happen by track, and the timeline change by group. -void AudacityProject::EditClipboardByLabel( WaveTrack::EditDestFunction action ) +void AudacityProject::EditClipboardByLabel( EditDestFunction action ) { Regions regions; diff --git a/src/Project.h b/src/Project.h index 8793bde25..0ce12a73b 100644 --- a/src/Project.h +++ b/src/Project.h @@ -86,6 +86,9 @@ class MixerBoardFrame; struct AudioIOStartStreamOptions; +class WaveTrackArray; +class Regions; + AudacityProject *CreateNewAudacityProject(); AUDACITY_DLL_API AudacityProject *GetActiveProject(); void RedrawAllProjects(); @@ -236,7 +239,7 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame, TrackPanel * GetTrackPanel(){return mTrackPanel;} - bool GetIsEmpty() { return mTracks->IsEmpty(); } + bool GetIsEmpty(); bool GetTracksFitVerticallyZoomed() { return mTracksFitVerticallyZoomed; } //lda void SetTracksFitVerticallyZoomed(bool flag) { mTracksFitVerticallyZoomed = flag; } //lda @@ -313,8 +316,14 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame, void ZoomBy(double multiplier); void Rewind(bool shift); void SkipEnd(bool shift); - void EditByLabel( WaveTrack::EditFunction action, bool bSyncLockedTracks ); - void EditClipboardByLabel( WaveTrack::EditDestFunction action ); + + + typedef bool (WaveTrack::* EditFunction)(double, double); + typedef bool (WaveTrack::* EditDestFunction)(double, double, Track**); + + void EditByLabel(EditFunction action, bool bSyncLockedTracks); + void EditClipboardByLabel(EditDestFunction action ); + bool IsSyncLocked(); void SetSyncLock(bool flag); diff --git a/src/Screenshot.cpp b/src/Screenshot.cpp index 94fc80c33..af6513968 100644 --- a/src/Screenshot.cpp +++ b/src/Screenshot.cpp @@ -34,6 +34,8 @@ #include "Prefs.h" #include "toolbars/ToolManager.h" +#include "Track.h" + class CommandType; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/Snap.cpp b/src/Snap.cpp index 951c81197..b69aa50be 100644 --- a/src/Snap.cpp +++ b/src/Snap.cpp @@ -16,6 +16,7 @@ #include "LabelTrack.h" #include "Project.h" #include "TrackPanel.h" +#include "WaveTrack.h" #include "widgets/NumericTextCtrl.h" // Change this to "true" to snap to nearest and "false" to snap to previous diff --git a/src/Spectrum.h b/src/Spectrum.h index 64e0e28cb..f600a05b8 100644 --- a/src/Spectrum.h +++ b/src/Spectrum.h @@ -11,7 +11,6 @@ #ifndef __AUDACITY_SPECTRUM__ #define __AUDACITY_SPECTRUM__ -#include "WaveTrack.h" #include "FFT.h" /* diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index 1aa195420..5295a8614 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -29,6 +29,7 @@ #include #include #include // #include "ShuttleGui.h" #include "Project.h" diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 17b4a7c04..09acf210e 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -1441,7 +1441,7 @@ void TrackArtist::DrawWaveform(WaveTrack *track, if (xx >= 0 && xx < rect.width) { dc.SetPen(*wxGREY_PEN); AColor::Line(dc, (int) (rect.x + xx - 1), rect.y, (int) (rect.x + xx - 1), rect.y + rect.height); - if (loc.typ == WaveTrack::locationCutLine) { + if (loc.typ == WaveTrackLocation::locationCutLine) { dc.SetPen(*wxRED_PEN); } else { diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index a9f79f4d3..fea525eb9 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -6537,7 +6537,7 @@ bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, wxM if (event.LeftDown()) { - if (mCapturedTrackLocation.typ == WaveTrack::locationCutLine) + if (mCapturedTrackLocation.typ == WaveTrackLocation::locationCutLine) { // When user presses left button on cut line, expand the line again double cutlineStart = 0, cutlineEnd = 0; @@ -6558,7 +6558,7 @@ bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, wxM MakeParentPushState(_("Expanded Cut Line"), _("Expand")); handled = true; } - } else if (mCapturedTrackLocation.typ == WaveTrack::locationMergePoint) + } else if (mCapturedTrackLocation.typ == WaveTrackLocation::locationMergePoint) { if (!track->MergeClips(mCapturedTrackLocation.clipidx1, mCapturedTrackLocation.clipidx2)) return false; diff --git a/src/TrackPanel.h b/src/TrackPanel.h index ef156d127..6fe0a9978 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -23,10 +23,11 @@ #include "Experimental.h" #include "Sequence.h" //Stm: included for the sampleCount declaration #include "WaveClip.h" -#include "WaveTrack.h" #include "UndoManager.h" //JKC: Included for PUSH_XXX definitions. #include "widgets/NumericTextCtrl.h" +#include "WaveTrackLocation.h" + class wxMenu; class wxRect; @@ -47,6 +48,8 @@ class TrackPanelAx; class ViewInfo; +class WaveTrack; + WX_DEFINE_ARRAY(LWSlider *, LWSliderArray); class AUDACITY_DLL_API TrackClip @@ -643,7 +646,7 @@ protected: WaveClip *mCapturedClip; TrackClipArray mCapturedClipArray; bool mCapturedClipIsSelection; - WaveTrack::Location mCapturedTrackLocation; + WaveTrackLocation mCapturedTrackLocation; wxRect mCapturedTrackLocationRect; wxRect mCapturedRect; diff --git a/src/TrackPanelAx.cpp b/src/TrackPanelAx.cpp index f87bbb591..1ef9a29f7 100644 --- a/src/TrackPanelAx.cpp +++ b/src/TrackPanelAx.cpp @@ -14,6 +14,9 @@ *//*******************************************************************/ +#include "Audacity.h" +#include "TrackPanelAx.h" + // For compilers that support precompilation, includes "wx/wx.h". #include @@ -23,11 +26,10 @@ #endif -#include "Audacity.h" -#include "TrackPanelAx.h" - #include +#include "Track.h" + TrackPanelAx::TrackPanelAx( wxWindow *window ) #if wxUSE_ACCESSIBILITY :wxWindowAccessible( window ) diff --git a/src/VoiceKey.cpp b/src/VoiceKey.cpp index f2ce8c5c9..11dc95827 100644 --- a/src/VoiceKey.cpp +++ b/src/VoiceKey.cpp @@ -32,6 +32,8 @@ or "OFF" point #include #include +#include "WaveTrack.h" + using std::cout; using std::endl; diff --git a/src/VoiceKey.h b/src/VoiceKey.h index a05c48efb..46584945d 100644 --- a/src/VoiceKey.h +++ b/src/VoiceKey.h @@ -11,13 +11,15 @@ #ifndef __AUDACITY_VOICEKEY__ #define __AUDACITY_VOICEKEY__ -#include "WaveTrack.h" - #ifndef M_PI #define M_PI 3.14159265358979323846 /* pi */ #endif +#include "audacity/Types.h" + +class WaveTrack; + enum VoiceKeyTypes { VKT_NONE = 0, @@ -91,10 +93,10 @@ class VoiceKey { }; -inline int sgn(int number){ return (number<0) ? -1: 1;}; +inline int sgn(int number){ return (number<0) ? -1: 1;} //This returns a logistic density based on a z-score // a logistic distn has variance (pi*s)^2/3 -//inline float inline float logistic(float z){ return fexp(-1 * z/(pi / sqrt(3)) / (1 + pow(fexp(-1 * z(pi / sqrt(3))),2)));}; +//inline float inline float logistic(float z){ return fexp(-1 * z/(pi / sqrt(3)) / (1 + pow(fexp(-1 * z(pi / sqrt(3))),2)));} #endif diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index 1f2028f64..7062ebd2b 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -32,6 +32,7 @@ #include "Envelope.h" #include "Resample.h" #include "Project.h" +#include "WaveTrack.h" #include "prefs/SpectrogramSettings.h" diff --git a/src/WaveTrack.cpp b/src/WaveTrack.cpp index ba6ac693c..2830eb48b 100644 --- a/src/WaveTrack.cpp +++ b/src/WaveTrack.cpp @@ -2407,7 +2407,7 @@ void WaveTrack::UpdateLocationsCache() it = it->GetNext()) { // Add cut line expander point - mDisplayLocations[curpos].typ = locationCutLine; + mDisplayLocations[curpos].typ = WaveTrackLocation::locationCutLine; mDisplayLocations[curpos].pos = clip->GetOffset() + it->GetData()->GetOffset(); curpos++; @@ -2421,7 +2421,7 @@ void WaveTrack::UpdateLocationsCache() < WAVETRACK_MERGE_POINT_TOLERANCE) { // Add merge point - mDisplayLocations[curpos].typ = locationMergePoint; + mDisplayLocations[curpos].typ = WaveTrackLocation::locationMergePoint; mDisplayLocations[curpos].pos = clips.Item(i-1)->GetEndTime(); mDisplayLocations[curpos].clipidx1 = mClips.IndexOf(previousClip); mDisplayLocations[curpos].clipidx2 = mClips.IndexOf(clip); diff --git a/src/WaveTrack.h b/src/WaveTrack.h index 13483cd37..b2d2b1229 100644 --- a/src/WaveTrack.h +++ b/src/WaveTrack.h @@ -22,6 +22,8 @@ #include #include +#include "WaveTrackLocation.h" + class SpectrogramSettings; class WaveformSettings; class TimeWarper; @@ -53,7 +55,7 @@ WX_DEFINE_ARRAY( Region*, Regions ); class Envelope; -class AUDACITY_DLL_API WaveTrack: public Track { +class AUDACITY_DLL_API WaveTrack : public Track { private: @@ -79,22 +81,8 @@ class AUDACITY_DLL_API WaveTrack: public Track { #ifdef EXPERIMENTAL_OUTPUT_DISPLAY static bool mMonoAsVirtualStereo; #endif - enum LocationType { - locationCutLine = 1, - locationMergePoint - }; - struct Location { - // Position of track location - double pos; - - // Type of track location - LocationType typ; - - // Only for typ==locationMergePoint - int clipidx1; // first clip (left one) - int clipidx2; // second clip (right one) - }; + typedef WaveTrackLocation Location; virtual ~WaveTrack(); virtual double GetOffset() const; @@ -184,9 +172,6 @@ class AUDACITY_DLL_API WaveTrack: public Track { virtual bool Join (double t0, double t1); virtual bool Disjoin (double t0, double t1); - typedef bool ( WaveTrack::* EditFunction )( double, double ); - typedef bool ( WaveTrack::* EditDestFunction )( double, double, Track** ); - virtual bool Trim (double t0, double t1); bool HandleClear(double t0, double t1, bool addCutLines, bool split); diff --git a/src/WaveTrackLocation.h b/src/WaveTrackLocation.h new file mode 100644 index 000000000..ddb9b2477 --- /dev/null +++ b/src/WaveTrackLocation.h @@ -0,0 +1,32 @@ +/********************************************************************** + +Audacity: A Digital Audio Editor + +WaveTrackLocation.h + +Paul Licameli -- split from WaveTrack.h + +**********************************************************************/ + +#ifndef __AUDACITY_WAVE_TRACK_LOCATION__ +#define __AUDACITY_WAVE_TRACK_LOCATION__ + +struct WaveTrackLocation { + + enum LocationType { + locationCutLine = 1, + locationMergePoint + }; + + // Position of track location + double pos; + + // Type of track location + LocationType typ; + + // Only for typ==locationMergePoint + int clipidx1; // first clip (left one) + int clipidx2; // second clip (right one) +}; + +#endif diff --git a/src/commands/CompareAudioCommand.cpp b/src/commands/CompareAudioCommand.cpp index 6957116b5..35833b9d5 100644 --- a/src/commands/CompareAudioCommand.cpp +++ b/src/commands/CompareAudioCommand.cpp @@ -20,6 +20,7 @@ threshold of difference in two selected tracks #include "CompareAudioCommand.h" #include "../Project.h" #include "Command.h" +#include "../WaveTrack.h" wxString CompareAudioCommandType::BuildName() { diff --git a/src/commands/GetProjectInfoCommand.cpp b/src/commands/GetProjectInfoCommand.cpp index 46fb010af..cc43d26cc 100644 --- a/src/commands/GetProjectInfoCommand.cpp +++ b/src/commands/GetProjectInfoCommand.cpp @@ -20,7 +20,6 @@ #include "../TrackPanel.h" #include "../Project.h" #include "../Track.h" -#include "../WaveTrack.h" wxString GetProjectInfoCommandType::BuildName() { @@ -149,3 +148,23 @@ void GetProjectInfoCommand::SendTracksInfo(TrackList *projTracks, } Status(boolValueStr); } + +bool GetProjectInfoCommand::testSelected(Track * track) const +{ + return track->GetSelected(); +} + +bool GetProjectInfoCommand::testLinked(Track * track) const +{ + return track->GetLinked(); +} + +bool GetProjectInfoCommand::testSolo(Track * track) const +{ + return track->GetSolo(); +} + +bool GetProjectInfoCommand::testMute(Track * track) const +{ + return track->GetMute(); +} diff --git a/src/commands/GetProjectInfoCommand.h b/src/commands/GetProjectInfoCommand.h index df181a065..329f619d2 100644 --- a/src/commands/GetProjectInfoCommand.h +++ b/src/commands/GetProjectInfoCommand.h @@ -50,10 +50,10 @@ private: void SendTracksInfo(TrackList *projTracks, Getter); // Functions pointed to for getting track parameters - bool testSelected(Track * track) const {return track->GetSelected();} - bool testLinked( Track * track) const {return track->GetLinked();} - bool testSolo( Track * track) const {return track->GetSolo();} - bool testMute( Track * track) const {return track->GetMute();} + bool testSelected(Track * track) const; + bool testLinked(Track * track) const; + bool testSolo(Track * track) const; + bool testMute(Track * track) const; }; diff --git a/src/commands/GetTrackInfoCommand.cpp b/src/commands/GetTrackInfoCommand.cpp index 7c3e9f786..daf44c0c4 100644 --- a/src/commands/GetTrackInfoCommand.cpp +++ b/src/commands/GetTrackInfoCommand.cpp @@ -19,7 +19,6 @@ #include "GetTrackInfoCommand.h" #include "../TrackPanel.h" #include "../Project.h" -#include "../Track.h" #include "../WaveTrack.h" wxString GetTrackInfoCommandType::BuildName() diff --git a/src/commands/ImportExportCommands.cpp b/src/commands/ImportExportCommands.cpp index 548af3ebe..4a6b6885a 100644 --- a/src/commands/ImportExportCommands.cpp +++ b/src/commands/ImportExportCommands.cpp @@ -15,6 +15,7 @@ #include "ImportExportCommands.h" #include "../Project.h" +#include "../Track.h" #include "../export/Export.h" // Import diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index 30dd1e433..5410c003f 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -25,6 +25,7 @@ project window. #include #include +#include "../Track.h" #include "../TrackPanel.h" #include "../toolbars/ToolManager.h" #include "../toolbars/ToolBar.h" diff --git a/src/commands/SelectCommand.cpp b/src/commands/SelectCommand.cpp index 087ad6cc4..f689135e3 100644 --- a/src/commands/SelectCommand.cpp +++ b/src/commands/SelectCommand.cpp @@ -19,6 +19,7 @@ #include "SelectCommand.h" #include #include "../Project.h" +#include "../Track.h" wxString SelectCommandType::BuildName() { diff --git a/src/commands/SetProjectInfoCommand.cpp b/src/commands/SetProjectInfoCommand.cpp index d96b60fa4..1724cacba 100644 --- a/src/commands/SetProjectInfoCommand.cpp +++ b/src/commands/SetProjectInfoCommand.cpp @@ -19,7 +19,6 @@ #include "SetProjectInfoCommand.h" #include "../Project.h" #include "../Track.h" -#include "../WaveTrack.h" // The following parameters have a boolean string, indicated by the kSetOfTracksStr #define kSetOfTracksStr "TrackSet" diff --git a/src/effects/AutoDuck.cpp b/src/effects/AutoDuck.cpp index 1887368a2..5f3db54ff 100644 --- a/src/effects/AutoDuck.cpp +++ b/src/effects/AutoDuck.cpp @@ -33,6 +33,8 @@ #include "../Theme.h" #include "../widgets/valnum.h" +#include "../WaveTrack.h" + // Define keys, defaults, minimums, and maximums for the effect parameters // // Name Type Key Def Min Max Scale diff --git a/src/effects/AutoDuck.h b/src/effects/AutoDuck.h index 45a8878d1..ede5f31bc 100644 --- a/src/effects/AutoDuck.h +++ b/src/effects/AutoDuck.h @@ -19,8 +19,6 @@ #include #include -#include "../WaveTrack.h" - #include "Effect.h" class EffectAutoDuckPanel; diff --git a/src/effects/ChangeSpeed.cpp b/src/effects/ChangeSpeed.cpp index a7245b876..f142ebce6 100644 --- a/src/effects/ChangeSpeed.cpp +++ b/src/effects/ChangeSpeed.cpp @@ -14,6 +14,7 @@ *//*******************************************************************/ #include "../Audacity.h" +#include "ChangeSpeed.h" #include @@ -27,9 +28,8 @@ #include "../ShuttleGui.h" #include "../widgets/valnum.h" -#include "ChangeSpeed.h" - #include "TimeWarper.h" +#include "../WaveTrack.h" enum { diff --git a/src/effects/ChangeSpeed.h b/src/effects/ChangeSpeed.h index 3648b5a4a..7df4ef8d4 100644 --- a/src/effects/ChangeSpeed.h +++ b/src/effects/ChangeSpeed.h @@ -19,7 +19,6 @@ #include #include -#include "../WaveTrack.h" #include "../widgets/NumericTextCtrl.h" #include "Effect.h" diff --git a/src/effects/ClickRemoval.cpp b/src/effects/ClickRemoval.cpp index 81e616f65..73943daef 100644 --- a/src/effects/ClickRemoval.cpp +++ b/src/effects/ClickRemoval.cpp @@ -37,6 +37,8 @@ #include "../ShuttleGui.h" #include "../widgets/valnum.h" +#include "../WaveTrack.h" + enum { ID_Thresh = 10000, diff --git a/src/effects/ClickRemoval.h b/src/effects/ClickRemoval.h index 5723f09d5..b4707d39a 100644 --- a/src/effects/ClickRemoval.h +++ b/src/effects/ClickRemoval.h @@ -22,7 +22,6 @@ #include #include "../Envelope.h" -#include "../WaveTrack.h" #include "Effect.h" diff --git a/src/effects/Compressor.cpp b/src/effects/Compressor.cpp index 4599d09a7..ca506eb77 100644 --- a/src/effects/Compressor.cpp +++ b/src/effects/Compressor.cpp @@ -41,6 +41,8 @@ #include "../float_cast.h" #include "../widgets/Ruler.h" +#include "../WaveTrack.h" + enum { ID_Threshold = 10000, diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 73d873e80..88269f8d9 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -2060,6 +2060,11 @@ TimeWarper *Effect::GetTimeWarper() // Use these two methods to copy the input tracks to mOutputTracks, if // doing the processing on them, and replacing the originals only on success (and not cancel). // Copy the group tracks that have tracks selected +void Effect::CopyInputTracks() +{ + CopyInputTracks(Track::Wave); +} + void Effect::CopyInputTracks(int trackType) { // Reset map diff --git a/src/effects/Effect.h b/src/effects/Effect.h index 973e3d33e..1cf24f6b1 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -30,7 +30,6 @@ class wxWindow; #include "audacity/EffectInterface.h" #include "../Experimental.h" -#include "../WaveTrack.h" #include "../SelectedRegion.h" #include "../Shuttle.h" #include "../Internat.h" @@ -40,9 +39,14 @@ class ShuttleGui; #define BUILTIN_EFFECT_PREFIX wxT("Built-in Effect: ") +class AudacityProject; class SelectedRegion; class TimeWarper; class EffectUIHost; +class Track; +class TrackList; +class TrackFactory; +class WaveTrack; // TODO: Apr-06-2015 // TODO: Much more cleanup of old methods and variables is needed, but @@ -337,7 +341,8 @@ protected: // Use these two methods to copy the input tracks to mOutputTracks, if // doing the processing on them, and replacing the originals only on success (and not cancel). - void CopyInputTracks(int trackType = Track::Wave); + void CopyInputTracks(); // trackType = Track::Wave + void CopyInputTracks(int trackType); // If bGoodResult, replace mWaveTracks tracks in mTracks with successfully processed // mOutputTracks copies, get rid of old mWaveTracks, and set mWaveTracks to mOutputTracks. diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 4201b4303..fab552507 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -53,6 +53,7 @@ #include "../Audacity.h" +#include "Equalization.h" #include #include @@ -95,13 +96,10 @@ #include "../xml/XMLFileReader.h" #include "../Theme.h" #include "../AllThemeResources.h" -#include "../WaveTrack.h" #include "../float_cast.h" #include "FileDialog.h" -#include "Equalization.h" - #ifdef EXPERIMENTAL_EQ_SSE_THREADED #include "Equalization48x.h" #endif diff --git a/src/effects/Equalization.h b/src/effects/Equalization.h index b07f58f28..e4de76506 100644 --- a/src/effects/Equalization.h +++ b/src/effects/Equalization.h @@ -36,7 +36,6 @@ #include "Effect.h" #include "../Envelope.h" -#include "../WaveTrack.h" #include "../xml/XMLTagHandler.h" #include "../widgets/Grid.h" #include "../widgets/Ruler.h" diff --git a/src/effects/FindClipping.cpp b/src/effects/FindClipping.cpp index 864e499b8..3211a2d42 100644 --- a/src/effects/FindClipping.cpp +++ b/src/effects/FindClipping.cpp @@ -30,6 +30,8 @@ #include "../ShuttleGui.h" #include "../widgets/valnum.h" +#include "../Wavetrack.h" + // Define keys, defaults, minimums, and maximums for the effect parameters // // Name Type Key Def Min Max Scale diff --git a/src/effects/FindClipping.h b/src/effects/FindClipping.h index d5e227045..f550ff248 100644 --- a/src/effects/FindClipping.h +++ b/src/effects/FindClipping.h @@ -17,7 +17,6 @@ class wxString; #include #include "../LabelTrack.h" -#include "../WaveTrack.h" #include "Effect.h" diff --git a/src/effects/Generator.cpp b/src/effects/Generator.cpp index b4b741d99..0c82567b1 100644 --- a/src/effects/Generator.cpp +++ b/src/effects/Generator.cpp @@ -14,10 +14,12 @@ **********************************************************************/ +#include "Generator.h" + #include "../Project.h" #include "../Prefs.h" +#include "../WaveTrack.h" -#include "Generator.h" #include "TimeWarper.h" #include diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index b03ae578c..9081132af 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -43,6 +43,8 @@ #include "../ShuttleGui.h" #include "../Prefs.h" +#include "../WaveTrack.h" + #include #include #include diff --git a/src/effects/Normalize.cpp b/src/effects/Normalize.cpp index c0ad7f978..fe3d8971d 100644 --- a/src/effects/Normalize.cpp +++ b/src/effects/Normalize.cpp @@ -16,6 +16,7 @@ #include "../Audacity.h" // for rint from configwin.h +#include "Normalize.h" #include @@ -28,8 +29,6 @@ #include "../WaveTrack.h" #include "../widgets/valnum.h" -#include "Normalize.h" - // Define keys, defaults, minimums, and maximums for the effect parameters // // Name Type Key Def Min Max Scale diff --git a/src/effects/Normalize.h b/src/effects/Normalize.h index a5ab075c5..84ac09ac0 100644 --- a/src/effects/Normalize.h +++ b/src/effects/Normalize.h @@ -18,8 +18,6 @@ #include #include -#include "../WaveTrack.h" - #include "Effect.h" class ShuttleGui; diff --git a/src/effects/Paulstretch.cpp b/src/effects/Paulstretch.cpp index fba28331c..76e21a042 100644 --- a/src/effects/Paulstretch.cpp +++ b/src/effects/Paulstretch.cpp @@ -27,6 +27,8 @@ #include "../FFT.h" #include "../widgets/valnum.h" +#include "../WaveTrack.h" + // Define keys, defaults, minimums, and maximums for the effect parameters // // Name Type Key Def Min Max Scale diff --git a/src/effects/Paulstretch.h b/src/effects/Paulstretch.h index 44dbd69fd..0741aeb04 100644 --- a/src/effects/Paulstretch.h +++ b/src/effects/Paulstretch.h @@ -12,8 +12,6 @@ #include -#include "../WaveTrack.h" - #include "Effect.h" class ShuttleGui; diff --git a/src/effects/Reverse.cpp b/src/effects/Reverse.cpp index e55c6e309..8ec87a89a 100644 --- a/src/effects/Reverse.cpp +++ b/src/effects/Reverse.cpp @@ -15,14 +15,14 @@ #include "../Audacity.h" +#include "Reverse.h" #include #include #include "../LabelTrack.h" - -#include "Reverse.h" +#include "../WaveTrack.h" // // EffectReverse diff --git a/src/effects/Reverse.h b/src/effects/Reverse.h index d01816ab7..1080f76c7 100644 --- a/src/effects/Reverse.h +++ b/src/effects/Reverse.h @@ -15,8 +15,6 @@ #include -#include "../WaveTrack.h" - #include "Effect.h" #define REVERSE_PLUGIN_SYMBOL XO("Reverse") diff --git a/src/effects/Silence.cpp b/src/effects/Silence.cpp index 39b30d0d7..2894ef1e7 100644 --- a/src/effects/Silence.cpp +++ b/src/effects/Silence.cpp @@ -19,6 +19,7 @@ #include #include "../ShuttleGui.h" +#include "../WaveTrack.h" EffectSilence::EffectSilence() { diff --git a/src/effects/Silence.h b/src/effects/Silence.h index 25be9f049..f95647257 100644 --- a/src/effects/Silence.h +++ b/src/effects/Silence.h @@ -15,7 +15,6 @@ #include -#include "../WaveTrack.h" #include "../widgets/NumericTextCtrl.h" #include "Generator.h" diff --git a/src/effects/StereoToMono.cpp b/src/effects/StereoToMono.cpp index d45c85e9a..bfdcf5a65 100644 --- a/src/effects/StereoToMono.cpp +++ b/src/effects/StereoToMono.cpp @@ -14,12 +14,12 @@ *//*******************************************************************/ #include "../Audacity.h" +#include "StereoToMono.h" #include #include "../Project.h" - -#include "StereoToMono.h" +#include "../WaveTrack.h" EffectStereoToMono::EffectStereoToMono() { diff --git a/src/effects/TwoPassSimpleMono.cpp b/src/effects/TwoPassSimpleMono.cpp index 57fe0bfb8..d1dbefd6e 100644 --- a/src/effects/TwoPassSimpleMono.cpp +++ b/src/effects/TwoPassSimpleMono.cpp @@ -22,6 +22,8 @@ doing the second pass over all selected tracks. #include "TwoPassSimpleMono.h" +#include "../WaveTrack.h" + bool EffectTwoPassSimpleMono::Process() { mPass = 0; diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index 058b1afca..0623ee16f 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -40,6 +40,8 @@ #include "../../ShuttleGui.h" #include "../../widgets/valnum.h" +#include "../../WaveTrack.h" + enum { ID_Program = 10000, diff --git a/src/export/Export.cpp b/src/export/Export.cpp index 6a02b36f0..3467fe28d 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -71,7 +71,6 @@ #include "../Prefs.h" #include "../Project.h" #include "../ShuttleGui.h" -#include "../Track.h" #include "../WaveTrack.h" #include "../widgets/Warning.h" #include "../AColor.h" diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index 34e77f9a6..6c42aba67 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,8 @@ #include "../float_cast.h" #include "../widgets/FileHistory.h" +#include "../Track.h" + //---------------------------------------------------------------------------- // ExportCLOptions diff --git a/src/export/ExportFFmpeg.cpp b/src/export/ExportFFmpeg.cpp index eb8b586c7..963165b5d 100644 --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -42,7 +42,6 @@ function. #include "../Project.h" #include "../Tags.h" #include "../Track.h" -#include "../WaveTrack.h" #include "Export.h" #include "ExportFFmpeg.h" diff --git a/src/export/ExportFLAC.cpp b/src/export/ExportFLAC.cpp index 159779bb3..972fe884f 100644 --- a/src/export/ExportFLAC.cpp +++ b/src/export/ExportFLAC.cpp @@ -41,6 +41,8 @@ and libvorbis examples, Monty #include "../Internat.h" #include "../Tags.h" +#include "../Track.h" + //---------------------------------------------------------------------------- // ExportFLACOptions Class //---------------------------------------------------------------------------- diff --git a/src/export/ExportMP2.cpp b/src/export/ExportMP2.cpp index 352bb5f9f..4e507ce67 100644 --- a/src/export/ExportMP2.cpp +++ b/src/export/ExportMP2.cpp @@ -55,7 +55,7 @@ #include "../Project.h" #include "../ShuttleGui.h" #include "../Tags.h" -#include "../WaveTrack.h" +#include "../Track.h" #define LIBTWOLAME_STATIC #include "twolame.h" diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp index ff9a2b886..9e846b6b3 100644 --- a/src/export/ExportMP3.cpp +++ b/src/export/ExportMP3.cpp @@ -86,7 +86,7 @@ #include "../Project.h" #include "../ShuttleGui.h" #include "../Tags.h" -#include "../WaveTrack.h" +#include "../Track.h" #include "../widgets/LinkingHtmlWindow.h" #include "FileDialog.h" diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index 139be1666..20f938c3b 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -48,6 +48,7 @@ #include "../Prefs.h" #include "../ShuttleGui.h" #include "../Tags.h" +#include "../WaveTrack.h" #include "../widgets/HelpSystem.h" diff --git a/src/export/ExportOGG.cpp b/src/export/ExportOGG.cpp index eafd27c1a..63f8f5316 100644 --- a/src/export/ExportOGG.cpp +++ b/src/export/ExportOGG.cpp @@ -35,6 +35,7 @@ #include "../Internat.h" #include "../Tags.h" +#include "../Track.h" //---------------------------------------------------------------------------- // ExportOGGOptions diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index 51a2f79ab..6d788838d 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -35,7 +35,6 @@ #include "../ShuttleGui.h" #include "../Tags.h" #include "../Track.h" -#include "../WaveTrack.h" #include "../ondemand/ODManager.h" #include "Export.h" diff --git a/src/import/ImportLOF.cpp b/src/import/ImportLOF.cpp index fb1d0ad1c..31058691f 100644 --- a/src/import/ImportLOF.cpp +++ b/src/import/ImportLOF.cpp @@ -90,7 +90,6 @@ #include "../Project.h" #include "../FileFormats.h" #include "../Prefs.h" -#include "../WaveTrack.h" #include "../Internat.h" #define BINARY_FILE_CHECK_BUFFER_SIZE 1024 diff --git a/src/ondemand/ODComputeSummaryTask.cpp b/src/ondemand/ODComputeSummaryTask.cpp index 9885d0ec2..32c9b0ad1 100644 --- a/src/ondemand/ODComputeSummaryTask.cpp +++ b/src/ondemand/ODComputeSummaryTask.cpp @@ -20,6 +20,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data. #include "ODComputeSummaryTask.h" #include "../blockfile/ODPCMAliasBlockFile.h" +#include "../WaveTrack.h" #include //36 blockfiles > 3 minutes stereo 44.1kHz per ODTask::DoSome diff --git a/src/ondemand/ODDecodeTask.cpp b/src/ondemand/ODDecodeTask.cpp index 3761d4ebf..744f8f6d4 100644 --- a/src/ondemand/ODDecodeTask.cpp +++ b/src/ondemand/ODDecodeTask.cpp @@ -18,6 +18,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data. #include "ODDecodeTask.h" #include "../blockfile/ODDecodeBlockFile.h" +#include "../WaveTrack.h" #include ///Creates a new task that computes summaries for a wavetrack that needs to be specified through SetWaveTrack() diff --git a/src/prefs/KeyConfigPrefs.cpp b/src/prefs/KeyConfigPrefs.cpp index 07e088512..e39621e15 100644 --- a/src/prefs/KeyConfigPrefs.cpp +++ b/src/prefs/KeyConfigPrefs.cpp @@ -20,12 +20,15 @@ KeyConfigPrefs and MousePrefs use. *//*********************************************************************/ #include "../Audacity.h" +#include "../Experimental.h" +#include "KeyConfigPrefs.h" #include #include #include #include #include +#include #include "../Prefs.h" #include "../Project.h" @@ -35,7 +38,6 @@ KeyConfigPrefs and MousePrefs use. #include "../Internat.h" #include "../ShuttleGui.h" -#include "KeyConfigPrefs.h" #include "FileDialog.h" diff --git a/src/prefs/KeyConfigPrefs.h b/src/prefs/KeyConfigPrefs.h index e6b2e942a..07bbd0b1d 100644 --- a/src/prefs/KeyConfigPrefs.h +++ b/src/prefs/KeyConfigPrefs.h @@ -30,6 +30,8 @@ class ShuttleGui; #include "PrefsPanel.h" +class wxStaticText; + class KeyConfigPrefs :public PrefsPanel { public: diff --git a/src/prefs/QualityPrefs.cpp b/src/prefs/QualityPrefs.cpp index 243d0c419..1f7e54918 100644 --- a/src/prefs/QualityPrefs.cpp +++ b/src/prefs/QualityPrefs.cpp @@ -16,6 +16,7 @@ *//*******************************************************************/ #include "../Audacity.h" +#include "QualityPrefs.h" #include @@ -26,8 +27,6 @@ #include "../SampleFormat.h" #include "../ShuttleGui.h" -#include "QualityPrefs.h" - #define ID_SAMPLE_RATE_CHOICE 7001 BEGIN_EVENT_TABLE(QualityPrefs, PrefsPanel) diff --git a/src/prefs/WaveformPrefs.cpp b/src/prefs/WaveformPrefs.cpp index 78bb92aaf..b29468947 100644 --- a/src/prefs/WaveformPrefs.cpp +++ b/src/prefs/WaveformPrefs.cpp @@ -21,6 +21,7 @@ Paul Licameli #include "../Project.h" #include "../TrackPanel.h" #include "../ShuttleGui.h" +#include "../WaveTrack.h" WaveformPrefs::WaveformPrefs(wxWindow * parent, WaveTrack *wt) : PrefsPanel(parent, _("Waveforms")) diff --git a/src/toolbars/ControlToolBar.cpp b/src/toolbars/ControlToolBar.cpp index c3abd8646..8a856a3c9 100644 --- a/src/toolbars/ControlToolBar.cpp +++ b/src/toolbars/ControlToolBar.cpp @@ -36,6 +36,7 @@ #include "../Audacity.h" #include "../Experimental.h" +#include "ControlToolBar.h" // For compilers that support precompilation, includes "wx/wx.h". #include @@ -51,7 +52,6 @@ #endif #include -#include "ControlToolBar.h" #include "TranscriptionToolBar.h" #include "MeterToolBar.h" @@ -62,7 +62,7 @@ #include "../Prefs.h" #include "../Project.h" #include "../Theme.h" -#include "../Track.h" +#include "../WaveTrack.h" #include "../widgets/AButton.h" #include "../widgets/Meter.h" diff --git a/src/toolbars/EditToolBar.cpp b/src/toolbars/EditToolBar.cpp index 16237ed01..9a77732b5 100644 --- a/src/toolbars/EditToolBar.cpp +++ b/src/toolbars/EditToolBar.cpp @@ -52,6 +52,7 @@ #include "../Prefs.h" #include "../Project.h" #include "../Theme.h" +#include "../Track.h" #include "../UndoManager.h" #include "../widgets/AButton.h" diff --git a/win/Projects/Audacity/Audacity.vcxproj b/win/Projects/Audacity/Audacity.vcxproj index 5c18d208c..44e173a79 100755 --- a/win/Projects/Audacity/Audacity.vcxproj +++ b/win/Projects/Audacity/Audacity.vcxproj @@ -544,6 +544,7 @@ + diff --git a/win/Projects/Audacity/Audacity.vcxproj.filters b/win/Projects/Audacity/Audacity.vcxproj.filters index ada5c9291..55ad05240 100755 --- a/win/Projects/Audacity/Audacity.vcxproj.filters +++ b/win/Projects/Audacity/Audacity.vcxproj.filters @@ -1700,6 +1700,9 @@ src/prefs + + src + From eaaab766db689002240a8a57d21f72695af342f9 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 4 Jul 2015 18:12:25 -0400 Subject: [PATCH 4/8] Remove WaveClip.h from other headers --- src/TrackPanel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TrackPanel.h b/src/TrackPanel.h index 6fe0a9978..0175c6a1b 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -22,7 +22,6 @@ #include "Experimental.h" #include "Sequence.h" //Stm: included for the sampleCount declaration -#include "WaveClip.h" #include "UndoManager.h" //JKC: Included for PUSH_XXX definitions. #include "widgets/NumericTextCtrl.h" @@ -49,6 +48,8 @@ class TrackPanelAx; class ViewInfo; class WaveTrack; +class WaveClip; +class Envelope; WX_DEFINE_ARRAY(LWSlider *, LWSliderArray); From 51d7b3670c0a60b73257d0f73c678834de81e09e Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 4 Jul 2015 13:58:01 -0400 Subject: [PATCH 5/8] Remove LabelTrack.h from other headers --- src/Track.cpp | 1 - src/WaveTrack.cpp | 2 -- src/effects/FindClipping.cpp | 1 + src/effects/FindClipping.h | 4 ++-- src/effects/vamp/VampEffect.cpp | 1 + src/effects/vamp/VampEffect.h | 4 ++-- src/export/Export.cpp | 1 - src/export/ExportFFmpeg.cpp | 1 - src/export/ExportFFmpegDialogs.cpp | 1 - src/export/ExportPCM.cpp | 1 - 10 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Track.cpp b/src/Track.cpp index f25b20918..07fc7a0aa 100644 --- a/src/Track.cpp +++ b/src/Track.cpp @@ -23,7 +23,6 @@ and TimeTrack. #include "Track.h" #include "WaveTrack.h" #include "NoteTrack.h" -#include "LabelTrack.h" #include "Project.h" #include "DirManager.h" diff --git a/src/WaveTrack.cpp b/src/WaveTrack.cpp index 2830eb48b..82b4cc333 100644 --- a/src/WaveTrack.cpp +++ b/src/WaveTrack.cpp @@ -39,8 +39,6 @@ Track classes. #include "float_cast.h" -#include "LabelTrack.h" - #include "Envelope.h" #include "Sequence.h" #include "Spectrum.h" diff --git a/src/effects/FindClipping.cpp b/src/effects/FindClipping.cpp index 3211a2d42..af70cf86d 100644 --- a/src/effects/FindClipping.cpp +++ b/src/effects/FindClipping.cpp @@ -30,6 +30,7 @@ #include "../ShuttleGui.h" #include "../widgets/valnum.h" +#include "../LabelTrack.h" #include "../Wavetrack.h" // Define keys, defaults, minimums, and maximums for the effect parameters diff --git a/src/effects/FindClipping.h b/src/effects/FindClipping.h index f550ff248..0505c253c 100644 --- a/src/effects/FindClipping.h +++ b/src/effects/FindClipping.h @@ -14,9 +14,9 @@ class wxString; -#include +class LabelTrack; -#include "../LabelTrack.h" +#include #include "Effect.h" diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index 0623ee16f..4f4e00fbc 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -40,6 +40,7 @@ #include "../../ShuttleGui.h" #include "../../widgets/valnum.h" +#include "../../LabelTrack.h" #include "../../WaveTrack.h" enum diff --git a/src/effects/vamp/VampEffect.h b/src/effects/vamp/VampEffect.h index 7e4d08d59..1c660d09d 100644 --- a/src/effects/vamp/VampEffect.h +++ b/src/effects/vamp/VampEffect.h @@ -25,10 +25,10 @@ #include -#include "../../LabelTrack.h" - #include "../Effect.h" +class LabelTrack; + #define VAMPEFFECTS_VERSION wxT("1.0.0.0") #define VAMPEFFECTS_FAMILY wxT("Vamp") diff --git a/src/export/Export.cpp b/src/export/Export.cpp index 3467fe28d..b38aeeeff 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -66,7 +66,6 @@ #include "../DirManager.h" #include "../FileFormats.h" #include "../Internat.h" -#include "../LabelTrack.h" #include "../Mix.h" #include "../Prefs.h" #include "../Project.h" diff --git a/src/export/ExportFFmpeg.cpp b/src/export/ExportFFmpeg.cpp index 963165b5d..6f85f461b 100644 --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -36,7 +36,6 @@ function. #include "../FileFormats.h" #include "../Internat.h" -#include "../LabelTrack.h" #include "../Mix.h" #include "../Prefs.h" #include "../Project.h" diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index 93de6aa88..442537531 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -56,7 +56,6 @@ #include "../FileFormats.h" #include "../Internat.h" -#include "../LabelTrack.h" #include "../Mix.h" #include "../Prefs.h" #include "../Project.h" diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index 6d788838d..5b4e5053e 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -28,7 +28,6 @@ #include "../FileFormats.h" #include "../Internat.h" -#include "../LabelTrack.h" #include "../Mix.h" #include "../Prefs.h" #include "../Project.h" From f81231efae9a727a0270639b3f71a295831628bf Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 5 Jul 2015 11:22:03 -0400 Subject: [PATCH 6/8] Remove Sequence.h from other headers --- src/AutoRecovery.cpp | 1 + src/Dependencies.cpp | 1 + src/FFmpeg.h | 6 +++--- src/Project.cpp | 1 + src/TrackArtist.cpp | 1 - src/TrackPanel.h | 2 +- src/WaveClip.cpp | 11 +++++++++++ src/WaveClip.h | 8 +++++--- src/WaveTrack.h | 1 - src/ondemand/ODComputeSummaryTask.cpp | 1 + src/ondemand/ODDecodeTask.cpp | 1 + src/toolbars/TranscriptionToolBar.cpp | 2 +- src/toolbars/TranscriptionToolBar.h | 4 ++-- src/widgets/Meter.h | 5 ++--- src/widgets/NumericTextCtrl.cpp | 4 ++-- 15 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/AutoRecovery.cpp b/src/AutoRecovery.cpp index df1d903bc..2f5430c92 100644 --- a/src/AutoRecovery.cpp +++ b/src/AutoRecovery.cpp @@ -19,6 +19,7 @@ recover previous Audacity projects that were closed incorrectly. #include "AudacityApp.h" #include "FileNames.h" #include "blockfile/SimpleBlockFile.h" +#include "Sequence.h" #include "ShuttleGui.h" #include diff --git a/src/Dependencies.cpp b/src/Dependencies.cpp index 1b5b1a92e..3a3df38e1 100644 --- a/src/Dependencies.cpp +++ b/src/Dependencies.cpp @@ -36,6 +36,7 @@ #include "Internat.h" #include "Prefs.h" #include "Project.h" +#include "Sequence.h" #include "ShuttleGui.h" #include "WaveTrack.h" #include "WaveClip.h" diff --git a/src/FFmpeg.h b/src/FFmpeg.h index 79cd36261..aef40ae8b 100644 --- a/src/FFmpeg.h +++ b/src/FFmpeg.h @@ -128,6 +128,8 @@ extern "C" { #endif #include "Audacity.h" +#include "Experimental.h" + /* rather earlier than normal, but pulls in config*.h and other program stuff * we need for the next bit */ #include @@ -141,10 +143,8 @@ extern "C" { #include "Prefs.h" #include #include -// needed for sampleCount -#include "Sequence.h" -#include "Experimental.h" +#include "audacity/Types.h" // if you needed them, any other audacity header files would go here diff --git a/src/Project.cpp b/src/Project.cpp index 758476cdf..7d9d72999 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -110,6 +110,7 @@ scroll information. It also has some status flags. #include "Mix.h" #include "NoteTrack.h" #include "Prefs.h" +#include "Sequence.h" #include "Snap.h" #include "Tags.h" #include "TimeTrack.h" diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 09acf210e..3119e5bac 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -175,7 +175,6 @@ audio tracks. #include "Prefs.h" #include "prefs/SpectrogramSettings.h" #include "prefs/WaveformSettings.h" -#include "Sequence.h" #include "Spectrum.h" #include "ViewInfo.h" #include "widgets/Ruler.h" diff --git a/src/TrackPanel.h b/src/TrackPanel.h index 0175c6a1b..7842b219d 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -21,7 +21,7 @@ #include #include "Experimental.h" -#include "Sequence.h" //Stm: included for the sampleCount declaration +#include "audacity/Types.h" #include "UndoManager.h" //JKC: Included for PUSH_XXX definitions. #include "widgets/NumericTextCtrl.h" diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index 7062ebd2b..572bf676c 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -27,6 +27,7 @@ #include #include +#include "Sequence.h" #include "Spectrum.h" #include "Prefs.h" #include "Envelope.h" @@ -368,6 +369,11 @@ bool WaveClip::SetSamples(samplePtr buffer, sampleFormat format, return bResult; } +BlockArray* WaveClip::GetSequenceBlockArray() +{ + return mSequence->GetBlockArray(); +} + double WaveClip::GetStartTime() const { // JS: mOffset is the minimum value and it is returned; no clipping to 0 @@ -395,6 +401,11 @@ sampleCount WaveClip::GetEndSample() const return GetStartSample() + mSequence->GetNumSamples(); } +sampleCount WaveClip::GetNumSamples() const +{ + return mSequence->GetNumSamples(); +} + bool WaveClip::WithinClip(double t) const { sampleCount ts = (sampleCount)floor(t * mRate + 0.5); diff --git a/src/WaveClip.h b/src/WaveClip.h index 686472923..0beddc6dd 100644 --- a/src/WaveClip.h +++ b/src/WaveClip.h @@ -14,7 +14,6 @@ #include "Audacity.h" #include "SampleFormat.h" -#include "Sequence.h" #include "widgets/ProgressDialog.h" #include "ondemand/ODTaskThread.h" #include "xml/XMLTagHandler.h" @@ -31,7 +30,10 @@ #include +class BlockArray; +class DirManager; class Envelope; +class Sequence; class SpectrogramSettings; class WaveCache; class WaveTrackCache; @@ -249,7 +251,7 @@ public: double GetEndTime() const; sampleCount GetStartSample() const; sampleCount GetEndSample() const; - sampleCount GetNumSamples() const { return mSequence->GetNumSamples(); } + sampleCount GetNumSamples() const; // One and only one of the following is true for a given t (unless the clip // has zero length -- then BeforeClip() and AfterClip() can both be true). @@ -264,7 +266,7 @@ public: sampleCount start, sampleCount len); Envelope* GetEnvelope() { return mEnvelope; } - BlockArray* GetSequenceBlockArray() { return mSequence->GetBlockArray(); } + BlockArray* GetSequenceBlockArray(); // Get low-level access to the sequence. Whenever possible, don't use this, // but use more high-level functions inside WaveClip (or add them if you diff --git a/src/WaveTrack.h b/src/WaveTrack.h index b2d2b1229..61c063e36 100644 --- a/src/WaveTrack.h +++ b/src/WaveTrack.h @@ -13,7 +13,6 @@ #include "Track.h" #include "SampleFormat.h" -#include "Sequence.h" #include "WaveClip.h" #include "Experimental.h" #include "widgets/ProgressDialog.h" diff --git a/src/ondemand/ODComputeSummaryTask.cpp b/src/ondemand/ODComputeSummaryTask.cpp index 32c9b0ad1..7bc0ca0c0 100644 --- a/src/ondemand/ODComputeSummaryTask.cpp +++ b/src/ondemand/ODComputeSummaryTask.cpp @@ -20,6 +20,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data. #include "ODComputeSummaryTask.h" #include "../blockfile/ODPCMAliasBlockFile.h" +#include "../Sequence.h" #include "../WaveTrack.h" #include diff --git a/src/ondemand/ODDecodeTask.cpp b/src/ondemand/ODDecodeTask.cpp index 744f8f6d4..bd4f483ae 100644 --- a/src/ondemand/ODDecodeTask.cpp +++ b/src/ondemand/ODDecodeTask.cpp @@ -18,6 +18,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data. #include "ODDecodeTask.h" #include "../blockfile/ODDecodeBlockFile.h" +#include "../Sequence.h" #include "../WaveTrack.h" #include diff --git a/src/toolbars/TranscriptionToolBar.cpp b/src/toolbars/TranscriptionToolBar.cpp index 9e71f691c..f99412584 100644 --- a/src/toolbars/TranscriptionToolBar.cpp +++ b/src/toolbars/TranscriptionToolBar.cpp @@ -15,6 +15,7 @@ *//*******************************************************************/ #include "../Audacity.h" +#include "TranscriptionToolBar.h" // For compilers that support precompilation, includes "wx/wx.h". #include @@ -28,7 +29,6 @@ #endif // WX_PRECOMP #include "../Envelope.h" -#include "TranscriptionToolBar.h" #include "ControlToolBar.h" #include "../AudacityApp.h" diff --git a/src/toolbars/TranscriptionToolBar.h b/src/toolbars/TranscriptionToolBar.h index 7a385173b..46af84a20 100644 --- a/src/toolbars/TranscriptionToolBar.h +++ b/src/toolbars/TranscriptionToolBar.h @@ -18,7 +18,7 @@ #include #include -#include "../Sequence.h" +#include "audacity/Types.h" #include "../Theme.h" class wxBitmap; @@ -82,7 +82,7 @@ class TranscriptionToolBar:public ToolBar { virtual void OnSensitivitySlider(wxCommandEvent & event); virtual void Populate(); - virtual void Repaint(wxDC * WXUNUSED(dc)) {}; + virtual void Repaint(wxDC * WXUNUSED(dc)) {} virtual void EnableDisableButtons(); virtual void UpdatePrefs(); diff --git a/src/widgets/Meter.h b/src/widgets/Meter.h index c97e0a011..55bfd7fa2 100644 --- a/src/widgets/Meter.h +++ b/src/widgets/Meter.h @@ -21,7 +21,6 @@ #include #include "../SampleFormat.h" -#include "../Sequence.h" #include "Ruler.h" // Event used to notify all meters of preference changes @@ -57,8 +56,8 @@ class MeterUpdateMsg int tailPeakCount[kMaxMeterBars]; /* neither constructor nor destructor do anything */ - MeterUpdateMsg() { }; - ~MeterUpdateMsg() { }; + MeterUpdateMsg() { } + ~MeterUpdateMsg() { } /* for debugging purposes, printing the values out is really handy */ /** \brief Print out all the values in the meter update message */ wxString toString(); diff --git a/src/widgets/NumericTextCtrl.cpp b/src/widgets/NumericTextCtrl.cpp index 76da2b9df..71c16257c 100644 --- a/src/widgets/NumericTextCtrl.cpp +++ b/src/widgets/NumericTextCtrl.cpp @@ -166,9 +166,9 @@ different formats. #include "../Audacity.h" -#include "../AudacityApp.h" #include "NumericTextCtrl.h" -#include "../Sequence.h" // for sampleCount +#include "audacity/Types.h" +#include "../AudacityApp.h" #include "../Theme.h" #include "../AllThemeResources.h" #include "../AColor.h" From cab89f6fb42aa3a438a28bbfb2ecda8338c173b4 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 5 Jul 2015 11:25:32 -0400 Subject: [PATCH 7/8] Remove Envelope.h from other headers --- src/AudioIO.cpp | 3 +-- src/FreqWindow.cpp | 1 + src/Mix.cpp | 1 - src/TimeTrack.cpp | 1 + src/effects/ChangeSpeed.cpp | 1 - src/effects/ClickRemoval.h | 3 +-- src/effects/Contrast.cpp | 1 - src/effects/Equalization.h | 2 +- src/prefs/BatchPrefs.cpp | 1 - src/widgets/Meter.cpp | 1 + src/widgets/Ruler.h | 1 - 11 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index 5f5a27ae4..aa2ca29f1 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -295,6 +295,7 @@ writing audio. #include #include "AudacityApp.h" +#include "Envelope.h" #include "Mix.h" #include "MixerBoard.h" #include "Resample.h" @@ -308,8 +309,6 @@ writing audio. #include "toolbars/ControlToolBar.h" #include "widgets/Meter.h" -#include "Experimental.h" - #ifdef EXPERIMENTAL_MIDI_OUT #define MIDI_SLEEP 10 /* milliseconds */ #define ROUND(x) (int) ((x)+0.5) diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index 0d9a6f841..7e942a920 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -71,6 +71,7 @@ and in the spectrogram spectral selection. #include +#include "Envelope.h" #include "ShuttleGui.h" #include "AColor.h" #include "FFT.h" diff --git a/src/Mix.cpp b/src/Mix.cpp index c2a74860f..3ed5e4b7d 100644 --- a/src/Mix.cpp +++ b/src/Mix.cpp @@ -35,7 +35,6 @@ #include "WaveTrack.h" #include "DirManager.h" -#include "Envelope.h" #include "Internat.h" #include "Prefs.h" #include "Project.h" diff --git a/src/TimeTrack.cpp b/src/TimeTrack.cpp index ea121cf4a..24464efd7 100644 --- a/src/TimeTrack.cpp +++ b/src/TimeTrack.cpp @@ -19,6 +19,7 @@ #include #include "AColor.h" #include "widgets/Ruler.h" +#include "Envelope.h" #include "Prefs.h" #include "Internat.h" #include "Resample.h" diff --git a/src/effects/ChangeSpeed.cpp b/src/effects/ChangeSpeed.cpp index f142ebce6..705df25bd 100644 --- a/src/effects/ChangeSpeed.cpp +++ b/src/effects/ChangeSpeed.cpp @@ -20,7 +20,6 @@ #include -#include "../Envelope.h" #include "../LabelTrack.h" #include "../Prefs.h" #include "../Project.h" diff --git a/src/effects/ClickRemoval.h b/src/effects/ClickRemoval.h index b4707d39a..723fd9e59 100644 --- a/src/effects/ClickRemoval.h +++ b/src/effects/ClickRemoval.h @@ -21,10 +21,9 @@ #include #include -#include "../Envelope.h" - #include "Effect.h" +class Envelope; class ShuttleGui; #define CLICKREMOVAL_PLUGIN_SYMBOL XO("Click Removal") diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 1615c6fd7..12ca38e74 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -14,7 +14,6 @@ #include "../AudacityApp.h" -#include "../Envelope.h" #include "../FFT.h" #include "../WaveTrack.h" #include "../Prefs.h" diff --git a/src/effects/Equalization.h b/src/effects/Equalization.h index e4de76506..a2ec0a904 100644 --- a/src/effects/Equalization.h +++ b/src/effects/Equalization.h @@ -35,7 +35,6 @@ #endif #include "Effect.h" -#include "../Envelope.h" #include "../xml/XMLTagHandler.h" #include "../widgets/Grid.h" #include "../widgets/Ruler.h" @@ -44,6 +43,7 @@ #define EQUALIZATION_PLUGIN_SYMBOL XO("Equalization") +class Envelope; class EqualizationPanel; // diff --git a/src/prefs/BatchPrefs.cpp b/src/prefs/BatchPrefs.cpp index 94ce27880..58454628c 100644 --- a/src/prefs/BatchPrefs.cpp +++ b/src/prefs/BatchPrefs.cpp @@ -21,7 +21,6 @@ #include #include "BatchPrefs.h" -#include "../Envelope.h" #include "../Languages.h" #include "../Prefs.h" #include "../Project.h" diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 2f7edde48..c593e550b 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -60,6 +60,7 @@ #include "../AudioIO.h" #include "../AColor.h" +#include "../Envelope.h" #include "../ImageManipulation.h" #include "../Project.h" #include "../toolbars/MeterToolBar.h" diff --git a/src/widgets/Ruler.h b/src/widgets/Ruler.h index 60b988d72..f33ad2e33 100644 --- a/src/widgets/Ruler.h +++ b/src/widgets/Ruler.h @@ -16,7 +16,6 @@ #include #include #include -#include "../Envelope.h" #include "../Experimental.h" class ViewInfo; From 4decbe80d30928f571a68e13c91dc05ade9fb480 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 5 Jul 2015 11:38:44 -0400 Subject: [PATCH 8/8] Remove Meter.h from other headers --- src/MixerBoard.cpp | 2 ++ src/MixerBoard.h | 6 +++--- src/Project.cpp | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index 9dd6ec7e4..6f350ef28 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -28,6 +28,8 @@ #include "Project.h" #include "WaveTrack.h" +#include "widgets/Meter.h" + #include "../images/MusicalInstruments.h" #ifdef __WXMSW__ diff --git a/src/MixerBoard.h b/src/MixerBoard.h index 057420226..15e9522dd 100644 --- a/src/MixerBoard.h +++ b/src/MixerBoard.h @@ -24,7 +24,6 @@ #include "widgets/AButton.h" #include "widgets/ASlider.h" -#include "widgets/Meter.h" // containment hierarchy: // MixerBoardFrame -> MixerBoard -> MixerBoardScrolledWindow -> MixerTrackCluster(s) @@ -45,7 +44,7 @@ public: bool canUseShift = true, float stepValue = STEP_CONTINUOUS, int orientation = wxHORIZONTAL); - virtual ~MixerTrackSlider() {}; + virtual ~MixerTrackSlider() {} void OnMouseEvent(wxMouseEvent & event); @@ -61,6 +60,7 @@ public: class AudacityProject; +class Meter; class MixerBoard; #ifdef EXPERIMENTAL_MIDI_OUT class Track; @@ -76,7 +76,7 @@ public: WaveTrack* pLeftTrack, WaveTrack* pRightTrack = NULL, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); - virtual ~MixerTrackCluster() {}; + virtual ~MixerTrackCluster() {} void HandleResize(); // For wxSizeEvents, update gain slider and meter. diff --git a/src/Project.cpp b/src/Project.cpp index 7d9d72999..21bdbe262 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -121,7 +121,6 @@ scroll information. It also has some status flags. #include "prefs/PrefsDialog.h" #include "widgets/LinkingHtmlWindow.h" #include "widgets/ErrorDialog.h" -#include "widgets/Meter.h" #include "widgets/Ruler.h" #include "widgets/Warning.h" #include "xml/XMLFileReader.h"