From: Jos v.d.V. <jo...@us...> - 2005-10-02 22:17:22
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17661/apps/Player4 Modified Files: Catalog.f Mediatree.f PLAYER4.F Log Message: - Optimized drag/dropping files into the catalog. - Now old deleted records will be used first before extending the database. Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PLAYER4.F 29 Sep 2005 16:46:06 -0000 1.21 --- PLAYER4.F 1 Oct 2005 12:57:38 -0000 1.22 *************** *** 80,86 **** MENUITEM "&Import directory tree...\tCtrl+I" 'I' +k_control pushkey ; MENUITEM "S&earch and make a collection..." SearchCatalog ; MENUITEM "&Start/Resume playing\tCtrl+R" 'R' +k_control pushkey ; - SUBMENU "S&ort" MENUITEM "Se&t maximum random level" SetRandomLevel ; --- 80,87 ---- MENUITEM "&Import directory tree...\tCtrl+I" 'I' +k_control pushkey ; MENUITEM "S&earch and make a collection..." SearchCatalog ; + MENUSEPARATOR MENUITEM "&Start/Resume playing\tCtrl+R" 'R' +k_control pushkey ; + MENUSEPARATOR SUBMENU "S&ort" MENUITEM "Se&t maximum random level" SetRandomLevel ; Index: Mediatree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Mediatree.f,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Mediatree.f 29 Sep 2005 16:46:06 -0000 1.12 --- Mediatree.f 1 Oct 2005 12:57:38 -0000 1.13 *************** *** 37,41 **** :M FillTreeView: ( -- ) ! 0 to last-selected-rec tvins /tvins erase tvitem /tvitem erase --- 37,41 ---- :M FillTreeView: ( -- ) ! 0 to last-selected-rec tvins /tvins erase tvitem /tvitem erase *************** *** 94,114 **** ; ! : AddDropFiles { wParam lParam \ drop$ #File wHndl -- res } SetForegroundWindow: self MAXCOUNTED 1+ LocalAlloc: drop$ 0 to #File ! 0 0 -1 wParam Call DragQueryFile ?dup if datfile$ count file-exist? check-config ! database$ create/open dup file-append throw to wHndl ! begin MAXCOUNTED drop$ #File wParam Call DragQueryFile dup 0> while wHndl drop$ rot AddDropFile 1 +to #File repeat then ! 2drop wParam Call DragFinish wHndl CloseReMap RefreshCatalog ; ! :M WM_DROPFILES ( wParam lParam -- res ) ! AddDropFiles ;M : CreateTreeView ( -- ) \ create a treeview window --- 94,115 ---- ; ! : AddDropFiles { hDrop \ drop$ #File wHndl -- res } SetForegroundWindow: self + wait-cursor MAXCOUNTED 1+ LocalAlloc: drop$ 0 to #File ! 0 0 -1 hDrop Call DragQueryFile ?dup if datfile$ count file-exist? check-config ! database$ create/open dup file-append throw to wHndl ! begin MAXCOUNTED drop$ #File hDrop Call DragQueryFile dup 0> while wHndl drop$ rot AddDropFile 1 +to #File repeat then ! 2drop hDrop Call DragFinish wHndl CloseReMap RefreshCatalog ; ! :M WM_DROPFILES ( hDrop lParam -- res ) ! drop AddDropFiles ;M : CreateTreeView ( -- ) \ create a treeview window Index: Catalog.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Catalog.f,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Catalog.f 29 Sep 2005 16:46:06 -0000 1.10 --- Catalog.f 1 Oct 2005 12:57:38 -0000 1.11 *************** *** 100,108 **** ; - : write-record ( wHndl - ) - InlineRecord [ sizeof RecordDef ] literal rot - write-file abort" Can't save record" - ; - : type-space ( adr cnt - ) type space ; : type-cr ( adr cnt - ) type cr ; --- 100,103 ---- *************** *** 169,173 **** ; ! : get-a-record-from-the-free-list ( - n ) vadr-config dup>r first-free-record @ r@ next-in-freelist r@ first-free-record ! r>record --- 164,168 ---- ; ! : get-a-record-from-the-free-list ( - adr ) vadr-config dup>r first-free-record @ r@ next-in-freelist r@ first-free-record ! r>record *************** *** 176,179 **** --- 171,182 ---- ; + : write-record ( wHndl - ) \ Recycle deleted records first. + InlineRecord [ sizeof RecordDef ] literal + vadr-config #free-list @ + if get-a-record-from-the-free-list swap cmove drop + else rot write-file abort" Can't save record" + then + ; + : build-free-list ( - ) 0 vadr-config #free-list ! *************** *** 181,185 **** ; ! : delete-record ( n - ) dup true swap n>record dup>r RecordDef Deleted- c! 0 r> RecordDef Excluded- c! --- 184,188 ---- ; ! : delete-record ( n - ) dup true swap n>record dup>r RecordDef Deleted- c! 0 r> RecordDef Excluded- c! |