#include "songedit_tools.au3"
if ($CmdLine[0]<3) then
   msgbox(0,"","Usage: "&@scriptname&" SongEdit.exe_path songlist.qb_path [replace|shrink] [songname] info.txt_path")
   exit
EndIf

$songedit = $CmdLine[1]
$qbpath = $CmdLine[2]
$action = $CmdLine[3]
$gui = "GH3-Wii Songlist Editor v0.1"

if (($action<>"replace")  and ($action<>"shrink")) then
   MsgBox(0,"","Action must be either replace or shrink")
   exit
EndIf

if ($action=="replace" and ($CmdLine[0]<>5)) then
   msgbox(0,"","Usage: "&@scriptname&" trucha.exe_path iso_path [replace] [songname] info.txt_path")
   exit
elseif ($action=="replace") then
	$song = $CmdLine[4]
	$file = $CmdLine[5]
EndIf

_SongEdit_init( $songedit, $gui, $qbpath)

Select 
   Case $action=="replace"
      _Replace($file,$song,$gui)     
   Case $action=="shrink"
      _Shrink($gui)
   Case Else
      msgbox(0,"","Unkown action")
EndSelect
  
Sleep(1000)
WinClose($gui)
Sleep(1000)
Exit