#include <ipod_cpp.h>
Public Types | |
enum | Encoding { IPOD_ENCODING_UTF_8, IPOD_ENCODING_ISO_8859_1 } |
String encodings. More... | |
Public Member Functions | |
IPod (std::string path) | |
Constructor, takes an absolute path to the mount point of the iPod. | |
~IPod () | |
Destructor, frees all data internal data structures. | |
void | Flush (void) |
Flushes any modifications to the iPod. | |
unsigned long | Version (void) |
Returns the database version found on the iPod. | |
void | DiskUsage (uint64_t *total, uint64_t *free) |
Returns information about the total and available storage on the iPod. | |
unsigned long | TrackCount (void) |
Returns the number of tracks on the iPod. | |
IPodTrack | TrackByIndex (unsigned long index) |
Returns an object encapsulating a single audio track. | |
IPodTrack | TrackByTrackID (uint32_t trackID) |
Returns an object encapsulating the single track with the supplied unique track ID. | |
unsigned long | PlaylistCount (void) |
Returns the number of playlists on the iPod. | |
IPodPlaylist | PlaylistByIndex (unsigned long index) |
Returns an object encapsulating a single playlist. | |
unsigned long | EQPresetCount (void) |
Returns the number of EQ Presets on the iPod. | |
IPodEQPreset | EQPresetByIndex (unsigned long index) |
Returns an object encapsulating a single EQ preset. | |
Static Public Member Functions | |
static int | Discover (std::string **paths) |
Scans for mounted iPods. | |
static Encoding | StringEncoding (void) |
The current encoding used for strings. | |
static void | SetStringEncoding (Encoding encoding) |
Sets the current encoding for strings. | |
Friends | |
class | IPodTrack |
class | IPodPlaylist |
class | IPodEQPreset |
enum IPod::Encoding |
IPod::IPod | ( | std::string | path | ) |
Constructor, takes an absolute path to the mount point of the iPod.
path | an absolute path to the mount point of the iPod |
IPod ipod("/mnt/sda1");
void IPod::Flush | ( | void | ) |
Flushes any modifications to the iPod.
If any changes have been made to the data structures, will write out any affected databases to the iPod storage
unsigned long IPod::Version | ( | void | ) |
Returns the database version found on the iPod.
void IPod::DiskUsage | ( | uint64_t * | total, | |
uint64_t * | free | |||
) |
Returns information about the total and available storage on the iPod.
total | pointer to 64-bit integer that will contain the total size of the iPod in bytes | |
free | pointer to 64-bit integer that will contain the total available space on the iPod in bytes |
uint64_t total,free; ipod.DiskUsage(&total,&free); cout << "Total storage on iPod: " << total << " bytes" << endl;
unsigned long IPod::TrackCount | ( | void | ) |
Returns the number of tracks on the iPod.
IPodTrack IPod::TrackByIndex | ( | unsigned long | index | ) |
Returns an object encapsulating a single audio track.
index | the index of the track to be retrieved |
IPodTrack IPod::TrackByTrackID | ( | uint32_t | trackID | ) |
Returns an object encapsulating the single track with the supplied unique track ID.
trackID | unique ID for the track to be retrieved |
unsigned long IPod::PlaylistCount | ( | void | ) |
Returns the number of playlists on the iPod.
IPodPlaylist IPod::PlaylistByIndex | ( | unsigned long | index | ) |
Returns an object encapsulating a single playlist.
index | the index of the playlist to be retrieved |
unsigned long IPod::EQPresetCount | ( | void | ) |
Returns the number of EQ Presets on the iPod.
IPodEQPreset IPod::EQPresetByIndex | ( | unsigned long | index | ) |
Returns an object encapsulating a single EQ preset.
index | the index of the EQ preset to retrieve |
static int IPod::Discover | ( | std::string ** | paths | ) | [static] |
Scans for mounted iPods.
Scans the /mnt directory looking for mounted iPods
paths | a pointer to a pointer in which an array of std:string instances will be returned |
static Encoding IPod::StringEncoding | ( | void | ) | [static] |
The current encoding used for strings.
static void IPod::SetStringEncoding | ( | Encoding | encoding | ) | [static] |
Sets the current encoding for strings.
encoding | either IPod::IPOD_ENCODING_ISO_8859_1 or IPod::IPOD_ENCODING_UTF_8 (default) |