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
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.)
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§
Source§impl Qua
impl Qua
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Qua, QuaError>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Qua, QuaError>
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");
Sourcepub fn from_reader<R>(reader: R) -> Result<Qua, QuaError>where
R: Read,
pub fn from_reader<R>(reader: R) -> Result<Qua, QuaError>where
R: Read,
Parse data from a reader to a Qua struct
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Qua, QuaError>
pub fn from_slice(bytes: &[u8]) -> Result<Qua, QuaError>
Parse data from a byte slice to a Qua struct
Sourcepub fn to_writer<W>(&self, writer: W) -> Result<(), QuaError>where
W: Write,
pub fn to_writer<W>(&self, writer: W) -> Result<(), QuaError>where
W: Write,
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");