##############################################
#            Engine Configuration            #
##############################################

general:
  # Path to the engine-core socket directory relative to the engine project root
  socket_dir: ../engine-core/socket
  # Directory to store temporary data
  cache_dir: ./.cache

log:
  # Directory where the log file resides
  directory: logs
  # Possible values: debug, info, warning, error, critical
  level: debug

monitoring:
  heartbeat:
    # Seconds how often the vitality of Engine Core should be checked (default: 1)
    frequency: 1
    # Host where heartbeat is sent to (disabled if empty string)
    host: ""
    # Some UDP port
    port: 43334

api:
  steering:
    # The URL to get the health status
    status: http://localhost:8000/api/v1/
    # The URL to get the Calendar via Steering
    calendar: http://localhost:8000/api/v1/program/playout

  tank:
    # The session name which is used to authenticate against Tank
    session: engine
    # The secret which is used to authenticate against Tank
    secret: rather-secret
    # The URL to get the health status
    status: http://localhost:8040/healthz
    # The URL to get playlist details via Tank
    playlist: http://localhost:8040/api/v1/playlists/${ID}

  engine:
    # Engine ID (1 or 2)
    number: 1
    # Engine API availability check
    status: http://localhost:8008/api/v1/ui/
    # Engine API endpoint to store playlogs
    store_playlog: http://localhost:8008/api/v1/playlog
    # Engine API endpoint to store clock information
    store_clock: http://localhost:8008/api/v1/clock
    # Engine API endpoint to store health information
    store_health: http://localhost:8008/api/v1/source/health/${ENGINE_NUMBER}

scheduler:
  # Base path as seen by "engine-core", not accessed by "engine"; this is required to construct the absolute audio file path (check "Audio Store" in the docs)
  # Either provide an absolute base path or a relative one starting in the `engine` directory. In case of `engine-core` running in docker use `/var/audio/source`
  audio:
    source_folder: ../engine-core/audio/source
    source_extension: .flac
    # Folder holding M3U Playlists to be scheduled in form of Engine Playlists (similar as audio source folder above)
    playlist_folder: ../engine-core/audio/playlist
    # Offset in seconds how long it takes for Liquidsoap to actually execute a scheduler command; Crucial to keep things in sync
    engine_latency_offset: 0.5

  # How often should the calendar be fetched in seconds. This determines the time of the last changes applied, before a specific show is aired
  fetching_frequency: 30
  # The scheduling window defines when the entries of each timeslot are queued for play-out. The windows start at (timeslot.start - window_start) seconds
  # and ends at (timeslot.end - window.end) seconds. Its also worth noting, that timeslots can only be deleted before the start of the window.
  scheduling_window_start: 60
  scheduling_window_end: 60
  # How many seconds before the actual schedule time the entry should be pre-loaded. Note to provide enough timeout for
  # contents which take longer to load (big files, bad connectivity to streams etc.). If the planned start time is in
  # the past the offset is ignored and the entry is played as soon as possible
  preload_offset: 15

  # Sometimes it might take longer to get a stream connected. Here you can define a viable length.
  # But note, that this may affect the preloading time (see `preload_offset`), hence affecting the
  # overall playout, its delays and possible fallbacks
  input_stream:
    buffer: 3.0

  # Fade duration when selecting another mixer input (seconds)
  fade_in_time: 1.5
  fade_out_time: 1.5
