import warnings; warnings.filterwarnings("ignore")
import sys, os
sys.path.insert(0, r"C:\Users\Administrator\Documents\fl_control")
from src.analyzer import analyze_file

tests = [
    ("MIDILATINO Lead",  r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Gracias_C#_Min_102BPM_ Lead.wav"),
    ("MIDILATINO Bass",  r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Holanda_F_Min_108BPM_Bass.wav"),
    ("MIDILATINO Pad",   r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Cielo_F_Min_90BPM_Pad.wav"),
    ("MIDILATINO Pluck", r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Cookie_E_Min_89BPM_Pluck.wav"),
    ("MIDILATINO Vocal", r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Cookie_E_Min_89BPM_Vocal.wav"),
    ("MIDILATINO Arp",   r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Classic_G#_Min_105BPM_Arp.wav"),
    ("MIDILATINO Drums", r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Anonaki_D#_Min_103BPM_Drums.wav"),
    ("MIDILATINO Full",  r"libreria\reggaeton\SentimientoLatino2025\01\full\Midilatino_Anonaki_D#_Min_103BPM.wav"),
    ("SS_RNBL Kick",     r"libreria\reggaeton\SentimientoLatino2025\02\SS_RNBL_Aqui_One_Shot_Kick.wav"),
    ("SS_RNBL Snare",    r"libreria\reggaeton\SentimientoLatino2025\02\SS_RNBL_Aqui_One_Shot_Snare.wav"),
    ("SS_RNBL Hats",     r"libreria\reggaeton\SentimientoLatino2025\02\SS_RNBL_Aqui_One_Shot_Hats.wav"),
    ("SS_RNBL Bass",     r"libreria\reggaeton\SentimientoLatino2025\02\SS_RNBL_Amor_One_Shot_Bass_C_.wav"),
    ("SS_RNBL Lead",     r"libreria\reggaeton\SentimientoLatino2025\02\SS_RNBL_Enga__o_One_Shot_Lead.wav"),
    ("ONESHOT LEAD",     r"libreria\reggaeton\SentimientoLatino2025\01\LATINOS  -  ONE SHOTS\Midilatino_LEAD_Amor_C.wav"),
    ("ONESHOT PAD",      r"libreria\reggaeton\SentimientoLatino2025\01\LATINOS  -  ONE SHOTS\Midilatino_PAD_Elevado_C.wav"),
    ("ONESHOT PLUCK",    r"libreria\reggaeton\SentimientoLatino2025\01\LATINOS  -  ONE SHOTS\Midilatino_PLUCK_Fish_C.wav"),
    ("ONESHOT BRASS",    r"libreria\reggaeton\SentimientoLatino2025\01\LATINOS  -  ONE SHOTS\Midilatino_BRASS_Thunder_C.wav"),
    ("ONESHOT BELL",     r"libreria\reggaeton\SentimientoLatino2025\01\LATINOS  -  ONE SHOTS\Midilatino_BELL_Church_C.wav"),
    ("ONESHOT SYNTH",    r"libreria\reggaeton\SentimientoLatino2025\01\LATINOS  -  ONE SHOTS\Midilatino_SYNTH_Voice_C.wav"),
]

base = r"C:\Users\Administrator\Documents\fl_control"
for label, path in tests:
    full = os.path.join(base, path)
    if not os.path.exists(full):
        print(f"{label:20s} -> NOT FOUND: {path}")
        continue
    r = analyze_file(full)
    if r and "error" not in r:
        role = r["role"]
        char = r["character"]
        new = r["new_name"]
        print(f"{label:20s} -> {role:12s} {char:10s} {new}")
    else:
        print(f"{label:20s} -> ERROR: {r}")
