1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Other methods of WaveTrack return void, will throw on failure instead

This commit is contained in:
Paul Licameli
2017-03-22 13:25:55 -04:00
parent e1473dfe76
commit 0d7250578d
12 changed files with 98 additions and 165 deletions

View File

@@ -150,7 +150,7 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
void SetVirtualState(bool state, bool half=false);
#endif
sampleFormat GetSampleFormat() const { return mFormat; }
bool ConvertToSampleFormat(sampleFormat format);
void ConvertToSampleFormat(sampleFormat format);
const SpectrogramSettings &GetSpectrogramSettings() const;
SpectrogramSettings &GetSpectrogramSettings();
@@ -176,31 +176,29 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
Track::Holder CopyNonconst(double t0, double t1) /* not override */;
void Clear(double t0, double t1) override;
bool Clear1(double t0, double t1) { Clear(t0, t1); return true; }
void Paste(double t0, const Track *src) override;
bool ClearAndPaste(double t0, double t1,
void ClearAndPaste(double t0, double t1,
const Track *src,
bool preserve = true,
bool merge = true,
const TimeWarper *effectWarper = NULL) /* not override */;
void Silence(double t0, double t1) override;
bool Silence1(double t0, double t1) { Silence(t0, t1); return true; }
void InsertSilence(double t, double len) override;
bool SplitAt(double t) /* not override */;
bool Split(double t0, double t1) /* not override */;
void SplitAt(double t) /* not override */;
void Split(double t0, double t1) /* not override */;
// Track::Holder CutAndAddCutLine(double t0, double t1) /* not override */;
bool ClearAndAddCutLine(double t0, double t1) /* not override */;
void ClearAndAddCutLine(double t0, double t1) /* not override */;
Track::Holder SplitCut(double t0, double t1) /* not override */;
bool SplitDelete(double t0, double t1) /* not override */;
bool Join(double t0, double t1) /* not override */;
bool Disjoin(double t0, double t1) /* not override */;
void SplitDelete(double t0, double t1) /* not override */;
void Join(double t0, double t1) /* not override */;
void Disjoin(double t0, double t1) /* not override */;
bool Trim(double t0, double t1) /* not override */;
void Trim(double t0, double t1) /* not override */;
bool HandleClear(double t0, double t1, bool addCutLines, bool split);
void HandleClear(double t0, double t1, bool addCutLines, bool split);
void SyncLockAdjust(double oldT1, double newT1) override;
@@ -218,20 +216,20 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
* appended to that clip. If there are no WaveClips in the track, then a NEW
* one is created.
*/
bool Append(samplePtr buffer, sampleFormat format,
void Append(samplePtr buffer, sampleFormat format,
size_t len, unsigned int stride=1,
XMLWriter* blockFileLog=NULL);
/// Flush must be called after last Append
bool Flush();
void Flush();
bool AppendAlias(const wxString &fName, sampleCount start,
void AppendAlias(const wxString &fName, sampleCount start,
size_t len, int channel,bool useOD);
///for use with On-Demand decoding of compressed files.
///decodeType should be an enum from ODDecodeTask that specifies what
///Type of encoded file this is, such as eODFLAC
//vvv Why not use the ODTypeEnum typedef to enforce that for the parameter?
bool AppendCoded(const wxString &fName, sampleCount start,
void AppendCoded(const wxString &fName, sampleCount start,
size_t len, int channel, int decodeType);
///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc.
@@ -256,7 +254,7 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
bool Get(samplePtr buffer, sampleFormat format,
sampleCount start, size_t len,
fillFormat fill = fillZero, bool mayThrow = true) const;
bool Set(samplePtr buffer, sampleFormat format,
void Set(samplePtr buffer, sampleFormat format,
sampleCount start, size_t len);
void GetEnvelopeValues(double *buffer, size_t bufferLen,
double t0) const;
@@ -488,7 +486,7 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
// Merge two clips, that is append data from clip2 to clip1,
// then remove clip2 from track.
// clipidx1 and clipidx2 are indices into the clip list.
bool MergeClips(int clipidx1, int clipidx2);
void MergeClips(int clipidx1, int clipidx2);
// Cache special locations (e.g. cut lines) for later speedy access
void UpdateLocationsCache() const;
@@ -497,7 +495,7 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
const std::vector<Location> &GetCachedLocations() const { return mDisplayLocationsCache; }
// Expand cut line (that is, re-insert audio, then DELETE audio saved in cut line)
bool ExpandCutLine(double cutLinePosition, double* cutlineStart = NULL, double* cutlineEnd = NULL);
void ExpandCutLine(double cutLinePosition, double* cutlineStart = NULL, double* cutlineEnd = NULL);
// Remove cut line, without expanding the audio in it
bool RemoveCutLine(double cutLinePosition);
@@ -507,7 +505,7 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
void Merge(const Track &orig) override;
// Resample track (i.e. all clips in the track)
bool Resample(int rate, ProgressDialog *progress = NULL);
void Resample(int rate, ProgressDialog *progress = NULL);
//
// AutoSave related