From b7d0e8901041dcee4df5fc3260b0fdfea27353dd Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Wed, 10 Nov 2004 18:55:38 +0000 Subject: sort tagtracker stuff and todo update git-svn-id: https://svn.musicpd.org/mpd/branches/r2562-metadata-handling-rewrite@2579 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- TODO | 13 +++++-------- src/directory.c | 5 +++++ src/tagTracker.c | 10 ++++++++++ src/tagTracker.h | 2 ++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 5f5c08fa4..6fc0719f8 100644 --- a/TODO +++ b/TODO @@ -5,14 +5,11 @@ *) add genre, date, composer metadata *) rewrite metadata/db handling - *) store all metadata entries in table - *) each contains a counter reference - *) new MpdDBTag, which instead of strings allocated for each metadata - entry, store a char * string to the metadata entry in the table - *) multiple artist support - *) multiple genre support {char *, int pairs for each metadata entry - indicating the type of metadata and its value) - *) MpdDBTag <-> MpdTag interface + *) rewrite search and find to be more flexible and elegant + *) implemnt list command + *) for each TagTrackerItem, include a temp varaible for storing + if it has been printed already + *) reset this variable before list command processing *) rewrite filename handling *) use memory more efficiently, by iteratively constructing filename diff --git a/src/directory.c b/src/directory.c index 5ac94c534..443c8bfba 100644 --- a/src/directory.c +++ b/src/directory.c @@ -32,6 +32,7 @@ #include "mpd_types.h" #include "sig_handlers.h" #include "player.h" +#include "tagTracker.h" #include #include @@ -1000,6 +1001,8 @@ int writeDirectoryDB() { while(fclose(fp) && errno==EINTR); + sortTagTrackerInfo(); + return 0; } @@ -1088,6 +1091,8 @@ int readDirectoryDB() { if(stat(directory_db,&st)==0) directory_dbModTime = st.st_mtime; + sortTagTrackerInfo(); + return 0; } diff --git a/src/tagTracker.c b/src/tagTracker.c index 56480167b..cea02f471 100644 --- a/src/tagTracker.c +++ b/src/tagTracker.c @@ -93,3 +93,13 @@ void printMemorySavedByTagTracker() { DEBUG("saved memory: %li\n", (long)sum); } + +void sortTagTrackerInfo() { + int i; + + for(i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) { + if(!tagLists[i]) continue; + + sortList(tagLists[i]); + } +} diff --git a/src/tagTracker.h b/src/tagTracker.h index f7c007fe7..fcafde736 100644 --- a/src/tagTracker.h +++ b/src/tagTracker.h @@ -11,4 +11,6 @@ int getNumberOfTagItems(int type); void printMemorySavedByTagTracker(); +void sortTagTrackerInfo(); + #endif -- cgit v1.2.3