WaveTrack.h does not include WaveClip.h

This commit is contained in:
Paul Licameli 2018-12-04 21:54:40 -05:00
parent 5e7d41ec07
commit b4ce681867
23 changed files with 62 additions and 29 deletions

View File

@ -32,6 +32,7 @@ text or binary format to a file.
#include <wx/dialog.h>
#include <wx/app.h>
#include "WaveClip.h"
#include "WaveTrack.h"
#include "widgets/ErrorDialog.h"

View File

@ -37,6 +37,7 @@ of the BlockFile system.
#include "DirManager.h"
#include "ShuttleGui.h"
#include "Project.h"
#include "WaveClip.h"
#include "WaveTrack.h"
#include "Sequence.h"
#include "Prefs.h"

View File

@ -117,6 +117,7 @@ scroll information. It also has some status flags.
#include "Tags.h"
#include "TimeTrack.h"
#include "TrackPanel.h"
#include "WaveClip.h"
#include "WaveTrack.h"
#include "DirManager.h"
#include "commands/CommandManager.h"

View File

@ -17,6 +17,7 @@
#include "Project.h"
#include "LabelTrack.h"
#include "NoteTrack.h"
#include "WaveClip.h"
#include "WaveTrack.h"
inline bool operator < (SnapPoint s1, SnapPoint s2)

View File

@ -72,6 +72,7 @@ audio tracks.
#include "BlockFile.h"
#include "Envelope.h"
#include "NumberScale.h"
#include "WaveClip.h"
#include "WaveTrack.h"
#include "LabelTrack.h"
#include "TimeTrack.h"

View File

@ -30,6 +30,7 @@ UndoManager
#include "Internat.h"
#include "Project.h"
#include "Sequence.h"
#include "WaveClip.h"
#include "WaveTrack.h" // temp
#include "NoteTrack.h" // for Sonify* function declarations
#include "Diags.h"

View File

@ -122,10 +122,6 @@ using WaveClipHolder = std::shared_ptr< WaveClip >;
using WaveClipHolders = std::vector < WaveClipHolder >;
using WaveClipConstHolders = std::vector < std::shared_ptr< const WaveClip > >;
// Temporary arrays of mere pointers
using WaveClipPointers = std::vector < WaveClip* >;
using WaveClipConstPointers = std::vector < const WaveClip* >;
// A bundle of arrays needed for drawing waveforms. The object may or may not
// own the storage for those arrays. If it does, it destroys them.
class WaveDisplay

View File

@ -31,6 +31,8 @@ Track classes.
#include "Experimental.h"
#include "WaveClip.h"
#include <wx/defs.h>
#include <wx/intl.h>
#include <wx/debug.h>
@ -2825,3 +2827,29 @@ void WaveTrackCache::Free()
mOverlapBuffer.Free();
mNValidBuffers = 0;
}
auto WaveTrack::AllClipsIterator::operator ++ () -> AllClipsIterator &
{
// The unspecified sequence is a post-order, but there is no
// promise whether sister nodes are ordered in time.
if ( !mStack.empty() ) {
auto &pair = mStack.back();
if ( ++pair.first == pair.second ) {
mStack.pop_back();
}
else
push( (*pair.first)->GetCutLines() );
}
return *this;
}
void WaveTrack::AllClipsIterator::push( WaveClipHolders &clips )
{
auto pClips = &clips;
while (!pClips->empty()) {
auto first = pClips->begin();
mStack.push_back( Pair( first, pClips->end() ) );
pClips = &(*first)->GetCutLines();
}
}

View File

@ -13,7 +13,6 @@
#include "Track.h"
#include "SampleFormat.h"
#include "WaveClip.h"
#include "widgets/ProgressDialog.h"
#include <vector>
@ -31,6 +30,18 @@ class CutlineHandle;
class SampleHandle;
class EnvelopeHandle;
class Sequence;
class WaveClip;
// Array of pointers that assume ownership
using WaveClipHolder = std::shared_ptr< WaveClip >;
using WaveClipHolders = std::vector < WaveClipHolder >;
using WaveClipConstHolders = std::vector < std::shared_ptr< const WaveClip > >;
// Temporary arrays of mere pointers
using WaveClipPointers = std::vector < WaveClip* >;
using WaveClipConstPointers = std::vector < const WaveClip* >;
//
// Tolerance for merging wave tracks (in seconds)
//
@ -387,21 +398,7 @@ private:
return mStack.back().first->get();
}
AllClipsIterator &operator ++ ()
{
// The unspecified sequence is a post-order, but there is no
// promise whether sister nodes are ordered in time.
if ( !mStack.empty() ) {
auto &pair = mStack.back();
if ( ++pair.first == pair.second ) {
mStack.pop_back();
}
else
push( (*pair.first)->GetCutLines() );
}
return *this;
}
AllClipsIterator &operator ++ ();
// Define == well enough to serve for loop termination test
friend bool operator ==
@ -414,15 +411,7 @@ private:
private:
void push( WaveClipHolders &clips )
{
auto pClips = &clips;
while (!pClips->empty()) {
auto first = pClips->begin();
mStack.push_back( Pair( first, pClips->end() ) );
pClips = &(*first)->GetCutLines();
}
}
void push( WaveClipHolders &clips );
using Iterator = WaveClipHolders::iterator;
using Pair = std::pair< Iterator, Iterator >;

View File

@ -30,6 +30,7 @@ This class now lists
#include "../widgets/OverlayPanel.h"
#include "../TrackPanel.h"
#include "../Track.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../LabelTrack.h"
#include "../Envelope.h"

View File

@ -22,6 +22,7 @@
#include "../Project.h"
#include "../Track.h"
#include "../TrackPanel.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../Shuttle.h"
#include "../ShuttleGui.h"

View File

@ -22,6 +22,7 @@
#include "../Project.h"
#include "../Track.h"
#include "../TrackPanel.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../Envelope.h"
#include "../Shuttle.h"

View File

@ -93,6 +93,7 @@
#include "../Prefs.h"
#include "../Project.h"
#include "../TrackArtist.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../widgets/Ruler.h"
#include "../xml/XMLFileReader.h"

View File

@ -46,6 +46,7 @@
#include "../ShuttleGui.h"
#include "../widgets/HelpSystem.h"
#include "../Prefs.h"
#include "../RealFFTf.h"
#include "../WaveTrack.h"
#include "../widgets/ErrorDialog.h"

View File

@ -22,6 +22,7 @@
#include <wx/intl.h>
#include "../LabelTrack.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
//

View File

@ -1,6 +1,7 @@
#include "../Project.h"
#include "../TrackPanel.h"
#include "../UndoManager.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"

View File

@ -12,6 +12,7 @@
#include "../TimeTrack.h"
#include "../TrackPanel.h"
#include "../UndoManager.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"

View File

@ -11,6 +11,7 @@
#include "../TimerRecordDialog.h"
#include "../TrackPanel.h"
#include "../UndoManager.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"

View File

@ -22,6 +22,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data.
#include "../AudacityException.h"
#include "../blockfile/ODPCMAliasBlockFile.h"
#include "../Sequence.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include <wx/wx.h>

View File

@ -21,6 +21,7 @@ updating the ODDecodeBlockFile and the GUI of the newly available data.
#include "../blockfile/ODDecodeBlockFile.h"
#include "../Sequence.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include <wx/wx.h>

View File

@ -21,6 +21,7 @@ in a background thread.
#include "ODTask.h"
#include "ODManager.h"
#include "../WaveClip.h"
#include "../WaveTrack.h"
#include "../Project.h"
#include "../UndoManager.h"

View File

@ -27,6 +27,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../TrackPanel.h"
#include "../../TrackPanelMouseEvent.h"
#include "../../ViewInfo.h"
#include "../../WaveClip.h"
#include "../../WaveTrack.h"
#include "../../commands/CommandManager.h"
#include "../../commands/Keyboard.h"

View File

@ -22,6 +22,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../TrackPanelMouseEvent.h"
#include "../../toolbars/ToolsToolBar.h"
#include "../../UndoManager.h"
#include "../../WaveClip.h"
#include "../../WaveTrack.h"
#include "../../../images/Cursors.h"