#!/bin/sh
export TEXTDOMAIN=pmusic
set -a

. $APPDIR/gui_misc
. $APPDIR/gui_playlist
. $APPDIR/gui_navigation
. $APPDIR/gui_mixer

$APPDIR/func_svg -heading "$(gettext 'Audio mixer')" > /dev/null

GUI='
<window title="pMusic - '$(gettext 'CD-Audio player')'" icon-name="pmusic" default_height="450" default_width="300">
 <vbox>
  <hbox height-request="80" spacing="0">
   <eventbox tooltip-text="'$(gettext 'Show track-info window')'" above-child="true" visible-window="true" spacing="0" space-expand="false" space-fill="false">
    <pixmap>
     <variable>ARTWORK</variable>
     <input file>'$WORKDIR'/albumart.jpg</input>
     <height>80</height>
    </pixmap>
    <action signal="enter-notify-event">disable:ARTWORK</action>
    <action signal="leave-notify-event">enable:ARTWORK</action>
    <action signal="button-release-event">'$APPDIR'/func_kill -trackinfo</action>
    <action signal="button-release-event">echo false > '$WORKDIR'/UPDATE_TRACKINFO</action> ##this to reset conditional timer - workaround
    <action signal="button-release-event">'$APPDIR'/func_trackinfo "" -gui &</action>
   </eventbox>
   <vbox scrollable="true" spacing="3" width="250" vscrollbar-policy="2" hscrollbar-policy="2">
    <text height-request="5"><label>""</label></text>
    <hbox homogeneous="true">
     <hbox>
     <text width-request="3"><label>""</label></text>
     <vbox homogeneous="true" space-expand="false" space-fill="false">
      '$GUI_BUTTON_PLAYMODE'
     </vbox>
     <text width-request="3"><label>""</label></text>
     '$GUI_NAVIGATION'
     <text width-request="3"><label>""</label></text>
     <vbox homogeneous="true" space-expand="false" space-fill="false">
      '$GUI_BUTTON_MIXER'
     </vbox>
     <text width-request="3"><label>""</label></text>
     </hbox>
    </hbox>
    '$GUI_PROGRESSBAR'
    '$GUI_PROGRESS'
   </vbox>
  </hbox>
  
  <hbox homogeneous="true"><hbox>
   <button tooltip-text="'$(gettext 'Copy and convert tracks in list')'"><label>" '$(gettext 'Rip CD')' "</label><action>'$APPDIR'/func_export</action></button>
   <button tooltip-text="'$(gettext 'Burn a new disc')'">
    <label>" '$(gettext 'Copy CD')' "</label>
    <action>'$APPDIR'/func_player -stop -skip_update</action>
    <action>[ -f '$APPDIR'/themes/'$THEME'/icon_pause.svg ] && cp -f '$APPDIR'/themes/'$THEME'/icon_play.svg '$WORKDIR'/icon_playpause.svg</action>
    <action>echo > '$WORKDIR'/UPDATE_GUI</action>
    <action>pburn -m copy-audio &</action>
   </button>
   <button tooltip-text="'$(gettext 'Refresh disc info')'">
    <label>" '$(gettext 'Read CD')' "</label>
    <action>'$APPDIR'/func_player -stop -skip_update</action>
    <action>'$APPDIR'/func_cd -play_cd</action>
   </button>
   <button>
    <label>" '$(gettext 'Eject CD')' "</label>
    <action>'$APPDIR'/func_player -stop -skip_update</action>
    <action>[ -f '$APPDIR'/themes/'$THEME'/icon_pause.svg ] && cp -f '$APPDIR'/themes/'$THEME'/icon_play.svg '$WORKDIR'/icon_playpause.svg</action>
    <action>echo > '$WORKDIR'/UPDATE_GUI</action>
    <action>eject</action>
   </button>
   <button><input file stock="gtk-preferences"></input><action>'$APPDIR'/func_config -cd</action></button>
  </hbox>
  </hbox>
  '$GUI_PLAYLIST_FIELD'
  '$GUI_STATUSBAR'
 </vbox>
 <action signal="show">echo > '$WORKDIR'/gui_is_running</action>
 <action signal="delete-event">'$APPDIR'/func -quit</action>
 <action signal="delete-event">exit:Exit</action>
</window>'

