102
* Types of fields in a frame, must be the same as id3lib's ID3_FieldID.
130
// These are additional fields used by TagLib
135
// Additional field for METADATA_BLOCK_PICTURE
139
/** Text encoding for fields of type ID_TextEnc. */
147
/** Picture type, compatible with ID3v2 and FLAC. */
162
PT_RecordingLocation = 13,
163
PT_DuringRecording = 14,
164
PT_DuringPerformance = 15,
167
PT_Illustration = 18,
169
PT_PublisherLogo = 20
172
/** Tag version contained in track data. */
174
TagNone = 0, /**< Empty or imported and not from a tag */
175
TagV1 = 1, /**< Tag 1 */
176
TagV2 = 2, /**< Tag 2 */
177
/** Tag 1 and 2 or merged from tag 2 and tag 1 (where tag 2 is not set) */
178
TagV2V1 = TagV1 | TagV2
95
181
/** Field in frame. */
98
* Types of fields in a frame, must be the same as id3lib's ID3_FieldID.
126
// These are additional fields used by TagLib
132
/** Text encoding for fields of type ID_TextEnc. */
182
struct KID3_CORE_EXPORT Field {
152
196
int m_id; /**< type of field. */
153
197
QVariant m_value; /**< value of field. */
200
* Get a translated string for a field ID.
202
* @param type field ID type
204
* @return field ID type, null string if unknown.
206
static QString getFieldIdName(FieldId type);
209
* List of field ID strings, NULL terminated.
211
static const char* const* getFieldIdNames();
214
* Get a translated string for a text encoding.
216
* @param type text encoding type
218
* @return text encoding type, null string if unknown.
220
static QString getTextEncodingName(TextEncoding type);
223
* List of text encoding strings, NULL terminated.
225
static const char* const* getTextEncodingNames();
228
* Get a translated string for a timestamp format.
230
* @param type timestamp format type
232
* @return timestamp format type, null string if unknown.
234
static QString getTimestampFormatName(int type);
237
* List of timestamp format strings, NULL terminated.
239
static const char* const* getTimestampFormatNames();
242
* Get a translated string for a content type.
244
* @param type content type
246
* @return content type, null string if unknown.
248
static QString getContentTypeName(int type);
251
* List of content type strings, NULL terminated.
253
static const char* const* getContentTypeNames();
156
257
/** list of fields. */
375
476
void setDifferent() { m_value = differentRepresentation(); }
479
* Check if frame is marked.
480
* @return true if marked.
482
bool isMarked() const { return m_marked; }
486
* @param marked true to mark, false to clear mark
488
void setMarked(bool marked) { m_marked = marked; }
378
491
* Check if value is changed.
379
492
* @return true if changed.
429
542
* @return field value, invalid if field not found.
431
QVariant getFieldValue(Field::Id id) const;
544
QVariant getFieldValue(FieldId id) const;
434
547
* Check if the fields in another frame are equal.
480
593
* @return true if field found and set.
482
static bool setField(Frame& frame, Field::Id id, const QVariant& value);
595
static bool setField(Frame& frame, FieldId id, const QVariant& value);
485
598
* Get value of a field.
490
603
* @return field value, invalid if not found.
492
static QVariant getField(const Frame& frame, Field::Id id);
605
static QVariant getField(const Frame& frame, FieldId id);
608
* Get type of frame from translated name.
610
* @param translatedName name, spaces and case are ignored
614
static Type getTypeFromTranslatedName(const QString& translatedName);
617
* Get a translated string for a frame type.
619
* @param type frame type
621
* @return frame type, null string if unknown.
623
static QString getFrameTypeName(Type type);
495
626
friend class TaggedFile;