kopia lustrzana https://github.com/jameshball/osci-render
Correct kHz to Hz and clarify how to change files with MIDI PC
rodzic
0b78d5c1f7
commit
7527ba35c4
|
@ -40,7 +40,7 @@ public class SimpleAudioDevice implements AudioDevice {
|
|||
public String toString() {
|
||||
String simplifiedName = name.replaceFirst(" \\(Shared\\)", "");
|
||||
simplifiedName = simplifiedName.replaceFirst(" \\(NVIDIA High Definition Audio\\)", "");
|
||||
return simplifiedName + " @ " + sampleRate + "kHz, " + sample;
|
||||
return simplifiedName + " @ " + sampleRate + "Hz, " + sample;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,6 +64,8 @@ import static sh.ball.math.Math.tryParse;
|
|||
|
||||
public class Controller implements Initializable, FrequencyListener, MidiListener {
|
||||
|
||||
private String openProjectPath;
|
||||
|
||||
// audio
|
||||
private static final double MAX_FREQUENCY = 12000;
|
||||
private final ShapeAudioPlayer audioPlayer;
|
||||
|
@ -209,6 +211,8 @@ public class Controller implements Initializable, FrequencyListener, MidiListene
|
|||
private MenuItem openProjectMenuItem;
|
||||
@FXML
|
||||
private MenuItem saveProjectMenuItem;
|
||||
@FXML
|
||||
private MenuItem saveAsProjectMenuItem;
|
||||
|
||||
public Controller() throws Exception {
|
||||
MidiCommunicator midiCommunicator = new MidiCommunicator();
|
||||
|
@ -406,6 +410,18 @@ public class Controller implements Initializable, FrequencyListener, MidiListene
|
|||
);
|
||||
|
||||
saveProjectMenuItem.setOnAction(e -> {
|
||||
if (openProjectPath != null) {
|
||||
saveProject(openProjectPath);
|
||||
} else {
|
||||
File file = osciFileChooser.showSaveDialog(stage);
|
||||
if (file != null) {
|
||||
updateLastVisitedDirectory(new File(file.getParent()));
|
||||
saveProject(file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
saveAsProjectMenuItem.setOnAction(e -> {
|
||||
File file = osciFileChooser.showSaveDialog(stage);
|
||||
if (file != null) {
|
||||
updateLastVisitedDirectory(new File(file.getParent()));
|
||||
|
@ -943,6 +959,7 @@ public class Controller implements Initializable, FrequencyListener, MidiListene
|
|||
StreamResult streamResult = new StreamResult(new File(projectFileName));
|
||||
|
||||
transformer.transform(domSource, streamResult);
|
||||
openProjectPath = projectFileName;
|
||||
} catch (ParserConfigurationException | TransformerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -1028,6 +1045,7 @@ public class Controller implements Initializable, FrequencyListener, MidiListene
|
|||
fileNames.add(fileName);
|
||||
}
|
||||
updateFiles(files, fileNames);
|
||||
openProjectPath = projectFileName;
|
||||
} catch (ParserConfigurationException | SAXException | IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<Label id="frequency" fx:id="frequencyLabel" layoutX="13.0" layoutY="206.0" prefHeight="58.0" prefWidth="376.0" text="L/R Frequency: " />
|
||||
<ComboBox fx:id="deviceComboBox" layoutX="14.0" layoutY="11.0" prefWidth="376.0" />
|
||||
<Button fx:id="chooseFolderButton" layoutX="14.0" layoutY="91.0" mnemonicParsing="false" prefHeight="26.0" prefWidth="114.0" text="Choose Folder" />
|
||||
<Label fx:id="jkLabel" layoutX="143.0" layoutY="95.0" maxWidth="270.0" prefHeight="18.0" prefWidth="246.0" text="Use j and k to cycle between files" visible="false" />
|
||||
<Label fx:id="jkLabel" layoutX="143.0" layoutY="84.0" maxWidth="270.0" prefHeight="43.0" prefWidth="246.0" text="Use j and k (or MIDI Program Change) to cycle between files" visible="false" wrapText="true" />
|
||||
<TextField fx:id="recordTextField" disable="true" layoutX="300.0" layoutY="154.0" prefHeight="26.0" prefWidth="70.0" text="2.0" />
|
||||
<Label fx:id="recordLengthLabel" disable="true" layoutX="290.0" layoutY="128.0" text="Record length (s)" />
|
||||
<CheckBox fx:id="recordCheckBox" layoutX="143.0" layoutY="146.0" mnemonicParsing="false" text="Timed record" />
|
||||
|
@ -145,11 +145,16 @@
|
|||
<KeyCodeCombination alt="UP" code="O" control="UP" meta="UP" shift="UP" shortcut="DOWN" />
|
||||
</accelerator>
|
||||
</MenuItem>
|
||||
<MenuItem fx:id="saveProjectMenuItem" mnemonicParsing="false" text="Save Project">
|
||||
<MenuItem fx:id="saveProjectMenuItem" mnemonicParsing="false" text="Save">
|
||||
<accelerator>
|
||||
<KeyCodeCombination alt="UP" code="S" control="UP" meta="UP" shift="UP" shortcut="DOWN" />
|
||||
</accelerator>
|
||||
</MenuItem>
|
||||
<MenuItem fx:id="saveAsProjectMenuItem" mnemonicParsing="false" text="Save As">
|
||||
<accelerator>
|
||||
<KeyCodeCombination alt="UP" code="S" control="UP" meta="UP" shift="DOWN" shortcut="DOWN" />
|
||||
</accelerator>
|
||||
</MenuItem>
|
||||
</items>
|
||||
</Menu>
|
||||
</menus>
|
||||
|
|
Ładowanie…
Reference in New Issue