pub struct Qua {
Show 24 fields pub audio_file: String, pub song_preview_time: i32, pub background_file: String, pub banner_file: String, pub map_id: i32, pub map_set_id: i32, pub game_mode: GameMode, pub title: String, pub artist: String, pub source: String, pub tags: String, pub creator: String, pub difficulty_name: String, pub description: String, pub genre: String, pub bpm_does_not_affect_scroll_velocity: bool, pub initial_scroll_velocity: f32, pub has_scratch_key: bool, pub editor_layers: Vec<EditorLayerInfo>, pub custom_audio_samples: Vec<CustomAudioSampleInfo>, pub sound_effects: Vec<SoundEffectInfo>, pub timing_points: Vec<TimingPointInfo>, pub slider_velocities: Vec<ScrollVelocityInfo>, pub hit_objects: Vec<HitObjectInfo>,
}
Expand description

Represents the .qua file format

Hitsounds are not considered for now. Genre is unused, but does exist in the format.

Fields

audio_file: String

The name of the audio file

song_preview_time: i32

Time in milliseconds of the song where the preview starts

background_file: String

The name of the background file

banner_file: String

The name of the mapset banner

map_id: i32

The unique Map Identifier (-1 if not submitted)

map_set_id: i32

The unique Map Set identifier (-1 if not submitted)

game_mode: GameMode

The game mode for this map

title: String

The title of the song

artist: String

The artist of the song

source: String

The source of the song (album, mixtape, etc.)

tags: String

Any tags that could be used to help find the song.

creator: String

The creator of the map

difficulty_name: String

The difficulty name of the map.

description: String

A description about this map.

genre: String

The genre of the song

bpm_does_not_affect_scroll_velocity: bool

Indicates if the BPM changes in affect scroll velocity.

If this is set to false, SliderVelocities are in the denormalized format (BPM affects SV), and if this is set to true, SliderVelocities are in the normalized format (BPM does not affect SV).

initial_scroll_velocity: f32

The initial scroll velocity before the first SV change.

Only matters if BPMDoesNotAffectScrollVelocity is true.

has_scratch_key: bool

If true, the map will have a +1 scratch key, allowing for 5/8 key play

editor_layers: Vec<EditorLayerInfo>

EditorLayer .qua data

custom_audio_samples: Vec<CustomAudioSampleInfo>

CustomAudioSamples .qua data

sound_effects: Vec<SoundEffectInfo>

SoundEffects .qua data

timing_points: Vec<TimingPointInfo>

TimingPoint .qua data

slider_velocities: Vec<ScrollVelocityInfo>

Slider Velocity .qua data

Note that SVs can be both in normalized and denormalized form, depending on BPMDoesNotAffectSV. Check WithNormalizedSVs if you need normalized SVs.

hit_objects: Vec<HitObjectInfo>

HitObject .qua data

Implementations

Parse a file to a Qua struct

use qua_format::Qua;

let path = "123.qua";
let mut qua = Qua::from_file(path).expect("Could not parse qua file");

Parse data from a reader to a Qua struct

Write the Qua struct to a writer

use std::fs::File;
use qua_format::Qua;

let qua = Qua {
    title: "Freedom Dive".to_string(),
    artist: "xi".to_string(),
    ..Default::default()
};

let new_path = "test.qua";
let new_file = File::create(&new_path).expect("Could not create new file");
qua.to_writer(new_file).expect("Could not write to file");

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.