/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 2024 Mike Robeson [dijksterhuis]
*/
mod helpers;
use helpers::*;

use ot_tools_io::{OctatrackFileIO, ProjectFile};
use std::path::PathBuf;

#[derive(Debug)]
#[allow(dead_code)]
struct Metadata {
    header: String,
    datatype_version: u8,
}

// read different data files and print some metadata
fn main() -> RBoxErr<()> {
    let blank_project_dirpath = PathBuf::from("test-data").join("blank-project");
    let project_fpath = blank_project_dirpath.join("project.work");
    let project = ProjectFile::from_data_file(&project_fpath)?;

    println!("====================================");
    println!("|       Project Sample Slots       |");
    println!("====================================");
    println!("-------------- Static --------------");
    for (idx, sample_slot) in project.slots.static_slots.iter().enumerate() {
        println!("Static Slot {}: {sample_slot:?}", idx + 1)
    }
    println!("--------------- Flex ---------------");
    for (idx, sample_slot) in project.slots.flex_slots.iter().enumerate() {
        println!("Flex Slot {}: {sample_slot:?}", idx + 1)
    }
    Ok(())
}
