[−][src]Struct nbs::header::Header
The header contains information about the file
Fields
vannila_instrument_count: Option<i8>Amount of default instruments when the song was saved. This is needed to determine at what index custom instruments start. Only avabile in the new format
layer_count: i16The last layer with at least one note block in it, or the last layer that has had its name, volume or stereo changed.
song_name: StringThe name of the song.
The author of the song.
The original author of the song.
song_description: StringThe description of the song.
song_tempo: i16The tempo of the song multiplied by 100.
auto_saving: boolWhether auto-saving has been enabled. As of NBS version 4 this value is still saved to the file, but no longer used in the program.
auto_saving_duration: i8The amount of minutes between each auto-save (if it has been enabled) (1-60). As of NBS version 4 this value is still saved to the file, but no longer used in the program.
time_signature: i8The time signature of the song. If this is 3, then the signature is 3/4. Default is 4. This value ranges from 2-8.
minutes_spent: i32Amount of minutes spent on the project.
left_clicks: i32Amount of times the user has left-clicked.
right_clicks: i32Amount of times the user has right-clicked.
noteblocks_added: i32Amount of times the user has added a note block.
noteblocks_removed: i32The amount of times the user have removed a note block.
imported_file_name: StringIf the song has been imported from a .mid or .schematic file, that file name is stored here (only the name of the file, not the path).
is_loop: Option<bool>Whether looping is on or off. Only avabile in the new format.
max_loop_count: Option<i8>0 = infinite. Other values mean the amount of times the song loops. Only avabile in the new format.
loop_start_tick: Option<i16>Determines which part of the song (in ticks) it loops back to. Only avabile in the new format.
format: NbsFormatNot part of the Header.
Methods
impl Header[src]
pub fn new(format: NbsFormat) -> Self[src]
pub fn decode<R>(reader: &mut R) -> Result<Self, NbsError> where
R: ReadStringExt, [src]
R: ReadStringExt,
pub fn encode<W>(
&self,
format: NbsFormat,
writer: &mut W
) -> Result<(), NbsError> where
W: WriteStringExt, [src]
&self,
format: NbsFormat,
writer: &mut W
) -> Result<(), NbsError> where
W: WriteStringExt,
pub fn song_ticks(&self) -> Option<i16>[src]
Returns the song ticks. This method will only return valid results for old versions and version 3 and 4 of the new version.
pub fn song_length(&self) -> Option<Duration>[src]
Returns the song Duration. This method will only return valid results for old versions and version 3 and 4 of the new version.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,