19 #include <KLocalizedString> 26 #define FILE_INFO_PROPERTY_PREFIX _("FILE_INFO: ") 33 QString(), QString());
37 _(I18N_NOOP(
"Album")),
38 _(I18N_NOOP(
"Name of the album if the source is an album\n" 39 "that consist of more medias.")));
42 _(I18N_NOOP(
"Annotation")),
44 "Provides general comments about the file or the subject of\n" 45 "the file. If the comment is several sentences long, end\n" 46 "each sentence with a period. Do not include newline\n" 50 _(I18N_NOOP(
"Archival location")),
51 _(I18N_NOOP(
"Indicates where the subject of the file is archived.")));
54 _(I18N_NOOP(
"Author")),
55 _(I18N_NOOP(
"Identifies the name of the author of the original\n" 56 "subject of the file." 57 "\nExample: 'van Beethoven, Ludwig'")));
60 _(I18N_NOOP(
"Lower Bitrate")),
61 _(I18N_NOOP(
"Specifies the lower limit in a VBR bitstream.")));
64 _(I18N_NOOP(
"Bitrate Mode")),
65 _(I18N_NOOP(
"Bitrate Mode (ABR, VBR, CBR, etc...)")));
68 _(I18N_NOOP(
"Bitrate")),
70 "Nominal bitrate of the audio stream in bits per second")));
73 _(I18N_NOOP(
"Upper Bitrate")),
74 _(I18N_NOOP(
"Specifies the upper limit in a VBR bitstream.")));
77 _(I18N_NOOP(
"Bits per Sample")),
78 _(I18N_NOOP(
"Specifies the number of bits per sample.")));
83 "Number of the CD, if the source is an album of more CDROMs")));
88 "Number of CDs, if the source is an album of more CDROMs")));
91 _(I18N_NOOP(
"Commissioned")),
92 _(I18N_NOOP(
"Lists the name of the person or organization\n" 93 "that commissioned the subject of the file.")));
96 _(I18N_NOOP(
"Comments")),
98 "Provides general comments about the file or the subject of\n" 99 "the file. If the comment is several sentences long, end\n" 100 "each sentence with a period. Do not include newline\n" 104 _(I18N_NOOP(
"Compression")),
105 _(I18N_NOOP(
"Sets a mode for compressing the audio\n" 106 "data to reduce disk space.")));
109 _(I18N_NOOP(
"Contact")),
110 _(I18N_NOOP(
"Contact information for the creators or distributors of\n" 111 "the track. This could be a URL, an email address, the\n" 112 "physical address of the producing label.")));
115 _(I18N_NOOP(
"Copyright")),
116 _(I18N_NOOP(
"Records the copyright information for the file. " 118 "multiple copyrights, separate them by a semicolon followed\n" 120 "Example: 'Copyright Linux community 2002'")));
123 _(I18N_NOOP(
"Copyrighted")),
124 _(I18N_NOOP(
"Indicates whether the file is protected by " 125 "copyright or not.")));
128 _(I18N_NOOP(
"Date")),
129 _(I18N_NOOP(
"Specifies the date the subject of the file was created.\n" 130 "Example: '2001-12-24'")));
133 _(I18N_NOOP(
"Engineer")),
134 _(I18N_NOOP(
"Shows the name of the engineer who worked on the file.\n" 135 "If there are multiple engineers, separate the names by\n" 136 "a semicolon and a blank.")));
139 _(I18N_NOOP(
"Estimated Length")),
140 _(I18N_NOOP(
"Estimated length of the file in samples")));
143 _(I18N_NOOP(
"Filename")),
144 _(I18N_NOOP(
"Name of the opened file")));
147 _(I18N_NOOP(
"File Size")),
148 _(I18N_NOOP(
"Size of the file in bytes")));
151 _(I18N_NOOP(
"Genre")),
152 _(I18N_NOOP(
"Describes the genre or style of the original work.\n" 153 "Examples: 'classic', 'pop'")));
156 _(I18N_NOOP(
"ISRC")),
157 _(I18N_NOOP(
"ISRC number for the track; see the ISRC intro page\n" 158 "for more information on ISRC numbers.\n" 159 "http://www.ifpi.org/site-content/online/isrc_intro.html")));
162 _(I18N_NOOP(
"Keywords")),
163 _(I18N_NOOP(
"Provides a list of keywords that refer to the\n" 164 "file or subject of the file.")));
167 _(I18N_NOOP(
"Labels")),
168 _(I18N_NOOP(
"The list of labels/markers.")));
171 _(I18N_NOOP(
"Length")),
172 _(I18N_NOOP(
"Length of the file in samples.")));
175 _(I18N_NOOP(
"License")),
176 _(I18N_NOOP(
"License information, e.g., 'All Rights Reserved',\n" 177 "'Any Use Permitted', an URL to a license or the\n" 178 "EFF Open Audio License ('distributed under the\n" 179 "terms of the Open Audio License.\n" 180 "See http://www.eff.org/IP/Open_licenses/eff_oal.html\n" 181 "for details'), etc.")));
184 _(I18N_NOOP(
"Medium")),
185 _(I18N_NOOP(
"Describes the original subject of the file,\n" 186 "where it was first recorded.\n" 187 "Example: 'orchestra'")));
190 _(I18N_NOOP(
"Mime Type")),
191 _(I18N_NOOP(
"Mime type of the file format")));
194 _(I18N_NOOP(
"Emphasis")),
195 _(I18N_NOOP(
"Audio emphasis mode")));
198 _(I18N_NOOP(
"Layer")),
199 _(I18N_NOOP(
"MPEG Layer, I, II or III")));
202 _(I18N_NOOP(
"Mode Extension")),
203 _(I18N_NOOP(
"MPEG Mode Extension (only if Joint Stereo)")));
206 _(I18N_NOOP(
"Version")),
207 _(I18N_NOOP(
"MPEG Version, 1, 2 or 2.5")));
210 _(I18N_NOOP(
"Name")),
211 _(I18N_NOOP(
"Stores the title of the subject of the file.\n" 212 "Example: \"Symphony No.6, Op.68 'Pastoral'\"")));
215 _(I18N_NOOP(
"Opus Frame Length")),
216 _(I18N_NOOP(
"Opus Frame Length in ms (supported values are " 217 "2.5, 5, 10, 20, 40, or 60 ms)")));
220 _(I18N_NOOP(
"Organization")),
221 _(I18N_NOOP(
"Name of the organization producing the track\n" 222 "(i.e. the 'record label')")));
225 _(I18N_NOOP(
"Original")),
226 _(I18N_NOOP(
"Indicates whether the file is an original or a copy")));
229 _(I18N_NOOP(
"Performer")),
230 _(I18N_NOOP(
"The artist(s) who performed the work. In classical\n" 231 "music this would be the conductor, orchestra, soloists.\n" 232 "In an audio book it would be the actor who did the reading.")));
235 _(I18N_NOOP(
"Private")),
236 _(I18N_NOOP(
"Indicates whether the subject is private")));
239 _(I18N_NOOP(
"Product")),
240 _(I18N_NOOP(
"Specifies the name or the title the\n" 241 "file was originally intended for.\n" 242 "Example: 'Linux audio collection'")));
245 _(I18N_NOOP(
"Sample Format")),
246 _(I18N_NOOP(
"Format used for storing the digitized audio samples.\n" 247 "Example: '32-bit IEEE floating-point'")));
250 _(I18N_NOOP(
"Sample Rate")),
251 _(I18N_NOOP(
"Number of samples per second")));
254 _(I18N_NOOP(
"Software")),
255 _(I18N_NOOP(
"Identifies the name of the software package\n" 256 "used to create the file.\n" 257 "Example: 'Kwave v0.6.4-1'")));
260 _(I18N_NOOP(
"Source")),
261 _(I18N_NOOP(
"Identifies the name of the person or organization\n" 262 "who supplied the original subject of the file.\n" 263 "Example: 'Chaotic Sound Research'")));
266 _(I18N_NOOP(
"Source form")),
267 _(I18N_NOOP(
"Identifies the original form of\n" 268 "the material that was digitized.\n" 269 "Examples: 'Record/Vinyl/90RPM', 'Audio DAT', " 270 "'tape/CrO2/60min'")));
273 _(I18N_NOOP(
"Subject")),
274 _(I18N_NOOP(
"Describes the subject of the file.\n" 275 "Example: 'Bird voices at early morning'")));
278 _(I18N_NOOP(
"Technician")),
280 "Identifies the technician who digitized the subject file.\n" 281 "Example: 'Torvalds, Linus'")));
284 _(I18N_NOOP(
"Track")),
285 _(I18N_NOOP(
"Track of the CD if the source was a CDROM.")));
288 _(I18N_NOOP(
"Tracks")),
289 _(I18N_NOOP(
"Number of tracks of the CD if the source was a CDROM.")));
292 _(I18N_NOOP(
"Channels")),
293 _(I18N_NOOP(
"Specifies the number of channels of the signal.")));
296 _(I18N_NOOP(
"Base Quality")),
297 _(I18N_NOOP(
"Base quality of the compression in VBR mode")));
300 _(I18N_NOOP(
"Version")),
301 _(I18N_NOOP(
"May be used to differentiate multiple versions\n" 302 "of the same track title in a single collection.\n" 303 "(e.g. remix info)")));
327 (meta_data_list.selectByType(
metaDataType()).isEmpty()) ?
329 meta_data_list.selectByType(
metaDataType()).values().first()
341 QVariant value = meta_data[
name];
391 QMap<Kwave::FileProperty, QVariant> map;
405 return (ok) ? len : 0;
419 double r = value.toDouble(&ok);
434 unsigned int bits = value.toUInt(&ok);
435 return (ok) ?
bits : 0;
449 unsigned int tracks = value.toUInt(&ok);
462 qDebug(
"--- dump of file info ---");
463 qDebug(
" id = #%s",
DBG(
id()));
464 qDebug(
"default properties:");
465 qDebug(
" length = %lu samples", static_cast<unsigned long int>(
length()));
466 qDebug(
" rate = %0.1f Hz",
rate());
467 qDebug(
" bits = %u",
bits());
468 qDebug(
" tracks = %u",
tracks());
476 qDebug(
"other properties:");
477 QMap<Kwave::FileProperty, QVariant>::Iterator it;
480 QVariant val =
get(key);
482 qDebug(
" '%s' = '%s'",
DBG(name),
DBG(val.toString()));
494 qDebug(
"-------------------------");
bool contains(const FileProperty property) const
virtual void fill() Q_DECL_OVERRIDE
QString name(FileProperty key) const
QVariant get(FileProperty key) const
PropertyTypesMap m_property_map
#define FILE_INFO_PROPERTY_PREFIX
virtual ~FileInfo() Q_DECL_OVERRIDE
void set(FileProperty key, const QVariant &value)
void setRate(double rate)
QList< FileProperty > keys() const
QList< FileProperty > allKnownProperties() const
sample_index_t length() const
const QMap< FileProperty, QVariant > properties() const
void setLength(sample_index_t length)
virtual void append(FileProperty index, Flags data, const QString &name, const QString &description)
void setTracks(unsigned int tracks)
unsigned int tracks() const
void setBits(unsigned int bits)
static QString metaDataType()
QString name(IDX type) const
virtual QList< FileProperty > all() const
unsigned int bits() const
virtual void dump() const Q_DECL_OVERRIDE