[][src]Struct libosu::Beatmap

pub struct Beatmap {
    pub version: u32,
    pub audio_filename: String,
    pub audio_leadin: u32,
    pub preview_time: u32,
    pub countdown: bool,
    pub sample_set: SampleSet,
    pub stack_leniency: f64,
    pub mode: Mode,
    pub letterbox_in_breaks: bool,
    pub widescreen_storyboard: bool,
    pub difficulty: Difficulty,
    pub bookmarks: Vec<i32>,
    pub distance_spacing: f64,
    pub beat_divisor: u8,
    pub grid_size: u8,
    pub timeline_zoom: f64,
    pub title: String,
    pub title_unicode: String,
    pub artist: String,
    pub artist_unicode: String,
    pub creator: String,
    pub difficulty_name: String,
    pub source: String,
    pub tags: Vec<String>,
    pub beatmap_id: i32,
    pub beatmap_set_id: i32,
    pub colors: Vec<Color>,
    pub hit_objects: Vec<HitObject>,
    pub timing_points: Vec<TimingPoint>,
}

Represents a single beatmap.

Fields

version: u32

The osu! file format being used

audio_filename: String

The name of the audio file to use, relative to the beatmap file.

audio_leadin: u32

The amount of time (in milliseconds) added before the audio file begins playing. Useful for audio files that begin immediately.

preview_time: u32

When (in milliseconds) the audio file should begin playing when selected in the song selection menu.

countdown: bool

Whether or not to show the countdown

sample_set: SampleSet

The default sample set for hit objects which don't have a custom override.

stack_leniency: f64

Leniency for stacked objects.

mode: Mode

The game mode (standard, taiko, catch the beat, mania).

letterbox_in_breaks: bool

Whether or not to show black borders during breaks.

widescreen_storyboard: bool

TODO: unknown field

difficulty: Difficulty

An instance of the difficulty settings.

bookmarks: Vec<i32>

Bookmarks in the editor

distance_spacing: f64

The last setting used for distance spacing.

beat_divisor: u8

The last setting used for beat divisor

grid_size: u8

The last setting used for grid size

timeline_zoom: f64

The last setting used for timeline zoom

title: String

The title of the song (ASCII only).

title_unicode: String

The title of the song (UTF-8).

artist: String

The artist of the song (ASCII only).

artist_unicode: String

The artist of the song (UTF-8).

creator: String

The creator of the mapset.

difficulty_name: String

The name of the difficulty.

source: String

Optional source.

tags: Vec<String>

Optional tags.

beatmap_id: i32

The beatmap ID on Bancho.

beatmap_set_id: i32

The beatmap set ID on Bancho.

colors: Vec<Color>

Overridden combo colors.

hit_objects: Vec<HitObject>

The set of hit objects.

timing_points: Vec<TimingPoint>

The set of timing points.

Implementations

impl Beatmap[src]

pub fn double_iter(&self) -> DoubleIter<'_>[src]

Iterate both hit objects and timing points

pub fn get_hitobject_end_time(&self, ho: &HitObject) -> TimeLocation[src]

Computes the end time of the given hitobject

pub fn get_slider_duration(&self, ho: &HitObject) -> Option<f64>[src]

Returns the slider duration for a given slider

pub fn get_slider_velocity_at_time(&self, time: TimeLocation) -> f64[src]

Returns the slider velocity at the given time

pub fn get_bpm_at_time(&self, time: TimeLocation) -> Option<f64>[src]

Returns the BPM at the given time

impl Beatmap[src]

pub fn locate_timing_point(
    &self,
    time: impl Into<TimeLocation>
) -> Option<TimingPoint>
[src]

Returns the timing point associated with the timing section to which the given time belongs.

pub fn locate_hitobject(
    &self,
    time: impl Into<TimeLocation>
) -> Option<HitObject>
[src]

Returns the hitobject located at the given time.

impl Beatmap[src]

pub fn from_osz(input: impl AsRef<str>) -> Result<Beatmap, Error>[src]

Creates a Beatmap from the *.osz format

pub fn as_osz(&self) -> Result<String, Error>[src]

Serializes this Beatmap into the *.osz format.

Trait Implementations

impl Clone for Beatmap[src]

impl Debug for Beatmap[src]

impl Default for Beatmap[src]

impl PartialEq<Beatmap> for Beatmap[src]

impl Serialize for Beatmap[src]

impl StructuralPartialEq for Beatmap[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.