XJ music engine
1.9.6
In-game runtime engine for XJ music.
|
#include <CraftWork.h>
Public Member Functions | |
CraftWork (SegmentEntityStore *store, ContentEntityStore *content, int persistenceWindowSeconds, int craftAheadSeconds, int deadlineSeconds) | |
void | start () |
void | finish () |
bool | isFinished () const |
void | runCycle (const unsigned long long int atChainMicros) |
TemplateConfig | getTemplateConfig () const |
std::vector< const Segment * > | getSegmentsIfReady (unsigned long long fromChainMicros, unsigned long long toChainMicros) const |
std::optional< const Segment * > | getSegmentAtChainMicros (unsigned long long chainMicros) const |
std::optional< const Segment * > | getSegmentAtOffset (int offset) const |
std::set< const SegmentChoiceArrangementPick * > | getPicks (const std::vector< const Segment * > &segments) const |
const Instrument * | getInstrument (const InstrumentAudio *audio) const |
const InstrumentAudio * | getInstrumentAudio (const SegmentChoiceArrangementPick *pick) const |
std::optional< const Program * > | getMainProgram (const Segment *segment) const |
std::optional< const Program * > | getMacroProgram (const Segment &segment) const |
ContentEntityStore * | getSourceMaterial () const |
bool | isReady () const |
void | doOverrideMacro (const Program *macroProgram) |
void | doOverrideMemes (std::set< std::string > memes) |
bool | getAndResetDidOverride () |
std::set< const SegmentChoice * > | getChoices (const Segment *segment) const |
std::set< const SegmentChoiceArrangement * > | getArrangements (const SegmentChoice *choice) const |
std::set< const SegmentChoiceArrangementPick * > | getPicks (const SegmentChoiceArrangement *arrangement) const |
THERE IS NO SPOON
Ground-up rewrite of the XJ work logic. First we instantiate the dub cycle, which depends on the craft cycle operating on a separate thread. All Segment craft is persisted in memory, and the dub cycle is responsible for requesting crafted segments and specifically the picked audio, and then dubbing each output audio chunk.
Output audio chunks are dynamically sized. There is a default size, but the size is also determined by the duration of the segment. E.g., during gapless album output, the chunk will cut short if necessary to begin the next chunk at exactly the top of the following segment.
|
explicit |
void CraftWork::doOverrideMacro | ( | const Program * | macroProgram | ) |
Go to the given macro program right now https://github.com/xjmusic/xjmusic/issues/197
macroProgram | the macro program to go to |
void CraftWork::doOverrideMemes | ( | std::set< std::string > | memes | ) |
Manually go to a specific taxonomy category meme, and force until reset https://github.com/xjmusic/xjmusic/issues/199
memes | specific (assumed allowably) set of taxonomy category memes |
void CraftWork::finish | ( | ) |
Stop work
bool CraftWork::getAndResetDidOverride | ( | ) |
Get whether an override happened, and reset its state after getting
std::set< const SegmentChoiceArrangement * > CraftWork::getArrangements | ( | const SegmentChoice * | choice | ) | const |
Get all arrangements for the given choice
choice | for which to get arrangements |
std::set< const SegmentChoice * > CraftWork::getChoices | ( | const Segment * | segment | ) | const |
Get all choices for the given segment
segment | for which to get choices |
const Instrument * CraftWork::getInstrument | ( | const InstrumentAudio * | audio | ) | const |
Get the instrument for the given pick
audio | the audio for which to get instrument |
const InstrumentAudio * CraftWork::getInstrumentAudio | ( | const SegmentChoiceArrangementPick * | pick | ) | const |
Get the audio for the given pick
pick | the pick for which to get audio |
Get the macro program for the given segment
segment | for which to get macro program |
Get the main program for the given segment
segment | for which to get main program |
std::set< const SegmentChoiceArrangementPick * > CraftWork::getPicks | ( | const SegmentChoiceArrangement * | arrangement | ) | const |
Get all picks for the given arrangement
arrangement | for which to get picks |
std::set< const SegmentChoiceArrangementPick * > CraftWork::getPicks | ( | const std::vector< const Segment * > & | segments | ) | const |
Get the segments spanning the given time range, if they are ready- if not, return an empty list
segments | the segments for which to get picks |
std::optional< const Segment * > CraftWork::getSegmentAtChainMicros | ( | unsigned long long | chainMicros | ) | const |
Get the segment at the given chain microseconds, if it is ready segment beginning <= chain microseconds < end
chainMicros | the microseconds since beginning of chain for which to get the segment |
std::optional< const Segment * > CraftWork::getSegmentAtOffset | ( | int | offset | ) | const |
Get the segment at the given offset, if it is ready
offset | of segment |
std::vector< const Segment * > CraftWork::getSegmentsIfReady | ( | unsigned long long | fromChainMicros, |
unsigned long long | toChainMicros | ||
) | const |
Get the segments spanning the given time range, if they are ready- if not, return an empty list
fromChainMicros | the start time |
toChainMicros | the end time |
ContentEntityStore * CraftWork::getSourceMaterial | ( | ) | const |
Get the source material
TemplateConfig CraftWork::getTemplateConfig | ( | ) | const |
Get the template config, if loaded
bool CraftWork::isFinished | ( | ) | const |
Check whether the craft work is finished
bool CraftWork::isReady | ( | ) | const |
Whether the current craft state is ready
void CraftWork::runCycle | ( | const unsigned long long int | atChainMicros | ) |
This is the internal cycle that's Run indefinitely
void CraftWork::start | ( | ) |
Start work