/* Quicktime Plugin - DMS - dec 99 - by Sylvain HUET */ /* rev April 00 - by Sebastien DENEUX */ /*to do : - pause - mute*/ var avfile="Dms/3d/Plugins/Quicktime/x.m3d";; typeof class=S;; fun destroyQT(o,z)= let z->[_ f tx movie _ _ _] in (_DSbitmap tx; _QTDestroyMovie movie); 0;; fun applytx(x,t)= match x with (objAnchor [_ m _ _] -> (M3chgMaterialTexture session m t; M3setType session m (M3getType session m)|1)) |(_->nil);; fun animQT(o,z)= let z->[_ _ tx movie txt _ _] in if _QTProcessMovie movie then (M3blitTexture16 session txt tx; apply_on_list ObAnchor o @applytx txt) else nil; 0;; fun startplay(o,param,z)= let z->[_ f tx movie _ _ _] in (if f then (_DSbitmap tx; _QTDestroyMovie movie; mutate z<-[_ 0 nil nil _ _ 0]; ObCbAnim o nil) else nil; if (strlen param)<=0 then nil else let _CRbitmap _channel 256 256 -> textureBMP in let _QTCreateStreamMovieBmp _channel param textureBMP 0 ->movie in /*let _QTCreateMovieBmp _channel _checkpack param textureBMP 0 ->movie in*/ (mutate z<-[_ 1 textureBMP movie _ 0 0]; ObCbAnim o mkfun2 @animQT z); 0);; fun play(o,from,action,param,rep,z)=startplay o param z;; fun stop(o,from,action,param,rep,z)=startplay o nil z;; /*fun mute(o,from,action,param,rep,z)= let z ->[_ _ _ movie _ m _] in if !strcmp param "1" then (_QTSetMovieVolume movie 0;0) else if !strcmp param "0" then (_QTSetMovieVolume movie 1000;0) else if m==1 then (_QTSetMovieVolume movie 1000;mutate z <- [_ _ _ _ _ 0 _];0) else (_QTSetMovieVolume movie 0;mutate z <- [_ _ _ _ _ 1 _];0);;*/ /*fun pause(o,from,action,param,rep,z)= let z ->[_ _ _ movie _ _ p] in if (!strcmp param "0") && (p==1) then (_QTPlayMovie movie;mutate z <-[_ _ _ _ _ _ 0];0) else if p==0 then (_QTStopMovie movie;mutate z <-[_ _ _ _ _ _ 1];0) else nil;; (_QTStopMovie movie;0);;*/ fun cbcomm(ui,action,param,z)= let z->[o _ _ _ _ _ _] in if !strcmp action "url" then startplay o param z else nil; 0;; fun newOb(o)= M3load session avfile nil; let M3copyMaterialTexture session M3getMat session "snapmater" -> tx in let [o 0 nil nil tx 0 0] -> z in (ObRegisterAction o strcat ObName o ".play" mkfun6 @play z; ObRegisterAction o strcat ObName o ".stop" mkfun6 @stop z; /*ObRegisterAction o strcat ObName o ".mute" mkfun6 @mute z;*/ /*ObRegisterAction o strcat ObName o ".pause" mkfun6 @pause z;*/ UcbComm this ObUi o mkfun4 @cbcomm z; UsendSrv this ObUi o "url?" nil; ObCbDestroy o mkfun2 @destroyQT z); 0;; fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0;;