/* 3DSound Plugin Editor - DMS - Jun 99 - by Sébastien DENEUX */ /* rev june 2000 by Vincent BEAUDENON */ var openBmp = "dms/3d/plugins/3dSound/open.bmp";; typeof plugin=S;; typeof class=S;; typeof ed = PluginEditor;; typeof WavFileName=ObjText;; typeof Volume=ObjText;; typeof Pan=ObjText;; typeof Frequency=ObjText;; typeof MinDistance=ObjText;; typeof MaxDistance=ObjText;; typeof Velocity=ObjText;; typeof Loop=ObjCheck;; typeof AutoStart=ObjCheck;; typeof Streaming=ObjCheck;; typeof B2D=ObjCheck;; typeof B3D=ObjCheck;; 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]];; var nbInst=0;; 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 "wav (*.wav)\0*.WAV\0\0" @_rflOpen T;; fun openedit(win,param)= let strextr param -> l in let getInfo l "wavFileName" -> wfn in let getInfo l "volume" -> vol in let getInfo l "pan" -> pan in let getInfo l "frequency" -> freq in let getInfo l "minDistance" -> mind in let getInfo l "maxDistance" -> maxd in let getInfo l "velocity" -> velo in let getInfo l "loop" -> loop in let getInfo l "autoStart" -> auto in let getInfo l "streaming" -> stre in let getInfo l "bufferType" -> buff in let _GETwindowSizePosition win -> [w h x y] 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_RIGHT ".wav File name :"; _CRtext _channel ed.PluginEditorEditWin 5 35 110 20 ET_ALIGN_RIGHT "Volume :"; _CRtext _channel ed.PluginEditorEditWin 5 65 110 20 ET_ALIGN_RIGHT ".Pan :"; _CRtext _channel ed.PluginEditorEditWin 5 95 110 20 ET_ALIGN_RIGHT "Frequency :"; _CRtext _channel ed.PluginEditorEditWin 5 125 110 20 ET_ALIGN_RIGHT "min Distance :"; _CRtext _channel ed.PluginEditorEditWin 5 155 110 20 ET_ALIGN_RIGHT "max Distance :"; _CRtext _channel ed.PluginEditorEditWin 5 185 110 20 ET_ALIGN_RIGHT "Velocity :"; _CRtext _channel ed.PluginEditorEditWin 250 125 110 20 ET_ALIGN_LEFT "Buffer Type :"; set WavFileName = _CReditLine _channel ed.PluginEditorEditWin 120 5 w-160 20 ET_ALIGN_LEFT|ET_DOWN wfn; _CBbutton _CRbuttonBitmap _channel ed.PluginEditorEditWin _LDbitmap _channel _checkpack openBmp w-30 5 20 20 0 @_rflButton WavFileName; set Volume=_SETtext _CReditText _channel ed.PluginEditorEditWin 120 35 100 20 ET_DOWN "" vol; set Pan=_SETtext _CReditText _channel ed.PluginEditorEditWin 120 65 100 20 ET_DOWN "" pan; set Frequency=_SETtext _CReditText _channel ed.PluginEditorEditWin 120 95 100 20 ET_DOWN|ET_NUMBER "" freq; set MinDistance=_SETtext _CReditText _channel ed.PluginEditorEditWin 120 125 100 20 ET_DOWN|ET_NUMBER "" if nil==mind then "1000" else mind; set MaxDistance=_SETtext _CReditText _channel ed.PluginEditorEditWin 120 155 100 20 ET_DOWN|ET_NUMBER "" if nil==maxd then "10000" else maxd; set Velocity=_SETtext _CReditText _channel ed.PluginEditorEditWin 120 185 100 20 ET_DOWN|ET_NUMBER "" velo; set Loop = _SETcheck _CRcheck _channel ed.PluginEditorEditWin 250 35 w-270 20 0 "loop" if strcmp loop "0" then 1 else 0; set AutoStart = _SETcheck _CRcheck _channel ed.PluginEditorEditWin 250 65 w-270 20 0 "AutoStart" if strcmp auto "0" then 1 else 0; set Streaming = _SETcheck _CRcheck _channel ed.PluginEditorEditWin 250 95 w-270 20 0 "Streaming" if strcmp stre "1" then 0 else 1; set B2D = _SETcheck _CRcheck _channel ed.PluginEditorEditWin 280 155 w-270 20 CH_RADIO "2D" if strcmp buff "2D" then 0 else 1; set B3D = _SETcheck _CRcheck _channel ed.PluginEditorEditWin 280 185 w-270 20 CH_RADIO "3D" if strcmp buff "2D" then 1 else 0; 0 );; fun closeedit()= strbuild ("wavFileName"::(_GETtext WavFileName)::nil):: ("volume"::(_GETtext Volume)::nil):: ("pan"::(_GETtext Pan)::nil):: ("frequency"::(_GETtext Frequency)::nil):: ("minDistance"::(_GETtext MinDistance)::nil):: ("maxDistance"::(_GETtext MaxDistance)::nil):: ("velocity"::(_GETtext Velocity)::nil):: ("loop"::(itoa _GETcheck Loop)::nil):: ("autoStart"::(itoa _GETcheck AutoStart)::nil):: ("streaming"::(itoa _GETcheck Streaming)::nil):: ("bufferType"::(if _GETcheck B2D then "2D" else "3D")::nil):: nil;; /*----------------*/ fun suppactions(l)= if l == nil then nil else let l -> [UI nl] in let (InstName UI) -> name in /*("action"::(strcatn name::".unregister"::nil)::nil)::*/ /*test*/ ("actionC"::(strcatn name::".start"::nil)::nil):: ("actionC"::(strcatn name::".stop"::nil)::nil):: (suppactions nl);; /*----------------*/ fun save(l)= if l==nil then [nil nil nil nil] else [ nil /*suppregister l*/ /* registerF */ nil /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ ("actionC"::"Pause3DSound"::nil)::("actionC"::"Enable3DSound"::nil)::("actionC"::"Disable3DSound"::nil):: suppactions l /* supplemental Dmi */ ];; /*----------------*/ fun IniPlug(file)= set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit;;