From: Jos v.d.V. <jo...@us...> - 2006-06-28 11:43:16
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5896/apps/Player4 Modified Files: Catalog.f Commands.f Mediatree.f PLAYER4.F Pl_MciWindow.f Pl_Version.f PopupWindow.f Log Message: Jos: Made joystickbrowsing in the treeview easier and faster. The long list problem has been solved by an extra index that will be shown when the catalog is sorted by artist and record in a hierarical view Index: Pl_Version.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_Version.f,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Pl_Version.f 10 Jun 2006 18:00:04 -0000 1.17 --- Pl_Version.f 28 Jun 2006 11:43:12 -0000 1.18 *************** *** 3,7 **** anew -Pl_Version.f ! 10124 value player_version# \ Version numbers: v.ww.rr --- 3,7 ---- anew -Pl_Version.f ! 10125 value player_version# \ Version numbers: v.ww.rr *************** *** 153,155 **** --- 153,177 ---- button6 shutdown the pc + \ changes for Version 1.01.25 + Jos: June 28th, 2006. + Added a Joystickbrowser and some more button commands. They are now: + button1 Next OR the current selected record + button2 Change the Font into big or small + button3 DecreaseVolume + button4 IncreaseVolume + button5 PAUSE/RESUME + button6 shutdown the pc + button9 Opens the item that is playing from the catalog + + Movements: Forward: Up in tree + Backward: Down in tree + Left: Close child in tree + Right: Open child in tree + + Added also an option to disable the joystick to avoid conflicts with games etc. + To keep the movements in the treeview under control you must move the + joystick between the center and a direction outside the center and then back to + the center to prevent continuous scrolling, + Push the joystick to the right when you would like to go in an already open child + in a tree. Index: Catalog.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Catalog.f,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Catalog.f 10 Jun 2006 18:00:04 -0000 1.35 --- Catalog.f 28 Jun 2006 11:43:12 -0000 1.36 *************** *** 17,20 **** --- 17,21 ---- string: index$ 0 value #Excluded + 0 value #playing true value _DriveType *************** *** 53,58 **** DWORD _SeparatorX BYTE Endless- - \ DWORD Noop DWORD VolLevel ;struct --- 54,59 ---- DWORD _SeparatorX BYTE Endless- DWORD VolLevel + BYTE JoyStickDisabled- ;struct *************** *** 113,117 **** BYTE CollectedNotPlayed- BYTE NotUsed1 ! DWORD NotUsed2 ;struct --- 114,118 ---- BYTE CollectedNotPlayed- BYTE NotUsed1 ! DWORD hInTree ;struct *************** *** 238,241 **** --- 239,243 ---- r> close-file throw map-config-file + true vadr-config s_Artist_Title- c! 1000 vadr-config VolLevel ! then Index: Mediatree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Mediatree.f,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Mediatree.f 22 Jun 2006 09:03:32 -0000 1.33 --- Mediatree.f 28 Jun 2006 11:43:12 -0000 1.34 *************** *** 13,16 **** --- 13,17 ---- Font TreeViewFont 0 value UseBigFont + 0 value MaxDif :Class MediaTree <super TreeViewControl *************** *** 103,108 **** --- 104,114 ---- int hMovies int hMusic + int hMovieChar + int hMusicChar int hRequests int OtherArtist? + int PrevRecAdr + int rec-addr + int LastChar sizeof RecordDef dup create dummy allot dummy swap 01 fill *************** *** 122,164 **** ; ! : hMusic/hMovie ( rec-adr - hMusic|hMovie ) ! CountedFilename music? ! if hMusic ! else hMovies then ; ! : AddArtist { PrevRecAdr } ( rec-addr PrevRecAdr - ) ! dup CountedArtist 1 max PrevRecAdr @ CountedArtist 1 max compareia 0<> ! over RecordDef Cnt_Artist c@ 0> and ! if dup PrevRecAdr ! true to OtherArtist? NotPlayable ! dup RecordDef Artist hPrev ! 2 pick RecordDef Request- c@ ! if rot drop hRequests ! else rot hMusic/hMovie then 1 AddItemHierarical PrevRecAdr hArtist ! ! else drop false to OtherArtist? then ; ! : AddAlbum { PrevRecAdr } ( rec-addr PrevRecAdr - ) ! dup CountedAlbum 1 max PrevRecAdr @ CountedAlbum 1 max compareia 0<> OtherArtist? or ! over RecordDef Cnt_Artist c@ 0> and ! if dup PrevRecAdr ! NotPlayable ! RecordDef Album hPrev PrevRecAdr hArtist @ ! 1 AddItemHierarical PrevRecAdr hAlbum ! ! else drop then ; ! : AddTitle { rec-addr PrevRecAdr } ( rec-addr PrevRecAdr - ) rec-addr RecordDef CountedTitle +InlineRecord InlineRecord +null InlineRecord 1+ hPrev PrevRecAdr rec-addr RecordDef Cnt_Artist c@ 0> if hAlbum @ ! else drop rec-addr hMusic/hMovie then ! 0 AddItemHierarical drop ; --- 128,181 ---- ; ! : AddNewChar ( hMusic|hMovie hChar - hChar ) ! rec-addr RecordDef Artist c@ upc dup LastChar <> ! if dup to LastChar 0x100 * 1+ pad ! ! drop dup pad 1+ -rot 1 AddItemHierarical ! else drop nip ! then ! ; ! ! : hMusic/hMovie ( - hMusic|hMovie|hChar ) \ hMovieChar ! rec-addr CountedFilename music? ! if hMusic vadr-config s_Artist_Title- c@ \ When sorted by artist + title ! if hMusicChar AddNewChar dup to hMusicChar ! then ! else hMovies true \ sorted by rec ! if hMovieChar AddNewChar dup to hMovieChar ! then then ; ! : AddArtist ( - ) ! rec-addr CountedArtist 1 max PrevRecAdr @ CountedArtist 1 max compareia 0<> ! rec-addr RecordDef Cnt_Artist c@ 0> and ! if rec-addr PrevRecAdr ! true to OtherArtist? NotPlayable ! rec-addr RecordDef Artist hPrev ! rec-addr RecordDef Request- c@ ! if hRequests ! else hMusic/hMovie then 1 AddItemHierarical PrevRecAdr hArtist ! ! else false to OtherArtist? then ; ! : AddAlbum ( - ) ! rec-addr CountedAlbum 1 max PrevRecAdr @ CountedAlbum 1 max compareia 0<> OtherArtist? or ! rec-addr RecordDef Cnt_Artist c@ 0> and ! if rec-addr PrevRecAdr ! NotPlayable ! rec-addr RecordDef Album hPrev PrevRecAdr hArtist @ ! 1 AddItemHierarical PrevRecAdr RecordDef hAlbum ! then ; ! : AddTitle ( - ) rec-addr RecordDef CountedTitle +InlineRecord InlineRecord +null InlineRecord 1+ hPrev PrevRecAdr rec-addr RecordDef Cnt_Artist c@ 0> if hAlbum @ ! else drop hMusic/hMovie then ! 0 AddItemHierarical rec-addr RecordDef hIntree ! ; *************** *** 166,170 **** dup NotIncollection? over n>record RecordDef Request- c@ not and if drop ! else ( 1306 +) >r ResetInlineRecord r@ n>record dup RecordDef Request- c@ if 1 +to #requests &PrevRequest --- 183,187 ---- dup NotIncollection? over n>record RecordDef Request- c@ not and if drop ! else >r ResetInlineRecord r@ n>record dup RecordDef Request- c@ if 1 +to #requests &PrevRequest *************** *** 174,186 **** then then \ ( n vadr-config rec-addr PrevRecAdr - ) ! 2dup AddArtist ! 2dup AddAlbum ! 2 pick l_Index- c@ if r> dup +(l.int) else r> then to lParam ! >r OptionalElements r> ! AddTitle drop then ; --- 191,204 ---- then then \ ( n vadr-config rec-addr PrevRecAdr - ) ! to PrevRecAdr to rec-addr ! AddArtist ! AddAlbum ! dup l_Index- c@ if r> dup +(l.int) else r> then to lParam ! rec-addr OptionalElements 2drop ! AddTitle then ; *************** *** 201,205 **** --- 219,225 ---- for-all-records AddRecordFlat else root-items to hPrev + 0 to hMovieChar 0 to hMusicChar for-all-records AddRecordHierarical + hMovies TVGN_CARET SelectItem: Self then ;M *************** *** 218,222 **** then ; ! :M GetLparm: ( hItem - lParm ) to hItem --- 238,242 ---- then ; ! :M GetLparm: ( hItem - lParm ) to hItem *************** *** 233,237 **** hItemNew GetLparm: Self dup to last-selected-rec -1 <> ! if UseBigFont not if StartPopupWindow then --- 253,257 ---- hItemNew GetLparm: Self dup to last-selected-rec -1 <> ! if MaxDif not if StartPopupWindow then *************** *** 273,278 **** Start: super false to UseBigFont SetfontTreeView: Self ;M ! :M ExWindowStyle: ( -- style ) ExWindowStyle: Super --- 293,299 ---- Start: super false to UseBigFont SetfontTreeView: Self + 0 to MaxDif ;M ! :M ExWindowStyle: ( -- style ) ExWindowStyle: Super *************** *** 305,332 **** ! \ GetNextItem: bij 0 terug dicht en next parent ! : SelectTreeViewItem ( hitem - ) dup 0<> if TVGN_CARET SelectItem: TreeView else drop then ! ; ! :M GetLparm: ( - hItem ) GetLparm: TreeView ;M :M GetSelectedItem: ( - hItem ) 0 TVGN_CARET GetNextItem: TreeView ;M :M DownInTree: ( - ) GetSelectedItem: Self TVGN_NEXT GetNextItem: TreeView ! SelectTreeViewItem ;M :M UpInTree: ( - ) GetSelectedItem: Self GetPrevious: TreeView ! SelectTreeViewItem ;M :M OpenChild: ( - ) GetSelectedItem: Self GetChild: TreeView ! SelectTreeViewItem ;M --- 326,352 ---- ! :M SelectTreeViewItem: ( hitem - ) dup 0<> if TVGN_CARET SelectItem: TreeView else drop then ! ;M ! :M GetLparm: ( - hItem ) GetLparm: TreeView ;M :M GetSelectedItem: ( - hItem ) 0 TVGN_CARET GetNextItem: TreeView ;M :M DownInTree: ( - ) GetSelectedItem: Self TVGN_NEXT GetNextItem: TreeView ! SelectTreeViewItem: Self ;M :M UpInTree: ( - ) GetSelectedItem: Self GetPrevious: TreeView ! SelectTreeViewItem: Self ;M :M OpenChild: ( - ) GetSelectedItem: Self GetChild: TreeView ! SelectTreeViewItem: Self ;M Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** PLAYER4.F 22 Jun 2006 09:03:32 -0000 1.59 --- PLAYER4.F 28 Jun 2006 11:43:12 -0000 1.60 *************** *** 232,236 **** else map-config-file then SortByFlags ! GetHandle: Self SetParent: ControlCenter GetHandle: Self SetParent: ViewForm --- 232,236 ---- else map-config-file then SortByFlags ! -1 to #playing GetHandle: Self SetParent: ControlCenter GetHandle: Self SetParent: ViewForm *************** *** 251,255 **** [ *lpjoycapsa joycapsa wXmax ] literal @ [ *lpjoycapsa joycapsa wXmin ] literal @ - 2/ to JoycenterX ! 0 200 1 hWnd Call SetTimer drop then ;M --- 251,255 ---- [ *lpjoycapsa joycapsa wXmax ] literal @ [ *lpjoycapsa joycapsa wXmin ] literal @ - 2/ to JoycenterX ! 0 100 1 hWnd Call SetTimer drop then ;M *************** *** 405,424 **** : ChangeFont ( Big|small - ) ! to UseBigFont Delete: TreeViewFont SetfontTreeView: Catalog SW_SHOWMAXIMIZED Show: MainWindow ; ! : PlaymodeForJoystick ( button - ) ! case ! JOY_BUTTON1 of IDM_NEXT DoCommand endof ! JOY_BUTTON2 of true ChangeFont 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 ; ! : PlayFromJoystick GetSelectedItem: Catalog GetLparm: Catalog dup -1 = --- 405,419 ---- : ChangeFont ( Big|small - ) ! to UseBigFont Delete: TreeViewFont SetfontTreeView: Catalog SW_SHOWMAXIMIZED Show: MainWindow ; ! : ShowPlaying ! #playing -1 > ! if #playing RecordDef hIntree @ SelectTreeViewItem: Catalog ! then ; ! : PlayFromJoystick ( - ) GetSelectedItem: Catalog GetLparm: Catalog dup -1 = *************** *** 430,440 **** : JoystickBrowser ( button - ) case ! JOY_BUTTON1 of PlayFromJoystick endof ! JOY_BUTTON8 of OpenChild: Catalog endof ! JOY_BUTTON7 of CloseChild: Catalog endof ! JOY_BUTTON2 of false ChangeFont endof endcase - ; : DifToCenter? { pos } ( Joycenter pos - dif ) dup 2 / over pos - abs > --- 425,438 ---- : JoystickBrowser ( button - ) case ! JOY_BUTTON1 of IDM_NEXT DoCommand endof ! JOY_BUTTON2 of UseBigFont not ChangeFont endof ! JOY_BUTTON3 of DecreaseVolume endof ! JOY_BUTTON4 of IncreaseVolume endof ! JOY_BUTTON5 of IDM_PAUSE/RESUME DoCommand endof ! JOY_BUTTON6 of down endof ! JOY_BUTTON9 of 10 to MaxDif ShowPlaying endof endcase ; + : DifToCenter? { pos } ( Joycenter pos - dif ) dup 2 / over pos - abs > *************** *** 444,451 **** ; - \ debug DifToCenter? 65000 JoycenterY swap DifToCenter? - \ debug DifToCenter? 32767 JoycenterY swap DifToCenter? - - : XYDifCenter ( posx posy - difx dify ) JoycenterY swap DifToCenter? >r --- 442,445 ---- *************** *** 455,460 **** 0 value incr-fact : ScrollFlag ( difx dify - f ) ! abs swap abs max dup 0= if to incr-fact else incr-fact JoycenterY >= --- 449,456 ---- 0 value incr-fact + : 2abs ( n1 n2 - n1Abs n2Abs ) abs swap abs swap ; + : ScrollFlag ( difx dify - f ) ! 2abs max dup to MaxDif dup 0= if to incr-fact else incr-fact JoycenterY >= *************** *** 479,485 **** dup 0<> if 0> ! if OpenChild: Catalog else CloseChild: Catalog ! then JoycenterY negate 2* to incr-fact else drop then --- 475,481 ---- dup 0<> if 0> ! if OpenChild: Catalog else CloseChild: Catalog ! then JoycenterY negate 3 * to incr-fact else drop then *************** *** 488,492 **** : HandleMovesJoystickBrowser ( x y z button - ) 2drop XYDifCenter 2dup ScrollFlag ! if down/up Left/Right else 2drop then --- 484,491 ---- : HandleMovesJoystickBrowser ( x y z button - ) 2drop XYDifCenter 2dup ScrollFlag ! if 2dup 2abs <= ! if down/up drop ! else drop Left/Right ! then else 2drop then *************** *** 494,510 **** ; ! :Noname ( - >>> ) ! IDJoystick GetJoystickInfo ! dup JOY_BUTTON1 >= ! if UseBigFont ! if JoystickBrowser WaitTillDepressed 3drop ! else PlaymodeForJoystick WaitTillDepressed 3drop ! then ! else UseBigFont ! if HandleMovesJoystickBrowser ! else 4drop then then - ; is HandleJoystick --- 493,503 ---- ; ! :Noname ( - ) ! vadr-config JoyStickDisabled- c@ 0= ! if IDJoystick GetJoystickInfo dup JOY_BUTTON1 >= ! if JoystickBrowser WaitTillDepressed 3drop ! else HandleMovesJoystickBrowser then then ; is HandleJoystick *************** *** 526,530 **** 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 --- 519,523 ---- 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 *************** *** 566,569 **** --- 559,563 ---- AutoPlay ; :MENUITEM mTray "Tray window at the start" TrayWindowCmd ; + :MENUITEM mJoyStickDisabled "Disable joystick" NoJoysticks ; POPUP "&Help" *************** *** 572,580 **** :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 ! vadr-config Endless- c@ Check: mEndless ; is MenuChecks \ enable/disable the menu items --- 566,575 ---- :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 ! vadr-config Endless- c@ Check: mEndless ! vadr-config JoyStickDisabled- c@ Check: mJoyStickDisabled ; is MenuChecks \ enable/disable the menu items Index: Pl_MciWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_MciWindow.f,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Pl_MciWindow.f 10 Jun 2006 18:00:04 -0000 1.24 --- Pl_MciWindow.f 28 Jun 2006 11:43:12 -0000 1.25 *************** *** 288,292 **** else n>record dup>r RecordDef File_name r@ Cnt_File_name c@ 2dup type-cr ! r@ incr-#played r> mark-played (PlayOneFile) then --- 288,292 ---- else n>record dup>r RecordDef File_name r@ Cnt_File_name c@ 2dup type-cr ! r@ incr-#played r@ to #playing r> mark-played (PlayOneFile) then Index: PopupWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PopupWindow.f,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PopupWindow.f 21 May 2006 15:30:03 -0000 1.7 --- PopupWindow.f 28 Jun 2006 11:43:12 -0000 1.8 *************** *** 6,10 **** : PlaySelectedFromTreeView ( -- ) ! last-selected-rec n>record dup>r RecordDef File_name r@ Cnt_File_name c@ r@ incr-#played --- 6,10 ---- : PlaySelectedFromTreeView ( -- ) ! last-selected-rec n>record dup to #playing dup>r RecordDef File_name r@ Cnt_File_name c@ r@ incr-#played Index: Commands.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Commands.f,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Commands.f 25 May 2006 15:36:50 -0000 1.3 --- Commands.f 28 Jun 2006 11:43:12 -0000 1.4 *************** *** 172,176 **** vadr-config AutoStart- invert-check ; ! : Endless ( -- ) vadr-config Endless- invert-check ; --- 172,176 ---- vadr-config AutoStart- invert-check ; ! : Endless ( -- ) vadr-config Endless- invert-check ; *************** *** 178,181 **** --- 178,184 ---- vadr-config AutoMinimized- invert-check ; + : NoJoysticks ( -- ) + vadr-config JoyStickDisabled- invert-check ; + \ -------------------------------------------------------------------------- \ Help menu |