From: Jos v.d.V. <jo...@us...> - 2006-05-14 13:56:16
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15173/apps/Player4 Modified Files: PLAYER4.F PLAYER4.frm Pl_MciWindow.f Log Message: Jos: Made a workaround for Ekey, so w32fConsole.dll is not needed for Player 4th. Now the control center is also able to execute all keystrokes. Keystrokes also work without the CTRL-key Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** PLAYER4.F 14 May 2006 09:41:31 -0000 1.48 --- PLAYER4.F 14 May 2006 13:56:11 -0000 1.49 *************** *** 41,44 **** --- 41,47 ---- defer PlaySelectedFromTreeView ' noop is PlaySelectedFromTreeView defer RequestRecord ' noop is RequestRecord + defer MenuChecks + defer KeyHandler + needs NoConsole.f *************** *** 54,126 **** needs Resources.f needs multiopen.f ! needs view.f ! ! : invert-check ( check - ) dup c@ not swap c! RefreshWindow ; ! ! \ ----------------------------------------------------------------------------- ! \ Define the Menu bar ! \ ----------------------------------------------------------------------------- ! MENUBAR player4-Menu-bar ! POPUP "&File" ! MENUITEM "&Play file...\tCtrl+O" 'O' +k_control pushkey ; ! MENUITEM "Play &folder...\tCtrl+F" 'F' +k_control pushkey ; ! MENUITEM "&Play &list...\tShift+L" 'L' +k_control pushkey ; ! MENUSEPARATOR ! MENUITEM "&Exit\tAlt+F4" 'Q' +k_control pushkey ; ! POPUP "&Catalog" ! MENUITEM "&Add file(s)...\tCtrl+M" 'M' +k_control pushkey ; ! MENUITEM "&Import directory tree...\tCtrl+I" 'I' +k_control pushkey ; ! MENUITEM "&Export the catalog to Player.csv" csv-catalog ; ! MENUITEM "S&earch and make a collection..." SearchCatalog ; ! MENUSEPARATOR ! MENUITEM "&Start/Resume playing\tCtrl+R" 'R' +k_control pushkey ; ! MENUSEPARATOR ! SUBMENU "S&ort and view" ! MENUITEM "Define a view and sort" StartViewForm ; ! MENUITEM "&Sort / Refresh" SortCatalog ; ! MENUSEPARATOR ! MENUITEM "Se&t maximum random level" SetRandomLevel ; ! MENUITEM "&Generate random numbers" RandomizeCatalog ; ! ENDSUBMENU ! SUBMENU "Re&quest handling" ! :MENUITEM mHandelReq "Ignore requests" ! vadr-config IgnoreRequests dup invert-check c@ not ! if SortCatalog ! then ! ; ! :MENUITEM mKeepReq "Keep requests" ! vadr-config KeepRequests invert-check ; ! \ MENUITEM "&Enable all kept requests" EnableKeptRequests ; ! MENUITEM "Se&t request level" player-base SetRequestLevel ; ! MENUITEM "Set a&ll requests to the same level" Level-requests SortCatalog ; ! ENDSUBMENU ! MENUSEPARATOR ! MENUITEM "Show &collection" RefreshCatalog ; ! MENUITEM "Sho&w deleted records" ShowDeleted ; ! MENUSEPARATOR ! MENUITEM "&Delete item" DeleteItem ; ! MENUITEM "D&elete collection..." DeleteCollection ; ! MENUSEPARATOR ! MENUITEM "&Undelete item" Undelete ; ! MENUITEM "Undelete &all" UndeleteAll ; ! ! POPUP "&Options" ! \ MENUITEM "&Fit to Window\tCtrl+W" 'W' +k_control pushkey ; ! MENUITEM " &50%\tCtrl+5" '5' +k_control pushkey ; ! MENUITEM "&100%\tCtrl+1" '1' +k_control pushkey ; ! MENUITEM "&200%\tCtrl+2" '2' +k_control pushkey ; ! MENUSEPARATOR ! MENUITEM "&FullScreen toggle\tCtrl+F" 'S' +k_control pushkey ; ! MENUSEPARATOR ! MENUITEM "&Audio on\tCtrl+A" 'A' +k_control pushkey ; ! MENUITEM "&Audio off\tShift+A" 'A' +k_shift pushkey ; ! MENUSEPARATOR ! :MENUITEM mAutostart "Auto play the catalog at the start" ! vadr-config AutoStart- invert-check ; ! :MENUITEM mTray "Tray window at the start" ! vadr-config AutoMinimized- invert-check ; ! POPUP "&Help" ! MENUITEM "About Player 4th..." k_F1 pushkey ; ! ENDBAR --- 57,61 ---- needs Resources.f needs multiopen.f ! needs view.f *************** *** 179,182 **** --- 114,118 ---- ;Object + defer player4-Menu-bar defer OnPosition ( window -- ) ' drop is OnPosition \ called when window panes are repositioned defer OnInit ( window -- ) ' drop is OnInit \ called during window On_init method *************** *** 222,231 **** :noname GetWindowRect: Self 2drop ; is GetPositionCatalog ( - x y ) ! :M WM_INITMENU ( h m w l -- res ) \ enable/disable the menu items ! vadr-config AutoStart- c@ Check: mAutostart ! vadr-config AutoMinimized- c@ Check: mTray ! vadr-config IgnoreRequests c@ Check: mHandelReq ! vadr-config KeepRequests c@ Check: mKeepReq ! 0 ;M --- 158,163 ---- :noname GetWindowRect: Self 2drop ; is GetPositionCatalog ( - x y ) ! :M WM_INITMENU ( h m w l -- res ) ! MenuChecks 0 ;M *************** *** 247,250 **** --- 179,183 ---- \ mouse click routines for Main Window to track the Splitter movement + : DoSizing ( -- ) mousedown? dragging? or 0= ?EXIT *************** *** 274,280 **** ; :M Classinit: ( -- ) ClassInit: super \ init super class - \ TestBar to CurrentMenu ['] On_clicked SetClickFunc: self ['] On_unclicked SetUnClickFunc: self --- 207,215 ---- ; + :M WM_KEYDOWN ( key l -- res ) + drop KeyHandler 0 ;M + :M Classinit: ( -- ) ClassInit: super \ init super class ['] On_clicked SetClickFunc: self ['] On_unclicked SetUnClickFunc: self *************** *** 330,333 **** --- 265,269 ---- ;M + :M On_Done: ( h m w l -- res ) Close: self *************** *** 366,370 **** \ ----------------------------------------------------------------------------- ! \ "Control center" dialog \ ----------------------------------------------------------------------------- : Pause/Resume ( -- ) --- 302,306 ---- \ ----------------------------------------------------------------------------- ! \ "Control center" dialog \ ----------------------------------------------------------------------------- : Pause/Resume ( -- ) *************** *** 372,376 **** : Stop/Next ( -- ) ! Playing?: Player4W if Close: Player4W then ; 5000 value step --- 308,318 ---- : Stop/Next ( -- ) ! if catalog-exist? ! if SetFocus: ControlCenter play-catalog-random: Player4W ! else Playing?: Player4W ! if Close: Player4W ! then ! then ! then ; 5000 value step *************** *** 544,586 **** On_Paint: MainWindow ; ! defer StopPlayer ! : QuitPlayer ( -- ) ! Close: MainWindow bye ; ! : start/resume ( - ) beep catalog-exist? if play-catalog-random: Player4W then ; ! : KeyHandler ( -- ) ! ekey? ! if ekey ! case ! BL of Pause/Resume endof ! 'O' +k_control of OpenFile: Player4W endof ! 'F' +k_control of OpenFolder: Player4W endof ! 'L' +k_control of OpenPlayList: Player4W endof ! 'S' +k_control of FullScreenToggle endof ! 'Q' +k_control of QuitPlayer endof ! k_F1 of AboutPlayer endof ! k_esc of StopPlayer endof ! 'A' +k_control of AudioOn: Player4W endof ! 'A' +k_shift of AudioOff: Player4W endof ! \ 'W' +k_control of 0 SetVideoSize: Player4W endof ! '5' +k_control of 50 SetVideoSize: Player4W endof ! '1' +k_control of 100 SetVideoSize: Player4W endof ! '2' +k_control of 200 SetVideoSize: Player4W endof ! k_pgdn of Stop/Next endof ! k_down of Stop/Next endof ! k_left of Rewind endof ! k_right of Forward endof ! 'R' +k_control of start/resume endof ! 'M' +k_control of AddFilesFromSelector: Player4W endof ! 'I' +k_control of Import-to-catalog: Player4W RefreshCatalog endof \ 'C' +k_control of PlayAudioCD: Player4W endof \ doesn't work on my system (dbu) endcase ! then ; : InitPlayer ( -- ) --- 486,608 ---- On_Paint: MainWindow ; ! : start/resume ( - ) catalog-exist? if play-catalog-random: Player4W then ; ! : QuitPlayer ( - ) Close: MainWindow bye ; ! : invert-check ( check - ) dup c@ not swap c! RefreshWindow ; ! \ ----------------------------------------------------------------------------- ! \ Define the Menu bar ! \ ----------------------------------------------------------------------------- ! MENUBAR (player4-Menu-bar ! POPUP "&File" ! MENUITEM "&Play file...\tCtrl+O" OpenFile: Player4W ; ! MENUITEM "Play &folder...\tCtrl+F" OpenFolder: Player4W ; ! MENUITEM "&Play &list...\tShift+L" OpenPlayList: Player4W ; ! MENUSEPARATOR ! MENUITEM "&Exit\tAlt+F4" QuitPlayer ; ! POPUP "&Catalog" ! MENUITEM "&Add file(s)...\tCtrl+M" ! AddFilesFromSelector: Player4W ; ! MENUITEM "&Import directory tree...\tCtrl+I" ! Import-to-catalog: Player4W RefreshCatalog ; ! MENUITEM "&Export the catalog to Player.csv" csv-catalog ; ! MENUITEM "S&earch and make a collection..." SearchCatalog ; ! MENUSEPARATOR ! MENUITEM "&Start/Resume playing\tCtrl+R" start/resume ; ! MENUSEPARATOR ! SUBMENU "S&ort and view" ! MENUITEM "Define a view and sort" StartViewForm ; ! MENUITEM "&Sort / Refresh" SortCatalog ; ! MENUSEPARATOR ! MENUITEM "Se&t maximum random level" SetRandomLevel ; ! MENUITEM "&Generate random numbers" RandomizeCatalog ; ! ENDSUBMENU ! SUBMENU "Re&quest handling" ! :MENUITEM mHandelReq "Ignore requests" ! vadr-config IgnoreRequests dup invert-check c@ not ! if SortCatalog ! then ! ; ! :MENUITEM mKeepReq "Keep requests" ! vadr-config KeepRequests invert-check ; ! \ MENUITEM "&Enable all kept requests" EnableKeptRequests ; ! MENUITEM "Se&t request level" player-base SetRequestLevel ; ! MENUITEM "Set a&ll requests to the same level" ! Level-requests SortCatalog ; ! ENDSUBMENU ! MENUSEPARATOR ! MENUITEM "Show &collection" RefreshCatalog ; ! MENUITEM "Sho&w deleted records" ShowDeleted ; ! MENUSEPARATOR ! MENUITEM "&Delete item" DeleteItem ; ! MENUITEM "D&elete collection..." DeleteCollection ; ! MENUSEPARATOR ! MENUITEM "&Undelete item" Undelete ; ! MENUITEM "Undelete &all" UndeleteAll ; ! POPUP "&Options" ! \ MENUITEM "&Fit to Window\tCtrl+W" 0 SetVideoSize: Player4W ; ! MENUITEM " &50%\tCtrl+5" 50 SetVideoSize: Player4W ; ! MENUITEM "&100%\tCtrl+1" 100 SetVideoSize: Player4W ; ! MENUITEM "&200%\tCtrl+2" 200 SetVideoSize: Player4W ; ! MENUSEPARATOR ! MENUITEM "&FullScreen toggle\tCtrl+F" FullScreenToggle ; ! MENUSEPARATOR ! MENUITEM "&Audio on\tCtrl+A" AudioOn: Player4W ; ! MENUITEM "&Audio off\tShift+A" AudioOff: Player4W ; ! MENUSEPARATOR ! :MENUITEM mAutostart "Auto play the catalog at the start" ! vadr-config AutoStart- invert-check ; ! :MENUITEM mTray "Tray window at the start" ! vadr-config AutoMinimized- invert-check ; ! POPUP "&Help" ! MENUITEM "About Player 4th..." AboutPlayer ; ! ENDBAR ! ' (player4-Menu-bar is player4-Menu-bar ! :Noname ( - ) ! vadr-config AutoStart- c@ Check: mAutostart ! vadr-config AutoMinimized- c@ Check: mTray ! vadr-config IgnoreRequests c@ Check: mHandelReq ! vadr-config KeepRequests c@ Check: mKeepReq ! ; is MenuChecks \ enable/disable the menu items ! defer StopPlayer ! 0x21 constant vk_pgdn ! 0x22 constant vk_down ! 0x25 constant vk_left ! 0x27 constant vk_right ! :Noname ( Vkey -- ) ! case ! BL of Pause/Resume endof ! 'O' of OpenFile: Player4W endof ! 'F' of OpenFolder: Player4W endof ! 'L' of OpenPlayList: Player4W endof ! 'S' of FullScreenToggle endof ! 'Q' of QuitPlayer endof \ Q only ! VK_F1 of AboutPlayer endof ! VK_ESCAPE of StopPlayer endof ! ! 'A' of AudioOn: Player4W endof ! 'A' +k_shift of AudioOff: Player4W endof ! ! 'W' of 0 SetVideoSize: Player4W endof ! '5' of 50 SetVideoSize: Player4W endof ! '1' of 100 SetVideoSize: Player4W endof ! '2' of 200 SetVideoSize: Player4W endof ! ! VK_PGDN of Stop/Next endof \ 21 ! VK_DOWN of Stop/Next endof \ 22 ! VK_LEFT of Rewind endof \ 25 ! VK_RIGHT of Forward endof \ 27 ! ! 'R' of start/resume endof ! 'M' of AddFilesFromSelector: Player4W endof ! 'I' of Import-to-catalog: Player4W RefreshCatalog endof \ 'C' +k_control of PlayAudioCD: Player4W endof \ doesn't work on my system (dbu) endcase ! ; is KeyHandler : InitPlayer ( -- ) *************** *** 595,599 **** WINPAUSE 10 MS Playing: Player4W ! KeyHandler ; is PLAYER --- 617,621 ---- WINPAUSE 10 MS Playing: Player4W ! \ KeyHandler ; is PLAYER *************** *** 615,619 **** ' QuitPlayer is StopPlayer false to MciDebug? ! \ NoConsoleIO NoConsoleInImage \ later when there is a work around for ekey and pushkey ' player4 turnkey Player4.exe s" Player4.ico" s" Player4.exe" AddAppIcon --- 637,641 ---- ' QuitPlayer is StopPlayer false to MciDebug? ! NoConsoleIO NoConsoleInImage ' player4 turnkey Player4.exe s" Player4.ico" s" Player4.exe" AddAppIcon *************** *** 621,625 **** [else] true to MciDebug? ! ' abort is StopPlayer \ Access to Forth ( Not fullproof ) s" Player4.ico" s" Player4.exe" AddAppIcon --- 643,647 ---- [else] true to MciDebug? ! ' quit is StopPlayer \ Access to Forth ( Not fullproof ) s" Player4.ico" s" Player4.exe" AddAppIcon Index: Pl_MciWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_MciWindow.f,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Pl_MciWindow.f 12 Apr 2006 19:44:24 -0000 1.17 --- Pl_MciWindow.f 14 May 2006 13:56:11 -0000 1.18 *************** *** 21,27 **** : music? ( adr len - f ) valid-sound-ext count (IsValidFileType?) ; ! POPUPBAR player4-Popup-bar POPUP " " ! MENUITEM "&Play file...\tCtrl+O" 'O' +k_control pushkey ; MENUITEM "Play &folder...\tCtrl+F" 'F' +k_control pushkey ; MENUITEM "Play &list...\tShift+L" 'L' +k_control pushkey ; --- 21,27 ---- : music? ( adr len - f ) valid-sound-ext count (IsValidFileType?) ; ! POPUPBAR player4-Popup-bar \ Not yet working POPUP " " ! (( MENUITEM "&Play file...\tCtrl+O" 'O' +k_control pushkey ; MENUITEM "Play &folder...\tCtrl+F" 'F' +k_control pushkey ; MENUITEM "Play &list...\tShift+L" 'L' +k_control pushkey ; *************** *** 33,37 **** MENUITEM "&Forward\tArrow right" k_right pushkey ; MENUSEPARATOR ! MENUITEM "&Exit\tAlt+F4" 'Q' +k_control pushkey ; ENDBAR --- 33,37 ---- MENUITEM "&Forward\tArrow right" k_right pushkey ; MENUSEPARATOR ! MENUITEM "&Exit\tAlt+F4" 'Q' +k_control pushkey ; )) ENDBAR *************** *** 233,237 **** :M OpenFolder: ( -- ) \ let user choose a folder and play all files in it ! z" Play this folder" string0$ GetHandle: self \ >>> BrowseForFolder if string0$ count PlayFolder: self --- 233,237 ---- :M OpenFolder: ( -- ) \ let user choose a folder and play all files in it ! z" Play this folder" string0$ GetHandle: self BrowseForFolder if string0$ count PlayFolder: self Index: PLAYER4.frm =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.frm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsrRJLQ7 and /tmp/cvsuOWZQ6 differ |