from __future__ import annotations

from flexohr.harmony.enums import register_enum_type, register_value_type

from .interval import (
    EI,
    EIC,
    GI,
    GIC,
    SI,
    SIC,
    EnharmonicInterval,
    EnharmonicIntervalClass,
    GenericInterval,
    GenericIntervalClass,
    SpecificInterval,
    SpecificIntervalClass,
)
from .pitch import (
    EP,
    EPC,
    GP,
    GPC,
    SP,
    SPC,
    EnharmonicPitch,
    EnharmonicPitchClass,
    GenericPitch,
    GenericPitchClass,
    SpecificPitch,
    SpecificPitchClass,
)

# ── Register all 12 pitchspace types for serialization round-trips ──

# Pitch classes (IntType subclasses)
register_value_type("epc", EPC)
register_value_type("spc", SPC)
register_value_type("gpc", GPC)

# Interval classes (IntType subclasses)
register_value_type("eic", EIC)
register_value_type("sic", SIC)
register_value_type("gic", GIC)

# Pitches (PairOfInts subclasses)
register_value_type("ep", EP)
register_value_type("sp", SP)
register_value_type("gp", GP)

# Intervals (PairOfInts subclasses)
register_value_type("ei", EI)
register_value_type("si", SI)
register_value_type("gi", GI)

# ── Register harmony enums for property round-trips ──

from flexohr.harmony.harmony_enums import (  # noqa: E402
    ChordClass,
    ChordQuality,
    CollectionType,
    Inversion,
    KeyMode,
    ToneFunction,
)

register_enum_type("ToneFunction", ToneFunction)
register_enum_type("ChordQuality", ChordQuality)
register_enum_type("ChordClass", ChordClass)
register_enum_type("Inversion", Inversion)
register_enum_type("CollectionType", CollectionType)
register_enum_type("KeyMode", KeyMode)
