#!/bin/bash
export TEXTDOMAIN=pmusic

[ ! "$PLAYLIST_HEIGHT" ] && PLAYLIST_HEIGHT=150
#GUI_PLAYLIST_FIELD='
#<tree name="playlist" tooltip-column="5" headers_visible="false" exported_column="3" hover-selection="true" reorderable="true" column-visible="true|true|true|false">
# <label>A|B|C|D</label>
# <height>'$PLAYLIST_HEIGHT'</height><width>150</width>
# <input file stock-column="0">'$WORKDIR'/playlist</input>
# <output file>'$WORKDIR'/playlist_output</output>
# <variable>PLAYLIST</variable>
# <action>. '$APPDIR'/func -playlist_select</action>
# <action signal="button-press-event">echo "$PLAYLIST" > '$WORKDIR'/PLAYLIST_PRESS_EVENT; case $PTR_BTN in 2) '$APPDIR'/func -remove_from_list; echo true > '$WORKDIR'/UPDATE_GUI;; 3) . '$APPDIR'/func -playlist_menu; echo true > '$WORKDIR'/UPDATE_GUI;; esac</action>
# <action signal="cursor-changed">save:PLAYLIST</action>
# <action signal="button-release-event">cut -d"|" -f2- '$WORKDIR'/playlist_output > '$WORKDIR'/playlist</action>
#</tree>'


GUI_PLAYLIST_FIELD='
<tree name="playlist" tooltip-column="5" headers_visible="false" exported_column="3" hover-selection="true" column-visible="true|true|true|false">
 <label>A|B|C|D</label>
 <height>'$PLAYLIST_HEIGHT'</height><width>150</width>
 <input file stock-column="0">'$WORKDIR'/playlist</input>
 <variable>PLAYLIST</variable>
 <action signal="button-press-event">grep -F "$PLAYLIST" '$WORKDIR'/playlist > '$WORKDIR'/PLAYLIST_PRESS_EVENT; [ "$PLAYLIST" ] && . '$APPDIR'/menu_playqueue</action>
 <action signal="button-release-event">. '$APPDIR'/func -playlist_move</action> ##this will play the track as well
 <action signal="button-release-event">refresh:PLAYLIST</action>
</tree>'

GUI_BUTTON_PLAYMODE='
<button space-expand="false" space-fill="false" tooltip-markup="'$(gettext '<b>Play mode</b>
Which track should be next')'">
 <input file>'$WORKDIR'/icon_playmode.svg</input>
 <height>22</height>
 <variable>PLAYMODE</variable>
 <action signal="button-press-event">. '$APPDIR'/menu_playmode</action>
 <action signal="button-press-event">refresh:PLAYMODE</action>
</button>'

GUI_BUTTON_PLAYLIST_HISTORY_BACK='
<button space-expand="false" space-fill="false" tooltip-markup=" '$(gettext 'Go <b>back</b> in playQueue history')' ">
 <input file stock="gtk-pmusic_undo"></input>
 <action>. '$APPDIR'/func -undo</action>
 <action>Refresh:PLAYLIST</action>
</button>'

GUI_BUTTON_PLAYLIST_HISTORY_FORWARD='
<button space-expand="false" space-fill="false" tooltip-markup=" '$(gettext 'Go <b>forward</b> in playQueue history')' ">
 <input file stock="gtk-pmusic_redo"></input>
 <action>. '$APPDIR'/func -redo</action>
 <action>Refresh:PLAYLIST</action>
</button>'

GUI_BUTTON_NEW='
<button space-expand="false" space-fill="false" tooltip-text=" '$(gettext 'Clear playQueue')' ">
 <input file stock="gtk-pmusic_remove"></input>
 <action>'$APPDIR'/func_store_playlist &</action>
 <action>sleep 0.2; '$APPDIR'/func -new</action>
 <action>Refresh:PLAYLIST</action>
</button>'

GUI_SVG_NOWPLAYING='
<hbox scrollable="true" shadow-type="0" spacing="0" height="50" height-request="10" width-request="10" space-expand="false" space-fill="false">
  <pixmap height-request="50" space-expand="false" space-fill="false"><variable>SVG_NOWPLAYING</variable><input file>'$WORKDIR'/status.svg</input></pixmap>
  <hbox height-request="1" space-expand="true" space-fill="true"><text><label>""</label></text></hbox>
</hbox>
'
