Audacity  2.2.0
ImportRaw.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ImportRaw.h
6 
7  Dominic Mazzoni
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_IMPORT_RAW__
12 #define __AUDACITY_IMPORT_RAW__
13 
14 #include "../MemoryX.h"
15 
16 class TrackFactory;
17 class WaveTrack;
18 class DirManager;
19 class wxString;
20 class wxWindow;
21 
22 #include <vector>
23 
24 #ifdef __AUDACITY_OLD_STD__
25 
26 class TrackHolder : public std::shared_ptr < WaveTrack >
27 {
28 public:
29  // shared_ptr can construct from unique_ptr&& in newer std, but not older,
30  // so define it here
31  TrackHolder &operator=(std::unique_ptr<WaveTrack> &&that)
32  {
33  reset(that.release());
34  return *this;
35  }
36 };
37 
38 using TrackHolders = std::vector<TrackHolder>;
39 
40 #else
41 
42 using TrackHolders = std::vector<std::unique_ptr<WaveTrack>>;
43 
44 #endif
45 
46 
47 void ImportRaw(wxWindow *parent, const wxString &fileName,
48  TrackFactory *trackFactory, TrackHolders &outTracks);
49 
50 #endif
Creates and manages BlockFile objects.
Definition: DirManager.h:52
Used to create a WaveTrack, or a LabelTrack.. Implementation of the functions of this class are dispe...
Definition: Track.h:676
A Track that contains audio waveform data.
Definition: WaveTrack.h:76
void ImportRaw(wxWindow *parent, const wxString &fileName, TrackFactory *trackFactory, TrackHolders &outTracks)
Definition: ImportRaw.cpp:100
std::vector< std::unique_ptr< WaveTrack >> TrackHolders
Definition: ImportRaw.h:42