Skip to content

Commit c40b07e

Browse files
committed
wip
1 parent 8989fa5 commit c40b07e

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

apps/notation_viewer/assets/kb/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Keyboard Shortcuts - GUI
2-
- *Tab* toggle control gui (right)
32
- *F1, H* toggle help dialog
43
- *F2* toggle guitar view (left)
54
- *F3* toggle chords view (top)
65
- *F4* toggle mini map (bottom)
76
- *F5, R* reload current tab
7+
- *F10, Backslash* toggle control gui (right)
88

99
# Keyboard Shortcuts - Move Around
1010
- *Home* jump to the first bar of current section
@@ -32,7 +32,7 @@
3232
- *E* set repeat selection to current section
3333

3434
# Keyboard Shortcuts - Others
35-
- *Backspace* toggle layout between grid mode and line mode
35+
- *Minus* toggle layout between grid mode and line mode
3636
- *G* toggle whether showing syllable in guitar fretboard
3737
- *M* toggle whether showing syllable in melody lines
3838
- *F* toggle whether always show fret number in guitar tab

apps/notation_viewer/src/viewer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use notation_bevy::bevy::input::mouse::{MouseMotion, MouseWheel, MouseScrollUnit
66

77
use notation_bevy::prelude::*;
88
use notation_bevy::settings::layout_settings::LayoutMode;
9-
use notation_bevy::notation_midi::prelude::*;
109

1110
use crate::assets::NotationViewerAssets;
1211
use crate::help_panel::HelpPanel;
@@ -67,7 +66,7 @@ impl NotationViewer {
6766
if keyboard_input.just_released(KeyCode::F10) || keyboard_input.just_released(KeyCode::Backslash) {
6867
app_state.show_control = !app_state.show_control;
6968
if !ControlPanel::HUD_MODE {
70-
window_resized_evts.send(WindowResizedEvent());
69+
window_resized_evts.send(WindowResizedEvent::new(&app_state));
7170
}
7271
} else if keyboard_input.just_released(KeyCode::F1) || keyboard_input.just_released(KeyCode::H)
7372
{

crates/notation_bevy/src/kb/notes_page.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ impl NotesPage {
9696
PageHelper::add_syllable_pitch_with_transpose(
9797
ui,
9898
theme,
99-
transpose,
10099
&scale,
101100
&key,
101+
transpose,
102102
syllable,
103103
index == 0,
104104
);

crates/notation_bevy/src/kb/page_helper.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,15 @@ impl PageHelper {
6868
}
6969
pub fn add_syllable_pitch_with_transpose(
7070
ui: &mut Ui,
71-
_theme: &NotationTheme,
72-
transpose: i8,
71+
theme: &NotationTheme,
7372
scale: &Scale,
7473
key: &Key,
74+
transpose: i8,
7575
syllable: &Syllable,
7676
strong: bool,
7777
) {
78-
let pitch = scale.calc_pitch(&key, &syllable);
79-
let pitch = Pitch::from(Semitones::from(pitch) - Semitones(transpose));
80-
let text = pitch.to_string();
81-
Self::add_maybe_strong_text(ui, strong, &text);
78+
let key = Key::from(Semitones::from(*key) - Semitones(transpose));
79+
Self::add_syllable_pitch(ui, theme, scale, &key, syllable, strong);
8280
}
8381
pub fn add_interval_syllable(
8482
ui: &mut Ui,

crates/notation_core/src/key.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ impl From<Key> for Semitones {
130130
}
131131
}
132132

133+
impl From<Semitones> for Key {
134+
fn from(v: Semitones) -> Self {
135+
Syllable::from(v).into()
136+
}
137+
}
138+
133139
impl From<Syllable> for Key {
134140
fn from(v: Syllable) -> Self {
135141
match v {

0 commit comments

Comments
 (0)