31 |
|
|
32 |
import org.linuxsampler.lscp.AudioOutputDevice; |
import org.linuxsampler.lscp.AudioOutputDevice; |
33 |
import org.linuxsampler.lscp.AudioOutputDriver; |
import org.linuxsampler.lscp.AudioOutputDriver; |
34 |
import org.linuxsampler.lscp.EffectInstance; |
import org.linuxsampler.lscp.EffectChainInfo; |
35 |
|
import org.linuxsampler.lscp.EffectInstanceInfo; |
36 |
import org.linuxsampler.lscp.Effect; |
import org.linuxsampler.lscp.Effect; |
37 |
import org.linuxsampler.lscp.Parameter; |
import org.linuxsampler.lscp.Parameter; |
38 |
|
|
504 |
exec() throws Exception { |
exec() throws Exception { |
505 |
setSilent(true); |
setSilent(true); |
506 |
|
|
507 |
EffectChain c = new EffectChain ( |
EffectChainInfo c = |
508 |
CC.getClient().getSendEffectChainInfo(audioDeviceId, chainId) |
CC.getClient().getSendEffectChainInfo(audioDeviceId, chainId); |
509 |
); |
|
510 |
AudioDeviceModel m = CC.getSamplerModel().getAudioDeviceById(audioDeviceId); |
AudioDeviceModel m = CC.getSamplerModel().getAudioDeviceById(audioDeviceId); |
511 |
m.getSendEffectChainById(chainId).setEffectInstances(c.getEffectInstances()); |
m.getSendEffectChainById(chainId).setEffectInstances(c); |
512 |
|
} |
513 |
|
} |
514 |
|
|
515 |
|
|
516 |
|
/** |
517 |
|
* This task updates the setting of an effect instance. |
518 |
|
*/ |
519 |
|
public static class UpdateEffectInstanceInfo extends EnhancedTask { |
520 |
|
private int instanceId; |
521 |
|
|
522 |
|
/** |
523 |
|
* Creates new instance of <code>UpdateEffectInstanceInfo</code>. |
524 |
|
* @param instanceId The id of the effect instance, which settings should be updated. |
525 |
|
*/ |
526 |
|
public |
527 |
|
UpdateEffectInstanceInfo(int instanceId) { |
528 |
|
setTitle("Audio.UpdateEffectInstanceInfo_task"); |
529 |
|
setDescription(i18n.getMessage("Audio.UpdateEffectInstanceInfo.desc", instanceId)); |
530 |
|
|
531 |
|
this.instanceId = instanceId; |
532 |
|
} |
533 |
|
|
534 |
|
/** The entry point of the task. */ |
535 |
|
@Override |
536 |
|
public void |
537 |
|
exec() throws Exception { |
538 |
|
EffectInstanceInfo ei = CC.getClient().getEffectInstanceInfo(instanceId); |
539 |
|
CC.getSamplerModel().updateEffectInstance(ei); |
540 |
|
} |
541 |
|
} |
542 |
|
|
543 |
|
|
544 |
|
/** |
545 |
|
* This task changes the value of an effect instance parameter. |
546 |
|
*/ |
547 |
|
public static class SetEffectInstanceParameter extends EnhancedTask { |
548 |
|
private int instanceId; |
549 |
|
private int prmIndex; |
550 |
|
private float newValue; |
551 |
|
|
552 |
|
/** |
553 |
|
* Creates new instance of <code>SetEffectInstanceParameter</code>. |
554 |
|
*/ |
555 |
|
public |
556 |
|
SetEffectInstanceParameter(int instanceId, int prmIndex, float newValue) { |
557 |
|
setTitle("Audio.SetEffectInstanceParameter_task"); |
558 |
|
setDescription(i18n.getMessage("Audio.SetEffectInstanceParameter.desc")); |
559 |
|
|
560 |
|
this.instanceId = instanceId; |
561 |
|
this.prmIndex = prmIndex; |
562 |
|
this.newValue = newValue; |
563 |
|
} |
564 |
|
|
565 |
|
/** The entry point of the task. */ |
566 |
|
@Override |
567 |
|
public void |
568 |
|
exec() throws Exception { |
569 |
|
CC.getClient().setEffectInstanceParameter(instanceId, prmIndex, newValue); |
570 |
} |
} |
571 |
} |
} |
572 |
|
|