XJ music engine  1.9.6
In-game runtime engine for XJ music.
Public Member Functions | List of all members
XJ::DubWork Class Referencefinal

#include <DubWork.h>

Public Member Functions

 DubWork (CraftWork *craftWork, int dubAheadSeconds)
 
void start ()
 
void finish ()
 
bool isFinished () const
 
std::set< ActiveAudiorunCycle (unsigned long long atChainMicros)
 
std::set< ActiveAudiocomputeActiveAudios (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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DubWork()

DubWork::DubWork ( CraftWork craftWork,
int  dubAheadSeconds 
)

Member Function Documentation

◆ computeActiveAudios()

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

◆ finish()

void DubWork::finish ( )

Stop work

◆ getMacroProgram()

std::optional< const Program * > DubWork::getMacroProgram ( const Segment segment) const

Get the macro program for the given segment

Parameters
segmentfor which to get program
Returns
macro program or empty if not yet available

◆ getMainProgram()

std::optional< const Program * > DubWork::getMainProgram ( const Segment segment) const

Get the main program for the given segment

Parameters
segmentfor which to get program
Returns
main program or empty if not yet available

◆ getSegmentAtChainMicros()

std::optional< const Segment * > DubWork::getSegmentAtChainMicros ( long  atChainMicros) const

Get the segment at the given chain micros

Parameters
atChainMicrosthe chain micros
Returns
the segment, or empty if not yet available

◆ getSegmentAtOffset()

std::optional< const Segment * > DubWork::getSegmentAtOffset ( int  offset) const

Get the segment at the given offset

Parameters
offsetthe offset
Returns
the segment, or empty if not yet available

◆ isFinished()

bool DubWork::isFinished ( ) const

Check whether the craft work is finished

Returns
true if finished (not running)

◆ runCycle()

std::set< ActiveAudio > DubWork::runCycle ( unsigned long long  atChainMicros)

Run the work cycle

◆ setIntensityOverride()

void DubWork::setIntensityOverride ( std::optional< float >  intensity)

Set the intensity override to a value between 0 and 1, or null if no override

Parameters
intensitythe intensity override value, or null

◆ start()

void DubWork::start ( )

Start work


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