
This function is called from CAudioProcessing class whenever a XTP command is received to switch the audio object processing state. This function configures the ramping related variables and also the function pointer for the method to be called for every subsequent audio interrupts.
void CAudioObject::aoSwitchProcState(int state, int prevState);
Audio Object Processing States
The audio objects can be set to one of the following states from the GTT:
These options are available to all regular audio objects with equal number of input and output channels. For source objects like Waveform generator, only Normal and Mute states are allowed. This feature is not available to the interface objects like Audio-in/out, Control-in/out. For the compound audio objects, the selected state will be applied to all inner audio objects.
Following are the tasks carried out every time an audio interrupt is received for each state:
To ensure smooth transition across states, linear ramping is provided with the ramp-up OR ramp-down time of 50 ms. Ramping is not provided for any transitions involving Bypass state and the individual audio object need to support this.
For transition between Normal and Stop states, first the output is ramped down from the present state to mute state and then ramped up to the target state.
This function is called every time an audio interrupt is received and when the audio object is in “BYPASS” processing state. The calc() function is called from here to get the internal states of the audio object updated. Subsequently the data from the input audio buffers are copied to the output audio buffers (overwriting the generated output data through the calc process).
This function takes pointers to input and output audio streams and is called by the CAudioProcessing class when an audio interrupt is received.
void CAudioObject::bypass(float** inputs, float** outputs) { }
This function is called every time an audio interrupt is received and when the audio object is in “MUTE” processing state. The calc() function is called from here to get the internal states of the audio object updated. Subsequently the output audio buffers are cleared to zero (overwriting the generated output data through the calc process).
This function takes pointers to input and output audio streams and is called by the CAudioProcessing class when an audio interrupt is received.
void CAudioObject::mute(xAFAudio** inputs, xAFAudio** outputs); { }
This function is called every time an audio interrupt is received and when the audio object is in “STOP” processing state. The data from the input audio buffers are copied to the output audio buffers without calling calc() and thereby the internal states of the audio object are not updated. This function is used to save cycles.
This function takes pointers to input and output audio streams and is called by the CAudioProcessing class when an audio interrupt is received.
void CAudioObject::stop(xAFAudio** inputs, xAFAudio** outputs);
This function is called every time an audio interrupt is received and when the audio object is in the transition state of switching from “MUTE” state to “NORMAL / STOP” processing state. The calc() function is called from here with “NORMAL / STOP” as the active state and the output is ramped up linearly. The ramp-up time is fixed as 50 ms. The ramp step and number of times this function need to be called is computed during the start of the ramp period.
This function takes pointers to input and output audio streams and is called by the CAudioProcessing class when an audio interrupt is received.
void CAudioObject::rampUp(xAFAudio** inputs, xAFAudio** outputs);
This function is called every time an audio interrupt is received and when the audio object is in the transition state of switching from “NORMAL / STOP” to “MUTE” processing state. The calc() function is called from here with NORMAL / STOP as the active state and the output is ramped down linearly. The ramp-down time is fixed as 50 ms. The ramp step and number of times this function need to be called is computed during the start of the ramp period.
This function takes pointers to input and output audio streams and is called by the CAudioProcessing class when an audio interrupt is received.
void CAudioObject::rampDown(xAFAudio** inputs, xAFAudio** outputs);
This function is called every time an audio interrupt is received and when the audio object is in the transition state of switching from “NORMAL” to “STOP” or “STOP” to “NORMAL” processing state. The transition is in two parts – ramp down from the present state to the MUTE state followed by ramp up from MUTE state to the target state. The calc() function is called from here with present state as the active state during ramp down and target state as the active state during ramp up. Linear ramping is applied and the ramp down time and ramp up time are fixed at 50 ms each. The ramp step and number of times this function need to be called is computed during the start of the ramp period.
This function takes pointers to input and output audio streams and is called by the CAudioProcessing class when an audio interrupt is received.
void CAudioObject::rampDownUp(xAFAudio** inputs, xAFAudio** outputs);