1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
31 class AudioFileModel : public QObject
36 AudioFileModel(const QString &path = QString(), const QString &name = QString());
37 AudioFileModel(const AudioFileModel &model, bool copyMetaInfo = true);
38 AudioFileModel &operator=(const AudioFileModel &model);
39 ~AudioFileModel(void);
41 //-----------------------
43 //-----------------------
45 const QString &filePath(void) const;
46 const QString &fileName(void) const;
47 const QString &fileArtist(void) const;
48 const QString &fileAlbum(void) const;
49 const QString &fileGenre(void) const;
50 const QString &fileComment(void) const;
51 const QString &fileCover(void) const;
52 unsigned int fileYear(void) const;
53 unsigned int filePosition(void) const;
54 unsigned int fileDuration(void) const;
56 const QString &formatContainerType(void) const;
57 const QString &formatContainerProfile(void) const;
58 const QString &formatAudioType(void) const;
59 const QString &formatAudioProfile(void) const;
60 const QString &formatAudioVersion(void) const;
61 unsigned int formatAudioSamplerate(void) const;
62 unsigned int formatAudioChannels(void) const;
63 unsigned int formatAudioBitdepth(void) const;
65 const QString fileDurationInfo(void) const;
66 const QString formatContainerInfo(void) const;
67 const QString formatAudioBaseInfo(void) const;
68 const QString formatAudioCompressInfo(void) const;
70 //-----------------------
72 //-----------------------
74 void setFilePath(const QString &path);
75 void setFileName(const QString &name);
76 void setFileArtist(const QString &artist);
77 void setFileAlbum(const QString &album);
78 void setFileGenre(const QString &genre);
79 void setFileComment(const QString &comment);
80 void setFileCover(const QString &coverFile);
81 void setFileYear(unsigned int year);
82 void setFilePosition(unsigned int position);
83 void setFileDuration(unsigned int duration);
85 void setFormatContainerType(const QString &type);
86 void setFormatContainerProfile(const QString &profile);
87 void setFormatAudioType(const QString &type);
88 void setFormatAudioProfile(const QString &profile);
89 void setFormatAudioVersion(const QString &version);
90 void setFormatAudioSamplerate(unsigned int samplerate);
91 void setFormatAudioChannels(unsigned int channels);
92 void setFormatAudioBitdepth(unsigned int bitdepth);
94 void updateMetaInfo(const AudioFileModel &model);
102 QString m_fileComment;
104 unsigned int m_fileYear;
105 unsigned int m_filePosition;
106 unsigned int m_fileDuration;
108 QString m_formatContainerType;
109 QString m_formatContainerProfile;
110 QString m_formatAudioType;
111 QString m_formatAudioProfile;
112 QString m_formatAudioVersion;
113 unsigned int m_formatAudioSamplerate;
114 unsigned int m_formatAudioChannels;
115 unsigned int m_formatAudioBitdepth;
117 static QMutex m_mutexCovers;
118 static QMap<QString, unsigned int> m_counterCovers;
119 static QMap<QString, QFile*> m_locksCovers;