oopapidocs  2.0
MetaDataTable Class Reference

Wrapper for Sql Table "MetaData". More...

#include <metadatatable.h>

Collaboration diagram for MetaDataTable:

List of all members.

Signals

void inserted (MetaDataValue v)
 Emitted after a record has been inserted into the database.

Public Member Functions

int visit (QString directory)
 Recursively searches for media files to add metadata to the table.
bool clearTable ()
 Drops the metadata table, in preparation for a full rescan.
QStringList genres () const
 Sorted list of genres in the metadata table.
bool hasMetaData (QString fileName, bool fetch=false, bool refresh=false)
 Check if there is metadata for this track available in the table.
bool dropMetaData (QString fileName)
 drops row from table
MetaDataValue findRecord (QString fileName)
 Uses database table to find metadata value.

Protected Member Functions

 MetaDataTable (QObject *parent=0)

Detailed Description

Wrapper for Sql Table "MetaData".

Can be used to store metadata for other media files besides MP3. Tested on MySQL. SQLite is almost working too.

Definition at line 21 of file metadatatable.h.


Constructor & Destructor Documentation

MetaDataTable::MetaDataTable ( QObject *  parent = 0) [protected]
See also:
instance()

Definition at line 35 of file metadatatable.cpp.

References Abstract::MetaDataLoader::instance().

Here is the call graph for this function:


Member Function Documentation

Drops the metadata table, in preparation for a full rescan.

Definition at line 102 of file metadatatable.cpp.

Uses database table to find metadata value.

Returns:
null value if not in the table.

Definition at line 168 of file metadatatable.cpp.

Referenced by hasMetaData().

bool MetaDataTable::hasMetaData ( QString  fileName,
bool  fetch = false,
bool  refresh = false 
)

Check if there is metadata for this track available in the table.

Insert (or update) the record in the metadata table for this track.

Returns:
true if the metadata for that file is already available in the database.
Parameters:
fetchif true, and record was not in the table, fetch the metadata and add to table.
refreshif true, fetch metadata and update table regardless of returned value

Definition at line 160 of file metadatatable.cpp.

References findRecord(), and Abstract::MetaDataLoader::get().

Referenced by PlayListDb::addFile(), and visit().

Here is the call graph for this function:

int MetaDataTable::visit ( QString  directory)

Recursively searches for media files to add metadata to the table.

Ignores files that were already added previously.

Parameters:
directorythe path to start searching

Definition at line 218 of file metadatatable.cpp.

References hasMetaData().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Enumerations