From: Jos v.d.V. <jo...@us...> - 2006-03-12 17:01:43
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30468/apps/Player4 Modified Files: Catalog.f Mediatree.f PLAYER4.F PLAYER4.frm Pl_MciWindow.f PopupWindow.f View.f Log Message: Jos: The title and artist are now shown when music is played using a big font. Index: PLAYER4.frm =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.frm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvszYdY26 and /tmp/cvs8XNfhv differ Index: Mediatree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Mediatree.f,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Mediatree.f 10 Mar 2006 22:11:23 -0000 1.25 --- Mediatree.f 12 Mar 2006 17:00:39 -0000 1.26 *************** *** 1,4 **** \ $Id$ ! needs number.f needs w_search.f --- 1,4 ---- \ $Id$ ! \ CHOOSEFONT needs number.f needs w_search.f *************** *** 125,130 **** ; - : music? ( adr len - f ) valid-sound-ext count (IsValidFileType?) ; - : AddArtist { PrevRecAdr } ( rec-addr PrevRecAdr - ) dup CountedArtist 1 max PrevRecAdr @ CountedArtist 1 max compareia 0<> --- 125,128 ---- *************** *** 302,305 **** --- 300,304 ---- DestroyTreeView \ destroy the current treeview window + CreateTreeView \ create a new one SW_HIDE Show: TreeView \ hide, *************** *** 318,322 **** ;M - :M WM_NOTIFY ( h m w l -- f ) dup @ GetHandle: TreeView = EnableNotify? and --- 317,320 ---- Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** PLAYER4.F 10 Mar 2006 22:11:23 -0000 1.40 --- PLAYER4.F 12 Mar 2006 17:00:39 -0000 1.41 *************** *** 163,167 **** 0 value toolbarH \ set to height of toolbar if any 0 value statusbarH \ set to height of status bar if any - 0 value SeparatorX 0 value clicked --- 163,166 ---- *************** *** 177,182 **** : position-windows ( -- ) \ auto adjust windows ! 0 toolbarH SeparatorX 1- Height toolbarH - statusbarH - dup>r Move: Catalog ! SeparatorX 2+ toolbarH Width 2 pick - r> Move: Player4W ; --- 176,181 ---- : position-windows ( -- ) \ auto adjust windows ! 0 toolbarH SeparatorX @ 1- Height toolbarH - statusbarH - dup>r Move: Catalog ! SeparatorX @ 2+ toolbarH Width 2 pick - r> Move: Player4W ; *************** *** 196,205 **** : drawline ( -- ) ! SeparatorX 0 MoveTo: dc ! SeparatorX height LineTo: dc ; : on_clicked ( -- ) true to clicked ! mousex to SeparatorX get-dc R2_NOT SetRop2: dc --- 195,204 ---- : drawline ( -- ) ! SeparatorX @ 0 MoveTo: dc ! SeparatorX @ height LineTo: dc ; : on_clicked ( -- ) true to clicked ! mousex SeparatorX ! get-dc R2_NOT SetRop2: dc *************** *** 209,214 **** : On_Mousemove ( -- ) ! mousex SeparatorX = ! mousex SeparatorX 1+ = or if SIZEWE-CURSOR else arrow-cursor --- 208,213 ---- : On_Mousemove ( -- ) ! mousex SeparatorX @ = ! mousex SeparatorX @ 1+ = or if SIZEWE-CURSOR else arrow-cursor *************** *** 228,232 **** release-dc hwnd Call ReleaseCapture ?win-error ! else mousex to SeparatorX drawline then ; --- 227,231 ---- release-dc hwnd Call ReleaseCapture ?win-error ! else mousex SeparatorX ! drawline then ; *************** *** 235,239 **** clicked 0= ?exit drawline ! mousex to SeparatorX position-windows release-dc --- 234,238 ---- clicked 0= ?exit drawline ! mousex SeparatorX ! position-windows release-dc *************** *** 242,246 **** :M StartSize: ( -- w h ) ! screen-size >r 2/ r> 2/ ;M :M On_Size: ( -- ) --- 241,245 ---- :M StartSize: ( -- w h ) ! screen-size >r 4 * 6 / r> 2/ ;M :M On_Size: ( -- ) *************** *** 253,256 **** --- 252,257 ---- ['] on_clicked to click-func ['] on_unclicked to unclick-func + COLOR_BTNFACE 1+ GCL_HBRBACKGROUND hwnd Call SetClassLong drop + InitFileNames check/resize-config-file GetHandle: Self dup SetParent: ControlCenter *************** *** 276,281 **** 2 Setid: Player4W self Start: Player4W ! ! Startsize: self drop 2/ to SeparatorX position-windows --- 277,283 ---- 2 Setid: Player4W self Start: Player4W ! SeparatorX @ 0= ! if Startsize: self drop 2/ SeparatorX ! ! then position-windows Index: Pl_MciWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_MciWindow.f,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Pl_MciWindow.f 8 Mar 2006 21:42:56 -0000 1.14 --- Pl_MciWindow.f 12 Mar 2006 17:00:40 -0000 1.15 *************** *** 12,18 **** --- 12,39 ---- \ needs MciInterface.f + needs gdi/gdi.f + needs Resources.f + needs MCIWnd.f + create FileName maxstring allot + : 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 ; + MENUSEPARATOR + MENUITEM "&Pause/Resume\tSpace" BL pushkey ; + MENUSEPARATOR + MENUITEM "&Stop/Next\tArrow down" k_down pushkey ; + MENUITEM "&Rewind\tArrow left" k_left pushkey ; + MENUITEM "&Forward\tArrow right" k_right pushkey ; + MENUSEPARATOR + MENUITEM "&Exit\tAlt+F4" 'Q' +k_control pushkey ; + ENDBAR + internal external *************** *** 25,35 **** --- 46,92 ---- :Object MouseHandlerWindow <super child-window + Font vFont + :M ExWindowStyle: ( -- style ) ExWindowStyle: Super [ WS_EX_CLIENTEDGE WS_EX_TRANSPARENT or ] literal or ;M + + :M On_Init: ( -- ) + 22 Width: vFont + FontHeight Height: vFont + s" Freestyle Script" SetFaceName: vFont + Create: vFont + ;M + :M On_Paint: ( -- ) + FileName count music? + if FileName count ExtractRecord + SaveDC: dc \ save device context + vFont SelectObject: dc + ltgreen SetTextColor: dc + TA_CENTER SetTextAlign: dc drop + GetSize: self 24 - swap 2/ swap 4 / 2dup + struct, InlineRecord RecordDef Artist + struct, InlineRecord RecordDef Cnt_Artist c@ Textout: dc + + FontHeight + struct, InlineRecord RecordDef Title + struct, InlineRecord RecordDef Cnt_Title c@ Textout: dc + RestoreDC: dc + then ;M + (( :M On_Size: ( -- ) + \ init-parameters wait-drawing resizing-window time-reset + \ paint: self + ;M )) + + + :M on_done: ( -- ) + Delete: vFont + on_done: super + ;M + + ;Object *************** *** 51,56 **** int (UpdateTitle) ! maxstring bytes FileName ! maxstring bytes string0$ maxstring bytes string1$ --- 108,112 ---- int (UpdateTitle) ! maxstring bytes title$ maxstring bytes string1$ *************** *** 69,78 **** : ReTitle ( addr len -- ) ! WindowTitle: parent zcount string0$ place ?dup ! if s" - " string0$ +place string0$ +place \ append filename ! s" - " string0$ +place GetLength: self (.ms) string0$ +place ! s" / " string0$ +place GetPosition: self (.ms) string0$ +place else drop ! then string0$ count SetTitle: parent ; :M Close: ( -- ) \ stop playing --- 125,137 ---- : ReTitle ( addr len -- ) ! ?dup ! if ! WindowTitle: parent zcount title$ place ! s" - " title$ +place title$ +place \ append filename ! s" - " title$ +place GetLength: self (.ms) title$ +place ! s" / " title$ +place GetPosition: self (.ms) title$ +place else drop ! then title$ count SetTitle: parent ! ; :M Close: ( -- ) \ stop playing *************** *** 88,92 **** GetShortPathName r> if OpenVideo: super ! else OpenAudio: super then SW_SHOW Show: self ;M --- 147,151 ---- GetShortPathName r> if OpenVideo: super ! else OpenAudio: super paint: MouseHandlerWindow then SW_SHOW Show: self ;M *************** *** 179,183 **** :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 --- 238,242 ---- :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 *************** *** 310,320 **** FileName maxstring erase ! string0$ maxstring erase string1$ maxstring erase 1 Setid: MouseHandlerWindow self Start: MouseHandlerWindow ! ! \ player4-popup-Bar SetPopupBar: MouseHandlerWindow ;M --- 369,378 ---- FileName maxstring erase ! title$ maxstring erase string1$ maxstring erase 1 Setid: MouseHandlerWindow self Start: MouseHandlerWindow ! \ player4-popup-Bar SetPopupBar: MouseHandlerWindow ;M *************** *** 323,327 **** \ resize MouseHandler-Window FullScreen?: self 0= ! if 0 0 Width Height Move: MouseHandlerWindow then \ resize Video-Window --- 381,386 ---- \ resize MouseHandler-Window FullScreen?: self 0= ! if 0 0 Width Height Move: MouseHandlerWindow ! then \ resize Video-Window Index: PopupWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PopupWindow.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PopupWindow.f 8 Mar 2006 21:42:56 -0000 1.1 --- PopupWindow.f 12 Mar 2006 17:00:40 -0000 1.2 *************** *** 10,14 **** : ClosePopupWindow ( - ) _hwnd call DestroyWindow drop ; ! POPUPBAR player4-Popup-bar POPUP " " MENUITEM "Play file" PlaySelectedFromTreeView ClosePopupWindow ; --- 10,14 ---- : ClosePopupWindow ( - ) _hwnd call DestroyWindow drop ; ! POPUPBAR PopupOnRecord POPUP " " MENUITEM "Play file" PlaySelectedFromTreeView ClosePopupWindow ; *************** *** 21,25 **** ColorObject FrmColor \ the background color ! :M ClassInit: ( -- ) ClassInit: super player4-Popup-bar SetPopupBar: Self ;M --- 21,25 ---- ColorObject FrmColor \ the background color ! :M ClassInit: ( -- ) ClassInit: super PopupOnRecord SetPopupBar: Self ;M *************** *** 38,42 **** \ SetActiveWindow: Self 0 0 GetSize: self Addr: FrmColor FillArea: dc ! _hwnd start: player4-Popup-bar StartPopup ;M --- 38,42 ---- \ SetActiveWindow: Self 0 0 GetSize: self Addr: FrmColor FillArea: dc ! _hwnd start: PopupOnRecord StartPopup ;M Index: Catalog.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Catalog.f,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Catalog.f 8 Mar 2006 21:42:56 -0000 1.26 --- Catalog.f 12 Mar 2006 17:00:38 -0000 1.27 *************** *** 49,52 **** --- 49,53 ---- BYTE IgnoreRequests BYTE KeepRequests + BYTE _SeparatorX ;struct *************** *** 220,223 **** --- 221,225 ---- : vadr-config ( - vadr-config ) s" config-mhndl map-hndl>vadr " EVALUATE ; IMMEDIATE + : SeparatorX ( - adr ) vadr-config _SeparatorX ; : check-config ( flag -- ) \ creates one with the right size *************** *** 505,530 **** then ; ! : (add-file) ( wHndl addr len file-size - wHndl ) \ add a file to the catalog ! InlineRecord [ sizeof RecordDef ] literal erase ! struct, InlineRecord RecordDef FileSize ! ! >r dup r@ + 1- dup r@ ascii \ -scan \ adr Title ! rot over ascii . -scan \ count Title ! drop 2 pick 1+ 2dup - dup \ 0< if cr .s ." file" abort then dup ! struct, InlineRecord RecordDef Cnt_Title c! ! struct, InlineRecord RecordDef Title swap cmove \ move Title ! drop ! >r 1- dup r> ascii \ -scan >r 2dup - >r 1+ ! r@ struct, InlineRecord RecordDef Cnt_Album c! ! struct, InlineRecord RecordDef Album r@ cmove ! r> - 1- dup r> ascii \ -scan drop 2dup - swap 1+ over ! struct, InlineRecord RecordDef Cnt_Artist c! ! struct, InlineRecord RecordDef Artist rot cmove ! drop ! struct, InlineRecord RecordDef File_name r@ cmove ! r@ struct, InlineRecord RecordDef Cnt_File_name c! 100 random struct, InlineRecord RecordDef RandomLevel ! VolumeNameBuffer struct, InlineRecord RecordDef MediaLabel --- 507,535 ---- then ; ! : ExtractRecord ( adr count - ) ! >r dup r@ + 1- dup r@ ascii \ -scan \ adr Title ! rot over ascii . -scan \ count Title ! drop 2 pick 1+ 2dup - dup \ 0< if cr .s ." file" abort then dup ! struct, InlineRecord RecordDef Cnt_Title c! ! struct, InlineRecord RecordDef Title swap cmove \ move Title ! drop ! >r 1- dup r> ascii \ -scan >r 2dup - >r 1+ ! r@ struct, InlineRecord RecordDef Cnt_Album c! ! struct, InlineRecord RecordDef Album r@ cmove ! r> - 1- dup r> ascii \ -scan drop 2dup - swap 1+ over ! struct, InlineRecord RecordDef Cnt_Artist c! ! struct, InlineRecord RecordDef Artist rot cmove ! drop ! struct, InlineRecord RecordDef File_name r@ cmove ! r> struct, InlineRecord RecordDef Cnt_File_name c! ! ; ! : (add-file) ( wHndl addr len file-size - wHndl ) \ add a file to the catalog ! InlineRecord [ sizeof RecordDef ] literal erase ! struct, InlineRecord RecordDef FileSize ! ! ExtractRecord 100 random struct, InlineRecord RecordDef RandomLevel ! VolumeNameBuffer struct, InlineRecord RecordDef MediaLabel *************** *** 532,536 **** /VolumeNameBuffer struct, InlineRecord RecordDef Cnt_MediaLabel c! _DriveType struct, InlineRecord RecordDef DriveType c! ! r>drop dup write-record ; --- 537,541 ---- /VolumeNameBuffer struct, InlineRecord RecordDef Cnt_MediaLabel c! _DriveType struct, InlineRecord RecordDef DriveType c! ! dup write-record ; Index: View.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/View.f,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** View.f 30 Oct 2005 18:58:14 -0000 1.5 --- View.f 12 Mar 2006 17:00:40 -0000 1.6 *************** *** 2,6 **** \- textbox needs excontrols.f - :Object ViewForm <Super DialogWindow --- 2,5 ---- |