Struct sofiza::Region[][src]

pub struct Region {
    pub group: Option<usize>,
    pub opcodes: HashMap<String, Opcode>,
}

A Region is the basic component of an instrument. An instrument is defined by one or more regions.

A region starts with the header, and finishes with the next header, header, or the end of the file.

Following the header one or more opcodes can be defined. The opcodes are special keywords which instruct the player on what, when and how to play a sample.

Opcodes within a region can appear in any order, and they have to be separated by one or more spaces or tabulation controls. Opcodes can appear in separated lines within a region.

All Input Controls defined in a region act using the AND boolean operator. Consequently, all conditions must be matched for the region to play.

Fields

group: Option<usize>

The opcodes of this group are applied and will override the defaults.

opcodes: HashMap<String, Opcode>

This list of opcodes will override both the default and inherited opcodes.

Implementations

impl Region[src]

pub fn new() -> Self[src]

pub fn with_group(group: usize) -> Self[src]

pub fn add_opcode(&mut self, opcode: &Opcode)[src]

Add an opcode to this Region

pub fn set_group(&mut self, group: Option<usize>)[src]

Set the group of this Region

pub fn group(&self) -> Option<usize>[src]

Get the group of this Region

Trait Implementations

impl Debug for Region[src]

Auto Trait Implementations

impl RefUnwindSafe for Region

impl Send for Region

impl Sync for Region

impl Unpin for Region

impl UnwindSafe for Region

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.