I like to add noise to the audio output of my plugin demos if the host is recording or is exporting audio, but the CurrentPositionInfo::isRecording flag is not set if the host exports audio (tested in BitWig).
The idea for a workaround: if the host exports audio we calculate more than one block in the time of one block, because exporting is usually faster. But I'm not sure if this is a good solution or does anybody know a better one?
Did you see isNonRealTime() in AudioProcessor? Seems like it does what you are looking for. http://www.juce.com/doc/classAudioProcessor#aed44cae950cdcf0d2283d875e036ff87
But I am not sure if it solves the initial question, if the audio stream is recorded, because nobody can stop you from exporting in realtime / recording in realtime. And second it depends if you trust the host, to set this flag always correctly.
EDIT: isRecording shows, if there are live inputs which implies that it can't be non realtime. But it does not say anything about if the output is being recorded to another memory... now I'm no longer sure, if I understood the problem correctly... ;-)
EDIT: isRecording shows, if there are live inputs which implies that it can't be non realtime. But it does not say anything about if the output is being recorded to another memory... now I'm no longer sure, if I understood the problem correctly... ;-)
Hm, right. Damn again. BitWig was confusing me, there is just one way to record the audio in realtime and for that you have to enable the record button and BitWig sets the isRecording flag...
But then only the workaround from my first post left and a noise after time x for time y.
EDIT: "noise for time y after time x" will be added to the output in realtime mode.
EDIT: better will be: "for x samples after x samples"