diff --git a/package.json b/package.json index d33f11e..c7ffb7a 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "web-vitals": "^2.1.4" }, "scripts": { - "start": "export GENERATE_SOURCEMAP=false; cross-env BROWSER=none react-scripts start", + "start": "cross-env BROWSER=none react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a8956c6..d1a709d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -477,9 +477,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5999502d32b9c48d492abe66392408144895020ec4709e549e840799f3bb74c0" +checksum = "2ccfd8c0ee4cce11e45b3fd6f9d5e69e0cc62912aa6a0cb1bf4617b0eba5a12f" dependencies = [ "generic-array", "typenum", @@ -1151,9 +1151,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" +checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022" [[package]] name = "heck" @@ -1802,9 +1802,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.40" +version = "0.10.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" +checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -1834,9 +1834,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.74" +version = "0.9.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" +checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" dependencies = [ "autocfg", "cc", diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f7eefba..57d532b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -42,30 +42,29 @@ fn open_midi_connection( let mut midi_in = MidiInput::new("piano-trainer-input").unwrap(); midi_in.ignore(Ignore::None); let midi_in_ports = midi_in.ports(); + *midi_state.input.lock().unwrap() = None; if let Some(in_port) = midi_in_ports.get(input_idx) { let conn_in = midi_in - .connect( - in_port, - "midir", - move |stamp, message, _log| { - // The last of the three callback parameters is the object that we pass in as last parameter of `connect`. + .connect( + in_port, + "midir", + move |stamp, message, _log| { + // The last of the three callback parameters is the object that we pass in as last parameter of `connect`. - handle - .emit_all( - "midi_message", - MidiMessage { - message: message.to_vec(), - }, - ) - .map_err(|err| println!("{:?}", err)) - .ok(); + handle + .emit_all( + "midi_message", + MidiMessage { + message: message.to_vec(), + }, + ) + .map_err(|err| println!("{:?}", err)) + .ok(); + + println!("{}: {:?} (len = {})", stamp, message, message.len()); + }, ()).unwrap(); - println!("{}: {:?} (len = {})", stamp, message, message.len()); - }, - (), - ) - .unwrap(); *midi_state.input.lock().unwrap() = Some(conn_in); } } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 4ef9dd8..5e6fce7 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -2,13 +2,13 @@ "$schema": "../node_modules/@tauri-apps/cli/schema.json", "build": { "beforeBuildCommand": "npm run build", - "beforeDevCommand": "pkill MIDIServer; npm run start", + "beforeDevCommand": "npm run start", "devPath": "http://localhost:3000", "distDir": "../build" }, "package": { "productName": "Piano Trainer", - "version": "1.0.2" + "version": "1.0.3" }, "tauri": { "allowlist": { diff --git a/yarn.lock b/yarn.lock index d79d74c..4eda580 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8884,13 +8884,6 @@ tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -"tauri-plugin-store-api@github:tauri-apps/tauri-plugin-store": - version "0.1.0" - resolved "https://codeload.github.com/tauri-apps/tauri-plugin-store/tar.gz/9e3732e0cf53b72ced6903583660cd7c5f756781" - dependencies: - "@tauri-apps/api" "1.0.1" - tslib "2.4.0" - "tauri-plugin-store-api@https://github.com/tauri-apps/tauri-plugin-store#dev": version "0.1.0" resolved "https://github.com/tauri-apps/tauri-plugin-store#9e3732e0cf53b72ced6903583660cd7c5f756781"