#!/bin/bash

export AUDIO_WIZARD='
<window title="Puppy Advanced Multimedia Engine Configurator">
  <vbox>
    <frame Audio Driver & Sound Server selection>
      <text><label>Select the targeted default output hardware channel architecture:</label></text>
      <comboboxtext variable="AUDIO_SERVER">
        <item>ALSA Native Kernel Pipeline Output</item>
        <item>PulseAudio Sound Management Link Server</item>
        <item>PipeWire Modern High-Fidelity Audio Framework</item>
      </comboboxtext>
    </frame>

    <hline></hline>

    <frame Operational Diagnostics>
      <text><label>Hardware Channel Buffer Fill Staging Status:</label></text>
      <progressbar variable="BUFFER_PROGRESS"></progressbar>
      <hbox>
        <text><label>Click button to trigger sound testing sequence:</label></text>
        <button>
          <label>Fire Sound Test</label>
          <action>echo "Live Action: Pinging kernel hardware audio registers..."</action>
        </button>
      </hbox>
    </frame>

    <hbox>
      <button cancel></button>
      <button ok></button>
    </hbox>
  </vbox>
</window>
'

# Run via our production release target
OUTPUT=$(valadialog --debug --program=AUDIO_WIZARD)
eval "$OUTPUT"

echo ""
echo "=========================================="
echo "      ULTIMATIVE WIZARD AUDIO PROFILE     "
echo "=========================================="
echo "Exit Code:       $EXIT"
echo "Selected Server: $AUDIO_SERVER"
echo "=========================================="