Commit Graph

10 Commits

Author SHA1 Message Date
Bryan Schumaker 33c80788b8 libsaria: Rewrite playlist filtering
I used to use my own inverted index implementation, which makes sense if
I'm searching all songs for a specific match.  Instead, GTK was visiting
each track and asking "does this song match?" and this requires a
different implementation.  So rather than make an index, instead I have
each track generate substrings for its tags and then I compare filter
text against the substring set.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-04 09:17:22 -05:00
Bryan Schumaker 258875bdb8 libsaria: Move header files out of include/libsaria/
Ocarina no longer has a header file subdirectory so there is no reason
to have a libsaria subdirectory anymore.  Putting header files directly
in the include/ directory is a bit simpler.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-12 08:15:31 -04:00
Bryan Schumaker c5fe4546e2 libsaria: Format a duration (in seconds)
I turn it into a string "W days, X hours, Y minutes, Z seconds"

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 1933689d4f Added copyright lines to everything
I probably should have done this earlier... oh well

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-19 17:17:24 -05:00
Bryan Schumaker a3130a7da5 libsaria: Cache lowercase strings, too
This is useful for sorting the library when filling in the list, since I
do many comparisons with the same artists and albums.  This beats having
to lowercase them every time!
2011-12-28 11:00:08 -05:00
Bryan Schumaker 8e4b3dfbfe libsaria: Don't track cache misses
Each cache miss will add a new word to either the format cache or the
substring cache.  I can look at the size of the caches to determine the
number of misses rather than keep track of this with a new variable.
2011-12-28 10:23:17 -05:00
Bryan Schumaker 147a212809 libsaria: Format to a set of words
I don't care about the order of words for indexing, and I don't need
duplicates either.  Formatting to a unique set of words should make
things a little faster.
2011-12-28 10:15:08 -05:00
Bryan Schumaker 52a3e73023 libsaria: Print format_cache stats
I wanted to know how often there were cache hits and misses, so I print
out these stats on shutdown.
2011-12-27 19:42:27 -05:00
Bryan Schumaker 664ad0dad2 libsaria: Cache words generated from strings
I now look up a list of words from a map (if it exists), rather than
having to iterate over the same string potentially many times.
2011-12-27 18:48:57 -05:00
Bryan Schumaker 1c0084b2e9 libsaria: Created a generic format_text() function
This is used by the track tags for creating word lists.  I also use the
function to format filter search text.
2011-11-13 10:47:55 -05:00