Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

MusicFilenameLayout Class Reference

#include <musicfilenamelayout.h>

List of all members.

Public Methods

 MusicFilenameLayout (QString _name, QRegExp _exp, int _artistPos=-1, int _albumPos=-1, int _trackPos=-1, int _titlePos=-1)
 MusicFilenameLayout (QString _name, QString _exp, bool minimal=false, int _artistPos=-1, int _albumPos=-1, int _trackPos=-1, int _titlePos=-1)
 MusicFilenameLayout ()
 ~MusicFilenameLayout ()
bool match (const QString &filename)
MusicInfo getInfo (const QString &filename)

Static Public Methods

QString toggleUnderscore (const QString &filename, bool underscore=false)
bool normalize (QString &filename)

Public Attributes

QString name
int trackPos
int titlePos
int artistPos
int albumPos

Private Methods

void addExtensions ()

Private Attributes

QRegExp regexp

Static Private Attributes

QString extensions


Detailed Description

This class is a base class for MP3 (or Ogg) filename layout. Derived classes will define RegExps and methods to match etc filenames like: Artist Name - Song Name.mp3 03 - Song Name.mp3 etc
Author:
Avi Alkalay


Constructor & Destructor Documentation

MusicFilenameLayout::MusicFilenameLayout QString    _name,
QRegExp    _exp,
int    _artistPos = -1,
int    _albumPos = -1,
int    _trackPos = -1,
int    _titlePos = -1
 

MusicFilenameLayout::MusicFilenameLayout QString    _name,
QString    _exp,
bool    minimal = false,
int    _artistPos = -1,
int    _albumPos = -1,
int    _trackPos = -1,
int    _titlePos = -1
 

MusicFilenameLayout::MusicFilenameLayout  
 

MusicFilenameLayout::~MusicFilenameLayout  
 


Member Function Documentation

bool MusicFilenameLayout::match const QString &    filename
 

Tests if the filename matches this layout

Parameters:
filename  the file name to be tested
Returns:
true if filename matches

MusicInfo MusicFilenameLayout::getInfo const QString &    filename
 

Tries to find some music information from file name

Parameters:
filename  the file name to be tested
Returns:
the MusicInfo object containing as much as was matched

QString MusicFilenameLayout::toggleUnderscore const QString &    filename,
bool    underscore = false
[static]
 

Returns the passed string substituting _ with space or vice-versa. Default is to remove underscore.

bool MusicFilenameLayout::normalize QString &    filename [static]
 

Normalize a filename to a standard:

  • Space to underline
  • Caps first letter of each word
  • Small caps extension
Returns:
True if something changed.

void MusicFilenameLayout::addExtensions   [private]
 

Add the extension to the regexp


Member Data Documentation

QString MusicFilenameLayout::name
 

This filename layout name. Something like "Artist Name - Song Name.mp3".

int MusicFilenameLayout::trackPos
 

Position of each item in the matched string

int MusicFilenameLayout::titlePos
 

Position of each item in the matched string

int MusicFilenameLayout::artistPos
 

Position of each item in the matched string

int MusicFilenameLayout::albumPos
 

Position of each item in the matched string

QRegExp MusicFilenameLayout::regexp [private]
 

The regular expression that will match a file name.

QString MusicFilenameLayout::extensions [static, private]
 

The global regular expression with all extensions.


The documentation for this class was generated from the following file:
Generated on Sat Jul 26 08:03:49 2003 for MusicMan by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002