Song

Struct Song 

Source
pub struct Song {
Show 30 fields pub version: Version, pub clipboard: Option<Clipboard>, pub name: String, pub subtitle: String, pub artist: String, pub album: String, pub words: String, pub author: String, pub date: String, pub copyright: String, pub writer: String, pub transcriber: String, pub instructions: String, pub comments: String, pub notice: Vec<String>, pub tracks: Vec<Track>, pub measure_headers: Vec<MeasureHeader>, pub channels: Vec<MidiChannel>, pub lyrics: Lyrics, pub tempo: i16, pub hide_tempo: bool, pub tempo_name: String, pub key: KeySignature, pub triplet_feel: TripletFeel, pub master_effect: RseMasterEffect, pub page_setup: PageSetup, pub current_measure_number: Option<usize>, pub current_track: Option<usize>, pub current_voice_number: Option<usize>, pub current_beat_number: Option<usize>,
}

Fields§

§version: Version§clipboard: Option<Clipboard>§name: String§subtitle: String§artist: String§album: String§words: String§author: String§date: String§copyright: String§writer: String

Tab writer

§transcriber: String§instructions: String§comments: String§notice: Vec<String>§tracks: Vec<Track>§measure_headers: Vec<MeasureHeader>§channels: Vec<MidiChannel>§lyrics: Lyrics§tempo: i16§hide_tempo: bool§tempo_name: String§key: KeySignature§triplet_feel: TripletFeel§master_effect: RseMasterEffect§page_setup: PageSetup§current_measure_number: Option<usize>§current_track: Option<usize>§current_voice_number: Option<usize>§current_beat_number: Option<usize>

Implementations§

Source§

impl Song

Source

pub fn read_gp3(&mut self, data: &[u8])

Read the song. A song consists of score information, triplet feel, tempo, song key, MIDI channels, measure and track count, measure headers, tracks, measures.

  • Version: byte-size-string of size 30.
  • Score information. See readInfo.
  • Triplet feel: bool. If value is true, then triplet feel is set to eigth.
  • Tempo: int.
  • Key: int. Key signature of the song.
  • MIDI channels. See readMidiChannels.
  • Number of measures: int.
  • Number of tracks: int.
  • Measure headers. See readMeasureHeaders.
  • Tracks. See read_tracks().
  • Measures. See read_measures().
Source

pub fn read_gp4(&mut self, data: &[u8])

Read the song. A song consists of score information, triplet feel, tempo, song key, MIDI channels, measure and track count, measure headers, tracks, measures.

  • Version: byte-size-string of size 30.
  • Score information. See readInfo.
  • Triplet feel: bool. If value is true, then triplet feel is set to eigth.
  • Lyrics. See read_lyrics().
  • Tempo: int.
  • Key: int. Key signature of the song.
  • Octave: signed-byte. Reserved for future uses.
  • MIDI channels. See readMidiChannels.
  • Number of measures: int.
  • Number of tracks: int.
  • Measure headers. See readMeasureHeaders.
  • Tracks. See read_tracks().
  • Measures. See read_measures().
Source

pub fn read_gp5(&mut self, data: &[u8])

Source

pub fn write(&self, version: (u8, u8, u8), clipboard: Option<bool>) -> Vec<u8>

Write data to a Vec, you are free to use the encoded data to write it in a file or in a database or do something else.

Trait Implementations§

Source§

impl Clone for Song

Source§

fn clone(&self) -> Song

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 Song

Source§

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

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

impl Default for Song

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Song

§

impl RefUnwindSafe for Song

§

impl Send for Song

§

impl Sync for Song

§

impl Unpin for Song

§

impl UnwindSafe for Song

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