Commit Graph

1924 Commits

Author SHA1 Message Date
Bryan Schumaker 78e9c744fd newgui: Start rewriting the gui
The plan is to port everything to gtkmm since using the C functions is
beginning to get annoying.  Compile the new code using `scons newgui`
for now.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker e4d73fee48 libsaria: Rename IdleTask::run_task()
I think that just calling it run() is better.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 9c72e56261 libsaria: Remove idle::do_task()
It's a 2 line function that was used in only one place.  Time to remove
it and simplify the surrounding code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 2f2c9cdf68 libsaria: Move idle.cpp to libsaria/
The idle queue code is all one file now, so it can exist directly in libsaria/

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 5bc357be18 libsaria: Remove operator[] for strings
Public member variables is easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker d79eefc8b2 libsaria: Remove operator[] for uint values
Public access to variables is easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 29718ceb12 libsaria: Remove operator[] for int values
Public access to these variables is easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 56dd54f114 libsaria: Remove operator[] for Track.banned
Public access to this variable is simpler and probably more efficient.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker aaf1205078 libsaria: Make some track variables public
This should be easier than making a bunch of getters or setters.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 05bbad5444 libsaria: Resizing a vector invalidates pointers
I was keeping a vector of objects, and then pass pointers to these
objects around everywhere.  HOWEVER, when vectors are resized they
allocate new memory and copy things over invalidating iterators and
pointers to the original objects.  This can cause memory corruption
issues when I try to use a pointer to an object that no longer exists.

The simple solution?  Allocate tracks dynamically and then store the
pointer in the library path.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker c094f9791f libsaria: Set correct library version
Otherwise we'll only read the first 124-ish songs and then stop...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 9043183807 libsaria: Remove old idle task stuff
I handle the idle task stuff inside the idle layer, hiding it from
everything else.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 1ac51775c3 libsaria: Remove ReadTask
I replaced it with the generic idle task I just created.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 5244fe9605 libsaria: Begin work on a new generic idle task
I want to remove the various idle task types that have built up and
replace everything with a single idle type.  I also want the idle layer
to be the only place new tasks are allocated.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker b6e0d6dd58 libsaria: Remove my custom linked list class
Now that I'm using vectors for everything I don't need to maintain my
own class.  Nothing uses it now, so it can be safely removed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 36e9995bb9 libsaria: Use vectors to store the track list
For each library path, I replace the linked list with a vector allowing
me to easily index into the list to find tracks.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 592a924881 libsaria: Change the path_list to a vector
For easier lookups.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 8f7a610d6d libsaria: Remove DataState optimization
It made sense at the time, but I'm not convinced the added complexity is
actually worth it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker b7a21789b6 libsaria: Pass around more const strings
This allows me to pass them by reference, it should be a bit more
efficient.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 0b9beac1c3 ocarina: Include bash completion script as part of build
I can't believe I forgot this...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:49 -04:00
Bryan Schumaker 8f10d75fac Ocarina 5.11.1
- Pass escaped URIs to gstreamer.
- Fix `scons release` for bugfix releases.
2012-12-06 19:36:21 -05:00
Bryan Schumaker fa812ece74 Correct `scons release` for bugfix releases
This corrects the package build to look for a tarbal named
"ocarina-5.11.1.tar.gz" instead of "ocarina-5.11.tar.gz"

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-12-06 19:35:54 -05:00
Bryan Schumaker 9370ef34a1 libsaria: Escape filepaths passed to gstreamer
Otherwise songs might error out part way through playing and skip to
something else.  It doesn't make sense and I wish I knew why :(

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-12-06 19:28:43 -05:00
Bryan Schumaker b2226d926e Ocarina 5.11 2012-11-22 10:14:34 -05:00
Bryan Schumaker a4b154765f libsaria: Send a PLAYLIST_CHANGED notification when loading
To tell the UI what gui settings need to be changed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-22 09:50:06 -05:00
Bryan Schumaker 98934ff42d libsaria: Move the rest of the deck code over
I also clean up the garbage collect code a bit.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-18 12:27:14 -05:00
Bryan Schumaker acb0334122 libsaria: Move deck::next() to deck.cpp
And extra variables / functions needed by next().

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-18 12:03:26 -05:00
Bryan Schumaker 3a486082af libsaria: Move recent playlist to the new deck file
I also created a new playlist flag for unique playlists so I don't need
to handle this elsewhere.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-18 11:45:10 -05:00
Bryan Schumaker b091df8ec4 libsaria: Load playlists to a new playlist_deck vector
The vector should be simpler than a linked list for tracking playlists.
I also changed reading playlists to use a function in the playlist class
rather than a function outside of the playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-18 11:15:18 -05:00
Bryan Schumaker 27b2e386f0 libsaria: Begin a new deck.cpp file
I'm going to gradually move this out of the playlist/ directory since it
doesn't really belong there.  I also plan on cleaning up / rewriting
much of the code as I go along.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-18 10:20:31 -05:00
Bryan Schumaker fa09d53d70 libsaria: Remove my custom List class from the idle queue
I plan on removing this class in favor STL classes.  I probably
shouldn't have even tried to implement this myself...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-18 09:53:43 -05:00
Bryan Schumaker 57bf98972d libsaria: Simplify finding audio position and duration
I don't need the extra static function calls since they're only called
once.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-11 15:26:57 -05:00
Bryan Schumaker e16b70fd81 libsaria: Make audio variables static
Everything is in a single file...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-11 14:46:29 -05:00
Bryan Schumaker 9122568d8a libsaria: Remove audio::durstr()
Nothing used it anymore, so it can be removed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-11 14:34:29 -05:00
Bryan Schumaker ab002e0a7f libsaria: Move audio.cpp to the libsaria directory
All the code is in a single file now so a subdirectory is unnecessary.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-11 14:31:30 -05:00
Bryan Schumaker 56f15b4c44 libsaria: Fold most audio code into a single file
This puts everything together and should help me remove the
subdirectory.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-11 14:30:30 -05:00
Bryan Schumaker 7557acc239 libsaria: Strip out old gstreamer code
Most of this was commented out and hasn't been used in almost a year.
The new gstreamer code doesn't have the property probe feature anymore,
so I can't reimplement my old alsa code.  I'll drop it for now and
figure it out later (after cleaning up this other code).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-11 14:19:36 -05:00
Bryan Schumaker 83f8b1e543 libsaria: Don't use random if playlist size == 1
This could cause a floating point exception when I mod-by-zero...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-11 14:03:53 -05:00
Bryan Schumaker 1205a94aa7 ocarina: Adjust scroling with j and k
When scrolling I think it's important to show a few rows that are coming
up next so users know they can stop scrolling and not need to reverse.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-08 08:11:19 -05:00
Bryan Schumaker 5e456ad64c libsaria: Tune random next()
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-08 08:10:17 -05:00
Bryan Schumaker beb9019057 libsaria: Switch to gstreamer 1.0
Gstreamer 1.0 has been out for a while and replaces gstreamer 0.10.
Let's make sure we use the most recent version going forward.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-08 08:09:05 -05:00
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 f65416ed2c libsaria: Clean up playlist header file
There was an undefined function and an unused protected section.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 23:14:36 -04:00
Bryan Schumaker e1930b0c88 libsaria: Create functions for checking and setting flags
I also replace a few PLAYLIST_* notifications with a generic
PLAYLIST_CHANGED notification for when small changes occur.  I think
that using set_flag() and check_flag() will make code cleaner and easier
to maintain.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 22:58:26 -04:00
Bryan Schumaker 0744aaad45 libsaria: Send track updated notifications after sorting
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 22:11:29 -04:00
Bryan Schumaker 671dd7eb3a libsaria: Remove PLAYLIST_SIZE notification
Instead, the UI should change the size during PLAYLIST_ADD and
PLAYLIST_RM.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 21:58:53 -04:00
Bryan Schumaker a6fa805a53 libsaria: Move next() into playlist.cpp
I don't want to keep one function in a file by itself.  Instead, let's
just move it into the main playlist file.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 21:48:29 -04:00
Bryan Schumaker 1e23389b51 libsaria: Remove old playlist.h
Nothing uses this file anymore, so it can be safely removed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 21:46:51 -04:00
Bryan Schumaker e116025754 libsaria: Fix playlist bulk insert
My "insert while sorted" code was getting complicated, and didn't send
all the notifications to the UI (only the first ~1200 songs were
displayed).  This patch both simplifies the code and produces the right
answer without a noticable performance penalty.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 21:43:52 -04:00
Bryan Schumaker d345d3211f libsaria: Remove the old remove_track_it() function
I can make this simplier by simply passing the index into the vector,
rather than needing to calculate the iterator and pass the index.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 17:03:16 -04:00