Commit Graph

1344 Commits

Author SHA1 Message Date
Bryan Schumaker
3749b56bfd libsaria: Remove old list file
I've completely replaced it with my new list now.
2011-12-29 15:47:11 -05:00
Bryan Schumaker
ec2aadbc2d libsaria: Move get_info() function to new list 2011-12-29 15:43:17 -05:00
Bryan Schumaker
fb0084c275 libsaria: Remove old play_id() function
Nothing uses it anymore
2011-12-29 15:35:06 -05:00
Bryan Schumaker
17e4f3f2ca ocarina: Use new playid() function 2011-12-29 15:33:48 -05:00
Bryan Schumaker
8049a7a9fd libsaria: Select songid using libsaria controls.cpp
I do this in the upper level namespace, rather than doing it in the
library, to make use of the play_filepath() function that I already have
written.
2011-12-29 15:32:15 -05:00
Bryan Schumaker
c1cc33877c libsaria: Find filepath from songid using new list 2011-12-29 15:30:30 -05:00
Bryan Schumaker
7b78f18e52 libsaria: Remove next() from the queue
I don't need it anymore.
2011-12-29 15:10:00 -05:00
Bryan Schumaker
bcc34ef4b0 libsaria: Choose next song from the new list
I removed the old list functions while I was at it.  I also changed the
next() function in the controls.cpp file to work with filepaths so the
library and queue won't have to load the chosen file themselves.
2011-12-29 15:06:12 -05:00
Bryan Schumaker
942c518394 libsaria: Remove for_each() from library
I don't need it anymore.
2011-12-29 14:20:53 -05:00
Bryan Schumaker
fea84b90ac libsaria: Move list size function
It now exists with my new playlist code, since I'm phasing out the old
code.
2011-12-29 12:28:00 -05:00
Bryan Schumaker
5dcfac8be2 ocarina: Use the iterators to fill the library list
I keep the old way around for the queue until I can change that, too.
2011-12-29 12:09:35 -05:00
Bryan Schumaker
2fd41ff4d7 libsaria: Create iterator functions for the library
I use these to fill in the UI list for the library.  I think this will
be easier to use (and cleaner) than passing a function pointer to a
for_each loop.
2011-12-29 12:08:32 -05:00
Bryan Schumaker
0fa608c90f libsaria: Sort the new playlist after reading
Otherwise it won't be useful...
2011-12-28 23:04:41 -05:00
Bryan Schumaker
2effa26b32 libsaria: Began new playlist namespace
It'll exist in parallel to the current list for now.  I'll remove the
old one once the new one has all the same features.
2011-12-28 22:25:55 -05:00
Bryan Schumaker
336f188686 libsaria: Sort list using comparison operator
It makes sense to define a function for sorting tracks as part of the
track class, rather than having to implement it externally.
2011-12-28 22:03:43 -05:00
Bryan Schumaker
1e5628d059 libsaria: Find lowercase tags when creating a track
This avoids several lookups during list sorting, so initial startup
should be a little bit faster now.
2011-12-28 17:40:11 -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
abfd67cc84 libsaria: Refresh index while scanning
This keeps the index up-to-date with the library.  Tracks are indexed as
they are scanned, then the current filter string is run through the
index again to update it.
2011-12-27 23:02:09 -05:00
Bryan Schumaker
26a18f331e libsaria: Remove old index code
It has been replaced with my new index.
2011-12-27 22:42:50 -05:00
Bryan Schumaker
1d3baa79d5 libsaria: Implement index::rand()
Needed to get a random song from the index when filtered.
2011-12-27 22:41:54 -05:00
Bryan Schumaker
5bf0a26584 ocarina: Filter using the new index
This is why I made it...
2011-12-27 22:31:52 -05:00
Bryan Schumaker
83488dfa06 libsaria: Add filtering to the new index
Otherwise it's useless.  I search all three indexes and use the union of
those results to determine what is visible.
2011-12-27 22:30:38 -05:00
Bryan Schumaker
9c749e4ade libsaria: Began new index
Right now I just add songs to it and cache substrings for each word.  I
also print out stats during libsaria shutdown.
2011-12-27 19:42:46 -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
6eaa8f944c ocarina: Changes for the TrackTag() class removal 2011-12-26 12:14:35 -05:00
Bryan Schumaker
a74cea2e71 libsaria: Remove old TrackTag() class
It was basically a layer of misdirection that made it harder to use
Tracks.  The Track() class now does everything that the TrackTag() one
did.
2011-12-26 12:14:25 -05:00
Bryan Schumaker
11e3d77dca ocarina: Remove references to ino_t
sid_t is more obvious that it's a song id.
2011-12-25 23:30:28 -05:00
Bryan Schumaker
5f20899b14 libsaria: Remove references to ino_t
I want to use sid_t instead.  It's more obvious what it's used for.
2011-12-25 23:29:35 -05:00
Bryan Schumaker
f047c72521 Ocarina: sid_t changes
Use the "get_songid()" function rather than "get_inode()"
2011-12-25 23:07:58 -05:00
Bryan Schumaker
e4f7fde197 Create a typedef for song ids
Passing around an inode number doesn't tell people what the inode is
used for.  Typedefing it to a song id is more helpful.
2011-12-25 23:07:58 -05:00
Bryan Schumaker
da118b2281 libsaria: Switch to the new OutFile() class
The new class is more convenient to work with since it's the output
stream with my save protocol built in.  I should have done this earlier!
2011-12-25 22:34:12 -05:00
Bryan Schumaker
5877d3ac4a libsaria: Created a new OutFile() class
Similar to how I created a new InFile() class.  The new one can be used
directly as a stream, only it has my save file protocol stuff built in.
2011-12-25 22:21:11 -05:00
Bryan Schumaker
6794ce15e5 libsaria: Return ifstream reference from operator>>
This allows me to chain calls to the same stream, cleaning up the code.
2011-12-25 22:20:04 -05:00
Bryan Schumaker
d39536d7d0 libsaria: Completely replace old InFile() class
My InFile2() class is clearer and simpler, so I've replaced InFile()
with it.
2011-12-25 21:24:02 -05:00
Bryan Schumaker
5e308202a0 libsaria: Create a new way to save files
I inherit from the ifstream class, so I can override the insertion
operator for string handling.  I can then use templates to save
everything else.
2011-12-25 21:16:09 -05:00
Bryan Schumaker
603a76964b libsaria: Store current audio volume
This allows me to restore the volume on startup.
2011-12-23 22:04:24 -05:00
Bryan Schumaker
f7d7d5e038 libsaria: Add floats as preferenc type
Now I can store floating point numbers in addition to booleans.
2011-12-23 22:03:31 -05:00
Bryan Schumaker
8dfbb8915b libsaria: Check for current file before attempting state change
Without this, pressing "play" on an empty library will cause an error.
The recovery code will then try to pick a new song, and fail (since
there are no tracks to choose from).  It will then try to play, cause an
error and repeat forever.
2011-12-23 21:18:45 -05:00
Bryan Schumaker
1dc9df80e1 libsaria: Cleanup audio progress code 2011-12-23 21:14:14 -05:00
Bryan Schumaker
0e983e4043 libsaria: Implement gapless playback
I need to get the next file out of the library or queue without changing
it immediately.  I then queue it up in the gstreamer pipeline so it will
play automatically when the current track finishes.
2011-12-23 20:48:37 -05:00
Bryan Schumaker
2783b8d995 libsaria: Improved audio file loading
I look for an audio-changed signal and push this to the message bus.  I
then use the message to send out the TRACK_LOADED callback to the UI.
This should be even more useful for gapless playback.
2011-12-23 20:46:02 -05:00
Bryan Schumaker
5e20a26dbf ocarina: Set duration on every refresh
The progress bar should stay in sync now.  I got annoyed that it never
did when pausing after the current track.
2011-12-23 20:38:00 -05:00
Bryan Schumaker
7711b354cb libsaria: Create a durstr() function
Call this to get a string representation of the pipeline's current
duration.
2011-12-23 20:31:07 -05:00
Bryan Schumaker
e509d4e723 libsaria: Added comments
I'll be able to figure out these functions easier the next time I see
them.
2011-12-23 16:04:28 -05:00
Bryan Schumaker
04a64ca015 libsaria: Use a load_file() function
All this function does is load a file.  Nothing else.  I think this will
be useful for using about-to-finish.
2011-12-23 16:03:10 -05:00
Bryan Schumaker
f8f5f87e54 libsaria: Remove the get_player() function
I declared the variables in the local header file for use by the audio
layer.  I think this will make things a bit more efficient.
2011-12-23 15:49:56 -05:00
Bryan Schumaker
2458061cf3 ocarina: Use new controls for shortcuts
Fewer things to implement in the UI!
2011-12-23 15:49:10 -05:00