[][src]Struct piano_keyboard::KeyboardBuilder

pub struct KeyboardBuilder { /* fields omitted */ }

The central builder to create a keyboard.

Methods

impl KeyboardBuilder[src]

pub fn new() -> KeyboardBuilder[src]

pub fn standard_piano(self, nr_of_keys: u8) -> Result<KeyboardBuilder, String>[src]

Define a standard piano with 25/37/49/61/64/73/76 or 88 keys.

pub fn is_rd64(self) -> KeyboardBuilder[src]

pub fn set_most_left_right_white_keys(
    self,
    left_white_key: u8,
    right_white_key: u8
) -> Result<KeyboardBuilder, String>
[src]

The keys are defined by MIDI key codes. This means the values have to be in range 0..128, with 0 representing C_-1. Thus the default 88 keyboard uses key codes 21 (A_0) to 108 (C_8).

pub fn set_width(self, width: u16) -> Result<KeyboardBuilder, String>[src]

Sets the desired keyboard width in pixels.

pub fn white_black_gap_present(self, gap_present: bool) -> KeyboardBuilder[src]

pub fn build2d(self) -> Keyboard2d[src]

Final build the keyboard, which means to perform all calculations and create all the elements.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.