From: Jos v.d.V. <jo...@us...> - 2006-06-10 18:00:09
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30849/apps/Player4 Modified Files: Catalog.f MCIWnd.f PLAYER4.F Pl_MciWindow.f Pl_Version.f Log Message: Jos: Added more joystick commands Index: Pl_Version.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_Version.f,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Pl_Version.f 21 May 2006 11:42:10 -0000 1.16 --- Pl_Version.f 10 Jun 2006 18:00:04 -0000 1.17 *************** *** 3,7 **** anew -Pl_Version.f ! 10123 value player_version# \ Version numbers: v.ww.rr --- 3,7 ---- anew -Pl_Version.f ! 10124 value player_version# \ Version numbers: v.ww.rr *************** *** 143,144 **** --- 143,155 ---- dbu Sonntag, Mai 21 2006 - Rewritten the Command handling by using an accelerator-key-table. + + \ changes for Version 1.01.24 + Jos: Added a the following joystick commands: + button1 next + button2 reserved for joystick browsing + button3 decreasevolume + button4 increasevolume + button5 pause/resume + button6 shutdown the pc + + Index: Catalog.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Catalog.f,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Catalog.f 25 May 2006 18:09:27 -0000 1.34 --- Catalog.f 10 Jun 2006 18:00:04 -0000 1.35 *************** *** 51,56 **** BYTE IgnoreRequests BYTE KeepRequests ! BYTE _SeparatorX BYTE Endless- ;struct --- 51,58 ---- BYTE IgnoreRequests BYTE KeepRequests ! DWORD _SeparatorX BYTE Endless- + \ DWORD Noop + DWORD VolLevel ;struct *************** *** 236,239 **** --- 238,242 ---- r> close-file throw map-config-file + 1000 vadr-config VolLevel ! then ; *************** *** 490,494 **** ; ! : random-shuffle ( - >>> ) vadr-config MaximumRandomLevel @ for-all-records change-randomlevel drop sort_by_RandomLevel RefreshCatalog --- 493,497 ---- ; ! : random-shuffle ( - ) vadr-config MaximumRandomLevel @ for-all-records change-randomlevel drop sort_by_RandomLevel RefreshCatalog Index: MCIWnd.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/MCIWnd.f,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MCIWnd.f 21 May 2006 11:42:10 -0000 1.4 --- MCIWnd.f 10 Jun 2006 18:00:04 -0000 1.5 *************** *** 46,50 **** :M GetLength: ( -- n ) 0 0 MCIWNDM_GETLENGTH SendMessage ;M :M GetVolume: ( -- n ) 0 0 MCIWNDM_GETVOLUME SendMessage ;M ! :M SetVolume: ( n -- ) 0 MCIWNDM_GETVOLUME SendMessageDrop ;M :M GetStart: ( -- n ) 0 0 MCIWNDM_GETSTART SendMessage ;M :M GetDest: ( -- l t r b ) AddrOf: Dest 0 MCIWNDM_GET_DEST SendMessageDrop --- 46,50 ---- :M GetLength: ( -- n ) 0 0 MCIWNDM_GETLENGTH SendMessage ;M :M GetVolume: ( -- n ) 0 0 MCIWNDM_GETVOLUME SendMessage ;M ! :M SetVolume: ( n -- ) 0 max 1000 min 0 MCIWNDM_SETVOLUME SendMessageDrop ;M :M GetStart: ( -- n ) 0 0 MCIWNDM_GETSTART SendMessage ;M :M GetDest: ( -- l t r b ) AddrOf: Dest 0 MCIWNDM_GET_DEST SendMessageDrop Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** PLAYER4.F 27 May 2006 19:13:33 -0000 1.57 --- PLAYER4.F 10 Jun 2006 18:00:04 -0000 1.58 *************** *** 33,36 **** --- 33,37 ---- needs AcceleratorTables.f needs Joystick.f + needs security.f 200 value IDJoystick *************** *** 40,43 **** --- 41,45 ---- defer RequestRecord ' noop is RequestRecord defer MenuChecks ' noop is MenuChecks + defer HandleJoystick ' noop is HandleJoystick needs Pl_Toolset.f *************** *** 238,258 **** if Startsize: self drop 2/ SeparatorX ! then position-windows - addr: self to player-base RefreshCatalog FindFirstJoyStick dup to IDJoystick MaxJoysticks < ! if 0 250 1 hWnd Call SetTimer drop then ;M ! :M WM_TIMER ( hm wl -- res >>> ) \ handle the WM_TIMER events ! 2drop IDJoystick GetJoystickInfo 1 = ! if IDM_NEXT DoCommand ! begin IDJoystick GetJoystickInfo 2nip nip 0= ! until ! 3drop ! then ! 0 ;M --- 240,253 ---- if Startsize: self drop 2/ SeparatorX ! then position-windows addr: self to player-base RefreshCatalog FindFirstJoyStick dup to IDJoystick MaxJoysticks < ! if 0 200 1 hWnd Call SetTimer drop then ;M ! :M WM_TIMER ( hm wl -- res ) \ handle the WM_TIMER events ! 2drop HandleJoystick 0 ;M *************** *** 385,388 **** --- 380,416 ---- needs Commands.f + : GetVolume/timeOut ( - Volume VolumeChange ) 100 ms GetVolume: Player4W dup 10 / ; + : ButtonIn? ( - ButtonIn ) IDJoystick GetJoystickInfo 2nip nip 0= ; + : WaitTillDepressed ( - ) begin ButtonIn? until ; + : SetVolLevel ( Volume - ) dup 1000 min 0 max vadr-config VolLevel ! SetVolume: Player4W ; + + : DecreaseVolume ( - ) + begin GetVolume/timeOut - SetVolLevel + ButtonIn? + until + ; + + : IncreaseVolume ( - ) + begin GetVolume/timeOut + SetVolLevel + ButtonIn? + until + ; + + :Noname ( - ) + IDJoystick GetJoystickInfo + dup JOY_BUTTON1 >= + if case + JOY_BUTTON1 of IDM_NEXT DoCommand endof + JOY_BUTTON3 of DecreaseVolume endof + JOY_BUTTON4 of IncreaseVolume endof + JOY_BUTTON5 of IDM_PAUSE/RESUME DoCommand endof + JOY_BUTTON6 of down endof + endcase + WaitTillDepressed 3drop + else 4drop + then + + ; is HandleJoystick + \ ----------------------------------------------------------------------------- \ Define the Menu bar *************** *** 402,406 **** MENUITEM "S&earch and make a collection..." SearchCatalog ; MENUSEPARATOR ! :MENUITEM mEndless "Endless play" Endless ; \ >>> MENUITEM "&Start/Resume playing\tCtrl+R" IDM_START/RESUME DoCommand ; MENUSEPARATOR --- 430,434 ---- MENUITEM "S&earch and make a collection..." SearchCatalog ; MENUSEPARATOR ! :MENUITEM mEndless "Endless play" Endless ; MENUITEM "&Start/Resume playing\tCtrl+R" IDM_START/RESUME DoCommand ; MENUSEPARATOR *************** *** 502,506 **** \ ----------------------------------------------------------------------------- ! : InitPlayer ( -- ) Start: MainWindow Start: ControlCenter --- 530,534 ---- \ ----------------------------------------------------------------------------- ! : InitPlayer ( -- >>> ) Start: MainWindow Start: ControlCenter Index: Pl_MciWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_MciWindow.f,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Pl_MciWindow.f 25 May 2006 17:59:20 -0000 1.23 --- Pl_MciWindow.f 10 Jun 2006 18:00:04 -0000 1.24 *************** *** 119,122 **** --- 119,125 ---- Video?: self 0= ;M + :M GetVolume: ( -- vol ) GetVolume: MCI ;M + :M SetVolume: ( vol -- ) SetVolume: MCI ;M + : ReTitle ( addr len -- ) WindowTitle: parent zcount title$ place ?dup *************** *** 220,223 **** --- 223,227 ---- : (PlayOneFile) ( addr len -- ) \ plays a file and waits until playing is finished PlayFile: self \ play this file + vadr-config VolLevel @ SetVolume: Self \ Restore the volume to VolLevel begin PLAYER \ call the main PLAYER Playing? 0= \ and wait until playing is finished |