Hi,
Using the framework I tried to set a physical audio input to multiple audio tracks at the same time in order to record both from the same input, but it does not seem to be possible.
Analyzing the code, more specifically :
void InputDeviceInstance::setTargetTrack (AudioTrack& track, int index, bool moveToTrack)
{
if (isRecording())
{
edit.engine.getUIBehaviour().showWarningMessage(TRANS("Can't change tracks while recording is active"));
return;
}
if (owner.isTrackDevice() || moveToTrack)
{
for (auto t : getTargetTracks())
removeTargetTrack(*t);
}
else
{
removeTargetTrack(track);
}
auto v = juce::ValueTree(IDs::INPUTDEVICEDESTINATION);
state.addChild(v, -1, &edit.getUndoManager());
auto& dest = *destTracks[destTracks.size() - 1];
dest.targetTrack = track.itemID;
dest.targetIndex = index;
trackDeviceEnabler.triggerAsyncUpdate();
}
I noticed that programmatically, before setting an input on a track, it is removed from all the la the others (if any).
Commenting on that section :
if (owner.isTrackDevice() || moveToTrack)
{
for (auto t : getTargetTracks())
removeTargetTrack(*t);
}
else
{
removeTargetTrack(track);
}
multiple INPUTDEVICEDESTINATION children are created with different destTracks for a single input, and by doing so, arming the tracks, you can record correctly.
I would like to understand the need to therefore have such a block of code.