print("=== TerminalDAW - Version 0.0.1 ===\n")

from ui.app import AppUI
from project import Project, ProjectChannel, AudioChannelChunk
import librosa
import sounddevice
import mp3


if __name__ == "__main__":
    print("Loading project...")
    test_project = Project(song_length=64,bpm=120)
    
    screams = ProjectChannel(
        test_project,
        name="screams of the damned",
    )
    sample = AudioChannelChunk(
        screams,
        *librosa.load("cool sample 2.mp3", sr=None, mono=False),
        name="cool sample 2.mp3"
    )
    screams.chunks.append(sample)
    
    test_project.channels.append(screams)
    
    test_project.write_to_file("test_project.tdp")
    #test_project = Project.from_file("test_project.tdp")
    
    # start the ui
    print("Starting UI...")
    app = AppUI(Project())
    app.run()