/* Speaker Editor - DMS - feb 98 - by Sylvain HUET */ /* Rev. Aug. '98 - by Marc BARILLEY */ /* longspeaker ver 1.0 - part editor - 01/2004 */ /* by iri : info@irizone.net */ /* rev. 1.1 - 03/2004 */ typeof editWin = ObjWin;; typeof t1 = ObjText;; /* t1 - t5 : paths bitmaps */ typeof t2 = ObjText;; typeof t3 = ObjText;; typeof t4 = ObjText;; typeof t5 = ObjText;; typeof bg = ObjText;; /* path du background */ typeof sf = ObjText;; /* field fontsize */ typeof c1 = ObjCheck;; /* checkbox longspeech */ var recon = "Dms/Sound/longspeaker/recon.bmp";; /* default file */ var recoff = "Dms/Sound/longspeaker/recoff.bmp";; /* default file */ var playon = "Dms/Sound/longspeaker/playon.bmp";; /* default file */ var playoff = "Dms/Sound/longspeaker/playoff.bmp";; /* default file */ var playmute = "Dms/Sound/longspeaker/playmute.bmp";; /* default file */ var background = "Dms/Sound/longspeaker/bg.jpg";; /* background default file (zone "info" */ var sizefont = 12;; /* default value */ var fontcolor = 0;; /* default value */ /* callback dialogbox "openFile" */ fun _OpenBmp(d,b,s)= let _PtoScol s -> name in if name == nil then nil else if b == 1 then ( set recon = name; _SETtext t1 name ) else if b == 2 then ( set recoff = name; _SETtext t2 name ) else if b == 3 then ( set playon = name; _SETtext t3 name ) else if b == 4 then ( set playoff = name; _SETtext t4 name ) else if b == 5 then ( set playmute = name; _SETtext t5 name ) else if b ==6 then ( set background = name; _SETtext bg name ) else nil; 0;; /* callbacks button choice bmp */ fun BMPrecon(a, b)= _DLGrflopen (_DLGOpenFile _channel editWin recon nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG\0\0") @_OpenBmp 1;; fun BMPrecoff(a, b)= _DLGrflopen (_DLGOpenFile _channel editWin recoff nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG\0\0") @_OpenBmp 2;; fun BMPplayon(a, b)= _DLGrflopen (_DLGOpenFile _channel editWin playon nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG\0\0") @_OpenBmp 3;; fun BMPplayoff(a, b)= _DLGrflopen (_DLGOpenFile _channel editWin playoff nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG\0\0") @_OpenBmp 4;; fun BMPplaymute(a, b)= _DLGrflopen (_DLGOpenFile _channel editWin playmute nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG\0\0") @_OpenBmp 5;; fun BMPbg(a, b)= _DLGrflopen (_DLGOpenFile _channel editWin background nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG\0\0") @_OpenBmp 6;; /* callback d'enregistrement du choix de la couleur du texte */ fun _color2(a)= if a!=nil then set fontcolor = a else nil;; /* callback du click sur le bouton de choix de la couleur du texte */ fun color(a, b)= _CRcolorMap _channel editWin 100 100 (_locEditor "choixColor" nil) @_color2 fontcolor;; /* callback de la fenête d'édition : */ /* lorsque la couleur de la police a été changé, la pastille affiche la nouvelle couleur */ fun _paintE(a, b)= _PAINTrectangle editWin 90 205 220 20 DRAW_SOLID 1 0 DRAW_SOLID fontcolor;; /* usuals fuctions */ /* lecture du fichier .dms */ fun load(l)= set recon = getInfo l "recon"; if recon == nil then _SETtext t1 "Dms/Sound/longspeaker/recon.bmp" else _SETtext t1 recon; set recoff = getInfo l "recoff"; if recoff == nil then _SETtext t2 "Dms/Sound/longspeaker/recoff.bmp" else _SETtext t2 recoff; set playon = getInfo l "playon"; if playon == nil then _SETtext t3 "Dms/Sound/longspeaker/playon.bmp" else _SETtext t3 playon; set playoff = getInfo l "playoff"; if playoff == nil then _SETtext t4 "Dms/Sound/longspeaker/playoff.bmp" else _SETtext t4 playoff; set playmute = getInfo l "playmute"; if playmute == nil then _SETtext t5 "Dms/Sound/longspeaker/playmute.bmp" else _SETtext t5 playmute; set background = getInfo l "background"; if background == nil then _SETtext bg "Dms/Sound/longspeaker/bg.jpg" else _SETtext bg background; let atoi getInfo l "longspeech" -> ls in _SETcheck c1 ls; let atoi getInfo l "sizefont" -> sfont in _SETtext sf itoa sfont; set fontcolor = atoi getInfo l "fontcolor"; 0;; /* sauvegarde sur le .dms */ fun save (filename, n)= let recon::recoff::playon::playoff::playmute::background::nil -> l in ("registerF"::l):: ("zoneC"::"ButtonRec"::nil):: ("zoneC"::"ButtonPlay"::nil):: ("zoneC"::"Info"::nil):: ("action"::"start_direct"::nil):: ("actionC"::"hide"::nil):: ("actionC"::"show"::nil):: ("action"::"destroy"::"destroy"::nil):: ("event"::"entering"::"entering"::nil):: ("event"::"destroyed"::"destroyed"::nil):: ("event"::"silent"::nil):: ("event"::"hidden"::nil):: ("event"::"shown"::nil):: ("recon"::recon::nil):: ("recoff"::recoff::nil):: ("playon"::playon::nil):: ("playoff"::playoff::nil):: ("playmute"::playmute::nil):: ("background"::background::nil):: ("sizefont"::(_GETtext sf)::nil):: ("fontcolor"::(itoa fontcolor)::nil):: ("longspeech"::(itoa _GETcheck c1)::nil):: nil;; /* initialisation de l'éditeur */ fun IniEditor(s)= let [315 230] -> [w h] in let startEditor _channel nil nil nil w h WN_MENU EDITOR_NORMAL s "dms/sound/longspeaker/longspeaker.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; _CBbutton _CRbutton _channel editWin 5 5 80 20 0 (_locEditor "recOn" nil) @BMPrecon 0; set t1 = _CRtext _channel editWin 90 5 w-95 20 ET_ALIGN_LEFT|ET_DOWN recon; _CBbutton _CRbutton _channel editWin 5 30 80 20 0 (_locEditor "recOff" nil) @BMPrecoff 0; set t2 = _CRtext _channel editWin 90 30 w-95 20 ET_ALIGN_LEFT|ET_DOWN recoff; _CBbutton _CRbutton _channel editWin 5 55 80 20 0 (_locEditor "playOn" nil) @BMPplayon 0; set t3 = _CRtext _channel editWin 90 55 w-95 20 ET_ALIGN_LEFT|ET_DOWN playon; _CBbutton _CRbutton _channel editWin 5 80 80 20 0 (_locEditor "playOff" nil) @BMPplayoff 0; set t4 = _CRtext _channel editWin 90 80 w-95 20 ET_ALIGN_LEFT|ET_DOWN playoff; _CBbutton _CRbutton _channel editWin 5 105 80 20 0 (_locEditor "playMute" nil) @BMPplaymute 0; set t5 = _CRtext _channel editWin 90 105 w-95 20 ET_ALIGN_LEFT|ET_DOWN playmute; _CRtext _channel editWin 5 130 w-30 20 ET_ALIGN_LEFT (_locEditor "checkLong" nil); set c1 = _CRcheck _channel editWin w-23 130 18 18 CH_DOWN nil; _CBbutton _CRbutton _channel editWin 5 155 80 20 0 (_locEditor "bgbitmap" nil) @BMPbg 0; set bg = _CRtext _channel editWin 90 155 w-95 20 ET_ALIGN_LEFT|ET_DOWN background; _CRtext _channel editWin 5 180 w-35 20 ET_ALIGN_LEFT (_locEditor "fontSize" nil); set sf = _CReditLine _channel editWin w-30 180 25 20 ET_BORDER|ET_DOWN|ET_NUMBER itoa sizefont; _CBbutton _CRbutton _channel editWin 5 205 80 20 0 (_locEditor "fontColor" nil) @color 0; _CBwinPaint editWin @_paintE nil; if s==nil then nil else openDMI ed ); 0;;