XJ music engine
1.9.6
In-game runtime engine for XJ music.
|
#include <DubWork.h>
Public Member Functions | |
DubWork (CraftWork *craftWork, int dubAheadSeconds) | |
void | start () |
void | finish () |
bool | isFinished () const |
std::set< ActiveAudio > | runCycle (unsigned long long atChainMicros) |
std::set< ActiveAudio > | computeActiveAudios (unsigned long long atChainMicros) |
std::optional< const Segment * > | getSegmentAtChainMicros (long atChainMicros) const |
std::optional< const Segment * > | getSegmentAtOffset (int offset) const |
std::optional< const Program * > | getMainProgram (const Segment *segment) const |
std::optional< const Program * > | getMacroProgram (const Segment &segment) const |
void | setIntensityOverride (std::optional< float > intensity) |
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.
DubWork::DubWork | ( | CraftWork * | craftWork, |
int | dubAheadSeconds | ||
) |
std::set< ActiveAudio > DubWork::computeActiveAudios | ( | unsigned long long | atChainMicros | ) |
Do dub frame
instead of mixing to file, mix to memory (produce to a BytePipeline) and let ship work consume the buffer use the same mixer from chunk to chunk, only changing the active audios
Ensure mixer has continuity of its processes/effects, e.g. the compressor levels at the last frame of the last chunk are carried over to the first frame of the next chunk
void DubWork::finish | ( | ) |
Stop work
Get the macro program for the given segment
segment | for which to get program |
Get the main program for the given segment
segment | for which to get program |
std::optional< const Segment * > DubWork::getSegmentAtChainMicros | ( | long | atChainMicros | ) | const |
Get the segment at the given chain micros
atChainMicros | the chain micros |
std::optional< const Segment * > DubWork::getSegmentAtOffset | ( | int | offset | ) | const |
Get the segment at the given offset
offset | the offset |
bool DubWork::isFinished | ( | ) | const |
Check whether the craft work is finished
std::set< ActiveAudio > DubWork::runCycle | ( | unsigned long long | atChainMicros | ) |
Run the work cycle
void DubWork::setIntensityOverride | ( | std::optional< float > | intensity | ) |
Set the intensity override to a value between 0 and 1, or null if no override
intensity | the intensity override value, or null |
void DubWork::start | ( | ) |
Start work