Commit Graph

1884 Commits

Author SHA1 Message Date
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
Bryan Schumaker 52c09ddb12 libsaria: Don't track playlist length
There is no reason to track this on my own, iterating over all tracks
and calculating it on the fly is easier and basically unnoticable.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 15:59:54 -04:00
Bryan Schumaker d9e343895c libsaria: Clean up picking the next song from a playlist
I don't need to iterate through a linked list to find the track anymore.
Instead, I can access tracks directly using an index.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 15:36:09 -04:00
Bryan Schumaker cf8ded7d5d libsaria: Remove name field from playlists
I know what playlists are library, recent and banned.  All others are
just named "Playlist" so there is no need to set up a name variable.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 15:34:13 -04:00
Bryan Schumaker b98373c0fa libsaria: Convert Playlist class to use a vector
Vectors are more straightforward than linked lists and they should allow
me to clean up the code a lot.  For now I just put in the straight
conversion, I'll clean things up in future patches.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-02 23:00:20 -04:00
Bryan Schumaker c67222ab95 libsaria: Remove remaining PlaylistRenderer code
I didn't realize this was still around.  It should be removed since I
switched to a notification system instead of using the renderer.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-02 21:43:32 -04:00
Bryan Schumaker 0a4e4d9085 libsaria: Use [] to access track string properties
This finishes the job I started in the last commit.  Once again, I use
an enum of string properties to determine the right field to return.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-10-31 17:42:57 -04:00
Bryan Schumaker a606830f7b libsaria: Use [] to access track properties (not string)
Rathen than using a bunch of get_PROPERTY_NAME() functions, I think it's
cleaner to use dictionary-like indexing to access properties.  This
patch converts most track access functions, but I haven't gotten around
to strings yet.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-10-31 17:29:12 -04:00
Bryan Schumaker 21313e9b52 ocarina: Add a sort button
I also respond to the PLAYLIST_SORTED notification so we do the right
thing when loading a playlist during startup.  I don't put the sort
button on the library, recent list or banned list because I don't think
these lists should ever be sorted.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-17 08:18:13 -04:00
Bryan Schumaker 9933b31353 libsaria: Sort the playlist when setting PL_SORT
Otherwise the flag seems to have no effect until new songs are added.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-17 08:16:59 -04:00
Bryan Schumaker d785b91c46 ocarina: Add a random button to playlists
I reused my old dice png from several releases ago.  This implements the
"switch a playlist from set to queue and back again" feature that I
wanted.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-16 10:34:46 -04:00
Bryan Schumaker 848faa2bc6 libsaria: Move library random into a preference variable
Rather than hardcode this as a flag, if I set this through the
preferences code users can change the value.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-16 10:28:56 -04:00
Bryan Schumaker bf5b8a3bdd libsaria: Remove PlaylistType in favor of flags
Flags let me manually set properties after the playlist has been
created, rather than needing to decide upfront with no way of converting
to something else.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 20:25:09 -04:00
Bryan Schumaker a730eaa2cc libsaria: Remove other playlist types
They were nice for queue vs set, but I'd rather just reintroduce the
random button.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 16:55:02 -04:00
Bryan Schumaker 64b5b78a42 libsaria: Move the next() function into the Playlist class
I plan on removing the extra playlist classes to simplify code a bit, so
this function needs to be implemented for everything.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 16:38:33 -04:00
Bryan Schumaker 0600556ca4 libsaria: Replace add_track() and friends
I created simpler functions using the push_front() / push_back() names
that stl uses.  If we're a set-type playlist, then call the
insert_sorted function instead.  I also remove unnecessary bulk-inserts
of a single track.  Packing and unpacking a list each time seems stupid.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 16:22:50 -04:00
Bryan Schumaker a8f18478fa libsaria: Turn recent playlist into a MRU list
Basically, don't list duplicates.  If a song on the list is added again,
instead I move it to the top of the list.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 13:31:59 -04:00
Bryan Schumaker fc7a27c99f ocarina: Change the ban button to my old thumbs up / thumbs down image
These images still work, and banning songs is the reason that I found
them in the first place!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:47:33 -04:00
Bryan Schumaker 31339bed2f ocarina: Add in bash command completion
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:47:33 -04:00
Bryan Schumaker 8a08967a48 Simplify remote commands
- Read a command from the pipe, rather than reading a file with a
  command in it.
- Use a single ocarina script for all commands, rather than several two
  line scripts.
- Change ocarina.bin to point to ocarina instead of ocarina-player for
  convenience.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:47:31 -04:00
Bryan Schumaker 4bf66921df Improve build scripts
The build system hadn't been touched in a while, so it needed some
cleaning up.  I moved ocarina-specific files into the ocarina/ directory
and use the ocarina/Sconscript to set up build commands.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:14:50 -04:00
Bryan Schumaker 11b421dfbb Remove old screenshot directory and image
THese are screenshots from 2010 and the early Ocarina 4.x days, so
they're somewhat out of date...  I also remove a crude ocarina icon that
I'm surprised is still around.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 19:42:08 -04:00
Bryan Schumaker 0d2191da13 libsaria: Remove path/
This was old code that had been replaced by fs.cpp months ago.  I must
have forgotten about removing the rest of it...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-12 08:27:06 -04: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 267d6084d1 Begin Ocarina 5.11 2012-09-12 07:59:07 -04:00
Bryan Schumaker d59402b6b8 Ocarina 5.10 2012-09-10 08:05:04 -04:00
Bryan Schumaker 97fbd569e9 ocarina: Show and hide the recent and banned lists
Users may not always want to see them, and now I don't have an empty
"settings" tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 13:44:01 -04:00
Bryan Schumaker a9d875e05e libsaria: Better prefs::init() function
The preference may be set to zero by the user but default to a non-zero
value.  This can cause frustration on both the user and developer ends.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 13:42:05 -04:00
Bryan Schumaker 83e3763083 libsaria: Remove songs from the library playlist when they are reaped
It's useful to keep the UI in sync with the backend...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 12:58:41 -04:00
Bryan Schumaker 4d764eeb00 libsaria: Add tracks to the lib_playlist when scanning
I was trying to add an empty list, rather than track items.  This caused
the library count to increase (on the library path tab), but the library
playlist was never given track pointers so you had to restart ocarina to
see songs.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 12:48:12 -04:00
Bryan Schumaker 3df9d153f6 ocarina: Reenable the named pipe
I eventually want to use a unix socket so I can get bidirectional
access.  For now, I'll just reuse the old code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 10:54:50 -04:00
Bryan Schumaker 42c6bdff0e ocarina: Created add-to-playlist menu items
For people who don't like keyboard shortcuts...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-08 10:09:57 -04:00
Bryan Schumaker 55cfdc5dba ocarina: Add a playlist right-click menu
Used to create new playlists, exactly the same as the menu in Ocarina
5.9.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-08 09:28:28 -04:00
Bryan Schumaker 5be817167b ocarina: Return index of searched track
And not the index of the current iterator.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-06 12:02:15 -04:00
Bryan Schumaker 442b6ffa50 ocarina: Change default window dimentions to (900, 600)
The 8:6 ratio looked ok, but 9:6 removes scrollbars with my current
font settings.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-06 11:59:08 -04:00
Bryan Schumaker 96ace25ffe ocarina: Respond to j and k even if treeviews aren't focused
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-06 11:52:31 -04:00
Bryan Schumaker 3acbbb048e ocarina: Focus the window when changing tabs
This prevents the entry widget from gaining focus when switching tabs.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:32:46 -04:00
Bryan Schumaker 11b685aeb0 libsaria: Remove playlist renderer
I have notifications to handle everything the renderer used to do, and
I've removed it from the UI side.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:22:43 -04:00
Bryan Schumaker 68aa523ba8 ocarina: Delete dynamically allocated playlist widgets
Plug the memory leak.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:18:46 -04:00
Bryan Schumaker 097b157c10 ocarina: Pass a playlist to set_length_label()
current_widgets() works based on the current tab number, and the
"switch-page" signal is triggered BEFORE the current page is updated in
the GtkNotebook structure.  This means that I was actually setting the
length based on the previous tab, and not the new one.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:15:58 -04:00
Bryan Schumaker 5f1fb2290a ocarina: Remove old playlist code
ocarina/playlist/ was the last subdirectory remaining in the ocarina
code, and I can finally remove it.  Thank you GtkBuilder!  At this
point, there is only one ocarina header file, so I move it to the main
ocarina directory.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:13:47 -04:00