use of blue.score.layers.audio.ui.bindings.AudioLayerChannelBinding in project blue by kunstmusik.
the class BlueProjectPropertyChangeListener method propertyChange.
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (BlueProjectManager.CURRENT_PROJECT.equals(evt.getPropertyName())) {
BlueProject oldProject = (BlueProject) evt.getOldValue();
BlueProject newProject = (BlueProject) evt.getNewValue();
if (oldProject == newProject) {
return;
}
if (oldProject != null) {
detachListeners(oldProject);
}
for (AudioLayerGroupBinding binding : layerGroupBindings.values()) {
binding.clearBinding();
}
layerGroupBindings.clear();
for (AudioLayerChannelBinding binding : layerBindings.values()) {
binding.clearBinding();
}
layerBindings.clear();
if (newProject != null) {
synchronizeAudioLayersAndMixer(newProject.getData());
attachListeners(newProject);
}
currentProject = newProject;
}
}
use of blue.score.layers.audio.ui.bindings.AudioLayerChannelBinding in project blue by kunstmusik.
the class BlueProjectPropertyChangeListener method attachListeners.
protected void attachListeners(BlueProject project) {
if (project == null) {
return;
}
Score score = project.getData().getScore();
Mixer mixer = project.getData().getMixer();
for (LayerGroup<? extends Layer> lg : score) {
if (lg instanceof AudioLayerGroup) {
AudioLayerGroup alg = (AudioLayerGroup) lg;
ChannelList channelList = findChannelListForAudioLayerGroup(mixer, alg);
lg.addLayerGroupListener(layerGroupListener);
AudioLayerGroupBinding binding = new AudioLayerGroupBinding(alg, channelList);
layerGroupBindings.put(alg, binding);
for (AudioLayer layer : alg) {
Channel channel = ChannelList.findChannelByAssociation(channelList, layer.getUniqueId());
if (channel != null) {
layerBindings.put(layer, new AudioLayerChannelBinding(layer, channel));
}
}
}
}
score.addListener(scoreListener);
}
Aggregations