{ helper application to control Cactus Jukebox from external scripts currently only loading/appending files is implemented. in future this can also control start/stop/next/... which makes it easy to interface Cactus Jukebox by LIRC written by Sebastian Kraft, 2006 Contact the author at: sebastian_kraft@gmx.de This Software is published under the GPL } program cactus_remote; {$mode objfpc}{$H+} uses SimpleIPC, Sysutils, dos; {$i cactus_const.inc} var CactusIPC: TSimpleIPCClient; FileName,tmps, WorkingDir: String; tchar, tchar2: Char; i, ActionID: byte; invalid_param, extd_command: boolean; begin WorkingDir:= ExtractFilePath(Paramstr(0)); if paramcount > 0 then begin tmps:= paramstr(1); tchar:=tmps[2]; if length(paramstr(1))>=3 then tchar2:=tmps[3]; invalid_param:=false; extd_command:=false; case tchar of 'o' : begin ActionID:=OPEN_FILE; extd_command:=true; end; 'e' : begin ActionID:=ENQUEU_FILE; extd_command:=true; end; 'n' : begin ActionID:=OPEN_AS_NEXT; extd_command:=true; end; 'v' : if tchar2='u' then ActionID:=VOLUME_UP else ActionID:=VOLUME_DOWN; 'p' : begin case tchar2 of 'n' : ActionID:=NEXT_TRACK; 's' : ActionID:=START_PLAYING; 'x' : ActionID:=STOP_PLAYING; 'p' : ActionID:=PREV_TRACK; 'b' : ActionID:=PAUSE_PLAYING; end; end; else invalid_param:=true; end end else invalid_param:=true; if invalid_param then begin writeln('Cactus Remote is a tool to control Cactus Jukebox from external programs, scripts...'); writeln('cactus_remote