diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2021-02-28 23:35:49 +0100 |
---|---|---|
committer | Daniel Schürmann <daschuer@mixxx.org> | 2021-03-02 09:54:40 +0100 |
commit | ccb04a55dd0ec4e7ccb9561bea5296bc707e5f63 (patch) | |
tree | 333b340a03efc0c31a95736f3e2972eddaebf147 /src | |
parent | 3560c38dfbd0296f20c6c542b2c7c29873edf71b (diff) |
remove redundant namespace prefix
Diffstat (limited to 'src')
-rw-r--r-- | src/track/beatgrid.cpp | 28 | ||||
-rw-r--r-- | src/track/beatgrid.h | 12 | ||||
-rw-r--r-- | src/track/beatmap.cpp | 18 | ||||
-rw-r--r-- | src/track/beatmap.h | 8 | ||||
-rw-r--r-- | src/track/beats.h | 9 |
5 files changed, 38 insertions, 37 deletions
diff --git a/src/track/beatgrid.cpp b/src/track/beatgrid.cpp index d011220e76..7475dfc0ce 100644 --- a/src/track/beatgrid.cpp +++ b/src/track/beatgrid.cpp @@ -78,7 +78,7 @@ BeatGrid::BeatGrid(const BeatGrid& other) } // static -mixxx::BeatsPointer BeatGrid::makeBeatGrid(const Track& track, +BeatsPointer BeatGrid::makeBeatGrid(const Track& track, SINT iSampleRate, double dBpm, double dFirstBeatSample) { @@ -98,11 +98,11 @@ mixxx::BeatsPointer BeatGrid::makeBeatGrid(const Track& track, // Calculate beat length as sample offsets double beatLength = (60.0 * iSampleRate / dBpm) * kFrameSize; - return mixxx::BeatsPointer(new BeatGrid(track, iSampleRate, grid, beatLength)); + return BeatsPointer(new BeatGrid(track, iSampleRate, grid, beatLength)); } // static -mixxx::BeatsPointer BeatGrid::makeBeatGrid( +BeatsPointer BeatGrid::makeBeatGrid( const Track& track, SINT sampleRate, const QByteArray& byteArray) { if (sampleRate <= 0) { sampleRate = track.getSampleRate(); @@ -111,12 +111,12 @@ mixxx::BeatsPointer BeatGrid::makeBeatGrid( mixxx::track::io::BeatGrid grid; if (grid.ParseFromArray(byteArray.constData(), byteArray.length())) { double beatLength = (60.0 * sampleRate / grid.bpm().bpm()) * kFrameSize; - return mixxx::BeatsPointer(new BeatGrid(track, sampleRate, grid, beatLength)); + return BeatsPointer(new BeatGrid(track, sampleRate, grid, beatLength)); } // Legacy fallback for BeatGrid-1.0 if (byteArray.size() != sizeof(BeatGridData)) { - return mixxx::BeatsPointer(new BeatGrid(track, sampleRate)); + return BeatsPointer(new BeatGrid(track, sampleRate)); } const BeatGridData* blob = reinterpret_cast<const BeatGridData*>(byteArray.constData()); @@ -324,19 +324,19 @@ double BeatGrid::getBpmAroundPosition(double curSample, int n) const { return bpm(); } -mixxx::BeatsPointer BeatGrid::translate(double dNumSamples) const { +BeatsPointer BeatGrid::translate(double dNumSamples) const { if (!isValid()) { - return mixxx::BeatsPointer(new BeatGrid(*this)); + return BeatsPointer(new BeatGrid(*this)); } mixxx::track::io::BeatGrid grid = m_grid; double newFirstBeatFrames = (firstBeatSample() + dNumSamples) / kFrameSize; grid.mutable_first_beat()->set_frame_position( static_cast<google::protobuf::int32>(newFirstBeatFrames)); - return mixxx::BeatsPointer(new BeatGrid(*this, grid, m_dBeatLength)); + return BeatsPointer(new BeatGrid(*this, grid, m_dBeatLength)); } -mixxx::BeatsPointer BeatGrid::scale(enum BPMScale scale) const { +BeatsPointer BeatGrid::scale(enum BPMScale scale) const { mixxx::track::io::BeatGrid grid = m_grid; double bpm = grid.bpm().bpm(); @@ -361,26 +361,26 @@ mixxx::BeatsPointer BeatGrid::scale(enum BPMScale scale) const { break; default: DEBUG_ASSERT(!"scale value invalid"); - return mixxx::BeatsPointer(new BeatGrid(*this)); + return BeatsPointer(new BeatGrid(*this)); } if (bpm > getMaxBpm()) { - return mixxx::BeatsPointer(new BeatGrid(*this)); + return BeatsPointer(new BeatGrid(*this)); } grid.mutable_bpm()->set_bpm(bpm); double beatLength = (60.0 * m_iSampleRate / bpm) * kFrameSize; - return mixxx::BeatsPointer(new BeatGrid(*this, grid, beatLength)); + return BeatsPointer(new BeatGrid(*this, grid, beatLength)); } -mixxx::BeatsPointer BeatGrid::setBpm(double dBpm) { +BeatsPointer BeatGrid::setBpm(double dBpm) { if (dBpm > getMaxBpm()) { dBpm = getMaxBpm(); } mixxx::track::io::BeatGrid grid = m_grid; grid.mutable_bpm()->set_bpm(dBpm); double beatLength = (60.0 * m_iSampleRate / dBpm) * kFrameSize; - return mixxx::BeatsPointer(new BeatGrid(*this, grid, beatLength)); + return BeatsPointer(new BeatGrid(*this, grid, beatLength)); } } // namespace mixxx diff --git a/src/track/beatgrid.h b/src/track/beatgrid.h index 929dedbcc3..30d7dfe938 100644 --- a/src/track/beatgrid.h +++ b/src/track/beatgrid.h @@ -25,14 +25,14 @@ class BeatGrid final : public Beats { // Initializes the BeatGrid to have a BPM of dBpm and the first beat offset // of dFirstBeatSample. Does not generate an updated() signal, since it is // meant for initialization. - static mixxx::BeatsPointer makeBeatGrid(const Track& track, + static BeatsPointer makeBeatGrid(const Track& track, SINT iSampleRate, double dBpm, double dFirstBeatSample); // Construct a BeatGrid. If a more accurate sample rate is known, provide it // in the iSampleRate parameter -- otherwise pass 0. The BeatGrid will be // deserialized from the byte array. - static mixxx::BeatsPointer makeBeatGrid( + static BeatsPointer makeBeatGrid( const Track& track, SINT iSampleRate, const QByteArray& byteArray); // The following are all methods from the Beats interface, see method @@ -43,7 +43,6 @@ class BeatGrid final : public Beats { } QByteArray toByteArray() const override; - BeatsPointer clone() const override; QString getVersion() const override; QString getSubVersion() const override; void setSubVersion(const QString& subVersion) override; @@ -72,9 +71,10 @@ class BeatGrid final : public Beats { // Beat mutations //////////////////////////////////////////////////////////////////////////// - mixxx::BeatsPointer translate(double dNumSamples) const override; - mixxx::BeatsPointer scale(enum BPMScale scale) const override; - mixxx::BeatsPointer setBpm(double dBpm) override; + BeatsPointer clone() const override; + BeatsPointer translate(double dNumSamples) const override; + BeatsPointer scale(enum BPMScale scale) const override; + BeatsPointer setBpm(double dBpm) override; private: BeatGrid(const BeatGrid& other); diff --git a/src/track/beatmap.cpp b/src/track/beatmap.cpp index dc848d80a1..a400956403 100644 --- a/src/track/beatmap.cpp +++ b/src/track/beatmap.cpp @@ -584,10 +584,10 @@ double BeatMap::getBpmAroundPosition(double curSample, int n) const { return BeatUtils::calculateAverageBpm(numberOfBeats, m_iSampleRate, lowerFrame, upperFrame); } -mixxx::BeatsPointer BeatMap::translate(double dNumSamples) const { +BeatsPointer BeatMap::translate(double dNumSamples) const { // Converting to frame offset if (!isValid()) { - return mixxx::BeatsPointer(new BeatMap(*this)); + return BeatsPointer(new BeatMap(*this)); } BeatList beats = m_beats; @@ -603,13 +603,13 @@ mixxx::BeatsPointer BeatMap::translate(double dNumSamples) const { } } - return mixxx::BeatsPointer(new BeatMap(*this, beats, m_nominalBpm)); + return BeatsPointer(new BeatMap(*this, beats, m_nominalBpm)); } -mixxx::BeatsPointer BeatMap::scale(enum BPMScale scale) const { +BeatsPointer BeatMap::scale(enum BPMScale scale) const { QMutexLocker locker(&m_mutex); if (!isValid() || m_beats.isEmpty()) { - return mixxx::BeatsPointer(new BeatMap(*this)); + return BeatsPointer(new BeatMap(*this)); } BeatList beats = m_beats; @@ -648,17 +648,17 @@ mixxx::BeatsPointer BeatMap::scale(enum BPMScale scale) const { break; default: DEBUG_ASSERT(!"scale value invalid"); - return mixxx::BeatsPointer(new BeatMap(*this)); + return BeatsPointer(new BeatMap(*this)); } double bpm = calculateNominalBpm(beats, m_iSampleRate); - return mixxx::BeatsPointer(new BeatMap(*this, beats, bpm)); + return BeatsPointer(new BeatMap(*this, beats, bpm)); } -mixxx::BeatsPointer BeatMap::setBpm(double dBpm) { +BeatsPointer BeatMap::setBpm(double dBpm) { Q_UNUSED(dBpm); DEBUG_ASSERT(!"BeatMap::setBpm() not implemented"); - return mixxx::BeatsPointer(new BeatMap(*this)); + return BeatsPointer(new BeatMap(*this)); /* * One of the problems of beattracking algorithms is the so called "octave error" diff --git a/src/track/beatmap.h b/src/track/beatmap.h index b5aa1bf344..c56b655bba 100644 --- a/src/track/beatmap.h +++ b/src/track/beatmap.h @@ -48,7 +48,6 @@ class BeatMap final : public Beats { } QByteArray toByteArray() const override; - BeatsPointer clone() const override; QString getVersion() const override; QString getSubVersion() const override; void setSubVersion(const QString& subVersion) override; @@ -78,9 +77,10 @@ class BeatMap final : public Beats { // Beat mutations //////////////////////////////////////////////////////////////////////////// - mixxx::BeatsPointer translate(double dNumSamples) const override; - mixxx::BeatsPointer scale(enum BPMScale scale) const override; - mixxx::BeatsPointer setBpm(double dBpm) override; + BeatsPointer clone() const override; + BeatsPointer translate(double dNumSamples) const override; + BeatsPointer scale(enum BPMScale scale) const override; + BeatsPointer setBpm(double dBpm) override; private: BeatMap(const BeatMap& other); diff --git a/src/track/beats.h b/src/track/beats.h index 46a63e7873..7b6e2a299e 100644 --- a/src/track/beats.h +++ b/src/track/beats.h @@ -57,7 +57,6 @@ class Beats : public QObject { // Serialization virtual QByteArray toByteArray() const = 0; - virtual BeatsPointer clone() const = 0; // A string representing the version of the beat-processing code that // produced this Beats instance. Used by BeatsFactory for associating a @@ -144,18 +143,20 @@ class Beats : public QObject { // Beat mutations //////////////////////////////////////////////////////////////////////////// + virtual BeatsPointer clone() const = 0; + // Translate all beats in the song by dNumSamples samples. Beats that lie // before the start of the track or after the end of the track are not // removed. Beats instance must have the capability BEATSCAP_TRANSLATE. - virtual mixxx::BeatsPointer translate(double dNumSamples) const = 0; + virtual BeatsPointer translate(double dNumSamples) const = 0; // Scale the position of every beat in the song by dScalePercentage. Beats // class must have the capability BEATSCAP_SCALE. - virtual mixxx::BeatsPointer scale(enum BPMScale scale) const = 0; + virtual BeatsPointer scale(enum BPMScale scale) const = 0; // Adjust the beats so the global average BPM matches dBpm. Beats class must // have the capability BEATSCAP_SET. - virtual mixxx::BeatsPointer setBpm(double dBpm) = 0; + virtual BeatsPointer setBpm(double dBpm) = 0; signals: void updated(); |