create constructors for VmcExtMidiCcBit and DeviceTransform
This commit is contained in:
parent
682591278f
commit
b027035aba
29
src/lib.rs
29
src/lib.rs
|
@ -992,7 +992,7 @@ impl VmcExtMidiCcVal {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct VmcExtMidiCcBit {
|
pub struct VmcExtMidiCcBit {
|
||||||
knob: i32,
|
knob: i32,
|
||||||
active: bool,
|
active: bool,
|
||||||
}
|
}
|
||||||
|
@ -1039,8 +1039,21 @@ impl VmcMessage for VmcExtMidiCcBit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl VmcExtMidiCcBit {
|
||||||
|
pub fn new(knob: i32, active: bool) -> MsgNewResult<Self> {
|
||||||
|
return Ok(Self { knob, active});
|
||||||
|
}
|
||||||
|
pub fn new_vmc_message(knob: i32, active: bool) -> TraitMsgNewResult {
|
||||||
|
let message = Self::new(knob, active);
|
||||||
|
match message {
|
||||||
|
Ok(val) => Ok(Box::new(val)),
|
||||||
|
Err(val) => Err(val),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct DeviceTranform {
|
pub struct DeviceTranform {
|
||||||
addr: String,
|
addr: String,
|
||||||
serial: String,
|
serial: String,
|
||||||
transform: Transform3D,
|
transform: Transform3D,
|
||||||
|
@ -1113,6 +1126,18 @@ impl VmcMessage for DeviceTranform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl DeviceTranform {
|
||||||
|
pub fn new(addr: String, serial: String, transform: Transform3D) ->MsgNewResult<Self> {
|
||||||
|
Ok(Self { addr, serial, transform})
|
||||||
|
}
|
||||||
|
pub fn new_vmc_message(addr: String, serial: String, transform: Transform3D) ->TraitMsgNewResult {
|
||||||
|
match Self::new(addr, serial, transform) {
|
||||||
|
Ok(val) => Ok(Box::new(val)),
|
||||||
|
Err(val) => Err(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct VmcExtRvc {
|
struct VmcExtRvc {
|
||||||
enable: bool,
|
enable: bool,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user