import Foundation

// MARK: - App Constants

struct AppConstants {
    /// App name
    static let appName = "Acapella"

    /// File extensions
    static let songFileExtension = "txt"
    static let bundleExtension = "acapella"
    static let audioFileExtension = "wav"

    /// Default tempo if not specified
    static let defaultTempo = 120

    /// Tempo range for the BPM slider
    static let minTempo = 40
    static let maxTempo = 240

    /// Audio settings
    static let sampleRate: Double = 44100.0
    static let audioChannels: Int = 1  // Mono for individual parts
    static let mixedChannels: Int = 2  // Stereo for final mix
    static let bitsPerSample: Int = 16

    /// Sheet music rendering
    struct Layout {
        static let staffLineSpacing: CGFloat = 8.0       // Distance between staff lines
        static let staffHeight: CGFloat = 32.0            // 4 spaces × 8 points
        static let measureMinWidth: CGFloat = 120.0       // Minimum width per measure
        static let measurePadding: CGFloat = 16.0         // Padding within a measure
        static let systemSpacing: CGFloat = 80.0          // Vertical space between staff systems
        static let leftMargin: CGFloat = 80.0             // Space for clef + key/time signature
        static let rightMargin: CGFloat = 20.0
        static let topMargin: CGFloat = 40.0
        static let noteHeadWidth: CGFloat = 10.0
        static let noteHeadHeight: CGFloat = 7.0
        static let stemLength: CGFloat = 28.0
        static let stemWidth: CGFloat = 1.5
        static let barLineWidth: CGFloat = 1.0
        static let beamWidth: CGFloat = 3.0
        static let dotOffset: CGFloat = 4.0
        static let accidentalOffset: CGFloat = 14.0
        static let ledgerLineExtension: CGFloat = 4.0
    }

    /// Selection highlight
    struct SelectionStyle {
        static let highlightAlpha: CGFloat = 0.15
    }
}
