kopia lustrzana https://github.com/jameshball/osci-render
Update frequency spinner with mic
rodzic
0fc2c30bd3
commit
8cf56a5a55
|
@ -143,6 +143,9 @@ public class EffectComponentGroupController implements Initializable, SubControl
|
|||
effectCheckBox.setSelected(Boolean.parseBoolean(selected));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void micSignalReceived() {}
|
||||
|
||||
public void setType(EffectType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
|
|
@ -176,4 +176,7 @@ public class EffectsController implements Initializable, SubController {
|
|||
Element element = (Element) root.getElementsByTagName("checkBoxes").item(0);
|
||||
effects().forEach(effect -> effect.controller.load(element));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void micSignalReceived() {}
|
||||
}
|
||||
|
|
|
@ -274,6 +274,9 @@ public class GeneralController implements Initializable, SubController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void micSignalReceived() {}
|
||||
|
||||
public void setFrameSourceName(String name) {
|
||||
this.frameSourceName = name;
|
||||
}
|
||||
|
|
|
@ -163,9 +163,7 @@ public class ImageController implements Initializable, SubController {
|
|||
translationScaleSlider.valueProperty().addListener((e, old, scale) -> translateEffect.setScale(scale.doubleValue()));
|
||||
|
||||
frequencySpinner.setValueFactory(new SpinnerValueFactory.DoubleSpinnerValueFactory(0, MAX_FREQUENCY, MidiNote.MIDDLE_C, 1));
|
||||
frequencySpinner.valueProperty().addListener((o, old, f) -> {
|
||||
frequency.set(f);
|
||||
});
|
||||
frequencySpinner.valueProperty().addListener((o, old, f) -> frequency.set(f));
|
||||
|
||||
frequency.addListener((o, old, f) -> {
|
||||
frequencySlider.setValue(Math.log(f.doubleValue()) / Math.log(MAX_FREQUENCY));
|
||||
|
@ -179,13 +177,13 @@ public class ImageController implements Initializable, SubController {
|
|||
frequency.set(Math.pow(MAX_FREQUENCY, frequencySlider.getValue()));
|
||||
}
|
||||
});
|
||||
frequencySlider.setOnMouseDragged(e -> {
|
||||
frequency.set(Math.pow(MAX_FREQUENCY, frequencySlider.getValue()));
|
||||
});
|
||||
frequencySlider.setOnMouseDragged(e ->
|
||||
frequency.set(Math.pow(MAX_FREQUENCY, frequencySlider.getValue()))
|
||||
);
|
||||
|
||||
volumeSlider.valueProperty().addListener((e, old, value) -> {
|
||||
audioPlayer.setVolume(value.doubleValue() / 3.0);
|
||||
});
|
||||
volumeSlider.valueProperty().addListener((e, old, value) ->
|
||||
audioPlayer.setVolume(value.doubleValue() / 3.0)
|
||||
);
|
||||
volumeSlider.valueProperty().addListener(e -> {
|
||||
if (!audioPlayer.midiPlaying()) {
|
||||
audioPlayer.resetMidi();
|
||||
|
@ -252,4 +250,9 @@ public class ImageController implements Initializable, SubController {
|
|||
Element ellipse = (Element) element.getElementsByTagName("ellipse").item(0);
|
||||
translateEllipseCheckBox.setSelected(ellipse != null && Boolean.parseBoolean(ellipse.getTextContent()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void micSignalReceived() {
|
||||
frequency.set(Math.pow(MAX_FREQUENCY, frequencySlider.getValue()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1109,6 +1109,8 @@ public class MainController implements Initializable, FrequencyListener, MidiLis
|
|||
} else if (sliderValue < slider.getMin()) {
|
||||
sliderValue = slider.getMin();
|
||||
}
|
||||
// TODO: Correctly update frequency spinner!
|
||||
subControllers().forEach(sub -> sub.micSignalReceived());
|
||||
sliders.get(i).setValue(sliderValue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,4 +183,7 @@ public class ObjController implements Initializable, SubController {
|
|||
@Override
|
||||
public void load(Element root) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void micSignalReceived() {}
|
||||
}
|
||||
|
|
|
@ -23,4 +23,6 @@ public interface SubController {
|
|||
Node save(Document document);
|
||||
|
||||
void load(Element root);
|
||||
|
||||
void micSignalReceived();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue