From e9aaf095a805f08fccc4407c8f1dc60780382f63 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 2 Mar 2025 20:21:28 -0500 Subject: Actually starting the rewrite. --- src/main.rs | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index e7520c7..8ae139b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,19 +2,28 @@ mod itfile; mod midifile; mod portmod; mod convert; +mod player; mod utils; fn main() -> Result<(), itfile::Error> { - match itfile::load("/home/chrisoft/Music/mods/nb_tear of the sun.it") - { - Ok(f) => + /*match itfile::load("/home/chrisoft/Music/mods/nb_tear of the sun.it") { - let mut conv = convert::Converter::new(&f); - conv.convert(); - let mf = conv.result(); - midifile::write_file("output.mid", &mf)?; - Ok(()) + Ok(f) => + { + let mut conv = convert::Converter::new(&f); + conv.convert(); + let mf = conv.result(); + midifile::write_file("output.mid", &mf)?; + Ok(()) + } + Err(e) => Err(e) + }?;*/ + match itfile::load("/home/chrisoft/Music/mods/nb_tear of the sun.it") { + Ok(f) => { + let player = player::BasePlayer::new(&f); + player::Player::play(&player); + Ok(()) + } + Err(e) => Err(e) } - Err(e) => Err(e) - } } -- cgit v1.2.3