From: Jos v.d.V. <jo...@us...> - 2005-10-19 19:37:32
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5453/apps/Player4 Modified Files: Catalog.f Mediatree.f PLAYER4.F Pl_Version.f View.f Log Message: Jos: Made the new form operational. Now you can choose what fields you would like to see in the treeview and how they should be sorted. Delete your old database berfore compiling this version. Index: Pl_Version.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Pl_Version.f,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Pl_Version.f 9 Oct 2005 16:33:07 -0000 1.13 --- Pl_Version.f 19 Oct 2005 19:37:20 -0000 1.14 *************** *** 3,7 **** anew -Pl_Version.f ! 10119 value player_version# \ Version numbers: v.ww.rr --- 3,7 ---- anew -Pl_Version.f ! 10120 value player_version# \ Version numbers: v.ww.rr *************** *** 40,47 **** - BTW the filenames should be stored with relative - Addtional search path's - - Volume info ( on what DVD/CD has a certain file been stored ) - Columns in the treeview. - Only add a new file to the catalog when it wasn't added before ! - Only add files to the catalog that can be played by the player \ --------------------------------------------------------------------------- --- 40,46 ---- - BTW the filenames should be stored with relative - Addtional search path's - Columns in the treeview. - Only add a new file to the catalog when it wasn't added before ! - A better stable sort routine \ --------------------------------------------------------------------------- *************** *** 130,132 **** --- 129,136 ---- Jos September 29th, 2005 - Enabled a fileselector to add files into de catalog + + \ changes for Version 1.01.20 + Jos October 19th, 2005 + - Added a form to define a view. + \s Index: Mediatree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Mediatree.f,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Mediatree.f 17 Oct 2005 20:26:31 -0000 1.16 --- Mediatree.f 19 Oct 2005 19:37:20 -0000 1.17 *************** *** 20,59 **** ;M ! : +space ( - ) s" " InlineRecord +place ; - \ add-record is under construction.... : add-record ( n - ) \ Add when not deleted and found in a collection ! dup n>record dup RecordDef Deleted- c@ 0= show-deleted = swap RecordDef Excluded- c@ or ! if drop ! Else vadr-config over to lParam 0 InlineRecord ! ! dup l_Index- c@ ! if over (l.int) InlineRecord place +space ! then ! swap n>record ! over l_Drivetype- c@ ! if dup RecordDef DriveType c@ ! DriveType$ InlineRecord +place +space ! then ! ! dup RecordDef File_name swap Cnt_File_name c@ ! ! InlineRecord +place ! ! \ dup l_Label- c@ ! \ dup l_File_size- c@ ! \ dup l_#Played- c@ ! \ l_Filename- c@ ! \ if CheckButton: R_Filename ! \ else CheckButton: R_Artist_and_title ! \ then ! ! ! InlineRecord +null ! InlineRecord 1+ to pszText ! tvitem->tvins ! tvins 0 TVM_INSERTITEMA hWnd Call SendMessage ! to hInsertAfter ! drop ! then ; --- 20,59 ---- ;M ! : +InlineRecord ( str cnt - ) InlineRecord +place s" " InlineRecord +place ; ! : +(l.int) ( n ) (l.int) +InlineRecord ; : add-record ( n - ) \ Add when not deleted and found in a collection ! dup n>record dup RecordDef Deleted- c@ 0= show-deleted = ! swap RecordDef Excluded- c@ or ! if drop ! else vadr-config over to lParam 0 InlineRecord ! ! dup l_Index- c@ ! if over +(l.int) ! then ! swap n>record \ ( vadr-config rec-addr - ) ! over l_Drivetype- c@ ! if dup RecordDef DriveType c@ DriveType$ +InlineRecord ! then ! over l_Label- c@ ! if dup RecordDef MediaLabel over Cnt_MediaLabel c@ +InlineRecord ! then ! over l_File_size- c@ ! if dup RecordDef FileSize @ 1000 / 1 max +(l.int) \ In KB ! then ! over l_#Random- c@ ! if dup RecordDef RandomLevel @ +(l.int) ! then ! over l_#Played- c@ ! if dup RecordDef #played @ +(l.int) ! then ! swap l_Filename- c@ ! if dup RecordDef File_name swap Cnt_File_name c@ ! else dup RecordDef Artist over Cnt_Artist c@ +InlineRecord ! dup RecordDef Title swap Cnt_Title c@ ! then ! InlineRecord +place ! InlineRecord +null InlineRecord 1+ to pszText tvitem->tvins ! tvins 0 TVM_INSERTITEMA hWnd Call SendMessage to hInsertAfter ! then ; Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PLAYER4.F 17 Oct 2005 20:29:20 -0000 1.26 --- PLAYER4.F 19 Oct 2005 19:37:20 -0000 1.27 *************** *** 90,101 **** MENUSEPARATOR ! SUBMENU "S&ort and show" MENUITEM "Se&t maximum random level" SetRandomLevel ; MENUITEM "&Generate random numbers" RandomizeCatalog ; - MENUSEPARATOR - MENUITEM "S&ort by random number" SortRandom ; - MENUITEM "Define a view" StartViewForm ; - MENUITEM "S&ort by size" SortSize ; - MENUITEM "S&ort by filename" SortCatalog ; ENDSUBMENU --- 90,98 ---- MENUSEPARATOR ! SUBMENU "S&ort and view" ! MENUITEM "Define a view" StartViewForm ; ! MENUSEPARATOR MENUITEM "Se&t maximum random level" SetRandomLevel ; MENUITEM "&Generate random numbers" RandomizeCatalog ; ENDSUBMENU *************** *** 351,355 **** :noname ( -- ) \ sort catalog by file names catalog-exist? ! if sort_by_filename RefreshCatalog then ; is SortCatalog --- 348,352 ---- :noname ( -- ) \ sort catalog by file names catalog-exist? ! if SortByFlags RefreshCatalog then ; is SortCatalog Index: Catalog.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Catalog.f,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Catalog.f 17 Oct 2005 20:26:31 -0000 1.14 --- Catalog.f 19 Oct 2005 19:37:20 -0000 1.15 *************** *** 30,33 **** --- 30,34 ---- BYTE s_Label- BYTE s_filesize- + BYTE s_#Random- BYTE s_#Played- BYTE s_Filename- *************** *** 37,40 **** --- 38,42 ---- BYTE l_Label- BYTE l_File_size- + BYTE l_#Random- BYTE l_#Played- BYTE l_Filename- *************** *** 64,83 **** :struct RecordDef \ catalog - /file_name Field: File_name - BYTE Cnt_File_name BYTE Deleted- BYTE Excluded- BYTE Played- BYTE DriveType - DWORD FileSize /MediaLabel Field: MediaLabel - BYTE Cnt_MediaLabel /artist Field: Artist \ Extracted from the filename - BYTE Cnt_Artist /Title Field: Title \ Extracted from the filename BYTE Cnt_Title - Offset Deleted-thread - DWORD RandomLevel - DWORD #played DWORD Not_used1 DWORD Not_used2 --- 66,85 ---- :struct RecordDef \ catalog BYTE Deleted- BYTE Excluded- BYTE Played- + DWORD FileSize + Offset Deleted-thread + DWORD RandomLevel + DWORD #played BYTE DriveType /MediaLabel Field: MediaLabel /artist Field: Artist \ Extracted from the filename /Title Field: Title \ Extracted from the filename + /file_name Field: File_name + BYTE Cnt_File_name + BYTE Cnt_MediaLabel + BYTE Cnt_Artist BYTE Cnt_Title DWORD Not_used1 DWORD Not_used2 *************** *** 313,321 **** : sort_by_size ( - ) by_FileSize sort-database-bin ; : sort_by_RandomLevel ( - ) 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 ; --- 315,386 ---- : sort_by_size ( - ) by_FileSize sort-database-bin ; + : SortByFlags ( - ) + vadr-config + dup>r s_Filename- c@ + if sort_by_filename then + 0 to key-len maxstring to key-start + r@ s_#Random- c@ + if 1 cells to key-len 0 RecordDef RandomLevel to key-start + then + r@ s_#Played- c@ + if key-len 1 cells + to key-len + key-start 0 RecordDef #played min to key-start + then + r@ s_Drivetype- c@ + if key-len 1+ to key-len + key-start 0 RecordDef DriveType min to key-start + then + r@ s_Label- c@ + if key-len /MediaLabel + to key-len + key-start 0 RecordDef MediaLabel min to key-start + then + r@ s_Artist_Title- c@ + if key-len [ /artist /Title + ] literal + to key-len + key-start 0 RecordDef Artist min to key-start + then + key-len 0> + if sort-database + then + r> s_filesize- c@ + if sort_by_size + then + ; + + (( : 0SortByFlags ( - ) \ Not yet useable + vadr-config + dup>r s_Filename- c@ + if sort_by_filename then + + r@ s_Artist_Title- c@ + if [ /artist /Title + ] literal to key-len + 0 RecordDef Artist to key-start + sort-database + then + + r@ s_#Played- c@ + if sort_by_leastPlayed + then + r@ s_#Random- c@ + if 1 cells to key-len 0 RecordDef RandomLevel to key-start + sort-database-bin + then + r@ s_filesize- c@ + if sort_by_size + then + r@ s_Label- c@ + if /MediaLabel to key-len 0 RecordDef MediaLabel to key-start + sort-database + then + r> s_Drivetype- c@ + if 1 to key-len 0 RecordDef DriveType to key-start + sort-database-bin + then + ; )) + : sort_by_RandomLevel ( - ) 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 ; *************** *** 344,348 **** >r dup r@ + r@ ascii \ -scan 2dup r@ swap - swap 1+ dup rot \ adr Title ! dup>r ascii . scan nip r> swap - dup \ count artist struct, InlineRecord RecordDef Cnt_Title c! struct, InlineRecord RecordDef Title swap cmove \ move Title --- 409,413 ---- >r dup r@ + r@ ascii \ -scan 2dup r@ swap - swap 1+ dup rot \ adr Title ! dup>r ascii . scan nip r> swap - dup \ count Title struct, InlineRecord RecordDef Cnt_Title c! struct, InlineRecord RecordDef Title swap cmove \ move Title *************** *** 479,481 **** then ; - --- 544,545 ---- Index: View.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/View.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** View.f 18 Oct 2005 17:11:36 -0000 1.1 --- View.f 19 Oct 2005 19:37:20 -0000 1.2 *************** *** 12,30 **** GroupBox Group2 GroupBox Group3 - CheckBox s_DriveType - CheckBox s_label - CheckBox s_filesize - CheckBox s_#played CheckBox lbl_Index - CheckBox lbl_Drivetype - CheckBox lbl_Label CheckBox lbl_File_size CheckBox lbl_#Played ! RadioButton R_Filename ! RadioButton R_Artist_and_title ! CheckBox s_Filename ! CheckBox s_Artist_Title PushButton Button1 PushButton Button2 :M ClassInit: ( -- ) --- 12,32 ---- GroupBox Group2 GroupBox Group3 CheckBox lbl_Index CheckBox lbl_File_size + CheckBox lbl_#Random CheckBox lbl_#Played ! CheckBox lbl_Drivetype ! CheckBox lbl_Label ! CheckBox R_Filename ! CheckBox R_Artist_and_title PushButton Button1 PushButton Button2 + RadioButton s_filesize + RadioButton s_#Random + RadioButton s_#played + RadioButton s_DriveType + RadioButton s_label + RadioButton s_Filename + RadioButton s_Artist_Title :M ClassInit: ( -- ) *************** *** 51,55 **** :M StartSize: ( -- width height ) ! 201 290 ;M --- 53,57 ---- :M StartSize: ( -- width height ) ! 197 290 ;M *************** *** 73,110 **** self Start: Group1 ! 20 10 164 230 Move: Group1 Handle: Winfont SetFont: Group1 s" Sort/Group" SetText: Group1 self Start: Group2 ! 50 30 101 124 Move: Group2 Handle: Winfont SetFont: Group2 s" Optional" SetText: Group2 self Start: Group3 ! 50 160 125 70 Move: Group3 Handle: Winfont SetFont: Group3 s" Name" SetText: Group3 - self Start: s_DriveType - 30 70 18 16 Move: s_DriveType - \ Handle: Winfont SetFont: s_DriveType - \ s" " SetText: s_DriveType - - self Start: s_label - 30 90 18 16 Move: s_label - \ Handle: Winfont SetFont: s_label - \ s" " SetText: s_label - - self Start: s_filesize - 30 110 18 16 Move: s_filesize - \ Handle: Winfont SetFont: s_filesize - \ s" " SetText: s_filesize - - self Start: s_#played - 30 130 18 16 Move: s_#played - \ Handle: Winfont SetFont: s_#played - \ s" " SetText: s_#played - self Start: lbl_Index 60 50 75 16 Move: lbl_Index --- 75,92 ---- self Start: Group1 ! 20 10 159 242 Move: Group1 Handle: Winfont SetFont: Group1 s" Sort/Group" SetText: Group1 self Start: Group2 ! 50 30 118 145 Move: Group2 Handle: Winfont SetFont: Group2 s" Optional" SetText: Group2 self Start: Group3 ! 50 180 118 63 Move: Group3 Handle: Winfont SetFont: Group3 s" Name" SetText: Group3 self Start: lbl_Index 60 50 75 16 Move: lbl_Index *************** *** 112,158 **** s" Index" SetText: lbl_Index self Start: lbl_Drivetype ! 60 70 77 16 Move: lbl_Drivetype Handle: Winfont SetFont: lbl_Drivetype s" Drivetype" SetText: lbl_Drivetype self Start: lbl_Label ! 60 90 76 16 Move: lbl_Label Handle: Winfont SetFont: lbl_Label s" Label" SetText: lbl_Label - self Start: lbl_File_size - 60 110 66 16 Move: lbl_File_size - Handle: Winfont SetFont: lbl_File_size - s" File size" SetText: lbl_File_size - - self Start: lbl_#Played - 60 130 77 16 Move: lbl_#Played - Handle: Winfont SetFont: lbl_#Played - s" #Played" SetText: lbl_#Played - self Start: R_Filename ! 60 180 107 16 Move: R_Filename Handle: Winfont SetFont: R_Filename s" Filename" SetText: R_Filename self Start: R_Artist_and_title ! 60 200 101 16 Move: R_Artist_and_title Handle: Winfont SetFont: R_Artist_and_title ! s" Artist and title" SetText: R_Artist_and_title ! ! self Start: s_Filename ! 30 180 18 16 Move: s_Filename ! \ Handle: Winfont SetFont: s_Filename ! \ s" " SetText: s_Filename ! ! self Start: s_Artist_Title ! 30 200 19 22 Move: s_Artist_Title ! \ Handle: Winfont SetFont: s_Artist_Title ! \ s" " SetText: s_Artist_Title IDOK SetID: Button1 self Start: Button1 ! 40 250 50 20 Move: Button1 Handle: Winfont SetFont: Button1 s" Ok" SetText: Button1 --- 94,135 ---- s" Index" SetText: lbl_Index + self Start: lbl_File_size + 60 70 94 18 Move: lbl_File_size + Handle: Winfont SetFont: lbl_File_size + s" File size (Kb)" SetText: lbl_File_size + + self Start: lbl_#Random + 60 90 94 16 Move: lbl_#Random + Handle: Winfont SetFont: lbl_#Random + s" #Random" SetText: lbl_#Random + + self Start: lbl_#Played + 60 110 94 18 Move: lbl_#Played + Handle: Winfont SetFont: lbl_#Played + s" #Played" SetText: lbl_#Played + self Start: lbl_Drivetype ! 60 130 77 16 Move: lbl_Drivetype Handle: Winfont SetFont: lbl_Drivetype s" Drivetype" SetText: lbl_Drivetype self Start: lbl_Label ! 60 150 77 16 Move: lbl_Label Handle: Winfont SetFont: lbl_Label s" Label" SetText: lbl_Label self Start: R_Filename ! 60 200 77 16 Move: R_Filename Handle: Winfont SetFont: R_Filename s" Filename" SetText: R_Filename self Start: R_Artist_and_title ! 60 220 104 16 Move: R_Artist_and_title Handle: Winfont SetFont: R_Artist_and_title ! s" Artist_and_title" SetText: R_Artist_and_title IDOK SetID: Button1 self Start: Button1 ! 50 260 50 20 Move: Button1 Handle: Winfont SetFont: Button1 s" Ok" SetText: Button1 *************** *** 160,170 **** IDcancel SetID: Button2 self Start: Button2 ! 100 250 50 20 Move: Button2 Handle: Winfont SetFont: Button2 s" Cancel" SetText: Button2 vadr-config dup s_Drivetype- c@ Check: s_DriveType dup s_Label- c@ Check: s_Label dup s_filesize- c@ Check: s_filesize dup s_#Played- c@ Check: s_#Played dup s_Filename- c@ Check: s_Filename --- 137,183 ---- IDcancel SetID: Button2 self Start: Button2 ! 120 260 50 20 Move: Button2 Handle: Winfont SetFont: Button2 s" Cancel" SetText: Button2 + self Start: s_filesize + 30 70 18 18 Move: s_filesize + Handle: Winfont SetFont: s_filesize + s" " SetText: s_filesize + + self Start: s_#Random + 30 90 18 18 Move: s_#Random + Handle: Winfont SetFont: s_#Random + s" " SetText: s_#Random + + self Start: s_#played + 30 110 18 18 Move: s_#played + Handle: Winfont SetFont: s_#played + s" " SetText: s_#played + + self Start: s_DriveType + 30 130 18 18 Move: s_DriveType + Handle: Winfont SetFont: s_DriveType + s" " SetText: s_DriveType + + self Start: s_label + 30 150 18 18 Move: s_label + Handle: Winfont SetFont: s_label + s" " SetText: s_label + + self Start: s_Filename + 30 200 18 18 Move: s_Filename + Handle: Winfont SetFont: s_Filename + s" " SetText: s_Filename + + self Start: s_Artist_Title + 30 220 18 18 Move: s_Artist_Title + Handle: Winfont SetFont: s_Artist_Title + s" " SetText: s_Artist_Title + vadr-config dup s_Drivetype- c@ Check: s_DriveType dup s_Label- c@ Check: s_Label dup s_filesize- c@ Check: s_filesize + dup s_#Random- c@ Check: s_#Random dup s_#Played- c@ Check: s_#Played dup s_Filename- c@ Check: s_Filename *************** *** 174,177 **** --- 187,191 ---- dup l_Label- c@ Check: lbl_Label dup l_File_size- c@ Check: lbl_File_size + dup l_#Random- c@ Check: lbl_#Random dup l_#Played- c@ Check: lbl_#Played l_Filename- c@ *************** *** 186,189 **** --- 200,204 ---- IsButtonChecked?: s_Label over s_Label- c! IsButtonChecked?: s_filesize over s_filesize- c! + IsButtonChecked?: s_#Random over s_#Random- c! IsButtonChecked?: s_#Played over s_#Played- c! IsButtonChecked?: s_Filename over s_Filename- c! *************** *** 193,196 **** --- 208,212 ---- IsButtonChecked?: lbl_Label over l_Label- c! IsButtonChecked?: lbl_File_size over l_File_size- c! + IsButtonChecked?: lbl_#Random over l_#Random- c! IsButtonChecked?: lbl_#Played over l_#Played- c! IsButtonChecked?: R_Filename over l_Filename- c! *************** *** 200,204 **** : HandleButtons ( Action/Button - ) case ! IDOK of SaveSettingsForm close: Self endof IDcancel of close: Self endof endcase --- 216,220 ---- : HandleButtons ( Action/Button - ) case ! IDOK of SaveSettingsForm close: Self SortCatalog endof IDcancel of close: Self endof endcase |