1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2013 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 ///////////////////////////////////////////////////////////////////////////////
27 #include "Model_Artwork.h"
29 ///////////////////////////////////////////////////////////////////////////////
30 // Audio File - Meta Info
31 ///////////////////////////////////////////////////////////////////////////////
33 class AudioFileModel_MetaInfo : public QObject
38 //Constructors & Destructor
39 AudioFileModel_MetaInfo(void);
40 AudioFileModel_MetaInfo(const AudioFileModel_MetaInfo &model);
41 AudioFileModel_MetaInfo &operator=(const AudioFileModel_MetaInfo &model);
42 ~AudioFileModel_MetaInfo(void);
45 inline const QString &title(void) const { return m_titel; }
46 inline const QString &artist(void) const { return m_artist; }
47 inline const QString &album(void) const { return m_album; }
48 inline const QString &genre(void) const { return m_genre; }
49 inline const QString &comment(void) const { return m_comment; }
50 inline const QString &cover(void) const { return m_cover.filePath(); }
51 inline unsigned int year(void) const { return m_year; }
52 inline unsigned int position(void) const { return m_position; }
55 inline void setTitle(const QString &titel) { m_titel = titel.trimmed(); }
56 inline void setArtist(const QString &artist) { m_artist = artist.trimmed(); }
57 inline void setAlbum(const QString &album) { m_album = album.trimmed(); }
58 inline void setGenre(const QString &genre) { m_genre = genre.trimmed(); }
59 inline void setComment(const QString &comment) { m_comment = comment.trimmed(); }
60 inline const ArtworkModel &setCover(const QString &path, const bool isOwner) { m_cover.setFilePath(path, isOwner); }
61 inline void setYear(const unsigned int year) { m_year = year; }
62 inline void setPosition(const unsigned int position) { m_position = position; }
68 void update(const AudioFileModel_MetaInfo &model);
78 unsigned int m_position;
81 ///////////////////////////////////////////////////////////////////////////////
82 // Audio File - Technical Info
83 ///////////////////////////////////////////////////////////////////////////////
85 class AudioFileModel_TechInfo : public QObject
90 //Constructors & Destructor
91 AudioFileModel_TechInfo(void);
92 AudioFileModel_TechInfo(const AudioFileModel_TechInfo &model);
93 AudioFileModel_TechInfo &operator=(const AudioFileModel_TechInfo &model);
94 ~AudioFileModel_TechInfo(void);
97 inline const QString &containerType(void) const { return m_containerType; }
98 inline const QString &containerProfile(void) const { return m_containerProfile; }
99 inline const QString &audioType(void) const { return m_audioType; }
100 inline const QString &audioProfile(void) const { return m_audioProfile; }
101 inline const QString &audioVersion(void) const { return m_audioVersion; }
102 inline const QString &audioEncodeLib(void) const { return m_audioEncodeLib; }
103 inline unsigned int audioSamplerate(void) const { return m_audioSamplerate; }
104 inline unsigned int audioChannels(void) const { return m_audioChannels; }
105 inline unsigned int audioBitdepth(void) const { return m_audioBitdepth; }
106 inline unsigned int audioBitrate(void) const { return m_audioBitrate; }
107 inline unsigned int audioBitrateMode(void) const { return m_audioBitrateMode; }
108 inline unsigned int duration(void) const { return m_duration; }
111 inline const QString &setContainerType(const QString &containerType) { m_containerType = containerType.trimmed(); }
112 inline const QString &setContainerProfile(const QString &containerProfile) { m_containerProfile = containerProfile.trimmed(); }
113 inline const QString &setAudioType(const QString &audioType) { m_audioType = audioType.trimmed(); }
114 inline const QString &setAudioProfile(const QString &audioProfile) { m_audioProfile = audioProfile.trimmed(); }
115 inline const QString &setAudioVersion(const QString &audioVersion) { m_audioVersion = audioVersion.trimmed(); }
116 inline const QString &setAudioEncodeLib(const QString &audioEncodeLib) { m_audioEncodeLib = audioEncodeLib.trimmed(); }
117 inline unsigned int setAudioSamplerate(const unsigned int audioSamplerate) { m_audioSamplerate = audioSamplerate; }
118 inline unsigned int setAudioChannels(const unsigned int audioChannels) { m_audioChannels = audioChannels; }
119 inline unsigned int setAudioBitdepth(const unsigned int audioBitdepth) { m_audioBitdepth = audioBitdepth; }
120 inline unsigned int setAudioBitrate(const unsigned int audioBitrate) { m_audioBitrate = audioBitrate; }
121 inline unsigned int setAudioBitrateMode(const unsigned int audioBitrateMode) { m_audioBitrateMode = audioBitrateMode; }
122 inline void setDuration(const unsigned int duration) { m_duration = duration; }
128 QString m_containerType;
129 QString m_containerProfile;
131 QString m_audioProfile;
132 QString m_audioVersion;
133 QString m_audioEncodeLib;
134 unsigned int m_audioSamplerate;
135 unsigned int m_audioChannels;
136 unsigned int m_audioBitdepth;
137 unsigned int m_audioBitrate;
138 unsigned int m_audioBitrateMode;
139 unsigned int m_duration;
142 ///////////////////////////////////////////////////////////////////////////////
144 ///////////////////////////////////////////////////////////////////////////////
146 class AudioFileModel : public QObject
154 BitrateModeUndefined = 0,
155 BitrateModeConstant = 1,
156 BitrateModeVariable = 2,
160 static const unsigned int BITDEPTH_IEEE_FLOAT32;
162 //Constructors & Destructor
163 AudioFileModel(const QString &path = QString());
164 AudioFileModel(const AudioFileModel &model);
165 AudioFileModel &operator=(const AudioFileModel &model);
166 ~AudioFileModel(void);
169 inline const QString &filePath(void) const { return m_filePath; }
170 inline const AudioFileModel_MetaInfo &metaInfo(void) const { return m_metaInfo; }
171 inline const AudioFileModel_TechInfo &techInfo(void) const { return m_techInfo; }
172 inline AudioFileModel_MetaInfo &metaInfo(void) { return m_metaInfo; }
173 inline AudioFileModel_TechInfo &techInfo(void) { return m_techInfo; }
176 inline const QString &setFilePath(const QString &filePath) { m_filePath = filePath; }
177 inline void setMetaInfo(const AudioFileModel_MetaInfo &metaInfo) { m_metaInfo = metaInfo; }
178 inline void setTechInfo(const AudioFileModel_TechInfo &techInfo) { m_techInfo = techInfo; }
181 const QString durationInfo(void) const;
182 const QString containerInfo(void) const;
183 const QString audioBaseInfo(void) const;
184 const QString audioCompressInfo(void) const;
191 AudioFileModel_MetaInfo m_metaInfo;
192 AudioFileModel_TechInfo m_techInfo;