kwave  18.07.70
Kwave::WavPropertyMap Class Reference

#include <WavPropertyMap.h>

Inheritance diagram for Kwave::WavPropertyMap:
Inheritance graph
Collaboration diagram for Kwave::WavPropertyMap:
Collaboration graph

Public Member Functions

 WavPropertyMap ()
 
virtual ~WavPropertyMap ()
 
QByteArray findProperty (const Kwave::FileProperty property) const
 
bool containsProperty (const Kwave::FileProperty property) const
 
void insert (const Kwave::FileProperty property, const QByteArray &chunk)
 
bool containsChunk (const QByteArray &chunk) const
 
QList< QByteArray > chunks () const
 
Kwave::FileProperty property (const QByteArray &chunk) const
 
QList< Kwave::FilePropertyproperties () const
 

Private Types

typedef QPair< Kwave::FileProperty, QByteArray > Pair
 

Detailed Description

Definition at line 32 of file WavPropertyMap.h.

Member Typedef Documentation

◆ Pair

typedef QPair<Kwave::FileProperty, QByteArray> Kwave::WavPropertyMap::Pair
private

Definition at line 83 of file WavPropertyMap.h.

Constructor & Destructor Documentation

◆ WavPropertyMap()

Kwave::WavPropertyMap::WavPropertyMap ( )

Default constructor, with initializing

Definition at line 21 of file WavPropertyMap.cpp.

References Kwave::INF_ALBUM, Kwave::INF_ANNOTATION, Kwave::INF_ARCHIVAL, Kwave::INF_AUTHOR, Kwave::INF_CD, Kwave::INF_COMMENTS, Kwave::INF_COMMISSIONED, Kwave::INF_CONTACT, Kwave::INF_COPYRIGHT, Kwave::INF_CREATION_DATE, Kwave::INF_ENGINEER, Kwave::INF_GENRE, Kwave::INF_ISRC, Kwave::INF_KEYWORDS, Kwave::INF_LICENSE, Kwave::INF_MEDIUM, Kwave::INF_NAME, Kwave::INF_ORGANIZATION, Kwave::INF_PERFORMER, Kwave::INF_PRODUCT, Kwave::INF_SOFTWARE, Kwave::INF_SOURCE, Kwave::INF_SOURCE_FORM, Kwave::INF_SUBJECT, Kwave::INF_TECHNICAN, Kwave::INF_TRACK, Kwave::INF_VERSION, and insert().

22 {
23  // NOTE #1: the left column is allowed to have multiple entries with the
24  // same property, when encoding the first one is used, when
25  // decoding, the other ones serve as alternatives
26  // NOTE #2: the chunk names in the right column must be *unique* !
27  // well-known tags
28  insert(Kwave::INF_AUTHOR ,"AUTH"); // author's name
29  insert(Kwave::INF_ANNOTATION ,"ANNO"); // annotations
30  insert(Kwave::INF_ARCHIVAL ,"IARL"); // archival location (EXIF 2.3)
31  insert(Kwave::INF_PERFORMER ,"IART"); // performer (EXIF 2.3)
32  insert(Kwave::INF_COMMISSIONED ,"ICMS"); // commissioned (EXIF 2.3)
33  insert(Kwave::INF_COMMENTS ,"ICMT"); // comments (EXIF 2.3)
34  insert(Kwave::INF_COPYRIGHT ,"ICOP"); // copyright (EXIF 2.3)
35  insert(Kwave::INF_CREATION_DATE ,"ICRD"); // creation date (iso) (EXIF 2.3)
36  insert(Kwave::INF_ENGINEER ,"IENG"); // engineer (EXIF 2.3)
37  insert(Kwave::INF_GENRE ,"IGNR"); // genre (EXIF 2.3)
38  insert(Kwave::INF_KEYWORDS ,"IKEY"); // keywords (EXIF 2.3)
39  insert(Kwave::INF_MEDIUM ,"IMED"); // medium (EXIF 2.3)
40  insert(Kwave::INF_NAME ,"INAM"); // name (EXIF 2.3)
41  insert(Kwave::INF_PRODUCT ,"IPRD"); // product (EXIF 2.3)
42  insert(Kwave::INF_SOFTWARE ,"ISFT"); // software (EXIF 2.3)
43  insert(Kwave::INF_SOURCE ,"ISRC"); // source (EXIF 2.3)
44  insert(Kwave::INF_SOURCE_FORM ,"ISRF"); // source form (EXIF 2.3)
45  insert(Kwave::INF_TECHNICAN ,"ITCH"); // technician (EXIF 2.3)
46  insert(Kwave::INF_SUBJECT ,"ISBJ"); // subject (EXIF 2.3)
47 
48  // tags from SoundForge Pro
49  insert(Kwave::INF_TRACK ,"TRCK"); // track number
50  insert(Kwave::INF_VERSION ,"TVER"); // version/remix
51  insert(Kwave::INF_ORGANIZATION ,"TORG"); // organization/label
52 
53  // some others, alternatives
54  insert(Kwave::INF_ALBUM ,"IALB"); // name of the album
55  insert(Kwave::INF_COPYRIGHT ,"(c) "); // copyright
56  insert(Kwave::INF_CREATION_DATE ,"DTIM"); // date/time original
57  insert(Kwave::INF_CREATION_DATE ,"YEAR"); // year (MovieID ref12)
58  insert(Kwave::INF_GENRE ,"GENR"); // genre (MovieID ref12)
59  insert(Kwave::INF_GENRE ,"ISGN"); // second genre (IMDB)
60  insert(Kwave::INF_AUTHOR ,"IWRI"); // written by (IMDB)
61  insert(Kwave::INF_ENGINEER ,"IEDT"); // edited by (IMDB)
62  insert(Kwave::INF_CD ,"IPTR"); // part (?)
63 
64  // non-standard, probably only known by Kwave
65  insert(Kwave::INF_CONTACT ,"cnt "); // contact information for creator
66  insert(Kwave::INF_ISRC ,"isrc"); // International Standard Recording Code
67  insert(Kwave::INF_LICENSE ,"lic "); // license information
68 }
void insert(const Kwave::FileProperty property, const QByteArray &chunk)
Here is the call graph for this function:

◆ ~WavPropertyMap()

virtual Kwave::WavPropertyMap::~WavPropertyMap ( )
inlinevirtual

Destructor

Definition at line 40 of file WavPropertyMap.h.

References chunks(), containsChunk(), containsProperty(), findProperty(), insert(), properties(), and property().

40 {}
Here is the call graph for this function:

Member Function Documentation

◆ chunks()

QList< QByteArray > Kwave::WavPropertyMap::chunks ( ) const

returns a list of all known chunks

Definition at line 111 of file WavPropertyMap.cpp.

Referenced by Kwave::WavDecoder::WavDecoder(), and ~WavPropertyMap().

112 {
113  QList<QByteArray> list;
114  foreach(const Pair &p, QList<Pair>(*this)) {
115  if (!list.contains(p.second))
116  list.append(p.second);
117  }
118  return list;
119 }
QPair< Kwave::FileProperty, QByteArray > Pair
Here is the caller graph for this function:

◆ containsChunk()

bool Kwave::WavPropertyMap::containsChunk ( const QByteArray &  chunk) const

returns true if a given chunk is in the list

Parameters
chunka 4-byte chunk name
Returns
true if found, false if not

Definition at line 101 of file WavPropertyMap.cpp.

Referenced by Kwave::WavDecoder::open(), and ~WavPropertyMap().

102 {
103  foreach(const Pair &p, QList<Pair>(*this)) {
104  if (p.second == chunk)
105  return true;
106  }
107  return false;
108 }
QPair< Kwave::FileProperty, QByteArray > Pair
Here is the caller graph for this function:

◆ containsProperty()

bool Kwave::WavPropertyMap::containsProperty ( const Kwave::FileProperty  property) const

Returns true if the map contains a given property

Definition at line 90 of file WavPropertyMap.cpp.

Referenced by Kwave::WavEncoder::writeInfoChunk(), and ~WavPropertyMap().

92 {
93  foreach(const Pair &p, QList<Pair>(*this)) {
94  if (p.first == property)
95  return true;
96  }
97  return false;
98 }
Kwave::FileProperty property(const QByteArray &chunk) const
QPair< Kwave::FileProperty, QByteArray > Pair
Here is the caller graph for this function:

◆ findProperty()

QByteArray Kwave::WavPropertyMap::findProperty ( const Kwave::FileProperty  property) const

Returns the chunk name of a property or an empty string if nothing found (reverse lookup).

Definition at line 79 of file WavPropertyMap.cpp.

Referenced by Kwave::WavEncoder::writeInfoChunk(), and ~WavPropertyMap().

81 {
82  foreach(const Pair &p, QList<Pair>(*this)) {
83  if (p.first == property)
84  return p.second;
85  }
86  return "";
87 }
Kwave::FileProperty property(const QByteArray &chunk) const
QPair< Kwave::FileProperty, QByteArray > Pair
Here is the caller graph for this function:

◆ insert()

void Kwave::WavPropertyMap::insert ( const Kwave::FileProperty  property,
const QByteArray &  chunk 
)

insert a new property / chunk mapping

Parameters
propertya Kwave FileProperty
chunka 4-byte chunk name

Definition at line 71 of file WavPropertyMap.cpp.

Referenced by WavPropertyMap(), and ~WavPropertyMap().

73 {
74  Pair p(property, chunk);
75  append(p);
76 }
Kwave::FileProperty property(const QByteArray &chunk) const
QPair< Kwave::FileProperty, QByteArray > Pair
Here is the caller graph for this function:

◆ properties()

QList< Kwave::FileProperty > Kwave::WavPropertyMap::properties ( ) const

Returns a list with all supported properties

Definition at line 132 of file WavPropertyMap.cpp.

Referenced by Kwave::WavEncoder::supportedProperties(), and ~WavPropertyMap().

133 {
134  QList<Kwave::FileProperty> list;
135  foreach(const Pair &p, QList<Pair>(*this)) {
136  if (!list.contains(p.first))
137  list.append(p.first);
138  }
139  return list;
140 }
QPair< Kwave::FileProperty, QByteArray > Pair
Here is the caller graph for this function:

◆ property()

Kwave::FileProperty Kwave::WavPropertyMap::property ( const QByteArray &  chunk) const

Returns the first FileProperty that matches a given chunk

Parameters
chunka 4-byte chunk name
Returns
a FileProperty

Definition at line 122 of file WavPropertyMap.cpp.

Referenced by Kwave::WavDecoder::open(), and ~WavPropertyMap().

124 {
125  foreach(const Pair &p, QList<Pair>(*this)) {
126  if (p.second == chunk) return p.first;
127  }
128  return static_cast<Kwave::FileProperty>(-1);
129 }
QPair< Kwave::FileProperty, QByteArray > Pair
FileProperty
Definition: FileInfo.h:45
Here is the caller graph for this function:

The documentation for this class was generated from the following files: