sounds
This commit is contained in:
BIN
assets/A_LA.ogg
Normal file
BIN
assets/A_LA.ogg
Normal file
Binary file not shown.
BIN
assets/B_SI.ogg
Normal file
BIN
assets/B_SI.ogg
Normal file
Binary file not shown.
BIN
assets/C_DO.ogg
Normal file
BIN
assets/C_DO.ogg
Normal file
Binary file not shown.
BIN
assets/D_RE.ogg
Normal file
BIN
assets/D_RE.ogg
Normal file
Binary file not shown.
BIN
assets/E_MI.ogg
Normal file
BIN
assets/E_MI.ogg
Normal file
Binary file not shown.
BIN
assets/F_FA.ogg
Normal file
BIN
assets/F_FA.ogg
Normal file
Binary file not shown.
BIN
assets/G_SOL.ogg
Normal file
BIN
assets/G_SOL.ogg
Normal file
Binary file not shown.
12
src/main.rs
12
src/main.rs
@@ -172,7 +172,8 @@ impl MyApp {
|
|||||||
}
|
}
|
||||||
Message::ChangeSound(i, s) => {
|
Message::ChangeSound(i, s) => {
|
||||||
self.poly_frame.polygons[i].sound =
|
self.poly_frame.polygons[i].sound =
|
||||||
StaticSoundData::from_file(&s).expect("Fail to load audio");
|
StaticSoundData::from_file(format!("./assets/{}", s))
|
||||||
|
.expect("Fail to load audio");
|
||||||
self.poly_frame.polygons[i].sound_name = s;
|
self.poly_frame.polygons[i].sound_name = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -190,11 +191,12 @@ impl MyApp {
|
|||||||
.map(|polygon| {
|
.map(|polygon| {
|
||||||
let current_index = i;
|
let current_index = i;
|
||||||
i += 1;
|
i += 1;
|
||||||
let entries = fs::read_dir("./assets/")
|
let mut entries: Vec<String> = fs::read_dir("./assets")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.map(|res| res.map(|e| e.path().to_str().unwrap().to_string()))
|
.filter_map(|res| res.ok())
|
||||||
.collect::<Result<Vec<_>, io::Error>>()
|
.map(|e| e.path().file_name().unwrap().to_str().unwrap().to_string())
|
||||||
.unwrap();
|
.collect();
|
||||||
|
entries.sort();
|
||||||
|
|
||||||
row![
|
row![
|
||||||
text(&polygon.name),
|
text(&polygon.name),
|
||||||
|
|||||||
Reference in New Issue
Block a user