/** Package for the Scol settings This is a part of the 'Scol voyager' ================================= License : This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/lesser.txt Author : Bastien Bourineau */ // VIDEO Setup interface structure struct VDSETUPstr = [ VDSETUP_WIN : ObjWin, VDSETUP_INFO : ObjText, VDSETUP_LABEL : ObjText, VDSETUP_VDCOMBO : ObjBox, VDSETUP_PREVIEW : ObjCapture, VDSETUP_TESTBTN : ObjButton, VDSETUP_CAPBMP : ObjBitmap, VDSETUP_TRM : Timer ] mkVDSETUPstr;; typeof SETUP_VIDEO = VDSETUPstr;; /* ********************************************************************************************* / Setup Video Interface / ********************************************************************************************* */ fun _cbVideoClick(combo, p, pos, name)= if SETUP_VIDEO.VDSETUP_PREVIEW == nil then nil else ( _deltimer SETUP_VIDEO.VDSETUP_TRM; set SETUP_VIDEO.VDSETUP_TRM = nil; _DScapture SETUP_VIDEO.VDSETUP_PREVIEW; set SETUP_VIDEO.VDSETUP_PREVIEW = nil; _FILLbitmap SETUP_VIDEO.VDSETUP_CAPBMP 0; _BLTbitmap SETUP_VIDEO.VDSETUP_WIN SETUP_VIDEO.VDSETUP_CAPBMP ((iSetupChildW / 2) - 160) 120; _SETbuttonName SETUP_VIDEO.VDSETUP_TESTBTN loc "CONFVIDEOTESTBTN"; ); chgress "videocapture" itoa pos; 0;; fun cbSetupVideoCap(trm, p)= _BLTcapture SETUP_VIDEO.VDSETUP_PREVIEW SETUP_VIDEO.VDSETUP_CAPBMP; _BLTbitmap SETUP_VIDEO.VDSETUP_WIN SETUP_VIDEO.VDSETUP_CAPBMP ((iSetupChildW / 2) - 160) 120; 0;; fun _cbBtnVideoTest(btn, p)= if SETUP_VIDEO.VDSETUP_PREVIEW == nil then ( let atoi (_getress "videocapture") -> vidindex in set SETUP_VIDEO.VDSETUP_PREVIEW = _CRcapture _channel vidindex; if SETUP_VIDEO.VDSETUP_PREVIEW != nil then ( set SETUP_VIDEO.VDSETUP_TRM = _rfltimer (_starttimer _channel (1000 / 30)) @cbSetupVideoCap nil; _SETbuttonName SETUP_VIDEO.VDSETUP_TESTBTN loc "CONFVIDEOSTOPBTN"; 0; ) else ( _FILLbitmap SETUP_VIDEO.VDSETUP_CAPBMP 0; _BLTbitmap SETUP_VIDEO.VDSETUP_WIN SETUP_VIDEO.VDSETUP_CAPBMP ((iSetupChildW / 2) - 160) 120; set SETUP_VIDEO.VDSETUP_PREVIEW = nil; _DLGMessageBox _channel SETUP_VIDEO.VDSETUP_WIN loc "ERROR" loc "CONFVIDEOBAD" 0; 0; ); 0; ) else ( _deltimer SETUP_VIDEO.VDSETUP_TRM; set SETUP_VIDEO.VDSETUP_TRM = nil; _DScapture SETUP_VIDEO.VDSETUP_PREVIEW; set SETUP_VIDEO.VDSETUP_PREVIEW = nil; _FILLbitmap SETUP_VIDEO.VDSETUP_CAPBMP 0; _BLTbitmap SETUP_VIDEO.VDSETUP_WIN SETUP_VIDEO.VDSETUP_CAPBMP ((iSetupChildW / 2) - 160) 120; _SETbuttonName SETUP_VIDEO.VDSETUP_TESTBTN loc "CONFVIDEOTESTBTN"; 0; ); 0;; fun cbSetupVideoPaint(win,p)= _BLTbitmap SETUP_VIDEO.VDSETUP_WIN SETUP_VIDEO.VDSETUP_CAPBMP ((iSetupChildW / 2) - 160) 120; 0;; fun cbSetupCrVideo(strSetup)= set SETUP_VIDEO = mkVDSETUPstr [nil nil nil nil nil nil nil nil]; set SETUP_VIDEO.VDSETUP_WIN = _CRwindow _channel strSetup.SETUP_WIN 210 10 iSetupChildW iSetupChildH WN_CHILDINSIDE|WN_NOCAPTION ""; set SETUP_VIDEO.VDSETUP_INFO = _CRtext _channel SETUP_VIDEO.VDSETUP_WIN 10 10 (iSetupChildW - 20) 50 ET_ALIGN_LEFT loc "CONFVIDEOMESS"; set SETUP_VIDEO.VDSETUP_LABEL = _CRtext _channel SETUP_VIDEO.VDSETUP_WIN 10 70 (iSetupChildW - 20) 20 ET_ALIGN_LEFT|ET_BORDER loc "CONFVIDEOLABEL"; set SETUP_VIDEO.VDSETUP_VDCOMBO = _CBcombo _CRcombo _channel SETUP_VIDEO.VDSETUP_WIN 10 95 200 120 CB_NOEDIT "" @_cbVideoClick nil; set SETUP_VIDEO.VDSETUP_CAPBMP = _FILLbitmap _CRbitmap _channel 320 240 0; set SETUP_VIDEO.VDSETUP_TESTBTN = _CBbutton _CRbutton _channel SETUP_VIDEO.VDSETUP_WIN ((iSetupChildW / 2) - 40) 365 80 20 nil loc "CONFVIDEOTESTBTN" @_cbBtnVideoTest nil; _BLTbitmap SETUP_VIDEO.VDSETUP_WIN SETUP_VIDEO.VDSETUP_CAPBMP ((iSetupChildW / 2) - 160) 120; _CBwinPaint SETUP_VIDEO.VDSETUP_WIN @cbSetupVideoPaint nil; let _GETcaptureDeviceList -> lcap in while (lcap != nil) do ( _ADDcombo SETUP_VIDEO.VDSETUP_VDCOMBO 100 hd lcap; set lcap = tl lcap; ); _SELcombo SETUP_VIDEO.VDSETUP_VDCOMBO (let (atoi _getress "videocapture")->n in if n==-1 then 0 else n); 0;; fun dsSetupVideo()= if SETUP_VIDEO.VDSETUP_PREVIEW == nil then nil else ( _deltimer SETUP_VIDEO.VDSETUP_TRM; set SETUP_VIDEO.VDSETUP_TRM = nil; _DScapture SETUP_VIDEO.VDSETUP_PREVIEW; set SETUP_VIDEO.VDSETUP_PREVIEW = nil; ); _DSbitmap SETUP_VIDEO.VDSETUP_CAPBMP; _DSwindow SETUP_VIDEO.VDSETUP_WIN; set SETUP_VIDEO = nil; 0;; fun loadSetupVideo(strSetup)= addSetupMenu loc "CONFVIDEO" (mkfun1 @cbSetupCrVideo strSetup) @dsSetupVideo; 0;;