IPod Class Reference

#include <ipod.h>

List of all members.

Public Member Functions

 IPod (const QString &ipodBase)
 Constructs a new IPod instance for an iPod at the given path. Does not actually read the contents - you need to open it with open().
virtual ~IPod ()
 The destructor.
bool open ()
 Tries to open an ipod.
void initialize (const QString &title)
 Initializes this ipod by creating the nessessary directories and files.
bool isOpen ()
 Returns true if open() was called successfully for this instance.
bool isStillConnected ()
 Returns true if the ipod represented by this instance is still connected to the system.
void close ()
 Clears all data we got from this instance whether or not it was changed.
QString getName () const
 Returns the name of the iPod.
void setName (const QString &name)
 Sets the name of the iPod.
const QString & getItunesDBError () const
 Returns the error occured during read or write.
const IPodSysInfogetSysInfo () const
 Returns the IPodSysInfo for this IPod instance (const).
IPodSysInfogetSysInfo ()
 Returns the IPodSysInfo for this IPod instance.
const ITunesDBgetITunesDB () const
 Returns the ITunesDB for this iPod (const).
ITunesDBgetITunesDB ()
 Returns the ITunesDB for this iPod.
void synchronize ()
 Writes back all the changed data to the device.
bool isDirty () const
 Returns true if this instances data differ somehow from the original.
void lock (bool write_lock)
 Lock control functions to prevent concurrent access to the iPod from different programs.
bool isLocked ()
 Returns true if the iPod got locked.
void unlock ()
 unlock an iPod previously locked
const QString & getBasePath () const
 Returns the base path of the iPod.
bool hasPodcasts ()
QStringList & findUnreferencedMusicFiles (QStringList &list) const
 Finds all the files in the Music folders that don't have a track record.

Static Public Member Functions

static QString createDistinctIPodName (const IPod &ipod) __attribute__((deprecated))

Protected Attributes

QString m_ipodBase


Detailed Description

This class represents all functionalities to access and modify information about the iPod/itunesDB

Author:
Michael Schulze
Examples:

listtests.cpp, and listtrackstest.cpp.


Constructor & Destructor Documentation

IPod::IPod ( const QString &  ipodBase  ) 

Constructs a new IPod instance for an iPod at the given path. Does not actually read the contents - you need to open it with open().

IPod::~IPod (  )  [virtual]

The destructor.


Member Function Documentation

bool IPod::open (  ) 

Tries to open an ipod.

That means reading all important information from the device.

Returns:
true if successful, otherwise false

void IPod::initialize ( const QString &  title  ) 

Initializes this ipod by creating the nessessary directories and files.

This IPod instance then contains the information about the initialized ipod - no need to call open() afterwards.

bool IPod::isOpen (  ) 

Returns true if open() was called successfully for this instance.

Returns:
true if open() was called successfully for this instance.

bool IPod::isStillConnected (  ) 

Returns true if the ipod represented by this instance is still connected to the system.

Returns:
true if the ipod represented by this instance is still connected to the system false otherwise

void IPod::close (  ) 

Clears all data we got from this instance whether or not it was changed.

Resets the state of this instance.

Examples:
listtests.cpp, and listtrackstest.cpp.

QString IPod::getName (  )  const

Returns the name of the iPod.

Returns:
the name of the iPod as set in the device details
Examples:
listtests.cpp.

void IPod::setName ( const QString &  name  ) 

Sets the name of the iPod.

When the iPod is not opened (isOpen() == false) nothing is changed

Parameters:
name the new name for the iPod

const QString & IPod::getItunesDBError (  )  const

Returns the error occured during read or write.

Returns:
the error occured during read or write

const IPodSysInfo & IPod::getSysInfo (  )  const

Returns the IPodSysInfo for this IPod instance (const).

Returns:
the IPodSysInfo for this IPod instance.

IPodSysInfo & IPod::getSysInfo (  ) 

Returns the IPodSysInfo for this IPod instance.

Returns:
the IPodSysInfo for this IPod instance.

const ITunesDB & IPod::getITunesDB (  )  const

Returns the ITunesDB for this iPod (const).

Returns:
the ITunesDB for this iPod.
Examples:
listtests.cpp, and listtrackstest.cpp.

ITunesDB & IPod::getITunesDB (  ) 

Returns the ITunesDB for this iPod.

Returns:
the ITunesDB for this iPod.

void IPod::synchronize (  ) 

Writes back all the changed data to the device.

This only includes control structures like the iTunesDB and DeviceInfo data.

bool IPod::isDirty (  )  const [inline]

Returns true if this instances data differ somehow from the original.

data from the iPod and need to be synchronized.

Examples:
listtests.cpp.

void IPod::lock ( bool  write_lock  ) 

Lock control functions to prevent concurrent access to the iPod from different programs.

locks the iPod

Parameters:
write_lock if true the ipod will be locked exclusively
Attention:
not implemented for win32

bool IPod::isLocked (  ) 

Returns true if the iPod got locked.

Returns:
true if the iPod got locked

void IPod::unlock (  ) 

unlock an iPod previously locked

const QString& IPod::getBasePath (  )  const [inline]

Returns the base path of the iPod.

(i.e. "/media/ipod" on linux or "E:" on a windows machine)

Returns:
the base path of the iPod

QString IPod::createDistinctIPodName ( const IPod ipod  )  [static]

This method creates a string containing the ipod base path encoded being distinct between different iPods simultanously connected to the system. Most users wont need this method - it's here as a relict from the old ipodslave code and may go away in the future

Deprecated:
this method doesn't belong here

QStringList & IPod::findUnreferencedMusicFiles ( QStringList &  list  )  const

Finds all the files in the Music folders that don't have a track record.

The fully qualified pathes will be added to the given list.

Parameters:
list the list to add the unreferences files to
Returns:
the reference to the given list


The documentation for this class was generated from the following files:
Generated on Wed Nov 28 03:04:38 2007 for libqtpod by  doxygen 1.5.0