425 |
} |
} |
426 |
|
|
427 |
AudioDeviceModel[] aDevs = CC.getSamplerModel().getAudioDevices(); |
AudioDeviceModel[] aDevs = CC.getSamplerModel().getAudioDevices(); |
428 |
|
int fxInsts = 0; |
429 |
|
|
430 |
for(int i = 0; i < aDevs.length; i++) { |
for(int i = 0; i < aDevs.length; i++) { |
431 |
exportAudioDeviceToLscpScript(aDevs[i].getDeviceInfo(), i, lscpClient); |
fxInsts += exportAudioDeviceToLscpScript(aDevs[i], i, fxInsts, lscpClient); |
432 |
sb.append(out.toString()); |
sb.append(out.toString()); |
433 |
out.reset(); |
out.reset(); |
434 |
sb.append("\r\n"); |
sb.append("\r\n"); |
490 |
} |
} |
491 |
} |
} |
492 |
|
|
493 |
private static void |
/** |
494 |
exportAudioDeviceToLscpScript(AudioOutputDevice aod, int devId, Client lscpCLient) { |
* @param fxInsts The current number of created effect instances. |
495 |
|
* @return The number of effect instances in this audio device. |
496 |
|
*/ |
497 |
|
private static int |
498 |
|
exportAudioDeviceToLscpScript(AudioDeviceModel model, int devId, int fxInsts, Client lscpCLient) { |
499 |
|
int effectInstances = 0; |
500 |
|
|
501 |
try { |
try { |
502 |
|
AudioOutputDevice aod = model.getDeviceInfo(); |
503 |
String s = aod.getDriverName(); |
String s = aod.getDriverName(); |
504 |
lscpCLient.createAudioOutputDevice(s, aod.getAllParameters()); |
lscpCLient.createAudioOutputDevice(s, aod.getAllParameters()); |
505 |
|
|
512 |
else lscpCLient.setAudioOutputChannelParameter(devId, i, p); |
else lscpCLient.setAudioOutputChannelParameter(devId, i, p); |
513 |
} |
} |
514 |
} |
} |
515 |
|
|
516 |
|
for(int i = 0; i < model.getSendEffectChainCount(); i++) { |
517 |
|
lscpCLient.addSendEffectChain(devId); |
518 |
|
EffectChain chain = model.getSendEffectChain(i); |
519 |
|
for(int j = 0; j < chain.getEffectInstanceCount(); j++) { |
520 |
|
EffectInstance ei = chain.getEffectInstance(j); |
521 |
|
String sys = ei.getInfo().getSystem(); |
522 |
|
String mod = ei.getInfo().getModule(); |
523 |
|
String name = ei.getInfo().getName(); |
524 |
|
lscpCLient.createEffectInstance(sys, mod, name); |
525 |
|
int fxInstanceId = fxInsts + effectInstances++; |
526 |
|
lscpCLient.appendEffectInstance(devId, i, fxInstanceId); |
527 |
|
} |
528 |
|
} |
529 |
} catch(Exception e) { |
} catch(Exception e) { |
530 |
CC.getLogger().log(Level.FINE, HF.getErrorMessage(e), e); |
CC.getLogger().log(Level.FINE, HF.getErrorMessage(e), e); |
531 |
} |
} |
532 |
|
|
533 |
|
return effectInstances; |
534 |
} |
} |
535 |
|
|
536 |
private static void |
private static void |
602 |
for(int j = 0; j < r.length; j++) { |
for(int j = 0; j < r.length; j++) { |
603 |
lscpClient.setFxSendAudioOutputChannel(chnId, i, j, r[j]); |
lscpClient.setFxSendAudioOutputChannel(chnId, i, j, r[j]); |
604 |
} |
} |
605 |
|
|
606 |
|
int chainId = f.getDestChainId(); |
607 |
|
int chainPos = f.getDestChainPos(); |
608 |
|
|
609 |
|
if(chainId != -1) { |
610 |
|
int aid = scm.getChannelInfo().getAudioOutputDevice(); |
611 |
|
AudioDeviceModel m = CC.getSamplerModel().getAudioDeviceById(aid); |
612 |
|
int idx = m.getSendEffectChainIndex(chainId); |
613 |
|
lscpClient.setFxSendEffect(chnId, i, idx, chainPos); |
614 |
|
} |
615 |
} |
} |
616 |
} catch(Exception e) { |
} catch(Exception e) { |
617 |
CC.getLogger().log(Level.FINE, HF.getErrorMessage(e), e); |
CC.getLogger().log(Level.FINE, HF.getErrorMessage(e), e); |