summaryrefslogtreecommitdiffstats
path: root/src/track/beatmap.h
diff options
context:
space:
mode:
authorRJ Ryan <rryan@mixxx.org>2014-09-19 14:44:29 -0400
committerRJ Ryan <rryan@mixxx.org>2014-09-19 14:47:54 -0400
commit191f88e2403d41c66ee9d51cbbf6f2d43cb9b2f5 (patch)
treeaa454bd1a6bd4a121b9b3c87cb9f16a1a14caee5 /src/track/beatmap.h
parent416773cfb1d8a74bced287c64f21b4b5a88f1433 (diff)
Trust SoundSource decoded samplerate more than TagLib decoded samplerate when
creating BeatGrid/BeatMap. Fixes some cases of BPM detection failing.
Diffstat (limited to 'src/track/beatmap.h')
-rw-r--r--src/track/beatmap.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/track/beatmap.h b/src/track/beatmap.h
index 4d0489331d..88bf482683 100644
--- a/src/track/beatmap.h
+++ b/src/track/beatmap.h
@@ -22,10 +22,18 @@ typedef QList<mixxx::track::io::Beat> BeatList;
class BeatMap : public QObject, public Beats {
Q_OBJECT
public:
- BeatMap(TrackPointer pTrack, const QByteArray* pByteArray=NULL);
- // Construct a BeatMap, optionally providing a list of beat locations in
- // audio frames.
- BeatMap(TrackPointer pTrack, const QVector<double> beats = QVector<double>());
+ // Construct a BeatMap. iSampleRate may be provided if a more accurate
+ // sample rate is known than the one associated with the Track. If it is
+ // zero then the track's sample rate will be used. If a byte array is
+ // provided then the BeatMap will be deserialized from the byte array.
+ BeatMap(TrackPointer pTrack, int iSampleRate,
+ const QByteArray* pByteArray=NULL);
+ // Construct a BeatMap. iSampleRate may be provided if a more accurate
+ // sample rate is known than the one associated with the Track. If it is
+ // zero then the track's sample rate will be used. A list of beat locations
+ // in audio frames may be provided.
+ BeatMap(TrackPointer pTrack, int iSampleRate,
+ const QVector<double> beats = QVector<double>());
virtual ~BeatMap();
// See method comments in beats.h
@@ -69,7 +77,7 @@ class BeatMap : public QObject, public Beats {
void updated();
private:
- void initialize(TrackPointer pTrack);
+ void initialize(TrackPointer pTrack, int iSampleRate);
void readByteArray(const QByteArray* pByteArray);
void createFromBeatVector(QVector<double> beats);
void onBeatlistChanged();