/* Sound Dialog Editor - DMS2 - January 00 - by Sébastien DENEUX*/ /* Rev May 2000 by Vincent BEAUDENON*/ var openBmpFile = "Dms/3d/plugins/sounddialog/open.bmp";; typeof plugin=S;; typeof class=S;; typeof ed = PluginEditor;; typeof Period=ObjText;; typeof DMsphere=ObjText;; typeof AutoStart=ObjCheck;; typeof RecOn=ObjText;; typeof RecOff=ObjText;; typeof PlayOn=ObjText;; typeof PlayOff=ObjText;; typeof PlayMute=ObjText;; fun InstName(UI)=UI.nameInst;; fun InstParam(UI)=UI.paramInst;; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; /*----------------*/ fun suppactions(l)= if l == nil then nil else let l -> [UI nl] in let (InstName UI) -> name in ("actionC"::(strcatn name::".on"::nil)::nil):: ("actionC"::(strcatn name::".off"::nil)::nil):: ("actionC"::(strcatn name::".enableRec"::nil)::nil):: ("actionC"::(strcatn name::".disableRec"::nil)::nil):: ("actionC"::(strcatn name::".IgnoreFlag"::nil)::nil):: ("actionC"::(strcatn name::".IgnLogout"::nil)::nil):: ("eventC"::(strcatn name::".clickOn"::nil)::nil):: ("eventC"::(strcatn name::".clickOff"::nil)::nil):: (suppactions nl);; /*----------------*/ fun suppregister(l)= if l == nil then nil else let l -> [UI nl] in let strextr (InstParam UI) -> param in let getInfo param "bmpon" -> bmpon in let getInfo param "bmpoff" -> bmpoff in let getInfo param "bmppon" -> bmppon in let getInfo param "bmppoff" -> bmppoff in let getInfo param "bmppmute" -> bmppmute in (bmpon)::(bmpoff)::(bmppon)::(bmppoff)::(bmppmute)::(suppregister nl);; fun _rflOpen(o,T,Pa)=let _PtoScol Pa -> s in if s==nil then nil else _SETtext T _PtoScol Pa;; fun _rflButton(b,T)= _DLGrflopen _DLGOpenFile _channel ed.PluginEditorEditWin nil nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG;*.JPEG\0\0" @_rflOpen T;; fun openedit(win,param)= let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in let _LDbitmap _channel _checkpack openBmpFile -> openBmp in ( set ed = startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class; _CRtext _channel ed.PluginEditorEditWin 5 5 110 20 ET_ALIGN_LEFT+ET_NUMBER "Refresh period :"; set Period = _CReditLine _channel ed.PluginEditorEditWin 120 5 w-120 20 ET_ALIGN_LEFT|ET_DOWN let getInfo l "Period" -> s in if (strlen s)<1 then "500" else s; _CRtext _channel ed.PluginEditorEditWin 5 35 110 20 ET_ALIGN_LEFT+ET_NUMBER "Sphere radius :"; set DMsphere = _CReditLine _channel ed.PluginEditorEditWin 120 35 w-120 20 ET_ALIGN_LEFT|ET_DOWN let getInfo l "DMsphere"-> s in if (strlen s)<1 then "1000" else s; _CRtext _channel ed.PluginEditorEditWin 5 65 110 20 ET_ALIGN_LEFT "Auto Start :"; set AutoStart = _CRcheck _channel ed.PluginEditorEditWin 120 65 w-120 20 0 ""; _SETcheck AutoStart let atoi getInfo l "autoStart" -> s in if s==nil then 0 else s; _CRtext _channel ed.PluginEditorEditWin 5 95 110 20 ET_ALIGN_LEFT "Record On :"; set RecOn = _CReditLine _channel ed.PluginEditorEditWin 120 95 w-160 20 ET_ALIGN_LEFT|ET_DOWN let getInfo l "bmpon" -> s in if (strlen s)<1 then "Dms/3d/plugins/SoundDialog/recon.bmp" else s; _CRtext _channel ed.PluginEditorEditWin 5 125 110 20 ET_ALIGN_LEFT "Record Off :"; set RecOff = _CReditLine _channel ed.PluginEditorEditWin 120 125 w-160 20 ET_ALIGN_LEFT|ET_DOWN let getInfo l "bmpoff" -> s in if (strlen s)<1 then "Dms/3d/plugins/SoundDialog/recoff.bmp" else s; _CRtext _channel ed.PluginEditorEditWin 5 155 110 20 ET_ALIGN_LEFT "Play On :"; set PlayOn = _CReditLine _channel ed.PluginEditorEditWin 120 155 w-160 20 ET_ALIGN_LEFT|ET_DOWN let getInfo l "bmppon" -> s in if (strlen s)<1 then "Dms/3d/plugins/SoundDialog/playon.bmp" else s; _CRtext _channel ed.PluginEditorEditWin 5 185 110 20 ET_ALIGN_LEFT "Play Off :"; set PlayOff = _CReditLine _channel ed.PluginEditorEditWin 120 185 w-160 20 ET_ALIGN_LEFT|ET_DOWN let getInfo l "bmppoff" -> s in if (strlen s)<1 then "Dms/3d/plugins/SoundDialog/playoff.bmp" else s; _CRtext _channel ed.PluginEditorEditWin 5 215 110 20 ET_ALIGN_LEFT "Play Mute :"; set PlayMute = _CReditLine _channel ed.PluginEditorEditWin 120 215 w-160 20 ET_ALIGN_LEFT|ET_DOWN let getInfo l "bmppmute" -> s in if (strlen s)<1 then "Dms/3d/plugins/SoundDialog/playmute.bmp" else s; _CBbutton _CRbuttonBitmap _channel ed.PluginEditorEditWin openBmp w-30 95 20 20 0 @_rflButton RecOn; _CBbutton _CRbuttonBitmap _channel ed.PluginEditorEditWin openBmp w-30 125 20 20 0 @_rflButton RecOff; _CBbutton _CRbuttonBitmap _channel ed.PluginEditorEditWin openBmp w-30 155 20 20 0 @_rflButton PlayOn; _CBbutton _CRbuttonBitmap _channel ed.PluginEditorEditWin openBmp w-30 185 20 20 0 @_rflButton PlayOff; _CBbutton _CRbuttonBitmap _channel ed.PluginEditorEditWin openBmp w-30 215 20 20 0 @_rflButton PlayMute; 0 );; fun closeedit()= strbuild ("Period"::(_GETtext Period)::nil):: ("DMsphere"::(_GETtext DMsphere)::nil):: ("autoStart"::(itoa _GETcheck AutoStart)::nil):: ("bmpon"::(_GETtext RecOn)::nil):: ("bmpoff"::(_GETtext RecOff)::nil):: ("bmppon"::(_GETtext PlayOn)::nil):: ("bmppoff"::(_GETtext PlayOff)::nil):: ("bmppmute"::(_GETtext PlayMute)::nil):: nil;; /*----------------*/ fun save(l)= if (sizelist l) <= 1 then nil else ( _DLGMessageBox _channel nil "Warning" "You can only use one instance of the SoundDialog.\nOnly the instance created first will be executed \n(the instance of ChatLimiter that is the closest to\n the end of the list).\nOther instances will be ignored." 0; [nil nil nil nil] ); if l==nil then [nil nil nil nil] else let l -> [UI nl] in let (InstName UI) -> name in ( [ nil /* registerF */ suppregister l /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ ("zoneC"::(strcatn name::".ButtonRec"::nil)::nil):: ("zoneC"::(strcatn name::".ButtonPlay"::nil)::nil):: ("zoneC"::(strcatn name::".Info"::nil)::nil)::(suppactions (endlist l (sizelist l)-1)) /* supplemental Dmi */ ] );; /*----------------*/ fun IniPlug(file)= set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit;;