mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
launch clips
This commit is contained in:
parent
8a2693c297
commit
a4061535b5
7 changed files with 117 additions and 28 deletions
|
|
@ -21,7 +21,7 @@ enum PluginKind {
|
|||
LV2 {
|
||||
world: ::livi::World,
|
||||
features: Arc<::livi::Features>,
|
||||
portList: Vec<::livi::Port>,
|
||||
port_list: Vec<::livi::Port>,
|
||||
instance: ::livi::Instance,
|
||||
},
|
||||
VST2 {
|
||||
|
|
@ -105,7 +105,7 @@ impl Plugin {
|
|||
inputs.push(atom);
|
||||
}
|
||||
let mut outputs = vec![];
|
||||
for port in self.midi_outs.iter() {
|
||||
for _ in self.midi_outs.iter() {
|
||||
outputs.push(::livi::event::LV2AtomSequence::new(
|
||||
&features,
|
||||
scope.n_frames() as usize
|
||||
|
|
@ -171,12 +171,12 @@ pub fn render (state: &Plugin, buf: &mut Buffer, area: Rect)
|
|||
let Rect { x, y, height, .. } = area;
|
||||
let mut width = 40u16;
|
||||
match &state.plugin {
|
||||
Some(PluginKind::LV2 { portList, instance, .. }) => {
|
||||
Some(PluginKind::LV2 { port_list, instance, .. }) => {
|
||||
let start = state.selected.saturating_sub((height as usize / 2).saturating_sub(1));
|
||||
let end = start + height as usize - 2;
|
||||
//draw_box(buf, Rect { x, y, width, height });
|
||||
for i in start..end {
|
||||
if let Some(port) = portList.get(i) {
|
||||
if let Some(port) = port_list.get(i) {
|
||||
let value = if let Some(value) = instance.control_input(port.index) {
|
||||
value
|
||||
} else {
|
||||
|
|
@ -218,7 +218,7 @@ pub fn handle (s: &mut Plugin, event: &AppEvent) -> Usually<bool> {
|
|||
s.selected = s.selected - 1
|
||||
} else {
|
||||
s.selected = match &s.plugin {
|
||||
Some(PluginKind::LV2 { portList, .. }) => portList.len() - 1,
|
||||
Some(PluginKind::LV2 { port_list, .. }) => port_list.len() - 1,
|
||||
_ => 0
|
||||
}
|
||||
}
|
||||
|
|
@ -229,8 +229,8 @@ pub fn handle (s: &mut Plugin, event: &AppEvent) -> Usually<bool> {
|
|||
|s: &mut Plugin|{
|
||||
s.selected = s.selected + 1;
|
||||
match &s.plugin {
|
||||
Some(PluginKind::LV2 { portList, .. }) => {
|
||||
if s.selected >= portList.len() {
|
||||
Some(PluginKind::LV2 { port_list, .. }) => {
|
||||
if s.selected >= port_list.len() {
|
||||
s.selected = 0;
|
||||
}
|
||||
},
|
||||
|
|
@ -242,8 +242,8 @@ pub fn handle (s: &mut Plugin, event: &AppEvent) -> Usually<bool> {
|
|||
[Char(','), NONE, "decrement", "decrement value",
|
||||
|s: &mut Plugin|{
|
||||
match s.plugin.as_mut() {
|
||||
Some(PluginKind::LV2 { portList, ref mut instance, .. }) => {
|
||||
let index = portList[s.selected].index;
|
||||
Some(PluginKind::LV2 { port_list, ref mut instance, .. }) => {
|
||||
let index = port_list[s.selected].index;
|
||||
if let Some(value) = instance.control_input(index) {
|
||||
instance.set_control_input(index, value - 0.01);
|
||||
}
|
||||
|
|
@ -256,8 +256,8 @@ pub fn handle (s: &mut Plugin, event: &AppEvent) -> Usually<bool> {
|
|||
[Char('.'), NONE, "increment", "increment value",
|
||||
|s: &mut Plugin|{
|
||||
match s.plugin.as_mut() {
|
||||
Some(PluginKind::LV2 { portList, ref mut instance, .. }) => {
|
||||
let index = portList[s.selected].index;
|
||||
Some(PluginKind::LV2 { port_list, ref mut instance, .. }) => {
|
||||
let index = port_list[s.selected].index;
|
||||
if let Some(value) = instance.control_input(index) {
|
||||
instance.set_control_input(index, value + 0.01);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue