aboutsummaryrefslogtreecommitdiff
path: root/src/qmmp/cueparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmmp/cueparser.h')
-rw-r--r--src/qmmp/cueparser.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/qmmp/cueparser.h b/src/qmmp/cueparser.h
index 467430630..03cdec531 100644
--- a/src/qmmp/cueparser.h
+++ b/src/qmmp/cueparser.h
@@ -28,29 +28,114 @@
#include "trackinfo.h"
#include "qmmp_export.h"
+/*! @brief The CueParser class provides CUE parser.
+ * @author Ilya Kotov <forkotov02@ya.ru>
+ */
class QMMP_EXPORT CueParser
{
public:
+ /*!
+ * Constructs empty CUE parser.
+ */
CueParser();
+ /*!
+ * Constructs CUE parser and parses given content.
+ * \param data Content of CUE file.
+ * \param codecName Codec name ("UTF-8" by default).
+ */
CueParser(const QByteArray &data, const QByteArray &codecName = QByteArray());
+ /*!
+ * Object destructor.
+ */
~CueParser();
+ /*!
+ * Parses CUE file content.
+ * \param data Content of CUE file.
+ * \param codecName Codec name ("UTF-8" by default).
+ */
void loadData(const QByteArray &data, const QByteArray &codecName = QByteArray());
+ /*!
+ * Parses CUE file content.
+ * \param data Content of CUE file.
+ * \param codecName Codec.
+ */
void loadData(const QByteArray &data, QTextCodec *codec);
+ /*!
+ * Creates playlist using parsed CUE metadata.
+ * \param track Track number to return (-1 for all playlist or 1..n for specific track)
+ */
QList<TrackInfo *> createPlayList(int track = -1) const;
+ /*!
+ * Returns a list of data files.
+ */
const QStringList &files() const;
+ /*!
+ * Returns offset in milliseconds of the given \b track.
+ */
qint64 offset(int track) const;
+ /*!
+ * Returns duration in milliseconds of the given \b track.
+ */
qint64 duration(int track) const;
+ /*!
+ * Returns data file of the given \b track.
+ */
QString file(int track) const;
+ /*!
+ * Returns URL of the given \b track.
+ */
QString url(int track) const;
+ /*!
+ * Returns number of tracks.
+ */
int count() const;
+ /*!
+ * Returns \b true if parser has no data, otherwise returns \b false.
+ */
bool isEmpty() const;
+ /*!
+ * Returns information for the given \b track.
+ */
const TrackInfo *info(int track) const;
+ /*!
+ * Sets duration for the given content file.
+ * \param file Content file path.
+ * \param duration Duration in milliseconds.
+ */
void setDuration(const QString &file, qint64 duration);
+ /*!
+ * Sets duration for the single content file (useful for embedded CUE).
+ * \param duration Duration in milliseconds.
+ */
void setDuration(qint64 duration);
+ /*!
+ * Sets audio properties for the given content file.
+ * \param file Content file path.
+ * \param properties Audio properties.
+ */
void setProperties(const QString &file, const QMap<Qmmp::TrackProperty, QString> &properties);
+ /*!
+ * Sets audio properties for the single content file (useful for embedded CUE).
+ * \param properties Audio properties.
+ */
void setProperties(const QMap<Qmmp::TrackProperty, QString> &properties);
+ /*!
+ * Updates metadata of the \b track.
+ * \param track Track number (1..n).
+ * \param key Metadata key.
+ * \param value Metadata value.
+ */
void setMetaData(int track, Qmmp::MetaData key, const QVariant &value);
+ /*!
+ * Sets URLs for CUE tracks in the following format:
+ * {scheme}://{path}#{track number}
+ * \param scheme URL scheme.
+ * \param path Content file path.
+ */
void setUrl(const QString &scheme, const QString &path);
+ /*!
+ * Removes all parsed data.
+ */
void clear();
private: