From: Jos v.d.V. <jo...@us...> - 2006-05-25 15:37:29
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6986/apps/Player4 Modified Files: Catalog.f Commands.f Mediatree.f PLAYER4.F Pl_MciWindow.f Log Message: Jos: Made an endless play optional and changed the handling of requests and collections more logical. Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** PLAYER4.F 24 May 2006 15:27:43 -0000 1.55 --- PLAYER4.F 25 May 2006 15:36:50 -0000 1.56 *************** *** 158,162 **** : DoSizing ( -- ) mousedown? dragging? or 0= ?EXIT ! mousex ( 1+ ) width min thickness 2/ - SeparatorX ! position-windows WINPAUSE ; --- 158,164 ---- : DoSizing ( -- ) mousedown? dragging? or 0= ?EXIT ! mousex ( 1+ ) width min thickness 2/ - ! [ thickness 2* ] literal max width [ thickness 2* ] literal - min ! SeparatorX ! position-windows WINPAUSE ; *************** *** 296,300 **** Playing?: Player4W if Close: Player4W ! else catalog-exist? if play-catalog-random: Player4W then then ; IDM_NEXT SetCommand --- 298,305 ---- Playing?: Player4W if Close: Player4W ! else catalog-exist? ! if SetFocus: ControlCenter ! play-catalog-random: Player4W ! then then ; IDM_NEXT SetCommand *************** *** 378,381 **** --- 383,387 ---- 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 *************** *** 427,430 **** --- 433,437 ---- 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 Index: Catalog.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Catalog.f,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Catalog.f 12 Apr 2006 19:44:24 -0000 1.31 --- Catalog.f 25 May 2006 15:36:50 -0000 1.32 *************** *** 16,19 **** --- 16,21 ---- string: database$ string: index$ + 0 value #Excluded + 0 value _DriveType *************** *** 50,53 **** --- 52,56 ---- BYTE KeepRequests BYTE _SeparatorX + BYTE Endless- ;struct *************** *** 106,110 **** BYTE Request- BYTE RequestLevelRecord ! WORD NotUsed1 DWORD NotUsed2 ;struct --- 109,114 ---- BYTE Request- BYTE RequestLevelRecord ! BYTE CollectedNotPlayed- ! BYTE NotUsed1 DWORD NotUsed2 ;struct *************** *** 334,338 **** ; ! : RequestKeyFagged vadr-config IgnoreRequests c@ not if RequestKey --- 338,342 ---- ; ! : RequestKeyFlagged vadr-config IgnoreRequests c@ not if RequestKey *************** *** 340,347 **** ; ! : By_FileName ( - by ) by[ FileNameKey RequestKeyFagged ]by ; ! : By_Random ( - by ) by[ RandomKey RequestKeyFagged ]by ; ! : by_leastPlayed ( - by ) by[ leastPlayedKey Ascending RequestKeyFagged ]by ; ! : by_FileSize ( - by ) by[ FileSizeKey RequestKeyFagged ]by ; : not-deleted? ( rec-adr - flag ) s" RecordDef deleted- c@ 0= " EVALUATE ; IMMEDIATE --- 344,351 ---- ; ! : By_FileName ( - by ) by[ FileNameKey RequestKeyFlagged ]by ; ! : By_Random ( - by ) by[ RandomKey RequestKeyFlagged ]by ; ! : by_leastPlayed ( - by ) by[ leastPlayedKey Ascending RequestKeyFlagged ]by ; ! : by_FileSize ( - by ) by[ FileSizeKey RequestKeyFlagged ]by ; : not-deleted? ( rec-adr - flag ) s" RecordDef deleted- c@ 0= " EVALUATE ; IMMEDIATE *************** *** 434,439 **** ; ! : record-not-played ( n - ) n>record 0 swap RecordDef Played- c! ; ! : set-all-not-played ( - ) for-all-records record-not-played ; : change-randomlevel ( level n - ) --- 438,443 ---- ; ! : record-not-played ( n - ) n>record 0 swap RecordDef Played- c! ; ! : set-all-not-played ( - ) for-all-records record-not-played ; : change-randomlevel ( level n - ) *************** *** 452,459 **** r@ s_Random_impopular- c@ of by[ by_record RandomKey ! leastPlayedKey Ascending RequestKeyFagged ]by sort-database endof r@ s_Random_popular- c@ of by[ by_record RandomKey ! leastPlayedKey Descending RequestKeyFagged ]by sort-database endof --- 456,463 ---- r@ s_Random_impopular- c@ of by[ by_record RandomKey ! leastPlayedKey Ascending RequestKeyFlagged ]by sort-database endof r@ s_Random_popular- c@ of by[ by_record RandomKey ! leastPlayedKey Descending RequestKeyFlagged ]by sort-database endof *************** *** 475,479 **** then FlexKey &key-len @ 0> ! if by[ FlexKey RequestKeyFagged ]by sort-database then --- 479,483 ---- then FlexKey &key-len @ 0> ! if by[ FlexKey RequestKeyFlagged ]by sort-database then *************** *** 484,495 **** : sort_by_RandomLevel ( - ) By_Random sort-database - \ 1 cells to key-len - \ 0 RecordDef RandomLevel to key-start sort-database-bin - \ 0 RecordDef #played to key-start sort-database-bin - \ \ 0 RecordDef Deleted- to key-start sort-database-bin - ; ! : random-shuffle ( - ) vadr-config MaximumRandomLevel @ for-all-records change-randomlevel drop sort_by_RandomLevel RefreshCatalog --- 488,494 ---- : sort_by_RandomLevel ( - ) By_Random sort-database ; ! : random-shuffle ( - >>> ) vadr-config MaximumRandomLevel @ for-all-records change-randomlevel drop sort_by_RandomLevel RefreshCatalog *************** *** 588,606 **** 0 value #InCollection ! : NoRequests? ( adr - flag ) #requests 0> vadr-config IgnoreRequests c@ not and ; : Requested? ( adr - flag ) RecordDef Request- c@ ; ! : next-not-played ( - n ) \ -1 means done. >>> ! -1 database-mhndl #records-in-database last-selected-rec 0 max \ Starting from the last-selected record ! do i n>record >r NoRequests? ! if r@ Requested? dup ! if r@ RequestDone ! then ! else ! r@ RecordDef Excluded- c@ not ! r@ Requested? not and then - r@ RecordDef Played- c@ 0= and r> RecordDef Deleted- c@ 0= and if drop i leave --- 587,613 ---- 0 value #InCollection ! : RemoveFromCollection ( adr - ) true swap RecordDef Excluded- c! -1 +to #excluded ; ! : Requests? ( adr - flag ) #requests 0> vadr-config IgnoreRequests c@ not and ; : Requested? ( adr - flag ) RecordDef Request- c@ ; ! : Incollection? ( adr - flag ) ! dup RecordDef Excluded- c@ not dup ! if swap RemoveFromCollection ! else nip ! then ! ; + : next-not-played ( - n ) \ -1 means all done. + -1 database-mhndl #records-in-database last-selected-rec 0 max \ Starting from the last-selected record + do i n>record >r Requests? \ Handle requests first when they are there and not ignored + if r@ Requested? dup + if r@ RequestDone + then + else #excluded \ There is a collection when > 0 + if r@ Incollection? + else r@ Requested? not and + r@ RecordDef Played- c@ 0= and + then then r> RecordDef Deleted- c@ 0= and if drop i leave *************** *** 678,682 **** : search-record ( arg-adr$ count #rec - arg-adr$ count ) n>record dup>r record-size 2over 2swap false *search ! not nip nip r> RecordDef Excluded- c! ; --- 685,690 ---- : search-record ( arg-adr$ count #rec - arg-adr$ count ) n>record dup>r record-size 2over 2swap false *search ! nip nip dup not r@ RecordDef Excluded- c! ! r> RecordDef CollectedNotPlayed- c! ; *************** *** 687,698 **** NewEditDialog searchDlg "Search for artist/album in the catalog." "The name contains:" "Ok" "Cancel" "" : search-records ( base - ) s" artist*album " init-dlg Start: searchDlg >r pad$_ok? over and r> 0> and ! if for-all-records search-record 2drop RefreshCatalog else 2drop then ; string: tmp$ --- 695,712 ---- NewEditDialog searchDlg "Search for artist/album in the catalog." "The name contains:" "Ok" "Cancel" "" + : "search-records ( adr count - ) + for-all-records search-record 2drop + ; + : search-records ( base - ) s" artist*album " init-dlg Start: searchDlg >r pad$_ok? over and r> 0> and ! if "search-records RefreshCatalog else 2drop then ; + : EnableAllRecords ( - ) s" *" "search-records ; + string: tmp$ Index: Pl_MciWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_MciWindow.f,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Pl_MciWindow.f 24 May 2006 15:27:43 -0000 1.21 --- Pl_MciWindow.f 25 May 2006 15:36:50 -0000 1.22 *************** *** 275,282 **** database-mhndl #records-in-database vadr-config #free-list @ - 0> if AbortPlaying: self false to catalog-aborted? ! begin catalog-aborted? #InCollection 0= or if exitm then Playing?: Self not if next-not-played dup -1 = ! if set-all-not-played random-shuffle else n>record dup>r RecordDef File_name r@ Cnt_File_name c@ 2dup type-space --- 275,285 ---- database-mhndl #records-in-database vadr-config #free-list @ - 0> if AbortPlaying: self false to catalog-aborted? ! begin catalog-aborted? if exitm then Playing?: Self not if next-not-played dup -1 = ! if vadr-config Endless- c@ ! if EnableAllRecords randomize-catalog ! else exitm ! then else n>record dup>r RecordDef File_name r@ Cnt_File_name c@ 2dup type-space *************** *** 285,288 **** --- 288,292 ---- then then + again then Index: Mediatree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Mediatree.f,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Mediatree.f 16 May 2006 17:41:26 -0000 1.31 --- Mediatree.f 25 May 2006 15:36:50 -0000 1.32 *************** *** 25,30 **** : NotIncollection? ( n - f ) ! n>record dup RecordDef Deleted- c@ 0= show-deleted = ! swap RecordDef Excluded- c@ or ; --- 25,30 ---- : NotIncollection? ( n - f ) ! n>record dup RecordDef Deleted- c@ 0= dup>r show-deleted = ! swap RecordDef Excluded- c@ dup r> and 1 min +to #Excluded or ; *************** *** 187,191 **** TVI_ROOT DeleteItem: self \ delete all items from the tree view ! 0 to #InCollection 0 to #requests --- 187,191 ---- TVI_ROOT DeleteItem: self \ delete all items from the tree view ! 0 to #Excluded 0 to #InCollection 0 to #requests Index: Commands.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Commands.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Commands.f 21 May 2006 11:42:10 -0000 1.2 --- Commands.f 25 May 2006 15:36:50 -0000 1.3 *************** *** 172,175 **** --- 172,178 ---- vadr-config AutoStart- invert-check ; + : Endless ( -- ) + vadr-config Endless- invert-check ; + : TrayWindowCmd ( -- ) vadr-config AutoMinimized- invert-check ; *************** *** 198,199 **** --- 201,203 ---- ResumeVideo On_Paint: MainWindow ; IDM_ABOUT SetCommand + \s |