Skip to main content

Header

Struct Header 

Source
pub struct Header {
Show 17 fields pub synth: u8, pub tracks: u8, pub unit: u32, pub length: u32, pub loop_at: Option<u32>, pub version: u8, pub ppq: u32, pub envelopes: u8, pub vibratos: u8, pub detunes: u8, pub arps: u8, pub waves: u8, pub duties: u8, pub extensions: u8, pub frame_hz: u8, pub markers: u8, pub meter: (u8, u8),
}
Expand description

ヘッダーの中身。

Fields§

§synth: u8

音源の番号(0 = basic、1 = ay-3-8912、2 = ym2149、255 = そのほか)。情報のみ。

§tracks: u8§unit: u32

1単位あたりの tick 数(Header::ppq の tick)。

§length: u32

曲の長さ(単位)。

§loop_at: Option<u32>

ループ点(単位)。

§version: u8

形式の版(今は 1 だけ)。

§ppq: u32

4分音符あたりの tick 数(いつも 10080)。

§envelopes: u8

音量エンベロープの数。

§vibratos: u8

ビブラートの数。

§detunes: u8

デチューンの数。

§arps: u8

アルペジオの数。

§waves: u8

波形(@wave)の数。

§duties: u8

音色エンベロープ(@duty)の数。

§extensions: u8

拡張ヘッダーのブロックの数(flags のビット 3 が立っていなければ 0)。

§frame_hz: u8

1 秒あたりのフレーム数(50 か 60。flags のビット 1 が立っていれば 50)。

§markers: u8

マーカーの数(flags のビット 2 が立っていなければ 0)。

§meter: (u8, u8)

拍子(1 小節の拍の数、拍の音符)。flags のビット 2 が立っていなければ 4/4。

Implementations§

Source§

impl Header

Source

pub fn beat_ticks(&self) -> u64

1 拍の tick 数。

Source

pub fn bar_ticks(&self) -> u64

1 小節の tick 数。

Trait Implementations§

Source§

impl Clone for Header

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Header

Source§

impl Debug for Header

Source§

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

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

impl Eq for Header

Source§

impl PartialEq for Header

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Header

Auto Trait Implementations§

§

impl Forget for Header

§

impl Freeze for Header

§

impl Move for Header

§

impl RefUnwindSafe for Header

§

impl Send for Header

§

impl Sync for Header

§

impl Unpin for Header

§

impl UnsafeUnpin for Header

§

impl UnwindSafe for Header

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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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.