Warning: session_start(): open(/var/lib/php/sessions/sess_8dg2elok6ehqhmeclh9qdlga3m, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
import static x30_pkg.x30_util.VF1;
sclass AudioOutput > DynPrintLog {
int bufSize = 40960;
float gain = 1;
transient playAudioFromSampleMakingFunction_AudioLoop loop;
transient L> sources = notifyingList(r setNumSources);
transient SimpleLiveValue numSources = new(Int, 0);
visualize {
ret centerAndSouth(super.visualize(),
withLeftAndRightMargin(vstackWithSpacing(
withLabel("Volume (0-200%):", liveSliderZeroToOne(gain/2, voidfunc(float f) { setField(gain := f*2) })),
jrightalignedline(withLabel("Sound sources:", jLiveValueLabel(numSources)))
)));
}
start {
ownTimer(loop = playAudioFromSampleMakingFunction(bufSize, voidfunc(double[] pair) {
audio_makeSampleFromSources(sources, pair, gain)
}));
dm_registerService('playWAVAndWait, func(S method, O[] args) -> bool {
temp enter();
callMC(f dm_playWAV, args);
true;
});
}
void setNumSources { numSources.set(l(sources)); }
// hold audio sources during reload
O _getReloadData() { ret sources; }
void _setReloadData(L> sources) { addAll(this.sources, sources); }
// API
void addSource(VF1 source) { sources.add(source); }
void removeSource(VF1 source) { sources.remove(source); }
}