MythTV  master
Functions | Variables
musicutils.cpp File Reference
#include <iostream>
#include <QFile>
#include <QRegExp>
#include <QDir>
#include <mythdirs.h>
#include <mythlogging.h>
#include <mythcorecontext.h>
#include <remotefile.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include "musicmetadata.h"
#include "musicutils.h"
Include dependency graph for musicutils.cpp:

Go to the source code of this file.

Functions

QString fixFilename (const QString &filename)
 remove any bad filename characters More...
 
QString findIcon (const QString &type, const QString &name, bool ignoreCache)
 find an image for a artist or genre More...
 
QString fixFileToken_sl (QString token)
 
QString filenameFromMetadata (MusicMetadata *track)
 create a filename using the template in the settings and a MusicMetadata object More...
 
bool isNewTune (const QString &artist, const QString &album, const QString &title)
 try to find a track in the db using the given artist, album and title More...
 

Variables

static QRegExp badChars = QRegExp("(/|\\\\|:|\'|\"|\\?|\\|)")
 
static QMap< QString, QString > iconMap
 

Function Documentation

◆ fixFilename()

QString fixFilename ( const QString &  filename)

remove any bad filename characters

Definition at line 26 of file musicutils.cpp.

Referenced by filenameFromMetadata(), and findIcon().

◆ findIcon()

QString findIcon ( const QString &  type,
const QString &  name,
bool  ignoreCache 
)

◆ fixFileToken_sl()

QString fixFileToken_sl ( QString  token)
inline

Definition at line 69 of file musicutils.cpp.

Referenced by filenameFromMetadata().

◆ filenameFromMetadata()

QString filenameFromMetadata ( MusicMetadata track)

create a filename using the template in the settings and a MusicMetadata object

Definition at line 77 of file musicutils.cpp.

Referenced by ImportMusicDialog::addPressed(), CDRipperThread::run(), and ImportCoverArtDialog::updateStatus().

◆ isNewTune()

bool isNewTune ( const QString &  artist,
const QString &  album,
const QString &  title 
)

Variable Documentation

◆ badChars

QRegExp badChars = QRegExp("(/|\\\\|:|\'|\"|\\?|\\|)")
static

Definition at line 24 of file musicutils.cpp.

Referenced by fixFilename().

◆ iconMap

QMap<QString, QString> iconMap
static

Definition at line 33 of file musicutils.cpp.

Referenced by findIcon(), and PlaybackBox::updateIcons().