#!/bin/bash

rm -f /tmp/sox*
rm -f /tmp/resample.txt

if [ "`which sox`" = "" ]; then
Xdialog --title "MESSAGE BOX" --msgbox "sox is not in your PATH, this program
will now exit.
http://www.murga-linux.com/puppy/viewtopic.php?search_id=1909976672&t=13934" 0 0
exit 0
fi

     export MAIN_DIALOG="
     <window title=\"Soxgui-0.9 \"icon-name=\"gtk-cdrom\">
      <vbox>
       <hbox>
       <frame Soxgui>
        <text>
         <label>このGUIはSOXやFFMPEGをいろいろな音声機能のために利用します。</label>
        </text>
       </frame>
       </hbox>
       
       <hbox>
        <text>
         <label>オーディオファイルの結合（マージ）</label>
        </text>
      <button>
			<input file stock=\"gtk-copy\"></input>
      <action type=\"exit\">MERGE-NOW</action>
      </button>
       </hbox>"
if [ "`which pawdioconverter`" != "" ]; then
MAIN_DIALOG="$MAIN_DIALOG
       <hbox>
        <text>
         <label>Audio format conversion</label>
        </text>
      <button>
			<input file stock=\"gtk-convert\"></input>
	<action>pawdioconverter &</action>
      </button>
       </hbox>"
fi
MAIN_DIALOG="$MAIN_DIALOG
       <hbox>
        <text>
         <label>振幅の調整 (ボリューム)</label>
        </text>
      <button>
			<input file stock=\"gtk-go-up\"></input>
      <action type=\"exit\">AMPLITUDE-NOW</action>
      </button>
       </hbox>"
if [ "`which soxmix`" != "" ]; then
MAIN_DIALOG="$MAIN_DIALOG
       <hbox>
        <text>
         <label>2つのオーディオファイルの混合</label>
        </text>
      <button>
			<input file stock=\"gtk-dnd-multiple\"></input>
      <action type=\"exit\">MIX-NOW</action>
      </button>
      </hbox>"
fi
MAIN_DIALOG="$MAIN_DIALOG
       <hbox>
        <text>
         <label>録音</label>
        </text>
      <button>
         <input file stock=\"gtk-no\"></input>
      <action type=\"exit\">RECORD-NOW</action>
      </button>
      </hbox>
       <hbox>
        <text>
         <label>オーディオファイルの再生</label>
        </text>
      <button>
         <input file stock=\"gtk-media-play\"></input>
      <action type=\"exit\">PLAY-NOW</action>
      </button>
      </hbox>
       <hbox>
        <text>
         <label>音響効果を付ける</label>
        </text>
      <button>
         <input file stock=\"gtk-edit\"></input>
      <action type=\"exit\">SOUND-EFFECTS-NOW</action>
      </button>
      </hbox>
       <hbox>
        <text>
	<label>WAVファイルにフェードをかける</label>
        </text>
      <button>
         <input file stock=\"gtk-media-forward\"></input>
      <action type=\"exit\">FADE-NOW</action>
      </button>
      </hbox>
       <hbox>
        <text>
         <label>______________________________________</label>
        </text>
       </hbox>
       <hbox>
        <button>
         <label>ヘルプ</label>
         <input file stock=\"gtk-help\"></input>
      <action>defaulthtmlviewer  /usr/local/apps/Soxgui/soxguihelp.htm & </action>
        </button>
      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>
       </hbox>
      </vbox>
      </window>
"
      
MAIN_DIALOG="`gtkdialog3 --program=MAIN_DIALOG --center`"

if [ "`echo "$MAIN_DIALOG" | grep EXIT-NOW`" != "" ]; then
echo Quit button pushed
exit 0
fi

echo 44100 > /tmp/resample.txt
echo 48000 >> /tmp/resample.txt
echo 8000 >> /tmp/resample.txt
echo 22050 >> /tmp/resample.txt
echo 32000 >> /tmp/resample.txt

echo wav > /tmp/soxtype.txt
echo 8svx >> /tmp/soxtype.txt
echo ac3 >> /tmp/soxtype.txt
echo aiff >> /tmp/soxtype.txt
echo al >> /tmp/soxtype.txt
echo alsa >> /tmp/soxtype.txt
echo au >> /tmp/soxtype.txt
echo auto >> /tmp/soxtype.txt
echo avr >> /tmp/soxtype.txt
echo cdr >> /tmp/soxtype.txt
echo cvs >> /tmp/soxtype.txt
echo dat >> /tmp/soxtype.txt
# echo flac >> /tmp/soxtype.txt ## supported in newer versions of ffmpeg
echo gsm >> /tmp/soxtype.txt
echo hcom >> /tmp/soxtype.txt
echo la >> /tmp/soxtype.txt
echo lu >> /tmp/soxtype.txt
echo m4a >> /tmp/soxtype.txt  ### apple lossless audio codec
echo maud >> /tmp/soxtype.txt
echo mp2 >> /tmp/soxtype.txt
echo mp3 >> /tmp/soxtype.txt
#echo nul >> /tmp/soxtype.txt
echo ogg >> /tmp/soxtype.txt
#echo ossdsp >> /tmp/soxtype.txt
echo prc >> /tmp/soxtype.txt
echo ra >> /tmp/soxtype.txt
echo raw >> /tmp/soxtype.txt
echo sb >> /tmp/soxtype.txt
echo sf >> /tmp/soxtype.txt
echo shn >> /tmp/soxtype.txt
echo sl >> /tmp/soxtype.txt
echo smp >> /tmp/soxtype.txt
echo sndt >> /tmp/soxtype.txt
echo sph >> /tmp/soxtype.txt
echo sw >> /tmp/soxtype.txt
#echo tta >> /tmp/soxtype.txt ##supported in newer version ffmpeg (true type audio)
echo txw >> /tmp/soxtype.txt
echo ub >> /tmp/soxtype.txt
echo ul >> /tmp/soxtype.txt
echo uw >> /tmp/soxtype.txt
echo vms >> /tmp/soxtype.txt
echo voc >> /tmp/soxtype.txt
echo vorbis >> /tmp/soxtype.txt
echo vox >> /tmp/soxtype.txt
echo wma >> /tmp/soxtype.txt
#echo wv >> /tmp/soxtype.txt ##supported in newer version ffmpeg (wavpack)
echo wve >> /tmp/soxtype.txt

if [ "`echo "$MAIN_DIALOG" | grep PLAY-NOW`" != "" ]; then
cat /tmp/soxtype.txt | grep -v flac | grep -v shn | grep -v wv | grep -v tta | grep -v m4a | grep -v wma | grep -v ac3 | grep -v mp2 | grep -v ra > /tmp/soxtype.txt
else
cat /tmp/soxtype.txt | grep -v flac | grep -v shn | grep -v wv | grep -v tta | grep -v m4a | grep -v wma | grep -v ac3 | grep -v mp2 | grep -v mp3 | grep -v ra > /tmp/soxtype.txt
fi
echo raw >> /tmp/soxtype.txt
echo wve >> /tmp/soxtype.txt
if [ "`echo "$MAIN_DIALOG" | grep MERGE-NOW`" != "" ]; then
if [ "`which mp3wrap`" != "" ]; then
echo mp3 >> /tmp/soxtype.txt
fi
fi

cat /tmp/soxtype.txt | sort -u > /tmp/soxtype.txt

KHZ=""
for RESAMPLE in `cat /tmp/resample.txt`
do
 KHZ="$KHZ<item>$RESAMPLE</item>"
done

TYPE=""
for TYPES in `cat /tmp/soxtype.txt`
do
 TYPE="$TYPE<item>$TYPES</item>"
done

cd /

if [ "`echo "$MAIN_DIALOG" | grep AMPLITUDE-NOW`" != "" ]; then

export SOXGUI="
<window title=\"Soxgui \"icon-name=\"gtk-cdrom\">
<hbox>
<vbox>
    
    <frame どちらか１つを選択して下さい>
	<frame ファイルのディレクトリとオーディオタイプの選択>
	<hbox>
      <entry accept=\"directory\">
        <label>Select a Directory</label>
        <variable>DIRENTRY</variable>
      </entry>
      <button>
        <input file stock=\"gtk-open\"></input>
        <variable>FILE_BROWSE_DIRECTORY</variable>
        <action type=\"fileselect\">DIRENTRY</action>
      </button>
  </hbox>
	<hbox>
    <combobox>
     <variable>TYPECOMBO</variable>
      $TYPE
    </combobox>
    </hbox>
  </frame>
	<frame あるいは1ファイルだけ選択>
    <hbox>
      <entry accept=\"filename\">
        <label>Select an Existing File</label>
        <variable>ENTRY1</variable>
      </entry>
      <button>
        <input file stock=\"gtk-file\"></input>
        <variable>FILE_BROWSE_FILENAME</variable>
        <action type=\"fileselect\">ENTRY1</action>
      </button>
    </hbox>
  </frame>
  </frame>
      
    <checkbox>
      <label>同じディレクトリに出力する</label>
      <variable>CHECKBOX</variable>
      <default>true</default>
    </checkbox>

	<frame 振幅>
    <frame 変形前に選択ファイルを最大に調整する>
    <hbox>
      <button>
       <input file stock=\"gtk-execute\"></input>
        <label>調整</label>
	<action>touch /tmp/soxvolumemax.txt</action>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      </button>
    </hbox>
    </frame>
	
    <frame あるいは自分で調整レートを入れる>
	<hbox>
      <entry>
        <variable>ENTRY2</variable>
      </entry>
      <button>
       <input file stock=\"gtk-execute\"></input>
        <label>調整</label>
	<action>touch /tmp/soxvolume.txt</action>
	<action>touch /tmp/soxvolumemax.txt</action>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      </button>
    </hbox>
    </frame>
    </frame>
    
	<frame 終了とヘルプ>
  <hbox>     

    <button>
       <input file stock=\"gtk-cdrom\"></input>
      <label>Soxgui</label>
      <action>soxgui &</action>
      <action type=\"exit\">Exit by button</action>
    </button>
    
    <button>
      <input file stock=\"gtk-help\"></input>
      <label>ヘルプ</label>
      <action>defaulthtmlviewer /usr/local/apps/Soxgui/soxguihelp.htm &</action>
    </button>

      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>

  </hbox>

</frame>
</vbox>
</hbox>
</window>
"

SOXGUI="`gtkdialog3 --program=SOXGUI --center`"

fi

if [ "`echo "$MAIN_DIALOG" | grep MERGE-NOW`" != "" ]; then

export SOXGUI="
<window title=\"Soxgui \"icon-name=\"gtk-cdrom\">
<hbox>
<vbox>
    
	<frame 編集したいディレクトリの選択>
	<hbox>
      <entry accept=\"directory\">
        <label>Select a Directory</label>
        <variable>ENTRY1</variable>
      </entry>
      <button>
        <input file stock=\"gtk-open\"></input>
        <variable>FILE_BROWSE_DIRECTORY</variable>
        <action type=\"fileselect\">ENTRY1</action>
      </button>
  </hbox>
  </frame>
    
    <frame 選択したディレクトリのオーディオタイプの選択>
    <hbox>
    <combobox>
     <variable>TYPECOMBO</variable>
      $TYPE
    </combobox>
    </hbox>
    </frame>

    <frame 選択したディレクトリ内の全選択ファイルの結合（マージ）>
    <hbox>
    <checkbox>
      <label>同じディレクトリに出力</label>
      <variable>CHECKBOX</variable>
      <default>true</default>
    </checkbox>
      <button>
       <input file stock=\"gtk-copy\"></input>
        <label>マージ</label>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      <action>refresh:INFO</action>
      </button>
    </hbox>
    </frame>

	<frame 終了とヘルプ>
  <hbox>     

    <button>
       <input file stock=\"gtk-cdrom\"></input>
      <label>Soxgui</label>
      <action>soxgui &</action>
      <action type=\"exit\">Exit by button</action>
    </button>
    
    <button>
      <input file stock=\"gtk-help\"></input>
      <label>ヘルプ</label>
      <action>defaulthtmlviewer /usr/local/apps/Soxgui/soxguihelp.htm &</action>
    </button>

      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>

  </hbox>

</frame>
</vbox>
</hbox>
</window>
"

SOXGUI="`gtkdialog3 --program=SOXGUI --center`"

fi

if [ "`echo "$MAIN_DIALOG" | grep MIX-NOW`" != "" ]; then

export SOXGUI="
<window title=\"Soxgui \"icon-name=\"gtk-cdrom\">
<hbox>
<vbox>
    
	<frame ミックスしたい最初のファイルの選択>
    <hbox>
      <entry accept=\"filename\">
        <label>Select an Existing File</label>
        <variable>ENTRY1</variable>
      </entry>
      <button>
        <input file stock=\"gtk-file\"></input>
        <variable>FILE_BROWSE_FILENAME</variable>
        <action type=\"fileselect\">ENTRY1</action>
      </button>
    </hbox>
  </frame>
  
	<frame ミックスしたい2番目のファイルの選択>
    <hbox>
      <entry accept=\"filename\">
        <label>Select an Existing File</label>
        <variable>ENTRY2</variable>
      </entry>
      <button>
        <input file stock=\"gtk-file\"></input>
        <variable>FILE_BROWSE_FILENAME</variable>
        <action type=\"fileselect\">ENTRY2</action>
      </button>
    </hbox>
  </frame>
  
    <hbox>
    <checkbox>
      <label>Entry 1と同じディレクトリに出力</label>
      <variable>CHECKBOX</variable>
      <default>true</default>
    </checkbox>
      <button>
       <input file stock=\"gtk-dnd-multiple\"></input>
        <label>ミックス</label>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      </button>
    </hbox>

	<frame 終了とヘルプ>
  <hbox>     

    <button>
       <input file stock=\"gtk-cdrom\"></input>
      <label>Soxgui</label>
      <action>soxgui &</action>
      <action type=\"exit\">Exit by button</action>
    </button>
    
    <button>
      <input file stock=\"gtk-help\"></input>
      <label>ヘルプ</label>
      <action>defaulthtmlviewer /usr/local/apps/Soxgui/soxguihelp.htm &</action>
    </button>

      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>

  </hbox>

</frame>
</vbox>
</hbox>
</window>
"

SOXGUI="`gtkdialog3 --program=SOXGUI --center`"

fi

if [ "`echo "$MAIN_DIALOG" | grep RECORD-NOW`" != "" ]; then

export SOXGUI="
<window title=\"Soxgui \"icon-name=\"gtk-cdrom\">
<hbox>
<vbox>
    
	<frame 出力ディレクトリの選択>
	<hbox>
      <entry accept=\"directory\">
        <label>Select a Directory</label>
        <variable>ENTRY1</variable>
      </entry>
      <button>
        <input file stock=\"gtk-open\"></input>
        <variable>FILE_BROWSE_DIRECTORY</variable>
        <action type=\"fileselect\">ENTRY1</action>
      </button>
  </hbox>
  </frame>
    
    <frame 出力するオーディオのタイプを選択>
    <hbox>
    <combobox>
     <variable>TYPECOMBO</variable>
      $TYPE
    </combobox>
    </hbox>
    </frame>
    
    <frame 出力レートの選択(Hz)>
    <hbox>
    <combobox>
     <variable>KHZCOMBO</variable>
      $KHZ
    </combobox>
    </hbox>
    </frame>
    
    <frame ステレオ又はモノラル出力>
  <hbox>
    <radiobutton active=\"true\">
      <label>ステレオ</label>
      <variable>RADIOBUTTON1</variable>
    </radiobutton>
    
    <radiobutton active=\"false\">
      <label>モノラル</label>
      <variable>RADIOBUTTON2</variable>
    </radiobutton>
	</hbox>
  </frame>
  
       <hbox>
      <text><label>ファイルの入力名</label></text>
      <entry>
    <variable>ENTRY2</variable>
      </entry>
    </hbox>

	<frame 録音の開始と停止>
    <hbox>
      <button>
       <input file stock=\"gtk-no\"></input>
        <label>録音</label>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      </button>
      <button>
       <input file stock=\"gtk-stop\"></input>
        <label>停止</label>
	<action>/usr/local/apps/Soxgui/soxexec -kill &</action>
      </button>
    </hbox>
    </frame>

	<frame 終了とヘルプ>
  <hbox>     

    <button>
       <input file stock=\"gtk-cdrom\"></input>
      <label>Soxgui</label>
      <action>soxgui &</action>
      <action type=\"exit\">Exit by button</action>
    </button>
    
    <button>
      <input file stock=\"gtk-help\"></input>
      <label>ヘルプ</label>
      <action>defaulthtmlviewer /usr/local/apps/Soxgui/soxguihelp.htm &</action>
    </button>

      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>

  </hbox>

</frame>
</vbox>
</hbox>
</window>
"

SOXGUI="`gtkdialog3 --program=SOXGUI --center`"

fi

if [ "`echo "$MAIN_DIALOG" | grep PLAY-NOW`" != "" ]; then

export SOXGUI="
<window title=\"Soxgui \"icon-name=\"gtk-cdrom\">
<hbox>
<vbox>

    <frame どちらか１つを選択して下さい>
	<frame 再生するファイルのディレクトリとオーディオタイプの選択>
	<hbox>
      <entry accept=\"directory\">
        <label>Select a Directory</label>
        <variable>DIRENTRY</variable>
      </entry>
      <button>
        <input file stock=\"gtk-open\"></input>
        <variable>FILE_BROWSE_DIRECTORY</variable>
        <action type=\"fileselect\">DIRENTRY</action>
      </button>
  </hbox>
	<hbox>
    <combobox>
     <variable>TYPECOMBO</variable>
      $TYPE
    </combobox>
    </hbox>
  </frame>
	<frame あるいは再生する1ファイルを選択>
    <hbox>
      <entry accept=\"filename\">
        <label>Select an Existing File</label>
        <variable>ENTRY1</variable>
      </entry>
      <button>
        <input file stock=\"gtk-file\"></input>
        <variable>FILE_BROWSE_FILENAME</variable>
        <action type=\"fileselect\">ENTRY1</action>
      </button>
    </hbox>
  </frame>
  </frame>

	<frame 再生の開始と停止>
    <hbox>
      <button>
       <input file stock=\"gtk-media-play\"></input>
        <label>再生</label>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      </button>
      <button>
       <input file stock=\"gtk-stop\"></input>
        <label>停止</label>
	<action>/usr/local/apps/Soxgui/soxexec -kill2 &</action>
      </button>
    </hbox>
    </frame>

	<frame 終了とヘルプ>
  <hbox>     

    <button>
       <input file stock=\"gtk-cdrom\"></input>
      <label>Soxgui</label>
      <action>soxgui &</action>
      <action type=\"exit\">Exit by button</action>
    </button>
    
    <button>
      <input file stock=\"gtk-help\"></input>
      <label>ヘルプ</label>
      <action>defaulthtmlviewer /usr/local/apps/Soxgui/soxguihelp.htm &</action>
    </button>

      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>

  </hbox>

</frame>
</vbox>
</hbox>
</window>
"

SOXGUI="`gtkdialog3 --program=SOXGUI --center`"

fi

if [ "`echo "$MAIN_DIALOG" | grep SOUND-EFFECTS-NOW`" != "" ]; then
echo chorus > /tmp/soxtype2.txt
echo echo >> /tmp/soxtype2.txt
echo flange >> /tmp/soxtype2.txt
echo phase >> /tmp/soxtype2.txt
echo reverb >> /tmp/soxtype2.txt
echo reverse >> /tmp/soxtype2.txt
echo vibro-champ >> /tmp/soxtype2.txt

TYPE2=""
for TYPES2 in `cat /tmp/soxtype2.txt`
do
 TYPE2="$TYPE2<item>$TYPES2</item>"
done

export SOXGUI="
<window title=\"Soxgui \"icon-name=\"gtk-cdrom\">
<hbox>
<vbox>
    
    <frame どちらか1つを選択して下さい>
	<frame ファイルのディレクトリとオーディオタイプ>
	<hbox>
      <entry accept=\"directory\">
        <label>Select a Directory</label>
        <variable>DIRENTRY</variable>
      </entry>
      <button>
        <input file stock=\"gtk-open\"></input>
        <variable>FILE_BROWSE_DIRECTORY</variable>
        <action type=\"fileselect\">DIRENTRY</action>
      </button>
  </hbox>
	<hbox>
    <combobox>
     <variable>TYPECOMBO</variable>
      $TYPE
    </combobox>
    </hbox>
  </frame>
	<frame あるいは1ファイルを選択>
    <hbox>
      <entry accept=\"filename\">
        <label>Select an Existing File</label>
        <variable>ENTRY1</variable>
      </entry>
      <button>
        <input file stock=\"gtk-file\"></input>
        <variable>FILE_BROWSE_FILENAME</variable>
        <action type=\"fileselect\">ENTRY1</action>
      </button>
    </hbox>
  </frame>
  </frame>

    <frame 効果のタイプを選択>
    <hbox>
    <combobox>
     <variable>TYPECOMBO2</variable>
      $TYPE2
    </combobox>
    </hbox>
    </frame>
	
    <frame 変換>
    <hbox>
    <checkbox>
      <label>同じディレクトリに出力</label>
      <variable>CHECKBOX</variable>
      <default>true</default>
    </checkbox>
      <button>
       <input file stock=\"gtk-convert\"></input>
        <label>変換</label>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      </button>
    </hbox>
    </frame>

	<frame 終了とヘルプ>
  <hbox> 

    <button>
       <input file stock=\"gtk-cdrom\"></input>
      <label>Soxgui</label>
      <action>soxgui &</action>
      <action type=\"exit\">Exit by button</action>
    </button>
    
    <button>
      <input file stock=\"gtk-help\"></input>
      <label>ヘルプ</label>
      <action>defaulthtmlviewer /usr/local/apps/Soxgui/soxguihelp.htm &</action>
    </button>

      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>

  </hbox>

</frame>
</vbox>
</hbox>
</window>
"

SOXGUI="`gtkdialog3 --program=SOXGUI --center`"

fi

if [ "`echo "$MAIN_DIALOG" | grep FADE-NOW`" != "" ]; then

export SOXGUI="
<window title=\"Soxgui \"icon-name=\"gtk-cdrom\">
<hbox>
<vbox>
    
	<frame 編集したいWAVファイルの選択>
    <hbox>
      <entry accept=\"filename\">
        <label>Select an Existing File</label>
        <variable>ENTRY1</variable>
      </entry>
      <button>
        <input file stock=\"gtk-file\"></input>
        <variable>FILE_BROWSE_FILENAME</variable>
        <action type=\"fileselect\">ENTRY1</action>
      </button>
    </hbox>
  </frame>
  
	<frame 何もしなければ、0か空白のままにして下さい>
    <hbox>
    <vbox>
      <text><label>フェードイン(秒)</label></text>
      <entry>
        <variable>FADEIN</variable>
		<action>refresh:FADEIN</action>
      </entry>
      </vbox>

		<vbox>
      <text><label>フェードアウト(秒)</label></text>
      <entry>
        <variable>FADEOUT</variable>
      <action>refresh:FADEOUT</action>
      </entry>
      </vbox>
      </hbox>
      </frame>
      
    <frame 線形または標準フェード?>
  <hbox>
    <radiobutton active=\"true\">
      <label>線形</label>
      <variable>RADIOBUTTON1</variable>
    </radiobutton>
    
    <radiobutton active=\"false\">
      <label>標準</label>
      <variable>RADIOBUTTON2</variable>
    </radiobutton>
	</hbox>
  </frame>
	
    <frame フェードの適用>
    <hbox>
    <checkbox>
      <label>同じディレクトリに出力</label>
      <variable>CHECKBOX</variable>
      <default>true</default>
    </checkbox>
      <button>
       <input file stock=\"gtk-media-forward\"></input>
        <label>適用</label>
	<action>/usr/local/apps/Soxgui/soxexec &</action>
      <action>refresh:INFO</action>
      </button>
    </hbox>
    </frame>

	<frame 終了とヘルプ>
  <hbox>     

    <button>
       <input file stock=\"gtk-cdrom\"></input>
      <label>Soxgui</label>
      <action>soxgui &</action>
      <action type=\"exit\">Exit by button</action>
    </button>
    
    <button>
      <input file stock=\"gtk-help\"></input>
      <label>ヘルプ</label>
      <action>defaulthtmlviewer /usr/local/apps/Soxgui/soxguihelp.htm &</action>
    </button>

      <button>
			<input file stock=\"gtk-quit\"></input>
        <label>終了</label>
        <action type=\"exit\">EXIT-NOW</action>
      </button>

  </hbox>

</frame>
</vbox>
</hbox>
</window>
"

SOXGUI="`gtkdialog3 --program=SOXGUI --center`"

fi

rm -f /tmp/sox*
rm -f /tmp/resample.txt

if [ "`echo "$SOXGUI" | grep EXIT-NOW`" != "" ]; then
echo Quit button pushed
exit 0
fi

exit 0
