hydrogen 1.2.6
Playlist Class Reference

Drumkit info. More...

#include <Playlist.h>

Inheritance diagram for Playlist:
Object< Playlist > Base

Data Structures

struct  Entry
 

Public Member Functions

 ~Playlist ()
 
void activateSong (int SongNumber)
 
void add (Entry *entry)
 
void clear ()
 
Entryget (int idx)
 
int getActiveSongNumber ()
 
const QString & getFilename ()
 
bool getIsModified ()
 
int getSelectedSongNr ()
 
bool getSongFilenameByNumber (int songNumber, QString &fileName)
 
bool save_file (const QString &pl_path, const QString &name, bool overwrite, bool useRelativePaths)
 
void setActiveSongNumber (int ActiveSongNumber)
 
void setFilename (const QString &filename)
 
void setIsModified (bool IsModified)
 
void setNextSongByNumber (int SongNumber)
 
void setSelectedSongNr (int songNumber)
 
int size () const
 
QString toQString (const QString &sPrefix="", bool bShort=true) const override
 Formatted string version for debugging purposes.
 
- Public Member Functions inherited from Object< Playlist >
 Object ()
 
 Object (const Object< Playlist > &other)
 
- Public Member Functions inherited from Base
 Base ()
 
 Base (const Base &other)
 
virtual const char * class_name () const
 
void logBacktrace () const
 Print the current stack at point into the debug log.
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG.
 

Static Public Member Functions

static void create_instance ()
 If __instance equals 0, a new Playlist singleton will be created and stored in it.
 
static Playlistget_instance ()
 Returns a pointer to the current Playlist singleton stored in __instance.
 
static Playlistload (const QString &filename, bool useRelativePaths)
 
static Playlistload_file (const QString &pl_path, bool useRelativePaths)
 
- Static Public Member Functions inherited from Base
static const char * _class_name ()
 return the class name
 
static QString base_clock (const QString &sMsg)
 Measures the current time and stores it in __last_clock.
 
static QString base_clock_in (const QString &sMsg)
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation !
 
static bool count_active ()
 
static int getAliveObjectCount ()
 
static object_map_t getObjectMap ()
 
static Loggerlogger ()
 return the logger instance
 
static int objects_count ()
 
static void printObjectMapDiff (object_map_t map)
 Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.
 
static void set_count (bool flag)
 enable/disable class instances counting
 
static void write_objects_map_to (std::ostream &out, object_map_t *map=nullptr)
 output the full objects map to a given ostream
 
static void write_objects_map_to_cerr ()
 output objects map to stderr
 

Private Member Functions

 Playlist ()
 
void execScript (int index)
 
void save_to (XMLNode *node, bool useRelativePaths)
 

Private Attributes

std::vector< Entry * > __entries
 
QString __filename
 
bool m_bIsModified
 
int m_nActiveSongNumber
 
int m_nSelectedSongNumber
 

Static Private Attributes

static Playlist__instance = nullptr
 Object holding the current Playlist singleton.
 

Additional Inherited Members

- Static Public Attributes inherited from Base
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes.
 
- Protected Member Functions inherited from Object< Playlist >
 ~Object ()
 
- Protected Member Functions inherited from Base
 ~Base ()
 
- Static Protected Member Functions inherited from Base
static void registerClass (const char *name, const atomic_obj_cpt_t *counters)
 
- Static Protected Attributes inherited from Base
static bool __count = false
 should we count class instances
 
static timeval __last_clock = { 0, 0 }
 
static Logger__logger = nullptr
 
static bool bLogColors = true
 

Detailed Description

Drumkit info.

Definition at line 35 of file Playlist.h.

Constructor & Destructor Documentation

◆ ~Playlist()

~Playlist ( )

Definition at line 44 of file Playlist.cpp.

◆ Playlist()

Playlist ( )
private

Definition at line 36 of file Playlist.cpp.

Member Function Documentation

◆ activateSong()

void activateSong ( int SongNumber)

Definition at line 183 of file Playlist.cpp.

◆ add()

void add ( Entry * entry)
inline

Definition at line 133 of file Playlist.h.

◆ clear()

void clear ( )

Definition at line 57 of file Playlist.cpp.

◆ create_instance()

void create_instance ( )
static

If __instance equals 0, a new Playlist singleton will be created and stored in it.

It is called in Hydrogen::audioEngine_init().

Definition at line 50 of file Playlist.cpp.

◆ execScript()

void execScript ( int index)
private

Definition at line 217 of file Playlist.cpp.

◆ get()

Playlist::Entry * get ( int idx)
inline

Definition at line 127 of file Playlist.h.

◆ get_instance()

static Playlist * get_instance ( )
inlinestatic

Returns a pointer to the current Playlist singleton stored in __instance.

Definition at line 60 of file Playlist.h.

◆ getActiveSongNumber()

int getActiveSongNumber ( )
inline

Definition at line 148 of file Playlist.h.

◆ getFilename()

const QString & getFilename ( )
inline

Definition at line 158 of file Playlist.h.

◆ getIsModified()

bool getIsModified ( )
inline

Definition at line 168 of file Playlist.h.

◆ getSelectedSongNr()

int getSelectedSongNr ( )
inline

Definition at line 138 of file Playlist.h.

◆ getSongFilenameByNumber()

bool getSongFilenameByNumber ( int songNumber,
QString & fileName )

Definition at line 191 of file Playlist.cpp.

◆ load()

Playlist * load ( const QString & filename,
bool useRelativePaths )
static

Definition at line 166 of file Playlist.cpp.

◆ load_file()

Playlist * load_file ( const QString & pl_path,
bool useRelativePaths )
static

Definition at line 65 of file Playlist.cpp.

◆ save_file()

bool save_file ( const QString & pl_path,
const QString & name,
bool overwrite,
bool useRelativePaths )

Definition at line 131 of file Playlist.cpp.

◆ save_to()

void save_to ( XMLNode * node,
bool useRelativePaths )
private

Definition at line 149 of file Playlist.cpp.

◆ setActiveSongNumber()

void setActiveSongNumber ( int ActiveSongNumber)
inline

Definition at line 153 of file Playlist.h.

◆ setFilename()

void setFilename ( const QString & filename)
inline

Definition at line 163 of file Playlist.h.

◆ setIsModified()

void setIsModified ( bool IsModified)
inline

Definition at line 173 of file Playlist.h.

◆ setNextSongByNumber()

void setNextSongByNumber ( int SongNumber)

Definition at line 207 of file Playlist.cpp.

◆ setSelectedSongNr()

void setSelectedSongNr ( int songNumber)
inline

Definition at line 143 of file Playlist.h.

◆ size()

int size ( ) const
inline

Definition at line 122 of file Playlist.h.

◆ toQString()

QString toQString ( const QString & sPrefix = "",
bool bShort = true ) const
overridevirtual

Formatted string version for debugging purposes.

Parameters
sPrefixString prefix which will be added in front of every new line
bShortInstead of the whole content of all classes stored as members just a single unique identifier will be displayed without line breaks.
Returns
String presentation of current object.

Reimplemented from Base.

Definition at line 230 of file Playlist.cpp.

Field Documentation

◆ __entries

std::vector<Entry*> __entries
private

Definition at line 108 of file Playlist.h.

◆ __filename

QString __filename
private

Definition at line 106 of file Playlist.h.

◆ __instance

Playlist * __instance = nullptr
staticprivate

Object holding the current Playlist singleton.

It is initialized with NULL, set with create_instance(), and accessed with get_instance().

Definition at line 105 of file Playlist.h.

◆ m_bIsModified

bool m_bIsModified
private

Definition at line 113 of file Playlist.h.

◆ m_nActiveSongNumber

int m_nActiveSongNumber
private

Definition at line 111 of file Playlist.h.

◆ m_nSelectedSongNumber

int m_nSelectedSongNumber
private

Definition at line 110 of file Playlist.h.