LameXP/src/Model_AudioFile.h

135 lines
4.4 KiB
C
Raw Normal View History

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
#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());
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);
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;
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);
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);
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);
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;
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;
QString m_formatAudioEncodeLib;
2010-11-06 23:04:47 +01:00
unsigned int m_formatAudioSamplerate;
unsigned int m_formatAudioChannels;
unsigned int m_formatAudioBitdepth;
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
};