VizKit  3.3.7
Classes | Public Types | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
VizKit::VisualDataStore Class Reference

Stores essential data for the visualizer. More...

#include <VisualDataStore.h>

List of all members.

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.
VisualDataStoreoperator= (const VisualDataStore &other)
 Assignment operator.
void advanceAudioMetaDataHistory (void)
 Advance (increment) the history of AudioMetaData.

Static Private Member Functions

static VisualDataStoregetInstance (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 VisualDataStoretheVisualDataStore = 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.

Detailed Description

Stores essential data for the visualizer.

The data stored is general (neither graphics related nor audio specific). All public methods are declared static.


Member Typedef Documentation

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.


Member Enumeration Documentation

The format of the data that is stored with the values.

Enumerator:
kIntPrefType 

Integer type.

kCharPrefType 

8-bit character type.

kFloatPrefType 

Float type.

kBoolPrefType 

Float type.

Enumerator:
kUnknownValue 
kTrackInfoTextureHeight 
kLyricsTextureHeight 

Constructor & Destructor Documentation

The constructor.

VisualDataStore is a singleton class. The constructor is private. New instance of class can only be created internally.

The destructor.

VisualDataStore is a singleton class. The destructor is private. Instance of class can only be destructed internally.

Copy constructor.

Parameters:
otherAnother VisualDataStore.
Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.

Member Function Documentation

Advance (increment) the history of AudioMetaData.

The current index is moved one forward.

Analyzes the currently set audio track meta data.

Returns:
True if the track information changed (meaning: a new audio track started).

Answers the question whether currently playing audio is stream or track.

Returns:
True if currently playing audio is stream. False if currently playing audio is a track.
void VisualDataStore::dispose ( void  ) [static]

Disposes the VisualDataStore.

Returns the name of the album of the current audio track.

Returns:
The name of album of the current track.

Returns the bug revision number of the host application.

Returns:
The minor version number of the host application.

Returns the major version number of the host application.

Returns:
The major version number of the host application.

Returns the minor version number of the host application.

Returns:
The minor version number of the host application.

Returns the name of the artist of the current audio track.

Returns:
The name of artist of the current track.

Returns a string with the info for the current audio data which can be used for display.

Returns:
String with the info for the current audio data.
VisualDataStore * VisualDataStore::getInstance ( void  ) [static, private]

Constructs a VisualDataStore.

The VisualDataStore internally is a singleton. Returns a pointer to the initialized VisualDataStore.

Returns:
A pointer to the singleton instance.

Returns the name of the current audio track.

Returns:
The name of current track.
const std::map< std::string, std::string > *const VisualDataStore::getProcessInfoMap ( ) [static]

Returns a pointer to the process info map.

Returns:
The process info map.

Returns the number of bytes of the current track.

Returns:
The number of bytes of the current track.

Returns the year of the current track.

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.

Parameters:
anIdentifierThe identifier (key) of the preference value.
wasSetOptional parameter that indicates whether the values was set previously.
Returns:
Returns a persistent value (boolean) which was set previously but not stored in preferences.
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.

Parameters:
anIdentifierThe identifier (key) of the preference value.
[out]outPrefValThe character string value.
wasSetOptional parameter that indicates whether the values was set previously.
Returns:
Returns a persistent value (string) which was set previously but not stored in preferences.
float VisualDataStore::getValueFloat ( const ValueKey  anIdentifier,
bool *  wasSet = NULL 
) [static]

Retrieves a persistent value (float) which was set previously but not stored in preferences.

Parameters:
anIdentifierThe identifier (key) of the preference value.
wasSetOptional parameter that indicates whether the values was set previously.
Returns:
Returns a persistent value (float) which was set previously but not stored in preferences.
int VisualDataStore::getValueInt ( const ValueKey  anIdentifier,
bool *  wasSet = NULL 
) [static]

Retrieves a persistent value (integer) which was set previously but not stored in preferences.

Parameters:
anIdentifierThe identifier (key) of the preference value.
wasSetOptional parameter that indicates whether the values was set previously.
Returns:
Returns a persistent value (integer) which was set previously but not stored in preferences.

Returns the major version number of the Visualizer API version implemented by the host application.

Returns:
The major version number of the Visualizer API version implemented by the host application.

Returns the minor version number of the Visualizer API version implemented by the host application.

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.

Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.
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.

Parameters:
majorVersionNumThe major version number of the host application.
minorVersionNumThe minor version number of the host application.
bugRevisionNumThe 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.

Parameters:
audioStreamMessageThe title of an audio stream.
audioStreamMessageLengthThe 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.

Parameters:
audioStreamMessageThe message of an audio stream.
audioStreamMessageLengthThe 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.

Parameters:
audioStreamNameThe name of an audio stream.
audioStreamNameLengthThe 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.

Parameters:
audioStreamTitleThe title of an audio stream.
audioStreamTitleLengthThe 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.

Parameters:
audioStreamTitleThe title of an audio stream.
audioStreamTitleLengthThe 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.

Parameters:
audioStreamURLThe URL of an audio stream.
audioStreamURLLengthThe 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.

Parameters:
audioStreamURLThe URL of an audio stream.
audioStreamURLLengthThe 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.

Parameters:
audioTrackAlbumNameThe name of the album of the current audio track.
audioTrackAlbumNameLengthThe 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.

Parameters:
audioTrackArtistNameThe name of the artist of the current audio track.
audioTrackArtistNameLengthThe 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.

Parameters:
audioTrackComposerThe name of the composer of the current audio track.
audioTrackComposerLengthThe 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.

Parameters:
audioTrackNameThe name of the current audio track.
audioTrackNameLengthThe 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.

Parameters:
sizeInBytesThe size in bytes of the audio track.
void VisualDataStore::setAudioTrackYear ( uint16  aYear) [static]

Sets the year of the audio track.

Parameters:
aYearThe year of the audio track.
void VisualDataStore::setLyricsOfCurrentTrack ( const VisualString lyricsString) [static]

Stores the lyrics of the current audio track.

Parameters:
lyricsStringThe 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.

Parameters:
labelStrThe string of the label.
valueStrThe 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.

Parameters:
anIdentifierThe identifier (key) of the preference value.
anIntValueThe 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.

Parameters:
anIdentifierThe identifier (key) of the preference value.
aFloatValueThe 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.

Parameters:
anIdentifierThe identifier (key) of the preference value.
aCharValueThe 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.

Parameters:
anIdentifierThe identifier (key) of the preference value.
aBoolValueThe 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.

Parameters:
majorVersionNumThe major version number of the Visualizer API version implemented by the host application.
minorVersionNumThe minor version number of the Visualizer API version implemented by the host application.

Member Data Documentation

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.

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.

The identifier of the styled track info string.

VisualDataStore is a singleton class.

Pointer to private instance is handled internally.

The identifier of the track for which the lyrics data is gathered.

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.


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

Generated on Sun May 3 2015 20:26:31 for VizKit by doxygen 1.8.0