2010-11-06 23:04:47 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LameXP - Audio Encoder Front-End
|
2012-01-02 00:52:27 +01:00
|
|
|
// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
|
2010-11-06 23:04:47 +01:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
//
|
|
|
|
// http://www.gnu.org/licenses/gpl-2.0.txt
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2011-03-21 22:51:47 +01:00
|
|
|
#include "Model_Artwork.h"
|
|
|
|
|
2011-01-14 23:34:31 +01:00
|
|
|
#include <QObject>
|
2010-11-06 23:04:47 +01:00
|
|
|
#include <QString>
|
2011-03-20 23:32:11 +01:00
|
|
|
#include <QMap>
|
|
|
|
#include <QMutex>
|
|
|
|
|
2011-01-14 23:34:31 +01:00
|
|
|
class AudioFileModel : public QObject
|
2010-11-06 23:04:47 +01:00
|
|
|
{
|
2011-01-14 23:34:31 +01:00
|
|
|
Q_OBJECT
|
2010-11-06 23:04:47 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
AudioFileModel(const QString &path = QString(), const QString &name = QString());
|
2011-02-06 17:34:14 +01:00
|
|
|
AudioFileModel(const AudioFileModel &model, bool copyMetaInfo = true);
|
2011-01-14 23:34:31 +01:00
|
|
|
AudioFileModel &operator=(const AudioFileModel &model);
|
2010-11-06 23:04:47 +01:00
|
|
|
~AudioFileModel(void);
|
|
|
|
|
2011-05-31 19:04:45 +02:00
|
|
|
enum BitrateMode
|
|
|
|
{
|
|
|
|
BitrateModeUndefined = 0,
|
|
|
|
BitrateModeConstant = 1,
|
|
|
|
BitrateModeVariable = 2,
|
|
|
|
};
|
|
|
|
|
2010-11-06 23:04:47 +01:00
|
|
|
//-----------------------
|
|
|
|
//Getters
|
|
|
|
//-----------------------
|
|
|
|
|
|
|
|
const QString &filePath(void) const;
|
|
|
|
const QString &fileName(void) const;
|
|
|
|
const QString &fileArtist(void) const;
|
|
|
|
const QString &fileAlbum(void) const;
|
|
|
|
const QString &fileGenre(void) const;
|
|
|
|
const QString &fileComment(void) const;
|
2011-03-20 23:32:11 +01:00
|
|
|
const QString &fileCover(void) const;
|
2010-11-06 23:04:47 +01:00
|
|
|
unsigned int fileYear(void) const;
|
|
|
|
unsigned int filePosition(void) const;
|
|
|
|
unsigned int fileDuration(void) const;
|
|
|
|
|
|
|
|
const QString &formatContainerType(void) const;
|
|
|
|
const QString &formatContainerProfile(void) const;
|
|
|
|
const QString &formatAudioType(void) const;
|
|
|
|
const QString &formatAudioProfile(void) const;
|
|
|
|
const QString &formatAudioVersion(void) const;
|
|
|
|
unsigned int formatAudioSamplerate(void) const;
|
|
|
|
unsigned int formatAudioChannels(void) const;
|
|
|
|
unsigned int formatAudioBitdepth(void) const;
|
2011-05-31 19:04:45 +02:00
|
|
|
unsigned int formatAudioBitrate(void) const;
|
|
|
|
unsigned int formatAudioBitrateMode(void) const;
|
|
|
|
|
2010-11-06 23:04:47 +01:00
|
|
|
const QString fileDurationInfo(void) const;
|
|
|
|
const QString formatContainerInfo(void) const;
|
|
|
|
const QString formatAudioBaseInfo(void) const;
|
|
|
|
const QString formatAudioCompressInfo(void) const;
|
|
|
|
|
|
|
|
//-----------------------
|
|
|
|
//Setters
|
|
|
|
//-----------------------
|
|
|
|
|
|
|
|
void setFilePath(const QString &path);
|
|
|
|
void setFileName(const QString &name);
|
|
|
|
void setFileArtist(const QString &artist);
|
|
|
|
void setFileAlbum(const QString &album);
|
|
|
|
void setFileGenre(const QString &genre);
|
|
|
|
void setFileComment(const QString &comment);
|
2011-03-22 17:33:03 +01:00
|
|
|
void setFileCover(const QString &coverFile, bool owner);
|
|
|
|
void setFileCover(const ArtworkModel &model);
|
2010-11-06 23:04:47 +01:00
|
|
|
void setFileYear(unsigned int year);
|
|
|
|
void setFilePosition(unsigned int position);
|
|
|
|
void setFileDuration(unsigned int duration);
|
|
|
|
|
|
|
|
void setFormatContainerType(const QString &type);
|
|
|
|
void setFormatContainerProfile(const QString &profile);
|
|
|
|
void setFormatAudioType(const QString &type);
|
|
|
|
void setFormatAudioProfile(const QString &profile);
|
|
|
|
void setFormatAudioVersion(const QString &version);
|
2012-08-01 00:17:12 +02:00
|
|
|
void setFormatAudioEncodeLib(const QString &encodeLib);
|
2010-11-06 23:04:47 +01:00
|
|
|
void setFormatAudioSamplerate(unsigned int samplerate);
|
|
|
|
void setFormatAudioChannels(unsigned int channels);
|
|
|
|
void setFormatAudioBitdepth(unsigned int bitdepth);
|
2011-05-31 19:04:45 +02:00
|
|
|
void setFormatAudioBitrate(unsigned int bitrate);
|
|
|
|
void setFormatAudioBitrateMode(unsigned int bitrateMode);
|
2010-11-06 23:04:47 +01:00
|
|
|
|
2011-02-06 23:43:26 +01:00
|
|
|
void updateMetaInfo(const AudioFileModel &model);
|
|
|
|
|
2010-11-06 23:04:47 +01:00
|
|
|
private:
|
|
|
|
QString m_filePath;
|
|
|
|
QString m_fileName;
|
|
|
|
QString m_fileArtist;
|
|
|
|
QString m_fileAlbum;
|
|
|
|
QString m_fileGenre;
|
|
|
|
QString m_fileComment;
|
2011-03-21 22:51:47 +01:00
|
|
|
ArtworkModel m_fileCover;
|
2010-11-06 23:04:47 +01:00
|
|
|
unsigned int m_fileYear;
|
|
|
|
unsigned int m_filePosition;
|
|
|
|
unsigned int m_fileDuration;
|
|
|
|
|
|
|
|
QString m_formatContainerType;
|
|
|
|
QString m_formatContainerProfile;
|
|
|
|
QString m_formatAudioType;
|
|
|
|
QString m_formatAudioProfile;
|
|
|
|
QString m_formatAudioVersion;
|
2012-08-01 00:17:12 +02:00
|
|
|
QString m_formatAudioEncodeLib;
|
2010-11-06 23:04:47 +01:00
|
|
|
unsigned int m_formatAudioSamplerate;
|
|
|
|
unsigned int m_formatAudioChannels;
|
|
|
|
unsigned int m_formatAudioBitdepth;
|
2011-05-31 19:04:45 +02:00
|
|
|
unsigned int m_formatAudioBitrate;
|
|
|
|
unsigned int m_formatAudioBitrateMode;
|
2011-02-06 23:43:26 +01:00
|
|
|
|
|
|
|
void resetAll(void);
|
2010-11-06 23:04:47 +01:00
|
|
|
};
|