VizKit
3.3.7
|
Stores essential data for the visualizer. More...
#include <VisualDataStore.h>
Classes | |
class | Value |
Stores a key-value-pair of values. More... | |
Public Types | |
enum | ValueKey { kUnknownValue = 0, kTrackInfoTextureHeight, kLyricsTextureHeight } |
Static Public Member Functions | |
static void | dispose (void) |
Disposes the VisualDataStore. | |
static void | setValue (const ValueKey anIdentifier, const int anIntValue) |
Sets a persistent value (integer) which is not stored in preferences. | |
static void | setValue (const ValueKey anIdentifier, const float aFloatValue) |
Sets a persistent value (float) which is not stored in preferences. | |
static void | setValue (const ValueKey anIdentifier, const char *const aCharValue) |
Sets a persistent value (string) which is not stored in preferences. | |
static void | setValue (const ValueKey anIdentifier, const bool aBoolValue) |
Sets a persistent value (boolean) which is not stored in preferences. | |
static int | getValueInt (const ValueKey anIdentifier, bool *wasSet=NULL) |
Retrieves a persistent value (integer) which was set previously but not stored in preferences. | |
static float | getValueFloat (const ValueKey anIdentifier, bool *wasSet=NULL) |
Retrieves a persistent value (float) which was set previously but not stored in preferences. | |
static void | getValueChar (const ValueKey anIdentifier, char *outPrefVal, bool *wasSet=NULL) |
Retrieves a persistent value (string) which was set previously but not stored in preferences. | |
static bool | getValueBool (const ValueKey anIdentifier, bool *wasSet=NULL) |
Retrieves a persistent value (boolean) which was set previously but not stored in preferences. | |
static void | setAppVersion (uint8 majorVersionNum, uint8 minorVersionNum, uint8 bugRevisionNum) |
Stores the major and minor version of the host application. | |
static uint8 | getAppVersionMajorNum (void) |
Returns the major version number of the host application. | |
static uint8 | getAppVersionMinorNum (void) |
Returns the minor version number of the host application. | |
static uint8 | getAppVersionBugRevisionNum (void) |
Returns the bug revision number of the host application. | |
static void | setVisualizerAPIVersion (uint8 majorVersionNum, uint8 minorVersionNum) |
Stores the major and minor version of the Visualizer API version implemented by the host application. | |
static uint8 | getVisualizerAPIVersionMajorNum (void) |
Returns the major version number of the Visualizer API version implemented by the host application. | |
static uint8 | getVisualizerAPIVersionMinorNum (void) |
Returns the minor version number of the Visualizer API version implemented by the host application. | |
static void | resetCurrAudioMetaData (void) |
Resets the currently set audio meta data. | |
static void | setAudioTrackName (const uint16 *const audioTrackName, uint32 audioTrackNameLength) |
Sets the audio track name. | |
static void | setAudioTrackArtistName (const uint16 *const audioTrackArtistName, uint32 audioTrackArtistNameLength) |
Sets the audio track artist name. | |
static void | setAudioTrackAlbumName (const uint16 *const audioTrackAlbumName, uint32 audioTrackAlbumNameLength) |
Sets the audio track album name. | |
static void | setAudioTrackComposer (const uint16 *const audioTrackComposer, uint32 audioTrackComposerLength) |
Sets the audio track composer. | |
static void | setAudioStreamTitle (const char *const audioStreamTitle, uint32 audioStreamTitleLength) |
Sets the title of an audio stream. | |
static void | setAudioStreamTitle (const uint16 *const audioStreamTitle, uint32 audioStreamTitleLength) |
Sets the title of an audio stream. | |
static void | setAudioStreamMessage (const char *const audioStreamMessage, uint32 audioStreamMessageLength) |
Sets the message of an audio stream. | |
static void | setAudioStreamMessage (const uint16 *const audioStreamMessage, uint32 audioStreamMessageLength) |
Sets the message of an audio stream. | |
static void | setAudioStreamURL (const char *const audioStreamURL, uint32 audioStreamURLLength) |
Sets the URL of an audio stream. | |
static void | setAudioStreamURL (const uint16 *const audioStreamURL, uint32 audioStreamURLLength) |
Sets the URL of an audio stream. | |
static void | setAudioStreamName (const uint16 *const audioStreamName, uint32 audioStreamNameLength) |
Sets the name of an audio stream. | |
static void | setAudioTrackSizeInBytes (int sizeInBytes) |
Sets the size in bytes of the audio track. | |
static void | setAudioTrackYear (uint16 aYear) |
Sets the year of the audio track. | |
static void | setAudioDataIsStream (bool isStream) |
Sets whether the current audio data is a stream. | |
static void | setLyricsOfCurrentTrack (const VisualString &lyricsString) |
Stores the lyrics of the current audio track. | |
static bool | analyzeCurrentlySetMetadata (void) |
Analyzes the currently set audio track meta data. | |
static VisualString | getInfoOfCurrentAudioDataForDisplay (void) |
Returns a string with the info for the current audio data which can be used for display. | |
static uint32 | getTrackSizeInBytes (void) |
Returns the number of bytes of the current track. | |
static uint16 | getTrackYear (void) |
Returns the year of the current track. | |
static VisualString | getNameOfCurrentTrack (void) |
Returns the name of the current audio track. | |
static VisualString | getArtistOfCurrentTrack (void) |
Returns the name of the artist of the current audio track. | |
static VisualString | getAlbumOfCurrentTrack (void) |
Returns the name of the album of the current audio track. | |
static VisualString | getLyricsOfCurrentTrack (void) |
static VisualItemIdentifier | getIdentifierOfCurrentTrack (void) |
static bool | currentlyPlayingAudioIsStream (void) |
Answers the question whether currently playing audio is stream or track. | |
static bool | createLyricsOfCurrentTrack (void) |
static void | setProcessInfo (const char *const labelStr, const char *const valueStr) |
Stores label and value of a process info entry that is sent later to the VisualProcessMonitor. | |
static const std::map < std::string, std::string > *const | getProcessInfoMap () |
Returns a pointer to the process info map. | |
Static Public Attributes | |
static const VisualItemIdentifier | albumCoverArtworkImageId |
The identifier of the image of the album cover artwork. | |
static VisualItemIdentifier | fileWithLyricsStringId |
The identifier of the file with lyrics string data. | |
static VisualItemIdentifier | trackIdentifierOfLyricsMetadata |
The identifier of the track for which the lyrics data is gathered. | |
static const VisualItemIdentifier | styledTrackInfoStringId |
The identifier of the styled track info string. | |
static const VisualItemIdentifier | updateInformationStringId |
The identifier of the update information string. | |
Private Types | |
enum | ValueDataType { kIntPrefType = 0, kCharPrefType, kFloatPrefType, kBoolPrefType } |
The format of the data that is stored with the values. More... | |
typedef std::vector< Value * > | ValueVector |
Values are collected as a vector of pointers to Values. | |
typedef ValueVector::iterator | ValueVectorIterator |
The ValueVectorIterator is an iterator of the ValueVector. | |
typedef std::vector < VisualAudioMetaData > | AudioMetaDataVector |
AudioMetaData entries are collected as a vector of pointers to AudioMetaData. | |
typedef AudioMetaDataVector::iterator | AudioMetaDataVectorIterator |
The AudioMetaDataVectorIterator is an iterator of the AudioMetaDataVector. | |
typedef std::map< std::string, std::string > | ProcessInfoMap |
The ProcessInfoMap is a map of strings that denote key and value of process info records. | |
typedef ProcessInfoMap::iterator | ProcessInfoMapIterator |
The ProcessInfoMapIterator is an iterator of the ProcessInfoMap. | |
Private Member Functions | |
VisualDataStore () | |
The constructor. | |
~VisualDataStore () | |
The destructor. | |
VisualDataStore (const VisualDataStore &other) | |
Copy constructor. | |
VisualDataStore & | operator= (const VisualDataStore &other) |
Assignment operator. | |
void | advanceAudioMetaDataHistory (void) |
Advance (increment) the history of AudioMetaData. | |
Static Private Member Functions | |
static VisualDataStore * | getInstance (void) |
Constructs a VisualDataStore. | |
Private Attributes | |
ValueVector | valueVector |
Vector of values. | |
uint8 | appVersionMajorNum |
The major version number of the host application iTunes. | |
uint8 | appVersionMinorNum |
The minor version number of the host application iTunes. | |
uint8 | visualizerAPIMajorNum |
The major version number of the Visualizer API implemented by the host application iTunes. | |
uint8 | visualizerAPIMinorNum |
The minor version number of the Visualizer API implemented by the host application iTunes. | |
uint8 | appVersionBugRevisionNum |
The bug revision number of the host application iTunes (third part of the app version number). | |
size_t | currAudioMetaDataHistoryIdx |
The current index of the history of meta data of audio track or stream. | |
AudioMetaDataVector | audioMetaDataHistory |
Vector of AudioMetaData. | |
VisualAudioMetaData | currAudioMetaData |
Instance variable with some temporarily current audio meta data. | |
ProcessInfoMap | processInfoMap |
A map of the process monitor info key-value-pairs. | |
Static Private Attributes | |
static VisualDataStore * | theVisualDataStore = NULL |
VisualDataStore is a singleton class. | |
static const size_t | audioMetaDataHistoryCount = 2 |
The number of entries in history of meta data of audio track or stream. | |
static bool | lyricsCreationThreadIsRunning = false |
Flag that answers whether the lyrics creation thread is currently running. |
Stores essential data for the visualizer.
The data stored is general (neither graphics related nor audio specific). All public methods are declared static.
typedef std::vector<VisualAudioMetaData> VizKit::VisualDataStore::AudioMetaDataVector [private] |
AudioMetaData entries are collected as a vector of pointers to AudioMetaData.
typedef AudioMetaDataVector::iterator VizKit::VisualDataStore::AudioMetaDataVectorIterator [private] |
The AudioMetaDataVectorIterator is an iterator of the AudioMetaDataVector.
typedef std::map<std::string, std::string> VizKit::VisualDataStore::ProcessInfoMap [private] |
The ProcessInfoMap is a map of strings that denote key and value of process info records.
typedef ProcessInfoMap::iterator VizKit::VisualDataStore::ProcessInfoMapIterator [private] |
The ProcessInfoMapIterator is an iterator of the ProcessInfoMap.
typedef std::vector<Value*> VizKit::VisualDataStore::ValueVector [private] |
Values are collected as a vector of pointers to Values.
typedef ValueVector::iterator VizKit::VisualDataStore::ValueVectorIterator [private] |
The ValueVectorIterator is an iterator of the ValueVector.
enum VizKit::VisualDataStore::ValueDataType [private] |
VisualDataStore::VisualDataStore | ( | ) | [private] |
The constructor.
VisualDataStore is a singleton class. The constructor is private. New instance of class can only be created internally.
VisualDataStore::~VisualDataStore | ( | ) | [private] |
The destructor.
VisualDataStore is a singleton class. The destructor is private. Instance of class can only be destructed internally.
VizKit::VisualDataStore::VisualDataStore | ( | const VisualDataStore & | other | ) | [private] |
Copy constructor.
other | Another VisualDataStore. |
void VisualDataStore::advanceAudioMetaDataHistory | ( | void | ) | [private] |
Advance (increment) the history of AudioMetaData.
The current index is moved one forward.
bool VisualDataStore::analyzeCurrentlySetMetadata | ( | void | ) | [static] |
Analyzes the currently set audio track meta data.
bool VisualDataStore::createLyricsOfCurrentTrack | ( | void | ) | [static] |
bool VisualDataStore::currentlyPlayingAudioIsStream | ( | void | ) | [static] |
Answers the question whether currently playing audio is stream or track.
void VisualDataStore::dispose | ( | void | ) | [static] |
Disposes the VisualDataStore.
VisualString VisualDataStore::getAlbumOfCurrentTrack | ( | void | ) | [static] |
Returns the name of the album of the current audio track.
uint8 VisualDataStore::getAppVersionBugRevisionNum | ( | void | ) | [static] |
Returns the bug revision number of the host application.
uint8 VisualDataStore::getAppVersionMajorNum | ( | void | ) | [static] |
Returns the major version number of the host application.
uint8 VisualDataStore::getAppVersionMinorNum | ( | void | ) | [static] |
Returns the minor version number of the host application.
VisualString VisualDataStore::getArtistOfCurrentTrack | ( | void | ) | [static] |
Returns the name of the artist of the current audio track.
VisualItemIdentifier VisualDataStore::getIdentifierOfCurrentTrack | ( | void | ) | [static] |
VisualString VisualDataStore::getInfoOfCurrentAudioDataForDisplay | ( | void | ) | [static] |
Returns a string with the info for the current audio data which can be used for display.
VisualDataStore * VisualDataStore::getInstance | ( | void | ) | [static, private] |
Constructs a VisualDataStore.
The VisualDataStore internally is a singleton. Returns a pointer to the initialized VisualDataStore.
VisualString VisualDataStore::getLyricsOfCurrentTrack | ( | void | ) | [static] |
VisualString VisualDataStore::getNameOfCurrentTrack | ( | void | ) | [static] |
Returns the name of the current audio track.
const std::map< std::string, std::string > *const VisualDataStore::getProcessInfoMap | ( | ) | [static] |
Returns a pointer to the process info map.
uint32 VisualDataStore::getTrackSizeInBytes | ( | void | ) | [static] |
Returns the number of bytes of the current track.
uint16 VisualDataStore::getTrackYear | ( | void | ) | [static] |
Returns the year of the current track.
bool VisualDataStore::getValueBool | ( | const ValueKey | anIdentifier, |
bool * | wasSet = NULL |
||
) | [static] |
Retrieves a persistent value (boolean) which was set previously but not stored in preferences.
anIdentifier | The identifier (key) of the preference value. |
wasSet | Optional parameter that indicates whether the values was set previously. |
void VisualDataStore::getValueChar | ( | const ValueKey | anIdentifier, |
char * | outPrefVal, | ||
bool * | wasSet = NULL |
||
) | [static] |
Retrieves a persistent value (string) which was set previously but not stored in preferences.
anIdentifier | The identifier (key) of the preference value. | |
[out] | outPrefVal | The character string value. |
wasSet | Optional parameter that indicates whether the values was set previously. |
float VisualDataStore::getValueFloat | ( | const ValueKey | anIdentifier, |
bool * | wasSet = NULL |
||
) | [static] |
Retrieves a persistent value (float) which was set previously but not stored in preferences.
anIdentifier | The identifier (key) of the preference value. |
wasSet | Optional parameter that indicates whether the values was set previously. |
int VisualDataStore::getValueInt | ( | const ValueKey | anIdentifier, |
bool * | wasSet = NULL |
||
) | [static] |
Retrieves a persistent value (integer) which was set previously but not stored in preferences.
anIdentifier | The identifier (key) of the preference value. |
wasSet | Optional parameter that indicates whether the values was set previously. |
uint8 VisualDataStore::getVisualizerAPIVersionMajorNum | ( | void | ) | [static] |
Returns the major version number of the Visualizer API version implemented by the host application.
uint8 VisualDataStore::getVisualizerAPIVersionMinorNum | ( | void | ) | [static] |
Returns the minor version number of the Visualizer API version implemented by the host application.
VisualDataStore& VizKit::VisualDataStore::operator= | ( | const VisualDataStore & | other | ) | [private] |
Assignment operator.
void VisualDataStore::resetCurrAudioMetaData | ( | void | ) | [static] |
Resets the currently set audio meta data.
void VisualDataStore::setAppVersion | ( | uint8 | majorVersionNum, |
uint8 | minorVersionNum, | ||
uint8 | bugRevisionNum | ||
) | [static] |
Stores the major and minor version of the host application.
majorVersionNum | The major version number of the host application. |
minorVersionNum | The minor version number of the host application. |
bugRevisionNum | The bug revision number of the host application. |
void VisualDataStore::setAudioDataIsStream | ( | bool | isStream | ) | [static] |
Sets whether the current audio data is a stream.
void VisualDataStore::setAudioStreamMessage | ( | const char *const | audioStreamMessage, |
uint32 | audioStreamMessageLength | ||
) | [static] |
Sets the message of an audio stream.
audioStreamMessage | The title of an audio stream. |
audioStreamMessageLength | The number of characters of the message of an audio stream. |
void VisualDataStore::setAudioStreamMessage | ( | const uint16 *const | audioStreamMessage, |
uint32 | audioStreamMessageLength | ||
) | [static] |
Sets the message of an audio stream.
audioStreamMessage | The message of an audio stream. |
audioStreamMessageLength | The number of characters of the message of an audio stream. |
void VisualDataStore::setAudioStreamName | ( | const uint16 *const | audioStreamName, |
uint32 | audioStreamNameLength | ||
) | [static] |
Sets the name of an audio stream.
audioStreamName | The name of an audio stream. |
audioStreamNameLength | The number of characters of the name of an audio stream. |
void VisualDataStore::setAudioStreamTitle | ( | const char *const | audioStreamTitle, |
uint32 | audioStreamTitleLength | ||
) | [static] |
Sets the title of an audio stream.
audioStreamTitle | The title of an audio stream. |
audioStreamTitleLength | The number of characters of title of an audio stream. |
void VisualDataStore::setAudioStreamTitle | ( | const uint16 *const | audioStreamTitle, |
uint32 | audioStreamTitleLength | ||
) | [static] |
Sets the title of an audio stream.
audioStreamTitle | The title of an audio stream. |
audioStreamTitleLength | The number of characters of title of an audio stream. |
void VisualDataStore::setAudioStreamURL | ( | const char *const | audioStreamURL, |
uint32 | audioStreamURLLength | ||
) | [static] |
Sets the URL of an audio stream.
audioStreamURL | The URL of an audio stream. |
audioStreamURLLength | The number of characters of the URL of an audio stream. |
void VisualDataStore::setAudioStreamURL | ( | const uint16 *const | audioStreamURL, |
uint32 | audioStreamURLLength | ||
) | [static] |
Sets the URL of an audio stream.
audioStreamURL | The URL of an audio stream. |
audioStreamURLLength | The number of characters of the URL of an audio stream. |
void VisualDataStore::setAudioTrackAlbumName | ( | const uint16 *const | audioTrackAlbumName, |
uint32 | audioTrackAlbumNameLength | ||
) | [static] |
Sets the audio track album name.
audioTrackAlbumName | The name of the album of the current audio track. |
audioTrackAlbumNameLength | The number of characters of the name of the album of the current audio track. |
void VisualDataStore::setAudioTrackArtistName | ( | const uint16 *const | audioTrackArtistName, |
uint32 | audioTrackArtistNameLength | ||
) | [static] |
Sets the audio track artist name.
audioTrackArtistName | The name of the artist of the current audio track. |
audioTrackArtistNameLength | The number of characters of the name of the artist of the current audio track. |
void VisualDataStore::setAudioTrackComposer | ( | const uint16 *const | audioTrackComposer, |
uint32 | audioTrackComposerLength | ||
) | [static] |
Sets the audio track composer.
audioTrackComposer | The name of the composer of the current audio track. |
audioTrackComposerLength | The number of characters of the name of the composer of the current audio track. |
void VisualDataStore::setAudioTrackName | ( | const uint16 *const | audioTrackName, |
uint32 | audioTrackNameLength | ||
) | [static] |
Sets the audio track name.
audioTrackName | The name of the current audio track. |
audioTrackNameLength | The number of characters of the name of the current audio track. |
void VisualDataStore::setAudioTrackSizeInBytes | ( | int | sizeInBytes | ) | [static] |
Sets the size in bytes of the audio track.
sizeInBytes | The size in bytes of the audio track. |
void VisualDataStore::setAudioTrackYear | ( | uint16 | aYear | ) | [static] |
Sets the year of the audio track.
aYear | The year of the audio track. |
void VisualDataStore::setLyricsOfCurrentTrack | ( | const VisualString & | lyricsString | ) | [static] |
Stores the lyrics of the current audio track.
lyricsString | The lyrics of the current audio track. |
void VisualDataStore::setProcessInfo | ( | const char *const | labelStr, |
const char *const | valueStr | ||
) | [static] |
Stores label and value of a process info entry that is sent later to the VisualProcessMonitor.
labelStr | The string of the label. |
valueStr | The value of the process info. |
void VisualDataStore::setValue | ( | const ValueKey | anIdentifier, |
const int | anIntValue | ||
) | [static] |
Sets a persistent value (integer) which is not stored in preferences.
The value is accessible during runtime.
anIdentifier | The identifier (key) of the preference value. |
anIntValue | The value (integer) of the value. |
void VisualDataStore::setValue | ( | const ValueKey | anIdentifier, |
const float | aFloatValue | ||
) | [static] |
Sets a persistent value (float) which is not stored in preferences.
The value is accessible during runtime.
anIdentifier | The identifier (key) of the preference value. |
aFloatValue | The value (float) of the value. |
void VisualDataStore::setValue | ( | const ValueKey | anIdentifier, |
const char *const | aCharValue | ||
) | [static] |
Sets a persistent value (string) which is not stored in preferences.
The value is accessible during runtime.
anIdentifier | The identifier (key) of the preference value. |
aCharValue | The value (string) of the value. |
void VisualDataStore::setValue | ( | const ValueKey | anIdentifier, |
const bool | aBoolValue | ||
) | [static] |
Sets a persistent value (boolean) which is not stored in preferences.
The value is accessible during runtime.
anIdentifier | The identifier (key) of the preference value. |
aBoolValue | The value (boolean) of the value. |
void VisualDataStore::setVisualizerAPIVersion | ( | uint8 | majorVersionNum, |
uint8 | minorVersionNum | ||
) | [static] |
Stores the major and minor version of the Visualizer API version implemented by the host application.
majorVersionNum | The major version number of the Visualizer API version implemented by the host application. |
minorVersionNum | The minor version number of the Visualizer API version implemented by the host application. |
const VisualItemIdentifier VisualDataStore::albumCoverArtworkImageId [static] |
The identifier of the image of the album cover artwork.
The bug revision number of the host application iTunes (third part of the app version number).
The major version number of the host application iTunes.
The minor version number of the host application iTunes.
Vector of AudioMetaData.
const size_t VisualDataStore::audioMetaDataHistoryCount = 2 [static, private] |
The number of entries in history of meta data of audio track or stream.
Instance variable with some temporarily current audio meta data.
size_t VizKit::VisualDataStore::currAudioMetaDataHistoryIdx [private] |
The current index of the history of meta data of audio track or stream.
The identifier of the file with lyrics string data.
bool VisualDataStore::lyricsCreationThreadIsRunning = false [static, private] |
Flag that answers whether the lyrics creation thread is currently running.
A map of the process monitor info key-value-pairs.
const VisualItemIdentifier VisualDataStore::styledTrackInfoStringId [static] |
The identifier of the styled track info string.
VisualDataStore * VisualDataStore::theVisualDataStore = NULL [static, private] |
VisualDataStore is a singleton class.
Pointer to private instance is handled internally.
The identifier of the track for which the lyrics data is gathered.
const VisualItemIdentifier VisualDataStore::updateInformationStringId [static] |
The identifier of the update information string.
Vector of values.
The major version number of the Visualizer API implemented by the host application iTunes.
The minor version number of the Visualizer API implemented by the host application iTunes.