MythTV  master
Classes | Functions | Variables
smartplaylist.cpp File Reference
#include <iostream>
#include <unistd.h>
#include <utility>
#include <QKeyEvent>
#include <QSqlDriver>
#include <QSqlField>
#include <libmyth/mythcontext.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythdb.h>
#include <libmythmetadata/musicmetadata.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythscreentype.h>
#include <libmythui/mythuibutton.h>
#include <libmythui/mythuibuttonlist.h>
#include <libmythui/mythuicheckbox.h>
#include <libmythui/mythuihelper.h>
#include <libmythui/mythuispinbox.h>
#include <libmythui/mythuitext.h>
#include <libmythui/mythuitextedit.h>
#include "musiccommon.h"
#include "musicdata.h"
#include "smartplaylist.h"
Include dependency graph for smartplaylist.cpp:

Go to the source code of this file.

Classes

struct  SmartPLField
 
struct  SmartPLOperator
 

Functions

static const SmartPLOperatorlookupOperator (const QString &name)
 
static const SmartPLFieldlookupField (const QString &name)
 
QString formattedFieldValue (const QVariant &value)
 
static QString evaluateDateValue (QString sDate)
 
QString getCriteriaSQL (const QString &fieldName, const QString &operatorName, QString value1, QString value2)
 
QString getOrderBySQL (const QString &orderByFields)
 
QString getSQLFieldName (const QString &fieldName)
 

Variables

static const std::array< const SmartPLField, 13 > SmartPLFields
 
static const std::array< const SmartPLOperator, 11 > SmartPLOperators
 

Function Documentation

◆ lookupOperator()

static const SmartPLOperator* lookupOperator ( const QString &  name)
static

◆ lookupField()

static const SmartPLField* lookupField ( const QString &  name)
static

◆ formattedFieldValue()

QString formattedFieldValue ( const QVariant &  value)

◆ evaluateDateValue()

static QString evaluateDateValue ( QString  sDate)
static

Definition at line 121 of file smartplaylist.cpp.

Referenced by getCriteriaSQL().

◆ getCriteriaSQL()

QString getCriteriaSQL ( const QString &  fieldName,
const QString &  operatorName,
QString  value1,
QString  value2 
)

◆ getOrderBySQL()

QString getOrderBySQL ( const QString &  orderByFields)

◆ getSQLFieldName()

QString getSQLFieldName ( const QString &  fieldName)

Definition at line 275 of file smartplaylist.cpp.

Variable Documentation

◆ SmartPLFields

const std::array<const SmartPLField,13> SmartPLFields
static
Initial value:
{{
{ "", "", ftString, 0, 0, 0 },
{ "Artist", "music_artists.artist_name", ftString, 0, 0, 0 },
{ "Album", "music_albums.album_name", ftString, 0, 0, 0 },
{ "Title", "music_songs.name", ftString, 0, 0, 0 },
{ "Genre", "music_genres.genre", ftString, 0, 0, 0 },
{ "Year", "music_songs.year", ftNumeric, 1900, 2099, 2000 },
{ "Track No.", "music_songs.track", ftNumeric, 0, 99, 0 },
{ "Rating", "music_songs.rating", ftNumeric, 0, 10, 0 },
{ "Play Count", "music_songs.numplays", ftNumeric, 0, 9999, 0 },
{ "Compilation", "music_albums.compilation", ftBoolean, 0, 0, 0 },
{ "Comp. Artist", "music_comp_artists.artist_name", ftString, 0, 0, 0 },
{ "Last Play", "FROM_DAYS(TO_DAYS(music_songs.lastplay))",
ftDate, 0, 0, 0 },
{ "Date Imported", "FROM_DAYS(TO_DAYS(music_songs.date_entered))",
ftDate, 0, 0, 0 },
}}

Definition at line 43 of file smartplaylist.cpp.

Referenced by SmartPlaylistEditor::Create(), SmartPLOrderByDialog::getOrderByFields(), lookupField(), and CriteriaRowEditor::updateFields().

◆ SmartPLOperators

const std::array<const SmartPLOperator,11> SmartPLOperators
static
Initial value:
{{
{ "is equal to", 1, false, true },
{ "is not equal to", 1, false, true },
{ "is greater than", 1, false, false },
{ "is less than", 1, false, false },
{ "starts with", 1, true, false },
{ "ends with", 1, true, false },
{ "contains", 1, true, false },
{ "does not contain", 1, true, false },
{ "is between", 2, false, false },
{ "is set", 0, false, false },
{ "is not set", 0, false, false },
}}

Definition at line 70 of file smartplaylist.cpp.

Referenced by CriteriaRowEditor::getOperatorList(), lookupOperator(), and CriteriaRowEditor::updateOperators().

ftString
@ ftString
Definition: smartplaylist.h:24
ftBoolean
@ ftBoolean
Definition: smartplaylist.h:27
ftNumeric
@ ftNumeric
Definition: smartplaylist.h:25
ftDate
@ ftDate
Definition: smartplaylist.h:26