Module

Struct Module 

Source
pub struct Module {
Show 18 fields pub name: Name, pub message: String, pub highlight: (u8, u8), pub made_with_version: u16, pub compatible_with_version: u16, pub flags: ModuleFlags, pub global_volume: RangedU8<0, 128>, pub sample_volume: RangedU8<0, 128>, pub speed: RangedU8<1, 255>, pub tempo: RangedU8<31, 255>, pub pan_separation: RangedU8<0, 128>, pub pitch_wheel_depth: u8, pub init_channel_panning: [u8; 64], pub init_channel_volume: [u8; 64], pub orders: Vec<Order>, pub instruments: Vec<Instrument>, pub samples: Vec<Sample>, pub patterns: Vec<Pattern>,
}

Fields§

§name: Name

Song Name, null-terminated (but may also contain nulls)

§message: String

Comment message

§highlight: (u8, u8)

Rows per Measure highlight, Rows per Beat highlight

§made_with_version: u16

“Made With” Tracker

§compatible_with_version: u16

“Compatible With” Tracker

§flags: ModuleFlags

combined Header Flags and Special Flags, for embedding extra information

§global_volume: RangedU8<0, 128>

Global Volume (0…128)

§sample_volume: RangedU8<0, 128>

Sample Volume (0…128)

§speed: RangedU8<1, 255>

Initial Speed (1…255)

§tempo: RangedU8<31, 255>

Initial Tempo (31…255)

§pan_separation: RangedU8<0, 128>

Pan Separation (0…128)

§pitch_wheel_depth: u8

Pitch Wheel Depth

§init_channel_panning: [u8; 64]

Initial Channel Panning

§init_channel_volume: [u8; 64]

Initial Channel Volume

§orders: Vec<Order>

Orders

§instruments: Vec<Instrument>

Instrument headers (without samples)

§samples: Vec<Sample>

Samples

§patterns: Vec<Pattern>

Patterns

Implementations§

Source§

impl Module

Source

pub fn ordered_patterns(&self) -> impl Iterator<Item = &Pattern> + '_

Returns an iterator over patterns as listed in the orders list.

It can yield any pattern multiple times or not yield some patterns at all.

Source

pub fn active_channels(&self) -> ActiveChannels

Returns active channels when playing the module.

Does not account for channels in patterns which are not present in the orders list.

Trait Implementations§

Source§

impl Clone for Module

Source§

fn clone(&self) -> Module

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Module

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Get<InstrumentId> for Module

Source§

type Output = Instrument

Source§

fn get(&self, index: InstrumentId) -> Option<&Self::Output>

Source§

impl Get<PatternId> for Module

Source§

type Output = Pattern

Source§

fn get(&self, index: PatternId) -> Option<&Self::Output>

Source§

impl Get<SampleId> for Module

Source§

type Output = Sample

Source§

fn get(&self, index: SampleId) -> Option<&Self::Output>

Source§

impl Index<&InstrumentId> for Module

Source§

type Output = <Module as Get<InstrumentId>>::Output

The returned type after indexing.
Source§

fn index(&self, index: &InstrumentId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<&PatternId> for Module

Source§

type Output = <Module as Get<PatternId>>::Output

The returned type after indexing.
Source§

fn index(&self, index: &PatternId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<&SampleId> for Module

Source§

type Output = <Module as Get<SampleId>>::Output

The returned type after indexing.
Source§

fn index(&self, index: &SampleId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<InstrumentId> for Module

Source§

type Output = <Module as Get<InstrumentId>>::Output

The returned type after indexing.
Source§

fn index(&self, index: InstrumentId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<PatternId> for Module

Source§

type Output = <Module as Get<PatternId>>::Output

The returned type after indexing.
Source§

fn index(&self, index: PatternId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<SampleId> for Module

Source§

type Output = <Module as Get<SampleId>>::Output

The returned type after indexing.
Source§

fn index(&self, index: SampleId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl Freeze for Module

§

impl RefUnwindSafe for Module

§

impl Send for Module

§

impl Sync for Module

§

impl Unpin for Module

§

impl UnwindSafe for Module

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I, C> Get<&I> for C
where C: Get<I>, I: Copy,

Source§

type Output = <C as Get<I>>::Output

Source§

fn get(&self, index: &I) -> Option<&<C as Get<&I>>::Output>

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.