bpmdetect 0.8.11
Automatic BPM detection tool
Loading...
Searching...
No Matches
Track Class Reference

#include <track.h>

Inheritance diagram for Track:
Collaboration diagram for Track:

Public Types

enum  DetectionState { Detecting , Error }
Public Types inherited from QObject
enum  TimerId

Signals

void hasBpm (bpmtype bpm)
void progress (qint64 pos, qint64 length)
void finished ()

Public Member Functions

 Track (const QString &fileName, QAudioDecoder *decoder, QObject *parent=nullptr)
 Track (const QString &fileName, QObject *parent=nullptr)
void clearBpm ()
DetectionState detectBpm ()
void saveBpm ()
void printBpm () const
void setBpm (bpmtype dBpm)
bpmtype bpm () const
QString formatted () const
QString formatted (const QString &format) const
QString fileName () const
qlonglong length () const
QString formattedLength () const
bool isValid () const
QString artist () const
QString title () const
void setFormat (const QString &format=QStringLiteral("0.00"))
QString format () const
void stop ()
void readTags ()
void setDetector (AbstractBpmDetector *detector)
bool hasValidBpm () const
bool hasSavedBpm () const
QString hostFileName () const
Public Member Functions inherited from QObject
QBindable< QString > bindableObjectName ()
 QObject (QObject *parent)
 QT_NO_CONTEXTLESS_CONNECT QT_NO_CONTEXTLESS_CONNECT
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 Q_CLASSINFO (Name, Value)
 Q_EMIT Q_EMIT
 Q_ENUM (...)
 Q_ENUMS (...)
 Q_ENUM_NS (...)
 Q_FLAG (...)
 Q_FLAGS (...)
 Q_FLAG_NS (...)
 Q_GADGET Q_GADGET
 Q_GADGET_EXPORT (EXPORT_MACRO)
 Q_INTERFACES (...)
 Q_INVOKABLE Q_INVOKABLE
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 Q_NAMESPACE Q_NAMESPACE
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 Q_OBJECT Q_OBJECT
 Q_PROPERTY (...)
 Q_REVISION Q_REVISION
 Q_SET_OBJECT_NAME (Object)
 Q_SIGNAL Q_SIGNAL
 Q_SIGNALS Q_SIGNALS
 Q_SLOT Q_SLOT
 Q_SLOTS Q_SLOTS
T qobject_cast (QObject *object)
T qobject_cast (const QObject *object)
bool blockSignals (bool block)
virtual bool event (QEvent *e)
virtual bool eventFilter (QObject *watched, QEvent *event)
bool moveToThread (QThread *targetThread)
bool setProperty (const char *name, QVariant &&value)
bool setProperty (const char *name, const QVariant &value)
int startTimer (int interval, Qt::TimerType timerType)
int startTimer (std::chrono::nanoseconds interval, Qt::TimerType timerType)
void deleteLater ()
void destroyed (QObject *obj)
void installEventFilter (QObject *filterObj)
void killTimer (Qt::TimerId id)
void killTimer (int id)
void objectNameChanged (const QString &objectName)
void removeEventFilter (QObject *obj)
void setObjectName (QAnyStringView name)
void setObjectName (const QString &name)
void setParent (QObject *parent)
QList< QByteArray > dynamicPropertyNames () const const
QList< T > findChildren (QAnyStringView name, Qt::FindChildOptions options) const const
QList< T > findChildren (Qt::FindChildOptions options) const const
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
QObject * parent () const const
QString objectName () const const
QThread * thread () const const
QVariant property (const char *name) const const
T findChild (QAnyStringView name, Qt::FindChildOptions options) const const
T findChild (Qt::FindChildOptions options) const const
bool disconnect (const QObject *receiver, const char *method) const const
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
bool inherits (const char *className) const const
bool isQuickItemType () const const
bool isWidgetType () const const
bool isWindowType () const const
bool signalsBlocked () const const
virtual const QMetaObject * metaObject () const const
const QObjectList & children () const const
void dumpObjectInfo () const const
void dumpObjectTree () const const

Static Public Member Functions

static bpmtype correctBpm (bpmtype dBpm)
static void setMinimumBpm (bpmtype dMin)
static void setMaximumBpm (bpmtype dMax)
static bpmtype minimumBpm ()
static bpmtype maximumBpm ()
Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString tr (const char *sourceText, const char *disambiguation, int n)
bool disconnect (const QMetaObject::Connection &connection)
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)

Protected Member Functions

void storeBpm (const QString &sBpm)
void removeBpm ()
Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
virtual void connectNotify (const QMetaMethod &signal)
virtual void customEvent (QEvent *event)
virtual void disconnectNotify (const QMetaMethod &signal)
virtual void timerEvent (QTimerEvent *event)
QObject * sender () const const
bool isSignalConnected (const QMetaMethod &signal) const const
int receivers (const char *signal) const const
int senderSignalIndex () const const

Additional Inherited Members

Public Attributes inherited from QObject
typedef QObjectList
 Invalid
Properties inherited from QObject
 objectName

Detailed Description

Represents a file on the system.

Member Enumeration Documentation

◆ DetectionState

Possible states of BPM detection.

Enumerator
Detecting 

Currently detecting BPM.

Error 

Error occurred.

Constructor & Destructor Documentation

◆ Track() [1/2]

Track::Track ( const QString & fileName,
QAudioDecoder * decoder,
QObject * parent = nullptr )

Constructor.

Parameters
fileNameFilename.
decoderAudio decoder.
parentParent object.

◆ Track() [2/2]

Track::Track ( const QString & fileName,
QObject * parent = nullptr )

Constructor.

Parameters
fileNameFilename.
parentParent object.

Member Function Documentation

◆ artist()

QString Track::artist ( ) const

Get the track artist.

◆ bpm()

bpmtype Track::bpm ( ) const

Get the BPM.

◆ clearBpm()

void Track::clearBpm ( )

Clear the BPM.

◆ correctBpm()

bpmtype Track::correctBpm ( bpmtype dBpm)
static

Correct the BPM based on the global minimum and maximum.

◆ detectBpm()

Track::DetectionState Track::detectBpm ( )

Detect the BPM.

◆ fileName()

QString Track::fileName ( ) const

Get the file name.

◆ finished

void Track::finished ( )
signal

Signal for when audio is finished being decoded.

◆ format()

QString Track::format ( ) const

Get the BPM format.

◆ formatted() [1/2]

QString Track::formatted ( ) const

Get the BPM as a formatted string.

◆ formatted() [2/2]

QString Track::formatted ( const QString & format) const

Get the BPM as a string according to the format passed in.

◆ formattedLength()

QString Track::formattedLength ( ) const

Get the track length as a formatted string.

◆ hasBpm

void Track::hasBpm ( bpmtype bpm)
signal

Signal for when BPM has been determined.

Parameters
bpmDetected BPM.

◆ hasSavedBpm()

bool Track::hasSavedBpm ( ) const

If the BPM is saved in the file metadata.

◆ hasValidBpm()

bool Track::hasValidBpm ( ) const

Check if the BPM is set and is valid.

◆ hostFileName()

QString Track::hostFileName ( ) const

Get the host filename when sandboxed.

◆ isValid()

bool Track::isValid ( ) const

Check if the track is valid.

◆ length()

qlonglong Track::length ( ) const

Get the track length in miliseconds.

◆ maximumBpm()

bpmtype Track::maximumBpm ( )
static

Get the maximum BPM.

◆ minimumBpm()

bpmtype Track::minimumBpm ( )
static

Get the minimum BPM.

◆ printBpm()

void Track::printBpm ( ) const

Print the BPM to standard output.

◆ progress

void Track::progress ( qint64 pos,
qint64 length )
signal

Signal for progress updates.

Parameters
posCurrent position in milliseconds.
lengthTotal length in milliseconds.

◆ readTags()

void Track::readTags ( )

Read tags (artist, title, BPM).

◆ removeBpm()

void Track::removeBpm ( )
protected

Remove BPM metadata from the file.

◆ saveBpm()

void Track::saveBpm ( )

Save the BPM to the metadata of the file.

◆ setBpm()

void Track::setBpm ( bpmtype dBpm)

Set the BPM.

◆ setDetector()

void Track::setDetector ( AbstractBpmDetector * detector)

Set BPM detector.

◆ setFormat()

void Track::setFormat ( const QString & format = QStringLiteral("0.00"))

Set the format of the BPM string.

◆ setMaximumBpm()

void Track::setMaximumBpm ( bpmtype dMax)
static

Set maximum BPM.

Parameters
dMaxMaximum BPM.

◆ setMinimumBpm()

void Track::setMinimumBpm ( bpmtype dMin)
static

Set minimum BPM.

Parameters
dMinMinimum BPM.

◆ stop()

void Track::stop ( )

Stop detection if it is running.

◆ storeBpm()

void Track::storeBpm ( const QString & sBpm)
protected

Store sBpm into the metadata of the file.

◆ title()

QString Track::title ( ) const

Get the track title.


The documentation for this class was generated from the following files:
  • src/track/track.h
  • src/track/track.cpp