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

IPodTrack Class Reference

A class representing an audio track on the iPod. More...

#include <ipod_cpp.h>

List of all members.

Public Member Functions

 IPodTrack (IPod &ipod)
 Constructor, creates a new, empty track on the iPod.
 IPodTrack (IPod &ipod, std::string filePath)
 Constuctor, creates a new track from the supplied file on the iPod.
 ~IPodTrack ()
 Destructor, does not delete the track.
void Remove (void)
 Removes the track from the iPod.
std::string GetText (int tag)
 Retrieves a text attribute from the track.
void SetText (int tag, std::string s)
 Sets a text attribute for the track.
bool HasText (int tag)
 Indicates whether the track currently has a particular string.
uint32_t GetAttribute (int tag)
 Return a numerical attribute for the track.
void SetAttribute (int tag, uint32_t value)
 Set the value of an attribute for the track.
void Upload (char *filePath, ipod_file_transfer_func callback=0, void *userData=0)
 Upload an audio file corresponding to this track.
void Download (char *filePath, ipod_file_transfer_func callback=0, void *userData=0)
 Download an audio file corresponding to this track.

Friends

class IPod


Detailed Description

A class representing an audio track on the iPod.


Constructor & Destructor Documentation

IPodTrack::IPodTrack IPod ipod  ) 
 

Constructor, creates a new, empty track on the iPod.

Parameters:
ipod the iPod on which to create the track

IPodTrack::IPodTrack IPod ipod,
std::string  filePath
 

Constuctor, creates a new track from the supplied file on the iPod.

This is a quick and dirty way to add audio files to the iPod - you only have to supply a local file path to a supported audio file. The file will be analyzed to extract the appropriate tag and format information to populate the data structures, and the file will be uploaded to the iPod

Parameters:
ipod the iPod on which to create the track
filePath path to a .mp3, .m4a or .wav file


Member Function Documentation

void IPodTrack::Download char *  filePath,
ipod_file_transfer_func  callback = 0,
void *  userData = 0
 

Download an audio file corresponding to this track.

Parameters:
filePath a path to the audio file to be downloaded
callback a function to be called as the file is downloaded
userData a pointer to a structure to be proved to the callback

uint32_t IPodTrack::GetAttribute int  tag  ) 
 

Return a numerical attribute for the track.

Parameters:
tag an identifier for the attribute to be retrieved
Returns:
the current value for the attribute
  cout << "Sample rate is " << track.GetAttribute(IPOD_TRACK_SAMPLE_RATE) << endl;

std::string IPodTrack::GetText int  tag  ) 
 

Retrieves a text attribute from the track.

Parameters:
tag an identifier for the string to be retrieved
Returns:
the text of the string in the current encoding
   cout << "Title is " << track.GetText(IPOD_TITLE) << endl;

bool IPodTrack::HasText int  tag  ) 
 

Indicates whether the track currently has a particular string.

Parameters:
tag an identifier for the string being queried
Returns:
a boolean indicating whether or not the string item exists in the track

void IPodTrack::Remove void   ) 
 

Removes the track from the iPod.

This method will remove the track from all playlists and from the master track list, and will remove the audio file from the iPod

void IPodTrack::SetAttribute int  tag,
uint32_t  value
 

Set the value of an attribute for the track.

Parameters:
tag an identifier for the attribute to be modified
value the new value for the attribute
   track.SetAttribute(IPOD_TRACK_ID,15);

void IPodTrack::SetText int  tag,
std::string  s
 

Sets a text attribute for the track.

Parameters:
tag an identifier for the string to be modified or added
s the string to be assigned in the current encoding
   std:string title = "Dead Puppies";
   track.SetText(IPOD_TITLE,title);

void IPodTrack::Upload char *  filePath,
ipod_file_transfer_func  callback = 0,
void *  userData = 0
 

Upload an audio file corresponding to this track.

Parameters:
filePath a path to the audio file to be uploaded
callback a function to be called as the file is uploaded
userData a pointer to a structure to be proved to the callback


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