Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
MusicDB Class Reference

The music database – every track, keyed by name. More...

#include <music.h>

Inheritance diagram for MusicDB:
Collaboration diagram for MusicDB:

Public Member Functions

const QVector< MusicDBEntry * > getStore () const
 All tracks.
const QHash< QString, MusicDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Track count.
MusicDBEntrygetStoreAt (int idx) const
 Track by store index (for QML).
MusicDBEntrygetIndAt (const QString &key) const
 Track by name key (for QML).
void load ()
 Load tracks from JSON.
void index ()
 Build the name->entry index.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static MusicDBinst ()
 < Number of tracks.

Detailed Description

The music database – every track, keyed by name.

Standard DB-singleton with a name index (see CreditsDB / db.md).

See also
MusicDBEntry, DB.

Definition at line 56 of file music.h.

Member Function Documentation

◆ getInd()

const QHash< QString, MusicDBEntry * > MusicDB::getInd ( ) const
nodiscard

Name->entry index.

Definition at line 44 of file music.cpp.

◆ getIndAt()

MusicDBEntry * MusicDB::getIndAt ( const QString & key) const

Track by name key (for QML).

Definition at line 53 of file music.cpp.

Referenced by MapDBEntry::deepLink().

◆ getStore()

const QVector< MusicDBEntry * > MusicDB::getStore ( ) const
nodiscard

All tracks.

Definition at line 43 of file music.cpp.

Referenced by AreaAudio::randomize().

◆ getStoreAt()

MusicDBEntry * MusicDB::getStoreAt ( int idx) const

Track by store index (for QML).

Definition at line 47 of file music.cpp.

◆ getStoreSize()

int MusicDB::getStoreSize ( ) const
nodiscard

Track count.

Definition at line 45 of file music.cpp.

◆ index()

void MusicDB::index ( )

Build the name->entry index.

Definition at line 68 of file music.cpp.

◆ inst()

MusicDB * MusicDB::inst ( )
static

< Number of tracks.

The process-wide MusicDB singleton.

Definition at line 37 of file music.cpp.

Referenced by MapDBEntry::deepLink(), DB::music(), DB::qmlProtect(), and AreaAudio::randomize().

◆ load()

void MusicDB::load ( )

Load tracks from JSON.

Definition at line 58 of file music.cpp.

References GameData::inst(), and GameData::json().

◆ qmlProtect()

void MusicDB::qmlProtect ( const QQmlEngine *const engine) const

Pin to C++ ownership.

Definition at line 79 of file music.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


The documentation for this class was generated from the following files: