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

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

New region.

New region with some group.

Add an opcode to this Region

Set the group of this Region

Get the group of this Region

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.