1 /* 2 * Project: VizKit 3 * Version: 2.3 4 5 * Date: 20090823 6 * File: VisualAudioMetaData.h 7 * 8 */ 9 10 /*************************************************************************** 11 12 Copyright (c) 2004-2009 Heiko Wichmann (http://www.imagomat.de/vizkit) 13 14 15 This software is provided 'as-is', without any expressed or implied warranty. 16 In no event will the authors be held liable for any damages 17 arising from the use of this software. 18 19 Permission is granted to anyone to use this software for any purpose, 20 including commercial applications, and to alter it and redistribute it 21 freely, subject to the following restrictions: 22 23 1. The origin of this software must not be misrepresented; 24 you must not claim that you wrote the original software. 25 If you use this software in a product, an acknowledgment 26 in the product documentation would be appreciated 27 but is not required. 28 29 2. Altered source versions must be plainly marked as such, 30 and must not be misrepresented as being the original software. 31 32 3. This notice may not be removed or altered from any source distribution. 33 34 ***************************************************************************/ 35 36 #ifndef VisualAudioMetaData_h 37 #define VisualAudioMetaData_h 38 39 40 #include "VisualTypes.h" 41 #include "VisualString.h" 42 43 44 namespace VizKit { 45 46 class VisualItemIdentifier; // Forward declaration (to avoid include of header file). 47 48 /** 49 * Meta data (like track name, artist name, or lyrics, etc.) of audio track or audio stream. 50 */ 51 class VisualAudioMetaData { 52 53 public: 54 55 /** 56 * Constructor. 57 */ 58 VisualAudioMetaData(); 59 60 /** 61 * Destructor. 62 */ 63 ~VisualAudioMetaData(); 64 65 /** 66 * Copy constructor. 67 * @param other Another VisualAudioMetaData. 68 */ 69 VisualAudioMetaData(const VisualAudioMetaData& other); 70 71 /** 72 * Assignment operator. 73 */ 74 VisualAudioMetaData& operator=(const VisualAudioMetaData& other); 75 76 /** 77 * Equality operator. 78 * @param other Another VisualAudioMetaData. 79 */ 80 bool operator==(const VisualAudioMetaData& other); 81 82 /** 83 * Inequality operator. 84 * @param other Another VisualAudioMetaData. 85 */ 86 bool operator!=(const VisualAudioMetaData& other); 87 88 /** 89 * Resets the values of the audio meta data to their initial default empty values. 90 */ 91 void init(void); 92 93 /** 94 * Sets whether data belongs to stream or track. 95 * @param isAStream If true data is stream meta data. If false data is track meta data. 96 */ 97 void setIsStream(bool isAStream); 98 99 /** 100 * Sets the name of the track. 101 * @param aTrackName The name of the track. 102 */ 103 void setTrackName(const VisualString& aTrackName); 104 105 /** 106 * Sets the artist of the track. 107 * @param aTrackArtist The name of the track artist. 108 */ 109 void setTrackArtist(const VisualString& aTrackArtist); 110 111 /** 112 * Sets the name of the album. 113 * @param aTrackAlbum The name of the album the track belongs to. 114 */ 115 void setTrackAlbum(const VisualString& aTrackAlbum); 116 117 /** 118 * Sets the lyrics of the track. 119 * @param someTrackLyrics The lyrics of the track. 120 */ 121 void setTrackLyrics(const VisualString& someTrackLyrics); 122 123 /** 124 * Sets the composer of the track. 125 * @param aComposer The composer of the track. 126 */ 127 void setTrackComposer(const VisualString& aComposer); 128 129 /** 130 * Sets the title of a stream. 131 * @param aStreamTitle The title of a stream. 132 */ 133 void setStreamTitle(const VisualString& aStreamTitle); 134 135 /** 136 * Sets the message of a stream. 137 * @param aStreamMessage The message of a stream. 138 */ 139 void setStreamMessage(const VisualString& aStreamMessage); 140 141 /** 142 * Sets the URL of a stream. 143 * @param aStreamURL The URL of a stream. 144 */ 145 void setStreamURL(const VisualString& aStreamURL); 146 147 /** 148 * Sets the size of the track in bytes. 149 * @param aTrackSizeInBytes The size of the track in bytes. 150 */ 151 void setTrackSizeInBytes(uint32 aTrackSizeInBytes); 152 153 /** 154 * Sets the year of the audio data. 155 * @param aYear The year of the audio data. 156 */ 157 void setYear(uint16 aYear); 158 159 /** 160 * Returns the name of the track. 161 * @return The name of the track. 162 */ 163 const VisualString& getTrackName(void); 164 165 /** 166 * Returns the artist of the track. 167 * @return The artist of the track. 168 */ 169 const VisualString& getTrackArtist(void); 170 171 /** 172 * Returns the name of the album. 173 * @return The name of the album the track belongs to. 174 */ 175 const VisualString& getTrackAlbum(void); 176 177 /** 178 * Returns the lyrics of the track. 179 * @return The lyrics of the track. 180 */ 181 const VisualString& getTrackLyrics(void); 182 183 /** 184 * Returns the composer of the track. 185 * @return The composer of the track. 186 */ 187 const VisualString& getTrackComposer(void); 188 189 /** 190 * Returns the title of a stream. 191 * @return The title of a stream. 192 */ 193 const VisualString& getStreamTitle(void); 194 195 /** 196 * Returns the message of a stream. 197 * @return The message of a stream. 198 */ 199 const VisualString& getStreamMessage(void); 200 201 /** 202 * Returns the URL of a stream. 203 * @return The URL of a stream. 204 */ 205 const VisualString& getStreamURL(void); 206 207 /** 208 * Returns the size of the track in bytes. 209 * @return The size of the track in bytes. 210 */ 211 uint32 getTrackSizeInBytes(void); 212 213 /** 214 * Returns the year of the audio data in bytes. 215 * @return The year of the audio data in bytes. 216 */ 217 uint16 getYear(void); 218 219 /** 220 * Returns the unique identifer of the track for the meta data. 221 * @return The unique identifer of the track for the meta data. 222 */ 223 VisualItemIdentifier getTrackIdentifier(void); 224 225 /** 226 * Answers the question whether audio meta data belongs to stream or track. 227 * @return True if audio meta data belongs to stream. False if audio meta data belongs to track. 228 */ 229 bool getIsStream(void); 230 231 private: 232 233 /** True if audio meta data belongs to stream. False if audio meta data belongs to track. */ 234 bool isStream; 235 236 /** Name of audio track. */ 237 VisualString trackName; 238 239 /** Name of track artist. */ 240 VisualString trackArtist; 241 242 /** Name of album the track belongs to. */ 243 VisualString trackAlbum; 244 245 /** Lyrics of track. */ 246 VisualString trackLyrics; 247 248 /** Composer of track. */ 249 VisualString trackComposer; 250 251 /** Title of a stream. */ 252 VisualString streamTitle; 253 254 /** Message of a stream. */ 255 VisualString streamMessage; 256 257 /** URL of a stream. */ 258 VisualString streamURL; 259 260 /** Size of audio track in bytes. */ 261 uint32 trackSizeInBytes; 262 263 /** The year of the audio track. */ 264 uint16 year; 265 266 /** The identifier of the audio track. */ 267 VisualItemIdentifier* trackIdentifier; 268 269 /** 270 * Copy method for assignment operator and copy constructor. 271 * @param other Another VisualAudioMetaData. 272 */ 273 void copy(const VisualAudioMetaData& other); 274 275 }; 276 277 } 278 279 #endif /* VisualAudioMetaData_h */ 280