Class PDJE

Class Documentation

class PDJE

the main Interface of this Engine PDJE gets music data and track data from database. from that datas, you can activate music player and you can get a music player handler. with this player handler, you can control music’s mixing in real time.

to-use

  1. make PDJE object

  2. call SearchTrack

  3. call InitPlayer

  4. use player. this is handler.

digraph PDJE_Interface_Tree{ PDJE -> Search_Tools; PDJE -> Player; Player -> Player_ON_OFF; Player -> FXController; Player -> MusicController; FXController -> FX_ON_OFF; FXController -> FX_arg_setter; FX_arg_setter -> change_FX_value; MusicController -> Load_Music; MusicController -> Unload_Music; MusicController -> ON_OFF_Music; MusicController -> Cue_Music; MusicController -> FXController; }

Public Functions

PDJE(const std::string &rootPath)

Construct a new PDJE object.

Parameters:

rootPath – the path to the Root Database.

~PDJE() = default
bool InitPlayer(PLAY_MODE mode, trackdata &td, const unsigned int FrameBufferSize)

this inits the music handler. the music handler called a “player” it initializes the player

Parameters:
  • mode – the play modes. you can choose “FULL_PRE_RENDER”, “HYBRID_RENDER”, “FULL_MANUAL_RENDER”

  • td – the track data. you can get this from SearchTrack()

  • FrameBufferSize – the buffersize. in this project, it uses 48000 samplerate. if you use 48 as a value, in theory, it calls mixing function 1000 times per second.

Returns:

true no error

Returns:

false error

bool InitEditor(const std::string &auth_name, const std::string &auth_email, const std::string &projectRoot)
bool GetNoteObjects(trackdata &td, OBJ_SETTER_CALLBACK &ObjectSetCallback)

Parse Note data and calls received function. this function parse the note datas in the database. after parsing the note datas, this function calls received function. you should make your custom function that can make your own note object.

Parameters:
  • td – the track data. you can get this from SearchTrack()

  • ObjectSetCallback – the lambda callback. give a function that could make a new note objects. it’s totally depends on you.

Returns:

true

Returns:

false

MUS_VEC SearchMusic(const std::string &Title, const std::string &composer, const double bpm = -1)

searches musics and metadatas from database. if you don’t need to filter, send “” to the values

Parameters:
  • Title – the title of the music

  • composer – the composer of the music

  • bpm – the bpm of the music. send under zero to skip filter

Returns:

MUS_VEC

TRACK_VEC SearchTrack(const std::string &Title)

searches track the track contains the note data, mix data and included music lists.

Parameters:

Title – the tile of the track. send “” to skip filter

Returns:

TRACK_VEC the array of the track_data. find what you want

audioPlayer *GetPlayerObject()

music handler getter api for binded codes. this function gives you a music handler. you can access player directly in cpp, but not in binded languages. so this function exists.

Returns:

audioPlayer* the player object.check nullptr before use.

Public Members

std::optional<audioPlayer> player

this is the music handler. you can play music, stop music, fx control, play/stop music manually in realtime.

std::optional<editorObject> editor