pub struct KeyswitchInfo {
pub type_id: u32,
pub title: [u8; 64],
pub title_len: u8,
pub short_title: [u8; 64],
pub short_title_len: u8,
pub keyswitch_min: i32,
pub keyswitch_max: i32,
pub key_remapped: i32,
pub unit_id: i32,
pub flags: i32,
}Expand description
Information about a keyswitch (articulation).
Used by sample libraries and orchestral instruments to describe available articulation switches.
Fields§
§type_id: u32Keyswitch type (see keyswitch_type module).
title: [u8; 64]Display title (e.g., “Staccato”, “Legato”).
title_len: u8Title length.
short_title: [u8; 64]Short title (e.g., “Stac”, “Leg”).
short_title_len: u8Short title length.
keyswitch_min: i32Minimum key in the keyswitch range (MIDI note 0-127).
keyswitch_max: i32Maximum key in the keyswitch range (MIDI note 0-127).
key_remapped: i32Remapped key (-1 if not remapped).
unit_id: i32Unit ID for grouping (-1 for none).
flags: i32Flags (reserved for future use).
Implementations§
Source§impl KeyswitchInfo
impl KeyswitchInfo
Sourcepub fn new(type_id: u32, title: &str, key: i32) -> Self
pub fn new(type_id: u32, title: &str, key: i32) -> Self
Create a new keyswitch info for a single key.
Sourcepub fn key_range(type_id: u32, title: &str, min_key: i32, max_key: i32) -> Self
pub fn key_range(type_id: u32, title: &str, min_key: i32, max_key: i32) -> Self
Create a keyswitch for a range of keys.
Sourcepub fn set_short_title(&mut self, short_title: &str)
pub fn set_short_title(&mut self, short_title: &str)
Set the short title.
Sourcepub fn short_title_str(&self) -> &str
pub fn short_title_str(&self) -> &str
Get the short title as a string slice.
Sourcepub fn with_short_title(self, short_title: &str) -> Self
pub fn with_short_title(self, short_title: &str) -> Self
Builder: set short title.
Sourcepub fn with_key_remapped(self, key: i32) -> Self
pub fn with_key_remapped(self, key: i32) -> Self
Builder: set remapped key.
Trait Implementations§
Source§impl Clone for KeyswitchInfo
impl Clone for KeyswitchInfo
Source§fn clone(&self) -> KeyswitchInfo
fn clone(&self) -> KeyswitchInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyswitchInfo
impl Debug for KeyswitchInfo
Source§impl Default for KeyswitchInfo
impl Default for KeyswitchInfo
impl Copy for KeyswitchInfo
Auto Trait Implementations§
impl Freeze for KeyswitchInfo
impl RefUnwindSafe for KeyswitchInfo
impl Send for KeyswitchInfo
impl Sync for KeyswitchInfo
impl Unpin for KeyswitchInfo
impl UnwindSafe for KeyswitchInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more