/* Trajectory - DMS2 Jun 99 - by Christophe LOREK */ typeof class=S;; fun activate(o,from,cli,action,param,reply,a)= if !strcmp action (strcat (ObName o) ".playonceS") then (mutate a <- [_ 1 1]; UsendCli this nil (ObUi o) "playonce" (ObName o); 0) else if !strcmp action (strcat (ObName o) ".playloopS") then (mutate a <- [_ 1 0]; UsendCli this nil (ObUi o) "playloop" (ObName o); 0) else if !strcmp action (strcat (ObName o) ".stopS") then (mutate a <- [_ 0 _]; UsendCli this nil (ObUi o) "stop" (ObName o); 0) else nil;; fun cbcomm(ui,cli,action,param,a)= if !strcmp action "newclient" then ( let a -> [_ playstop onceloop] in if playstop then ( if onceloop then UsendCli this cli ui "playonce" param else UsendCli this cli ui "playloop" param; ) else UsendCli this cli ui "stop" param; ) else nil;; fun newOb(o)= UcbComm this ObUi o mkfun5 @cbcomm [(ObName o) 0 0]; ObRegisterAction o (strcatn (ObName o)::".playonceS"::nil) mkfun7 @activate [(ObName o) 0 0]; ObRegisterAction o (strcatn (ObName o)::".playloopS"::nil) mkfun7 @activate [(ObName o) 0 0]; ObRegisterAction o (strcatn (ObName o)::".stopS"::nil) mkfun7 @activate [(ObName o) 0 0]; 0;; fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0;;