Main Page | Class List | File List | Class Members | File Members

IPod Class Reference

A class representing a connected iPod. More...

#include <ipod_cpp.h>

List of all members.

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

int Discover (std::string **paths)
 Scans for mounted iPods.
Encoding StringEncoding (void)
 The current encoding used for strings.
void SetStringEncoding (Encoding encoding)
 Sets the current encoding for strings.

Friends

class IPodTrack
class IPodPlaylist
class IPodEQPreset


Detailed Description

A class representing a connected iPod.


Member Enumeration Documentation

enum IPod::Encoding
 

String encodings.

Enumeration values:
IPOD_ENCODING_UTF_8  Selector to encode strings in UTF-8 (default)
IPOD_ENCODING_ISO_8859_1  Selector to encode strings in ISO-8859-1 (Latin-1)


Constructor & Destructor Documentation

IPod::IPod std::string  path  ) 
 

Constructor, takes an absolute path to the mount point of the iPod.

Parameters:
path an absolute path to the mount point of the iPod
   IPod ipod("/mnt/sda1");


Member Function Documentation

int IPod::Discover std::string **  paths  )  [static]
 

Scans for mounted iPods.

Scans the /mnt directory looking for mounted iPods

Parameters:
paths a pointer to a pointer in which an array of std:string instances will be returned
Returns:
the number of iPods found

void IPod::DiskUsage uint64_t *  total,
uint64_t *  free
 

Returns information about the total and available storage on the iPod.

Parameters:
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;

IPodEQPreset IPod::EQPresetByIndex unsigned long  index  ) 
 

Returns an object encapsulating a single EQ preset.

Parameters:
index the index of the EQ preset to retrieve
Returns:
an object encapsulating the EQ preset

unsigned long IPod::EQPresetCount void   ) 
 

Returns the number of EQ Presets on the iPod.

Returns:
the number of EQ Presets on the iPod

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

IPodPlaylist IPod::PlaylistByIndex unsigned long  index  ) 
 

Returns an object encapsulating a single playlist.

Parameters:
index the index of the playlist to be retrieved
Returns:
an object encapsulating the playlist

unsigned long IPod::PlaylistCount void   ) 
 

Returns the number of playlists on the iPod.

Returns:
the number of playlists on the iPod

void IPod::SetStringEncoding Encoding  encoding  )  [static]
 

Sets the current encoding for strings.

Parameters:
encoding either IPod::IPOD_ENCODING_ISO_8859_1 or IPod::IPOD_ENCODING_UTF_8 (default)

Encoding IPod::StringEncoding void   )  [static]
 

The current encoding used for strings.

Returns:
the current string encoding, defaults to IPod::IPOD_ENCODING_UTF_8

IPodTrack IPod::TrackByIndex unsigned long  index  ) 
 

Returns an object encapsulating a single audio track.

Parameters:
index the index of the track to be retrieved
Returns:
an object encapsulating the track

IPodTrack IPod::TrackByTrackID uint32_t  trackID  ) 
 

Returns an object encapsulating the single track with the supplied unique track ID.

Parameters:
trackID unique ID for the track to be retrieved
Returns:
an object encapsulating the track

unsigned long IPod::TrackCount void   ) 
 

Returns the number of tracks on the iPod.

Returns:
the number of tracks on the iPod

unsigned long IPod::Version void   ) 
 

Returns the database version found on the iPod.

Returns:
the version of the database


The documentation for this class was generated from the following file:
Generated on Tue Dec 13 14:55:22 2005 for libipod by  doxygen 1.3.9.1