mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 20:26:42 +01:00
wip: refactor pt.10, 301 errors
This commit is contained in:
parent
8aa1ba8d0f
commit
1405b82341
10 changed files with 199 additions and 177 deletions
|
|
@ -196,46 +196,6 @@ impl<E: Engine> PhraseEditor<E> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn note_cursor_inc (&self) {
|
||||
let mut axis = self.note_axis.write().unwrap();
|
||||
axis.point_dec(1);
|
||||
if let Some(point) = axis.point { if point < axis.start { axis.start = (point / 2) * 2; } }
|
||||
}
|
||||
|
||||
pub fn note_cursor_dec (&self) {
|
||||
let mut axis = self.note_axis.write().unwrap();
|
||||
axis.point_inc(1);
|
||||
if let Some(point) = axis.point { if point > 73 { axis.point = Some(73); } }
|
||||
}
|
||||
|
||||
pub fn note_page_up (&self) {
|
||||
let mut axis = self.note_axis.write().unwrap();
|
||||
axis.start_dec(3);
|
||||
axis.point_dec(3);
|
||||
}
|
||||
|
||||
pub fn note_page_down (&self) {
|
||||
let mut axis = self.note_axis.write().unwrap();
|
||||
axis.start_inc(3);
|
||||
axis.point_inc(3);
|
||||
}
|
||||
|
||||
pub fn note_scroll_inc (&self) {
|
||||
self.note_axis.write().unwrap().start_dec(1);
|
||||
}
|
||||
|
||||
pub fn note_scroll_dec (&self) {
|
||||
self.note_axis.write().unwrap().start_inc(1);
|
||||
}
|
||||
|
||||
pub fn note_length_inc (&mut self) {
|
||||
self.note_len = next_note_length(self.note_len)
|
||||
}
|
||||
|
||||
pub fn note_length_dec (&mut self) {
|
||||
self.note_len = prev_note_length(self.note_len)
|
||||
}
|
||||
|
||||
pub fn time_cursor_advance (&self) {
|
||||
let point = self.time_axis.read().unwrap().point;
|
||||
let length = self.phrase.as_ref().map(|p|p.read().unwrap().length).unwrap_or(1);
|
||||
|
|
@ -243,39 +203,6 @@ impl<E: Engine> PhraseEditor<E> {
|
|||
self.time_axis.write().unwrap().point = point.map(forward);
|
||||
}
|
||||
|
||||
pub fn time_cursor_inc (&self) {
|
||||
let scale = self.time_axis.read().unwrap().scale;
|
||||
self.time_axis.write().unwrap().point_inc(scale);
|
||||
}
|
||||
|
||||
pub fn time_cursor_dec (&self) {
|
||||
let scale = self.time_axis.read().unwrap().scale;
|
||||
self.time_axis.write().unwrap().point_dec(scale);
|
||||
}
|
||||
|
||||
pub fn time_scroll_inc (&self) {
|
||||
let scale = self.time_axis.read().unwrap().scale;
|
||||
self.time_axis.write().unwrap().start_inc(scale);
|
||||
}
|
||||
|
||||
pub fn time_scroll_dec (&self) {
|
||||
let scale = self.time_axis.read().unwrap().scale;
|
||||
self.time_axis.write().unwrap().start_dec(scale);
|
||||
}
|
||||
|
||||
pub fn time_zoom_in (&self) {
|
||||
let scale = self.time_axis.read().unwrap().scale;
|
||||
self.time_axis.write().unwrap().scale = prev_note_length(scale)
|
||||
}
|
||||
|
||||
pub fn time_zoom_out (&self) {
|
||||
let scale = self.time_axis.read().unwrap().scale;
|
||||
self.time_axis.write().unwrap().scale = next_note_length(scale)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl<E: Engine> PhraseEditor<E> {
|
||||
pub fn put (&mut self) {
|
||||
if let (Some(phrase), Some(time), Some(note)) = (
|
||||
&self.phrase,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue