main.rs 707 B

1234567891011121314151617181920212223242526272829303132333435
  1. use std::io::BufReader;
  2. use std::path::PathBuf;
  3. use std::thread;
  4. use std::time::Duration;
  5. extern crate rodio;
  6. mod base;
  7. use base::*;
  8. fn main() {
  9. let dev = rodio::default_output_device().unwrap();
  10. let hat = Sound{location: PathBuf::from("media/c64sid-ch1.wav")};
  11. let snare = Sound{location: PathBuf::from("media/c64sid-snare12.wav")};
  12. let kick = Sound{location: PathBuf::from("media/c64sid-kick5.wav")};
  13. let mut bar = Bar::default();
  14. bar.repeat = 2;
  15. bar.sounds = vec!(
  16. kick.clone(),
  17. hat.clone(),
  18. snare.clone(),
  19. hat.clone(),
  20. kick.clone(),
  21. hat.clone(),
  22. snare.clone(),
  23. hat.clone(),
  24. );
  25. bar.play(&dev);
  26. }