/* Morph - DMS - Feb 2000 - by Christophe LOREK */ typeof class=S;; fun activate(o,from,cli,action,param,reply,a)= let (strfind "." action 0) -> firstDotPos in let (strfind "." action firstDotPos+1) -> secondDotPos in let (substr action 0 firstDotPos) -> current_ObName in let (substr action firstDotPos+1 secondDotPos-firstDotPos-1) -> current_SeqName in let (substr action secondDotPos+1 (strlen action)-(secondDotPos)) -> current_action in if !strcmp current_ObName (ObName o) then ( if !strcmp current_action "playonceS" then ( mutate a <- [_ 1 1 _]; UsendCli this nil (ObUi o) (strcat current_SeqName ".playonce") (ObName o); 0 ) else if !strcmp current_action "playloopS" then ( mutate a <- [_ 1 0 _]; UsendCli this nil (ObUi o) (strcat current_SeqName ".playloop") (ObName o); 0 ) else if !strcmp current_action "stopS" then ( mutate a <- [_ 0 _ _]; UsendCli this nil (ObUi o) (strcat current_SeqName ".stop") (ObName o); 0 ) else nil ) else nil;; fun cbcomm(ui,cli,action,param,anim)= let anim -> [_ playstop onceloop SeqName] in if !strcmp action "newclient" then ( if playstop then ( if onceloop then UsendCli this cli ui (strcat SeqName ".playonce") param else UsendCli this cli ui (strcat SeqName ".playloop") param; ) else UsendCli this cli ui (strcat SeqName ".stop") param; ) else nil;; fun getsequences(l)= if l == nil then nil else let l -> [paramline nl] in let paramline -> [paramname paramvalues] in if !strcmp paramname "sequence" then ( let paramvalues -> [name _] in name::(getsequences nl) ) else (getsequences nl);; fun RegisterSequenceActions(current_Ob,l,anim)= if l == nil then nil else let l -> [SeqName nl] in ( ObRegisterAction current_Ob (strcatn (ObName current_Ob)::"."::SeqName::".playonceS"::nil) mkfun7 @activate anim; ObRegisterAction current_Ob (strcatn (ObName current_Ob)::"."::SeqName::".playloopS"::nil) mkfun7 @activate anim; ObRegisterAction current_Ob (strcatn (ObName current_Ob)::"."::SeqName::".stopS"::nil) mkfun7 @activate anim; RegisterSequenceActions current_Ob nl anim; 0 );; fun RegisterActions(current_Ob,l,a)= let getsequences l -> seqlist in RegisterSequenceActions current_Ob seqlist a;; fun newOb(o)= let UgetParams ObUi o -> paramlist in let getInfo paramlist "MOLfilename" -> MOLfilename in ( _RSregister this MOLfilename 1 MOLfilename; RegisterActions o paramlist [(ObName o) 0 0 nil] ); UcbComm this ObUi o mkfun5 @cbcomm [(ObName o) 0 0 nil]; 0;; fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0;;