#!/bin/bash
export TEXTDOMAIN=pmusic

if [ "$1" = "-width" ]; then
	WIDTH_ARTWORK="<width>$2</width>"
	WIDTH_BOX=' width-request="'$2'"'
fi

ID3_GENRES=""
while read I; do
	ID3_GENRES="$ID3_GENRES <menuitem><label>"$I"</label><action>echo '"$I"' > $WORKDIR/trackinfo${MYPID}_ID3_GENRE</action><action>refresh:ID3_GENRE</action></menuitem>"
done < $APPDIR/txt_id3genre

GUI_TRACKINFO_UPDATE='
<checkbox visible="false" file-monitor="true" auto-refresh="true">
 <variable>UPDATE_TRACKINFO</variable>
 <input file>'$WORKDIR'/UPDATE_TRACKINFO'${MYPID}'</input>
 <action>if true refresh:ID3_ARTIST</action>
 <action>if true refresh:ID3_TITLE</action>
 <action>if true refresh:ID3_ALBUM</action>
 <action>if true refresh:ID3_ALBUM_DISCOGRAPHY</action>
 <action>if true refresh:ID3_YEAR</action>
 <action>if true refresh:ID3_TRACK</action>
 <action>if true refresh:ID3_COMMENT</action>
 <action>if true refresh:ID3_GENRE</action>
 <action>if true refresh:ICON_ID3_ARTIST</action>
 <action>if true refresh:ICON_ID3_TITLE</action>
 <action>if true refresh:ICON_ID3_ALBUM</action>
 <action>if true refresh:ICON_ID3_YEAR</action>
 <action>if true refresh:ICON_ID3_TRACK</action>
 <action>if true refresh:TXT_ID3_INFO</action>
 <action>if true refresh:EDIT_LYRICS</action>
 <action>if true refresh:LYRICS_SOURCE</action>
 <action>if true refresh:ALBUMART</action>
 <action>if true refresh:ALBUMART_SOURCE</action>
 <action>if true refresh:ALBUM_LIST</action>
 <action>if true refresh:ALBUM_LIST_SOURCE</action>
 <action>if true refresh:EDIT_DISCOGRAPHY</action>
 <action>if true refresh:TREE_URLS</action>
 <action>if true refresh:STREAMINFO</action>
 <action>if true echo false > '$WORKDIR'/UPDATE_TRACKINFO'${MYPID}'</action>
</checkbox>'

S='
<frame '$(gettext 'Meta tags')'>
 <hbox>
  <text width-request="124"><label>""</label></text>
  <vbox space-expand="false" space-fill="false" homogeneous="true">
   <button tooltip-text="'$(gettext 'Clear tags')'" space-expand="false" space-fill="false">
    <label>'$(gettext 'Clear tags')'</label>
    <input file stock="gtk-clear"></input>
    <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -clear_tags</action>
   </button>
  </vbox>
  <text space-expand="true" space-fill="true"><label>""</label></text>
  <button can-default="true" has-default="true" tooltip-text="'$(gettext 'After saving new meta-info, you need to click the 'Refresh' button to update info in the other tabs - Lyrics, albumart')'...">
   <label>'$(gettext 'Save tags')'</label>
   <input file stock="gtk-save"></input>
   <action>ln -sf '$APPDIR'/themes/$THEME/blank.svg $WORKDIR/trackinfo'${MYPID}'_icon_id3_artist.svg</action>
   <action>ln -sf '$APPDIR'/themes/$THEME/blank.svg $WORKDIR/trackinfo'${MYPID}'_icon_id3_title.svg</action>
   <action>ln -sf '$APPDIR'/themes/$THEME/blank.svg $WORKDIR/trackinfo'${MYPID}'_icon_id3_album.svg</action>
   <action>ln -sf '$APPDIR'/themes/$THEME/blank.svg $WORKDIR/trackinfo'${MYPID}'_icon_id3_year.svg</action>
   <action>ln -sf '$APPDIR'/themes/$THEME/blank.svg $WORKDIR/trackinfo'${MYPID}'_icon_id3_track.svg</action>
   <action>refresh:ICON_ID3_ARTIST</action>
   <action>refresh:ICON_ID3_TITLE</action>
   <action>refresh:ICON_ID3_ALBUM</action>
   <action>refresh:ICON_ID3_YEAR</action>
   <action>refresh:ICON_ID3_TRACK</action>
   <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -save_tags</action>
  </button>
 </hbox>

 <hseparator></hseparator>
 <text><label>""</label></text>
 
 <hbox>
  <vbox space-expand="true" space-fill="true">
   <hbox space-expand="true" space-fill="true">
    <text width-request="100" space-expand="false" space-fill="false"><label>'$(gettext 'Artist')'</label></text>
    <pixmap tooltip-text="'$(gettext 'The icon shows status of auto tag-search (found or searching)')'" space-expand="false" space-fill="false">
     <variable>ICON_ID3_ARTIST</variable>
     <width>20</width>
     <input file>'$WORKDIR'/trackinfo'${MYPID}'_icon_id3_artist.svg</input>
    </pixmap>
    <entry activates-default="true" primary-icon-stock="gtk-clear" space-expand="true" space-fill="true">
     <variable>ID3_ARTIST</variable>
     <input file>'$WORKDIR'/trackinfo'${MYPID}'_ID3_ARTIST</input>
     <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
     <action signal="primary-icon-release">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_ARTIST</action>
     <action signal="primary-icon-release">refresh:ID3_ARTIST</action>
    </entry>
   </hbox>
   <hbox space-expand="true" space-fill="true">
    <text width-request="100" space-expand="false" space-fill="false"><label>'$(gettext 'Title')'</label></text>
    <pixmap tooltip-text="'$(gettext 'The icon shows status of auto tag-search (found or searching)')'" space-expand="false" space-fill="false">
     <variable>ICON_ID3_TITLE</variable>
     <width>20</width>
     <input file>'$WORKDIR'/trackinfo'${MYPID}'_icon_id3_title.svg</input>
    </pixmap>
    <entry activates-default="true" primary-icon-stock="gtk-clear" space-expand="true" space-fill="true">
     <variable>ID3_TITLE</variable>
     <input file>'$WORKDIR'/trackinfo'${MYPID}'_ID3_TITLE</input>
     <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
     <action signal="primary-icon-release">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_TITLE</action>
     <action signal="primary-icon-release">refresh:ID3_TITLE</action>
    </entry>
   </hbox>
  </vbox>
  <button tooltip-text="'$(gettext 'Search for alternative meta information based on ARTIST and TITLE. The search-string does not require complete Artist/Title information, but you MUST use complete words.')'">
   <input file stock="gtk-find"></input>
   <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -search_alternatives</action>
   <action>gtkdialog -f '$WORKDIR'/xml_pmusic_trackinfo'${MYPID}'_alternativ_id3 &</action>
  </button>
 </hbox>
 
 <text><label>""</label></text>
 
 <hbox>
  <vbox space-expand="false" space-fill="false">
   <text width-request="100" space-expand="false" space-fill="false"><label>'$(gettext 'Album')'</label></text>
  </vbox>
  <vbox space-expand="true" space-fill="true">
   <hbox space-expand="true" space-fill="true">
    <pixmap space-expand="false" space-fill="false" tooltip-text="'$(gettext 'The icon shows status of auto tag-search (found or searching)')'">
     <variable>ICON_ID3_ALBUM</variable>
     <width>20</width>
     <input file>'$WORKDIR'/trackinfo'${MYPID}'_icon_id3_album.svg</input>
    </pixmap>
    <entry activates-default="true" primary-icon-stock="gtk-clear" space-expand="true" space-fill="true">
     <variable>ID3_ALBUM</variable>
     <input>cat '$WORKDIR'/trackinfo'${MYPID}'_ID3_ALBUM</input>
     <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
     <action signal="primary-icon-release">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_ALBUM</action>
     <action signal="primary-icon-release">refresh:ID3_ALBUM</action>
    </entry>
   </hbox>
   <hbox visible="false" space-expand="true" space-fill="true">
    <text width-request="20" space-expand="false" space-fill="false"><label>""</label></text>
    <tree sort-function="1" column-visible="true|true|false" hover-selection="true" space-expand="true" space-fill="true">
     <label>|'$(gettext 'Pick correct album')'|musicbrainz.org Disc-id</label>
     <variable>ID3_ALBUM_DISCOGRAPHY</variable>
     <input file>'$WORKDIR'/trackinfo'${MYPID}'_discography</input>
     <height>150</height>
     <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
     <action signal="button-release-event">cat '$WORKDIR'/trackinfo'${MYPID}'_discography | grep -F ${ID3_ALBUM_DISCOGRAPHY} | cut -d"|" -f2 > '$WORKDIR'/trackinfo'${MYPID}'_ID3_ALBUM</action>
     <action signal="button-release-event">cat '$WORKDIR'/trackinfo'${MYPID}'_discography | grep -F ${ID3_ALBUM_DISCOGRAPHY} | cut -d"|" -f1 > '$WORKDIR'/trackinfo'${MYPID}'_ID3_YEAR</action>
     <action signal="button-release-event">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_TRACK</action>
     <action signal="button-release-event">refresh:ID3_ALBUM</action>
     <action signal="button-release-event">refresh:ID3_YEAR</action>
     <action signal="button-release-event">refresh:ID3_TRACK</action>
     <action signal="button-release-event">activate:ID3_ALBUM_CHOOSER</action>
     <action signal="button-release-event">export INPUT_MB_DISC_ID=$ID3_ALBUM_DISCOGRAPHY; . '$APPDIR'/func_id3io "'$FILE'" -read</action>
     <action signal="button-release-event">. '$APPDIR'/func_trackinfo "'${MYPID}'" -save_tags</action>
    </tree>
    <variable>ID3_ALBUM_DISCOGRAPHY_HBOX</variable>
   </hbox>
  </vbox>
  <vbox space-expand="false" space-fill="false">
   <togglebutton width-request="30" space-expand="false" space-fill="false" tooltip-text="'$(gettext 'Choose album from discography')'">
    <variable>ID3_ALBUM_CHOOSER</variable>
    <label>..</label>
    <action>if false hide:ID3_ALBUM_DISCOGRAPHY_HBOX</action>
    <action>if false show:ICON_ID3_ALBUM</action>
    <action>if false show:ID3_ALBUM</action>
    <action>if true show:ID3_ALBUM_DISCOGRAPHY_HBOX</action>
    <action>if true hide:ICON_ID3_ALBUM</action>
    <action>if true hide:ID3_ALBUM</action>
   </togglebutton>
  </vbox>
 </hbox>
  
 <hbox>
  <text width-request="100"><label>'$(gettext 'Date')'</label></text>
  <pixmap tooltip-text="'$(gettext 'The icon shows status of auto tag-search (found or searching)')'">
   <variable>ICON_ID3_YEAR</variable>
   <width>20</width>
   <input file>'$WORKDIR'/trackinfo'${MYPID}'_icon_id3_year.svg</input>
  </pixmap>
  <entry activates-default="true" primary-icon-stock="gtk-clear">
   <variable>ID3_YEAR</variable>
   <input>cat '$WORKDIR'/trackinfo'${MYPID}'_ID3_YEAR</input>
   <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
   <action signal="primary-icon-release">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_YEAR</action>
   <action signal="primary-icon-release">refresh:ID3_YEAR</action>
  </entry>
  <text width-request="30"><label>""</label></text>
 </hbox>
 <hbox>
  <text width-request="100"><label>'$(gettext 'Track nr')'</label></text>
  <pixmap tooltip-text="'$(gettext 'The icon shows status of auto tag-search (found or searching)')'">
   <variable>ICON_ID3_TRACK</variable>
   <width>20</width>
   <input file>'$WORKDIR'/trackinfo'${MYPID}'_icon_id3_track.svg</input>
  </pixmap>
  <entry activates-default="true" primary-icon-stock="gtk-clear">
   <variable>ID3_TRACK</variable>
   <input>cat '$WORKDIR'/trackinfo'${MYPID}'_ID3_TRACK</input>
   <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
   <action signal="primary-icon-release">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_TRACK</action>
   <action signal="primary-icon-release">refresh:ID3_TRACK</action>
  </entry>
  <text width-request="30"><label>""</label></text>
 </hbox>
 <hbox>
  <text width-request="124"><label>'$(gettext 'Genre')'</label></text>
  <entry activates-default="true" primary-icon-stock="gtk-clear">
   <variable>ID3_GENRE</variable>
   <input>cat '$WORKDIR'/trackinfo'${MYPID}'_ID3_GENRE</input>
   <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
   <action signal="primary-icon-release">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_GENRE</action>
   <action signal="primary-icon-release">refresh:ID3_GENRE</action>
  </entry>
   <menubar width-request="30">
    <menu>
    '$ID3_GENRES'
   <label>..</label>
    </menu>
   </menubar>
 </hbox>
 <hbox>
  <text width-request="124"><label>'$(gettext 'Comment')'</label></text>
  <entry activates-default="true" primary-icon-stock="gtk-clear">
   <variable>ID3_COMMENT</variable>
   <input>cat '$WORKDIR'/trackinfo'${MYPID}'_ID3_COMMENT</input>
   <action signal="focus-in-event">'$APPDIR'/func_kill -trackinfo &</action>
   <action signal="primary-icon-release">echo "" > '$WORKDIR'/trackinfo'${MYPID}'_ID3_COMMENT</action>
   <action signal="primary-icon-release">refresh:ID3_COMMENT</action>
  </entry>
  <text width-request="30"><label>""</label></text>
 </hbox>
 <vbox space-expand="true" space-fill="true">
  <text'$WIDTH_BOX'>
   <variable>TXT_ID3_INFO</variable>
   <input>cat '$WORKDIR'/trackinfo'${MYPID}'_ID3_info</input>
  </text>
 </vbox>
</frame>'
GUI_TRACKINFO_ID3="$S"






#####      L Y R I C S      ######


S='
<frame '$(gettext 'Lyrics')'>
 <hbox>
  <entry name="lyrics_path" editable="false" progress-fraction="1">
   <variable>LYRICS_SOURCE</variable>
   <input>cat '$WORKDIR'/trackinfo'${MYPID}'_lyrics_source</input>
  </entry>
  <button tooltip-text="'$(gettext 'Edit local file')'">'
   [ $LYRICS_LOCAL = false ] && S=$S'<sensitive>false</sensitive>'
   S=$S'<input file stock="gtk-edit"></input>
   <action>if [ ! "`echo "$LYRICS_SOURCE" | grep -F "/"`" ]; then TMP="'$STORAGE_DIR'/lyrics/$ID3_ARTIST - ${ID3_TITLE}.txt"; echo -n > "$TMP"; else TMP=$LYRICS_SOURCE; fi; export GTK2_RC_FILES=$HOME/.gtkrc-2.0; '$TEXT_EDITOR' "$TMP" &</action>
  </button>
  <togglebutton tooltip-text="'$(gettext ''$(gettext 'Manually override default search order.')'')'">
   <input file stock="gtk-refresh"></input>
   <action>if true show:LYRICS_REFRESH</action>
   <action>if false hide:LYRICS_REFRESH</action>
  </togglebutton>
  <button tooltip-text="'$(gettext 'Local storage')'">
   <input file stock="gtk-preferences"></input>
   <action>'$APPDIR'/func_config -preferences -lyrics</action>
  </button>
 </hbox>
 <vbox visible="false">
  <hseparator></hseparator>
  <hbox space-expand="false" space-fill="false">
   <button space-expand="false" space-fill="false">
    <label>'$(gettext 'lyrics.wikia.com')'</label>
    <input file stock="gtk-refresh"></input>
    <action>echo "" > $WORKDIR/trackinfo${MYPID}_lyrics_source</action>
    <action>refresh:LYRICS_SOURCE</action>
    <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -lyrics_refresh lyricswiki &</action>
    <action>echo</action>
   </button>
   <button space-expand="false" space-fill="false">
    <label>'$(gettext 'elyrics.net')'</label>
    <input file stock="gtk-refresh"></input>
    <action>echo "" > $WORKDIR/trackinfo${MYPID}_lyrics_source</action>
    <action>refresh:LYRICS_SOURCE</action>
    <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -lyrics_refresh elyrics &</action>
   </button>
   <text space-expand="true" space-fill="true"><label>""</label></text>
  </hbox>
  <variable>LYRICS_REFRESH</variable>
 </vbox>
 <vbox space-expand="true" space-fill="true"> 
  <edit name="lyrics" left_margin="10" cursor-visible="false">
   <variable>EDIT_LYRICS</variable>
   <input file>'$WORKDIR'/trackinfo'${MYPID}'_lyrics</input>
  </edit>
 </vbox>
</frame>'
GUI_TRACKINFO_LYRICS="$S"






#####      A L B U M   A R T      ######


GUI_TRACKINFO_ALBUMART='
<frame '$(gettext 'Album art')'>
 <hbox>
  <entry name="albumart_path" editable="false" progress-fraction="1">
   <variable>ALBUMART_SOURCE</variable>
   <input file>'$WORKDIR'/trackinfo'${MYPID}'_albumart_source</input>
  </entry>
  <button tooltip-text="'$(gettext 'Save')'">
   <variable>ALBUMART_SAVE</variable>
   <input file stock="gtk-save"></input>
   <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -save_albumart</action>
  </button>
  <button tooltip-text="'$(gettext 'Delete embedded albumart')'">
   <variable>ALBUMART_DEL</variable>
   <input file stock="gtk-delete"></input>
   <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -del_albumart</action>
  </button>
  <togglebutton tooltip-text="'$(gettext 'Manually override default search order.')'">
   <input file stock="gtk-find_more"></input>
   <action>if true show:ALBUMART_REFRESH</action>
   <action>if false hide:ALBUMART_REFRESH</action>
  </togglebutton>
  <button tooltip-text="'$(gettext 'Local storage')'">
   <input file stock="gtk-preferences"></input>
   <action>'$APPDIR'/func_config -preferences -lyrics</action>
  </button>
 </hbox>
 <vbox visible="false">
  <hseparator></hseparator>
  <hbox space-expand="false" space-fill="false">
   <togglebutton tooltip-text="'$(gettext 'Manually search the web.')'">
    <label>'$(gettext 'www Manual')'</label>
    <input file stock="gtk-find_more"></input>
    <action>if true show:ALBUMART_WEB</action>
    <action>if false hide:ALBUMART_WEB</action>
   </togglebutton>
   <button space-expand="false" space-fill="false" tooltip-text="'$(gettext 'Use builtin albumart-grabber to find albumart on the web.')'">
    <label>'$(gettext 'www Auto')'</label>
    <input file stock="gtk-find"></input>
    <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -albumart_refresh amazon</action>
   </button>
   <button space-expand="false" space-fill="false">
    <label>'$(gettext 'Local file')'</label>
    <input file stock="gtk-open"></input>
    <action type="fileselect">ALBUMART_SOURCE</action>
    <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -albumart_refresh "$ALBUMART_SOURCE"</action>
   </button>
   <button space-expand="false" space-fill="false" tooltip-text="'$(gettext 'Check if audio file has an embedded image')'">
    <label>'$(gettext 'Embedded')'</label>
    <input file stock="gtk-find"></input>
    <action>echo " " > '$WORKDIR'/trackinfo'${MYPID}'_albumart_source</action>
    <action>refresh:ALBUMART_SOURCE</action>
    <action>'$APPDIR'/func_trackinfo "'${MYPID}'" -albumart_refresh embedded</action>
   </button>
   <text width-request="1" space-expand="true" space-fill="true"><label>""</label></text>
  </hbox>
  <variable>ALBUMART_REFRESH</variable>
 </vbox>

 <vbox visible="false">
  <hseparator></hseparator>
  <hbox space-expand="false" space-fill="false">
   <button space-expand="false" space-fill="false">
    <label>'$(gettext 'albumart.org')'</label>
    <action>'$BROWSER' http://www.albumart.org &</action>
   </button>
   <button space-expand="false" space-fill="false">
    <label>'$(gettext 'amazon.com')'</label>
    <action>'$BROWSER' http://www.amazon.com &</action>
   </button>
   <button space-expand="false" space-fill="false">
    <label>'$(gettext 'albumartexchange.com')'</label>
    <action>'$BROWSER' http://www.albumartexchange.com/ &</action>
   </button>
   <text width-request="1" space-expand="true" space-fill="true"><label>""</label></text>
  </hbox>
  <text xalign="0" space-expand="true" space-fill="true"><label>"'$(gettext 'This will point you to the chosen webpage to manually do a search for wished albumart. To let the albumart interact with pMusic db, you should save the image to')'"</label></text>
  <text selectable="true" xalign="0" use-markup="true" space-expand="true" space-fill="true"><label>"<b>'${STORAGE_DIR}'/albumart/Artist - Album.jpg</b>"</label></text>
  <variable>ALBUMART_WEB</variable>
 </vbox>



 <vbox scrollable="true" space-expand="true" space-fill="true">
  <eventbox tooltip-text="'$(gettext 'Click for full size')'" above-child="true" visible-window="true" spacing="0" space-expand="true" space-fill="true">
   <pixmap space-expand="true" space-fill="true">
    <variable>ALBUMART</variable>
    <input file>'$WORKDIR'/trackinfo'${MYPID}'_albumart.jpg</input>
    '$WIDTH_ARTWORK'
   </pixmap>
   <action signal="button-release-event">albumart_fullsize</action>
  </eventbox>
 </vbox>
</frame>'


S='
<frame '$(gettext 'Album')'>
 <hbox>
  <entry name="albumlist_path" editable="false" progress-fraction="1">
   <variable>ALBUM_LIST_SOURCE</variable>
   <input>cat '$WORKDIR'/trackinfo'${MYPID}'_album_source</input>
  </entry>
  <button tooltip-text="'$(gettext 'Edit local file')'">'
   [ $PMU_LOCAL = false ] && S=$S'<sensitive>false</sensitive>'
   S=$S'<input file stock="gtk-edit"></input>
   <action>if [ ! "`echo "$ALBUM_LIST_SOURCE" | grep -F "/"`" ]; then TMP="'$STORAGE_DIR'/pmu/${ID3_ARTIST} - ${ID3_ALBUM}.pmu"; echo -n > "$TMP"; else TMP="$ALBUM_LIST_SOURCE"; fi; export GTK2_RC_FILES=$HOME/.gtkrc-2.0; '$TEXT_EDITOR' "$TMP" &</action>
  </button>
  <button tooltip-text="'$(gettext 'Clear album list and make a new search')'">
   <input file stock="gtk-refresh"></input>
   <action signal="button-press-event">clear:ALBUM_LIST</action>
   <action>echo " " > '$WORKDIR'/trackinfo'${MYPID}'_album</action>
   <action>TMP="$ALBUM_LIST_SOURCE"; rm "$TMP"</action>
   <action>'$APPDIR'/func_kill -trackinfo</action>
   <action>. '$APPDIR'/func_trackinfo '${MYPID}' -quiet -refresh</action>
  </button>
  <button tooltip-text="'$(gettext 'Local storage')'">
   <input file stock="gtk-preferences"></input>
   <action>'$APPDIR'/func_config -preferences -lyrics</action>
  </button>
 </hbox>
 <tree rubber-banding="true" fixed-height-mode="true" selection-mode="3" exported_column="4" column-visible="false|true|true|true|false">
  <label>|'$(gettext 'Length')'|'$(gettext 'Title')'|'$(gettext 'Path')'|</label>
  <variable>ALBUM_LIST</variable>
  <input file>'$WORKDIR'/trackinfo'${MYPID}'_album</input>
  <action signal="button-press-event">if [ $PTR_BTN -eq 3 ]; then echo "$ALBUM_LIST" > '$WORKDIR'/ALBUM_LIST_PRESS_EVENT; . '$APPDIR'/menu_trackinfo_albumlist; fi</action>
  <action>TMP="`echo "$ALBUM_LIST" | cut -c 21-`"; '$APPDIR'/func_add -add "$TMP"</action>
 </tree>
</frame>'
GUI_TRACKINFO_ALBUM="$S"


GUI_TRACKINFO_ARTIST='
<frame '$(gettext 'Artist')'>
 <text use-markup="true"><label>"<b>'$(gettext 'Discography')'</b>"</label></text>
 <tree sort-function="1" column-visible="true|true|false" selection-mode="0">
  <label>'$(gettext 'Year')'|'$(gettext 'Album')'|musicbrainz.org Disc-id</label>
  <variable>EDIT_DISCOGRAPHY</variable>
  <input file>'$WORKDIR'/trackinfo'${MYPID}'_discography</input>
 </tree>
 <text use-markup="true"><label>"<b>'$(gettext 'Webpages')'</b> - '$(gettext 'doubleclick to browse')'"</label></text>
 <tree exported_column="1">
  <label>'$(gettext 'Type')'|URL</label>
  <variable>TREE_URLS</variable>
  <input>cat '$WORKDIR'/trackinfo'${MYPID}'_urls</input>
  <action>export GTK2_RC_FILES='$HOME'/.gtkrc-2.0; TMP=$TREE_URLS; '$BROWSER' $TMP &</action>
 </tree>
</frame>'


GUI_TRACKINFO_STREAM='
<frame '$(gettext 'Stream')'>
 <tree headers-visible="false" selection-mode="0">
  <label>a|b</label>
  <variable>STREAMINFO</variable>
  <input file>'$WORKDIR'/trackinfo'${MYPID}'_stream</input>
 </tree>
</frame>'

 echo '
<notebook page="'$TABNR'" labels="'$(gettext 'Tags')'|'$(gettext 'Lyrics')'|'$(gettext 'Album')'|'$(gettext 'Album art')'|'$(gettext 'Artist')'|'$(gettext 'Stream')' " space-expand="true" space-fill="true">
 '$GUI_TRACKINFO_ID3'
 '$GUI_TRACKINFO_LYRICS'
 '$GUI_TRACKINFO_ALBUM'
 '$GUI_TRACKINFO_ALBUMART'
 '$GUI_TRACKINFO_ARTIST'
 '$GUI_TRACKINFO_STREAM'
</notebook>
<vbox height-request="1" space-expand="false" space-fill="false">
 '$GUI_TRACKINFO_UPDATE'
</vbox>' > $WORKDIR/xml_pmusic_trackinfo${MYPID}
