|
@@ -40,6 +40,7 @@ fn main() {
|
|
let dev = rodio::default_output_device().unwrap();
|
|
let dev = rodio::default_output_device().unwrap();
|
|
|
|
|
|
let mut sounds = collect_sounds("media");
|
|
let mut sounds = collect_sounds("media");
|
|
|
|
+ let mut patterns = collect_patterns("patterns");
|
|
|
|
|
|
let mut timeline = Timeline::default();
|
|
let mut timeline = Timeline::default();
|
|
|
|
|
|
@@ -53,8 +54,6 @@ fn main() {
|
|
// let mut active_bar = &mut timeline.patterns[0].bars[0];
|
|
// let mut active_bar = &mut timeline.patterns[0].bars[0];
|
|
let mut active_pattern = Pattern::default();
|
|
let mut active_pattern = Pattern::default();
|
|
let mut active_sound: Option<Sound> = None;
|
|
let mut active_sound: Option<Sound> = None;
|
|
- let mut active_pattern_name = ImString::new("dsd");
|
|
|
|
- // let mut active_pattern = &mut timeline.patterns[0];
|
|
|
|
|
|
|
|
|
|
|
|
let mut system = support_ogl::init(file!());
|
|
let mut system = support_ogl::init(file!());
|
|
@@ -63,6 +62,9 @@ fn main() {
|
|
// let system = support_glium::init(file!());
|
|
// let system = support_glium::init(file!());
|
|
|
|
|
|
system.main_loop(move |_, ui| {
|
|
system.main_loop(move |_, ui| {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
Window::new(im_str!("sources"))
|
|
Window::new(im_str!("sources"))
|
|
// .resizable(false)
|
|
// .resizable(false)
|
|
.position([400.0, 140.0], Condition::Appearing)
|
|
.position([400.0, 140.0], Condition::Appearing)
|
|
@@ -94,7 +96,29 @@ fn main() {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
|
|
|
|
+ Window::new(im_str!("patterns"))
|
|
|
|
+ // .resizable(false)
|
|
|
|
+ .position([400.0, 140.0], Condition::Appearing)
|
|
|
|
+ .collapsible(true)
|
|
|
|
+ .size([300.0, 300.0], Condition::FirstUseEver)
|
|
|
|
+ .build(ui, || {
|
|
|
|
+ ui.tree_node(im_str!("patterns"))
|
|
|
|
+ .opened(true, Condition::Appearing)
|
|
|
|
+ .build(|| {
|
|
|
|
+ for p in &mut patterns {
|
|
|
|
+ ui.tree_node(&im_str!("{}", p.name)).build(|| {
|
|
|
|
+ // ui.same_line(0.0);
|
|
|
|
+ if ui.small_button(im_str!("load")) {
|
|
|
|
+ active_pattern = p.clone();
|
|
|
|
+ }
|
|
|
|
+ ui.same_line(0.0);
|
|
|
|
+ if ui.small_button(im_str!("play")) {
|
|
|
|
+ p.play(&dev);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
|
|
// PATTERN WINDOW ====================================
|
|
// PATTERN WINDOW ====================================
|
|
Window::new(im_str!("pattern"))
|
|
Window::new(im_str!("pattern"))
|
|
@@ -114,7 +138,6 @@ fn main() {
|
|
// dbg!(&active_pattern_name);
|
|
// dbg!(&active_pattern_name);
|
|
// }
|
|
// }
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
let mut imstr_name = ImString::from(active_pattern.name.clone());
|
|
let mut imstr_name = ImString::from(active_pattern.name.clone());
|
|
if ui.input_text(&im_str!("yo"), &mut imstr_name)
|
|
if ui.input_text(&im_str!("yo"), &mut imstr_name)
|
|
@@ -173,9 +196,6 @@ fn main() {
|
|
active_pattern.sounds[row_idx][snd_idx] = active_sound.clone();
|
|
active_pattern.sounds[row_idx][snd_idx] = active_sound.clone();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
ui.text(im_str!("pat {} {}", pattern_col, pattern_row));
|
|
ui.text(im_str!("pat {} {}", pattern_col, pattern_row));
|