Commit Graph

655 Commits

Author SHA1 Message Date
Bryan Schumaker 38c074d898 build: Improve aliasing for tests
scons tests - Compile all tests
scons tests/basic - Compile basic tests
scons tests/basic/print - Compile text printing test

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker f75ba5a2b8 tests: Add a basic test
This test checks for the version.h file and then compiles it with and
without debugging enabled.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 101648dc0a Remove old include files
I'm going to replace them with new files for Ocarina 6.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker f6cb19145d libsaria: Remove app name from init data
I only have one application so there is no point in having a way to
create multiple application directories.

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
Bryan Schumaker ba9ecd258b ocarina: Pass key presses directly to the playlist
This lets me remove the "if treeview is focused" special cases that keep
popping up in the window keypress handler.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 10:17:57 -04:00
Bryan Schumaker 50b4198001 Add a PLAYLIST_DISABLE notification
Disabled playlists are ignored when picking the next song.  I grey-out
the widgets on the UI when this notification is received.  I keep
filtering enabled this time (the entry was disabled too in Ocarina 5.9)

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 09:21:02 -04:00
Bryan Schumaker 3bb8053ea2 Add a close button to temporary playlists
I put it on the tab page this time, instead of in the tab label.  I
don't want wide tab labels, so I should eventually come up with a way of
closing playlists without having to change tabs.  Maybe a right-click
menu?

I also noticed that the libsaria delete_playlist() code didn't work, so
I simplified it a bit.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 13:34:06 -04:00
Bryan Schumaker e57b2891e6 ocarina: Clean out some unused playlist code
And comment out things I want to keep as reference so that things
compile.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 12:40:02 -04:00
Bryan Schumaker c46671b1fb Create a PLAYLIST_GOTO notification
To move the cursor to the current song.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 12:14:54 -04:00
Bryan Schumaker 9fb1d05376 Remove PLAYLIST_FILTER notification
It's easier to refilter automatically after setting the filter text,
rather than going through a bunch of function pointers to change the filter.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 11:02:46 -04:00
Bryan Schumaker 992539798b ocarina: Unselect rows when pressing the Escape key
The first time Escape is pressed, rows are unselected.  The second time
Escape is pressed, the toplevel window is selected.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:07:41 -04:00
Bryan Schumaker 9365881cb4 Reorder playlists
The user can drag-and-drop tabs to change their order in the libsaria
playlist deck.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 23:39:08 -04:00
Bryan Schumaker 5bce295251 Add a PLAYLIST_DELETE notification
Triggered when a playlist is garbage collected so the UI can remove the
tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 13:35:48 -04:00
Bryan Schumaker 26e818cc21 Send a PLAYLIST_RENUMBER notification
I do this when playlists are renumbered, I also move tabs around to
match their new numbers.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 13:06:18 -04:00
Bryan Schumaker d27a1fb7ba ocarina: Implement switch-to-page-n keyboard shortcut
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 12:20:43 -04:00
Bryan Schumaker 5c09db59a6 Create dynamic playlist tabs
Instead of using a "on_new_playlist()" function, I now use the
notification system to tell the gui that a new playlist has been
created.  For now I just put it on the front of the tab list.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 12:09:01 -04:00
Bryan Schumaker 370f6a6832 ocarina: Programmatically create tabs
Dynamic playlists are going to need to run the same code to generate
playlist tabs as the static tabs.  Since I don't know how to use
GtkBuilder fragments, instead I write the code for generating each page.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 11:11:20 -04:00
Bryan Schumaker 10cdc5248a ocarina: Move some playlist setup to playlist.cpp
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 12:35:56 -04:00
Bryan Schumaker 5a4b9df2b2 ocarina: Split playlist.cpp into two files
One for managing the notebook tabs (tabs.cpp) and one for managing a
specific playlist page (playlist.cpp).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 12:21:11 -04:00
Bryan Schumaker e6c44bf1a9 ocarina: Respond to "Return" as a shortcut
I think it'll be useful to change focus to the current treeview through
a shortcut.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:37:08 -04:00
Bryan Schumaker 5a9f4f4bca ocarina: Add shortcuts for switching directly to a playlist
Since I don't have dynamic playlists re-implemented yet, I just swtch
between the library, recent, and banned playlists.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:18:46 -04:00
Bryan Schumaker be67f81782 ocarina: Respond to "slash" keypress
This allows easier access to the filter entry, since clicking it is too
slow.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:04:52 -04:00
Bryan Schumaker 55431421bf ocarina: Reenable some keyboard shortcuts
I have to track if a filter-text entry has focus to do this properly,
otherwise using a shortcut key while searching a playlist will trigger
that shortcut.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 09:48:11 -04:00
Bryan Schumaker ad3cbdebff ocarina: Move playlist tabs setup to playlist.cpp
This was in body/playlist.cpp, but I eventually plan on removing this
file so the code I'm using from there needs to be moved somewhere else.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-30 13:58:46 -04:00
Bryan Schumaker a985ff70a9 Create a PLAYLIST_UPDATE notification
This notification is sent when a track in the playlist is updated, such
as when the play count is incremented.  I also remove the
track_updated() functions from the library renderer and ocarina::Playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-30 10:44:48 -04:00
Bryan Schumaker e8fd94cdeb ocarina: Clear out old ocarina::Playlist code
This class is slowly going away, and these functions have already been
reimplemented using my GtkBuilder interface.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-30 09:29:53 -04:00
Bryan Schumaker 69687ac6c6 libsaria: Remove obsolete renderer functions
Dynamic playlists are disabled right now, so I'm making use of this time
to clear out old code.  This patch removes library renderer functions
that have already been reimplemented.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-30 09:28:07 -04:00
Bryan Schumaker e6d9d2a906 ocarina: Remove more obsolete code
Some of this involved commenting out dead code that I want to use for
reference later.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-30 09:16:08 -04:00
Bryan Schumaker 9801e9335b Create an IDLE_ADD notification
Used for setting up g_idle_add().  Without this, banning songs will save
but unbanning them won't.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-29 10:30:56 -04:00
Bryan Schumaker e9f8c34e5a Create a PLAYLIST_RM notification
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-29 10:30:54 -04:00
Bryan Schumaker 7483aa3c4f ocarina: Set length label when tabs are changed
My old code was doing this by looking for widgets getting mapped or
unmapped.  This was stupid, so now I'm using the GtkNotebook switch-page
signal.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-29 10:29:41 -04:00
Bryan Schumaker b8f2ffdf48 Add a LIBRARY_FILTER notification
I also enable filtering on the new library tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-26 10:27:40 -04:00
Bryan Schumaker b2e2404741 ocarina: Play songs when double clicking rows
I copied this function from playlist/treeview.cpp since it seemed to be
working well.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-26 09:31:38 -04:00
Bryan Schumaker 8583ac01d9 Add a PLAYLIST_SIZE notification
Used to notify the UI that the playlist size has changed.  Other options
include: Set the size automatically when responding to PLAYLIST_ADD (and
evenutally "PLAYLIST_RM")

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-25 16:15:47 -04:00
Bryan Schumaker 9b6665030a Create a new Library playlist tab
This tab is appended at the end of the notebook, so it looks as if there
are two Library tabs.  I'm going to use notifications and GtkBuilder on
the new tab to remove the PlaylistRenderer and to hopefully make adding
new features easier.  Right now only inserting tracks into the
LibraryPlist works, and I eventually want to remove the LibraryPlist
liststore in favor of a custom treemodel.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-24 08:35:25 -04:00
Bryan Schumaker fc40dd535c libsaria: Create notifications for autopause
- Send one when the pause type changes
- Send another when the pause count changes

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-22 08:04:21 -04:00
Bryan Schumaker 00111fc87b libsaria: Notifications for play and pause events
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-21 18:19:27 -04:00
Bryan Schumaker 9f7d861b77 libsaria: Remove library::Driver
I initially made this class so that multiple front ends could be used at
once and all receive the same notifications.  I see now that this was a
stupid idea, since I only need to keep one list of the library.  My
notify() function does the same stuff without the need for a driver
list.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-21 17:55:27 -04:00
Bryan Schumaker 3c87b9f852 libsaria: Pass an argument for notifications
Any void * will do, or even NULL!  Try to keep notify.h up-to-date with
what argument is passed and please don't send out the same notification
with multiple argument types.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-21 07:56:45 -04:00
Bryan Schumaker db8be5659c libsaria: Add in a simple notification system
Right now it only notifies that an event happened.  I think I should
eventually pass in an additional argument related to the event that
happened.  This will allow me to send out notifications for preferences
or library paths changing.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-20 08:26:38 -04:00
Bryan Schumaker 5d2631d19a ocarina: Implement the "Add Library" button
To add new paths to the library.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-09 08:29:41 -04:00
Bryan Schumaker 97a7edce41 ocarina: Add an update_all() button
Click to update all library paths.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-08 08:22:33 -04:00
Bryan Schumaker 34dd1a1088 ocarina: Show paths in the library
Clicking them doesn't do anything yet, and the buttons are
non-functional as well.  But paths are displayed as they're configured!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-07 19:29:18 -04:00
Bryan Schumaker aebcfaab45 ocarina: Re-enable automatic pause
I modified the code slightly from what I used to have.  The biggest
difference is changing the counter will always enable automatic pausing,
so I no longer need the extra click to enable this feature.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-05 09:26:47 -04:00
Bryan Schumaker 761842869e ocarina: Show and hide the idle bar
I check the size of the idle queue during the timeout poll and then
enable the progress bar.  When the queue size reaches zero I hide the
bar again.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-04 13:31:47 -04:00
Bryan Schumaker fdecd7bbdf ocarina: Get the progress bar working again
This was easy, just copy over the old code to status.cpp.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-04 11:57:31 -04:00
Bryan Schumaker 4a764fcc8d ocarina: Remove old controls code
This has already been reimplemented in gtk builder.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 08:09:03 -04:00
Bryan Schumaker 54d1ff991d ocarina: Set the length label
The length label is part of the gtk builder description.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 08:00:08 -04:00
Bryan Schumaker 5a1b8555db ocarina: Clean out old gtk and button code
Now that I'm using gtk builder I don't need gtk convenience functions.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 07:52:08 -04:00
Bryan Schumaker 90355962e4 ocarina: Initialize playlists during startup
I plan on replacing the playlist code eventually, but for now I want to
see how everything looks.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-01 08:19:31 -04:00
Bryan Schumaker bb56dc4d2a ocarina: Remove idle_add() from the ocarina namespace
It's only used in ocarina.cpp, and it's already static there.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 16:09:20 -04:00
Bryan Schumaker ff0f4a2c66 ocarina: Add back Title / Artist / Album labels
Using GtkBuilder now...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 16:04:22 -04:00
Bryan Schumaker 4585d90a32 ocarina: Remove window.h and lots of gtk shortcuts
The shortcuts were hiding more than they probably should have, and I
didn't have much using them.  The only function in window.h that I'm
going to use is init_window(), so I'll just declare it in ocarina.h.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:11:36 -04:00
Bryan Schumaker 1ddcb9f2fc ocarina: Initialize the window from window.cpp
Eventually this will support all the same features of the old ocarina
window...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:01:20 -04:00
Bryan Schumaker 681aa4b611 libsaria: Remove flags from initdata
I wasn't doing anything with these, so they're just getting in the way
and increasing complexity.  This change also allows me to remove the
"enabled" variable from the idle queue.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 14:31:35 -04:00
Bryan Schumaker bfb00ec812 libsaria: Remove the remove_tracks() function from playlists
It doesn't make sense to keep it around anymore since I have the
single-track removal function.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-01 12:02:11 -04:00
Bryan Schumaker 94cbcd9a5d libsaria: Give playlists a remove_track() function
This makes more sense than pushing a single track into a list and then
iterating over the single item...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-01 11:38:50 -04:00
Bryan Schumaker 1ba1c72e3f libsaria: Use a flags variable for initdata
I was using multiple boolean fields, but I think it'll be easier to set
up a single bit-flag field instead.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-01 11:24:06 -04:00
Bryan Schumaker aed5a023b3 libsaria: Remove second library path list
I kept around the old list while I was converting everything over to the
new list.  Now that I support all the needed features, I can remove the
old variable.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-01 11:24:02 -04:00
Bryan Schumaker 250a8b9bfe libsaria: Rename List::last() -> List::end()
To better match C++ iterators.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-30 12:08:04 -04:00
Bryan Schumaker e0074525f3 libsaria: Convert the idle queue to use the new list class
- The erase() function returns the previous item
- Implement a push_front() function
- Implement a pop_front() function

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-30 11:59:32 -04:00
Bryan Schumaker e2242359d4 libsaria: Create iterators for lists
Not really C++ iterators, but close enough.  I can get the first and
last values values to use in for loops, I also made a next() function
for list items.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-30 11:28:12 -04:00
Bryan Schumaker 065feedee2 libsaria: Save tracks using for_each_item()
It's simpler than custom writing my own for each loop...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-16 14:51:47 -04:00
Bryan Schumaker bd8cdee041 libsaria: Implement a find_item() for lists
This function takes a function pointer argument that should return
"true" if the current item is the item we're looking for and "false"
otherwise.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-16 14:51:45 -04:00
Bryan Schumaker 8b56659b1c libsaria: Created a list for_each_item()
Useful for accessing each item in the list sequentially without having
to write a lot of loops.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-16 14:04:55 -04:00
Bryan Schumaker 311e404af9 libsaria: Give Lists a size()
Return the "count" variable and hope we don't have more than
MAX_UNSIGNED_INT objects in the list...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-16 13:37:38 -04:00
Bryan Schumaker bf0e340a53 libsaria: Rename ListNode -> ListItem
I like ListItem better.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-14 17:48:44 -04:00
Bryan Schumaker 34c13bc93e libsaria: Add items to a List
I free the memory in the destructor, too!  Be careful, though, the copy
constructor isn't actually a copy constructor.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-14 17:18:22 -04:00
Bryan Schumaker da776eeebf libsaria: Initialize list objects
I point the list head towards itself.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-14 08:11:16 -04:00
Bryan Schumaker 4aac603b85 libsaria: Begin a custom List class
I'm going to gradually replace the stl list with my own implementation.
This should make everything more efficient and I won't have to deal with
those pesky iterators.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-13 21:34:45 -04:00
Bryan Schumaker 14fe5661a5 libsaria: Rename List -> Stack
I want to recycle the "class List" name, so I need to free it up from
the playlist code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-13 21:34:44 -04:00
Bryan Schumaker 7cc5cded9f libsaria: Directly set version in version.h
Rather than building it up as part of a function call

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-02 12:16:34 -04:00
Bryan Schumaker 80cf0bb28e ocarina: Use files in the lib directory
I copy images and other files to lib/ocarina/ during the build to make
installing easier.  The lib directory should always be relative to the
bin (executable) path, so I can easily find the lib path based on
executable path (/proc/self/exe).

I can also use this to find bugs in the buld process, such as adding a
file to the images/ directory but forgetting to add it as an install
target.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-02 10:41:04 -04:00
Bryan Schumaker fbcc660bd6 build: Create a configuration script
Users set values here to be used by the build system.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-28 11:34:37 -04:00
Bryan Schumaker 5f5f23bf9e Build: Create version.h using an Sconscript file
This lets me pull code out of the generic Sconstruct, so it can't be
bad!  I also removed the test directory since I never made unit tests.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-27 10:23:47 -04:00
Bryan Schumaker 4afce6300c Turn off library paths
I set the "visible" field to "false" and then remove each track from the
library playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-23 07:48:10 -04:00
Bryan Schumaker f5181c50b1 libsaria: Fix deck::prev()
Having tracks add themselves to the recent playlist means that it also
adds itself when going backwards through the playlist, resetting the
cur iterator and causing the same 2 songs to be played.  To get around
this, I gave tracks a new load_unlisted() function to load without
adding themselves to the recently played list.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-19 20:48:25 -04:00
Bryan Schumaker 057bce8809 Show last played date on each playlist tab
I like to know when I last listened to a song.

Signed-off-by: Bryan Schumaker <bjchuma@gmail.com>
2012-05-19 20:09:21 -04:00
Bryan Schumaker ca9f3e6cf9 Show the play count in the playlist renderer
I created a new renderer function for updating tracks when they change.
Using this, I can show the new playcount of tracks as it is incremented.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-19 19:47:11 -04:00
Bryan Schumaker 61769f74fd libsaria: Keep a pointer to each playlist a Track is on
Useful for removing them later without having to check every playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-19 19:01:55 -04:00
Bryan Schumaker 77225d4d9f libsaria: Define MAX_PLAYLISTS in a header file
So applications can use this value too.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-19 18:34:30 -04:00
Bryan Schumaker d74d008223 ocarina: Change disable playlist button image
I do this whenever the playlist disabled flag changes.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 12:05:03 -04:00
Bryan Schumaker 973b5d3d31 Save playlist disabled status to file
This allows me to restore it when restarting ocarina.  I also need to
notify the renderer that the playlist status has changed so I can change
the button state.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 11:51:52 -04:00
Bryan Schumaker 35d71efe58 Disable temporary playlists
When a playlist is disabled I won't pick songs from it until the user
re-enables it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 11:25:51 -04:00
Bryan Schumaker f6cdcae79c ocarina: Create a make_toggle_button_data() function
Used to pass extra data to the toggle function.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 11:24:38 -04:00
Bryan Schumaker ed33881a25 ocarina: Created a shortcut for switching to the banned list
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 13:31:02 -04:00
Bryan Schumaker 4718bf77f3 Change playlists when the ban button is pressed
I remove the track from the library playlist and add it to the banned
list.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 13:15:36 -04:00
Bryan Schumaker bb7a662f92 Ban songs in the library
Right now, this just toggles the "banned" field in the Track class and
then skips to the next track.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 13:00:03 -04:00
Bryan Schumaker e8e8589614 libsaria: Add a new field to the Track class
I plan on using this to track if the user has banned a track or not.
This patch introduces the new field and handles the library version
upgrade.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 12:30:11 -04:00
Bryan Schumaker ea7b66ae6d libsaria: Read file from pipe
Scripts should write commands to a temporary file and then write the
path to that file to the application pipe.  I can then write results of
the command to this file before exiting.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 11:51:36 -04:00
Bryan Schumaker 8f1de2745e libsaria: Create functions for opening and closing pipes
I'm going to use the pipe with shell scripts for remote-controlling
ocarina (possibly through a web interface).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-15 11:23:47 -04:00
Bryan Schumaker 463cef95dd libsaria: Create an initdata struct for initializing
Passing individual variables through works for a small number of
variables, but passing a struct makes it easier to add new arguments.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-15 11:06:43 -04:00
Bryan Schumaker d0f6996403 libsaria: Remove the list_recent field from tracks
I think it's easier to check if the track has an associated library
path.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-15 10:49:56 -04:00
Bryan Schumaker 34cd70fa39 libsaria: Track play count
I've had a library field for this for a while, but I haven't been using
it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-15 10:29:26 -04:00
Bryan Schumaker 36bd2c2b66 Reorder playlists in the playlist deck
This allows me to change playback order without having to delete old
playlists and make new ones.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-14 11:21:10 -04:00
Bryan Schumaker 2dd1e362d1 Created a "delete playlist" button
On the libsaria side, I created a function for finding and deleting a
playlist pointer.  On the ocarina side, I added a button to each
playlist tab to remove the tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 13:48:22 -04:00
Bryan Schumaker d03e38ffbb ocarina: Add a make_button_data() function
Used for passing extra data through the button clicked callback.  I also
use this patch to remove the extra GdkEvent argument passed to buttons,
since this argument isn't actually part of the callback...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 13:36:42 -04:00
Bryan Schumaker 5363cfac82 libsaria: Garbage collect the playlist deck
I do this after choosing the next song and after tracks are removed from
each playlist.  This allows me to remove playlists as they empty.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 12:09:39 -04:00
Bryan Schumaker 8309c4a606 libsaria: Remove undefined function
I used in a while ago, but it's been removed (but not from the header file).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 11:35:39 -04:00
Bryan Schumaker 4fe9e667f7 libsaria: Almost always add track to the recent list
Before I was only adding tracks that were picked through the
deck::next() function.  Now I have the track add itself to the recent
list (except when I'm playing an outside track).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 11:26:23 -04:00
Bryan Schumaker c3ba90f900 libsaria: Tell tracks if they should play when loaded
This should set the gst pipeline to the correct state when the song is
loaded, rather than pausing after telling it to play.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 11:07:00 -04:00
Bryan Schumaker b04aaf3815 libsaria: Restore last song on startup
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-07 08:08:23 -04:00
Bryan Schumaker a8c6aabff7 libsaria: Return new current index from rm_index()
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-14 11:36:29 -04:00
Bryan Schumaker c2c13b2cbc libsaria: Create a single add_tracks() function
Derived classes need to implement a do_add_tracks() function instead so
I have a single place to notify the renderer and save the playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-14 11:16:15 -04:00
Bryan Schumaker 18e0daeb17 ocarina: Remove more commented out and disabled code
- The old header functions
- The old callback header file
- The old shortcut registering system
- The old main() code

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:22:44 -04:00
Bryan Schumaker 3b705515c2 ocarina: Remove old songlist code
I've been wanting to do this for a long time.  I don't think I need it
anymore, so it can all be safely removed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:19:20 -04:00
Bryan Schumaker 0cdd5eff0d libsaria: Remove diff reject file
Where did this come from?

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:05:40 -04:00
Bryan Schumaker 3287cde11e ocarina: Find selected indicies
Used for removing tracks from temporary playlists.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:05:01 -04:00
Bryan Schumaker 99757c47f9 libsaria: Remove tracks by index
Because otherwise removing a track will remove all duplicates, too.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:03:46 -04:00
Bryan Schumaker 97427af922 Create new playlists in front
The "S" or "Q" shortcut will create a new playlist on the front of the
deck, "s" or "q" creates a shortcut on the back of the deck.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-10 08:04:29 -04:00
Bryan Schumaker 898865293d libsaria: Change deck::push() to deck::push_back()
I'm going to create a push_front() function too, so renaming it makes
sense.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-10 07:57:14 -04:00
Bryan Schumaker b2c17bd54a libsaria: Create a get_playlist() function
I don't want to keep creating functions for doing things to playlists.
Instead, I'd rather just get the playlist directly.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-09 08:00:12 -04:00
Bryan Schumaker 851aa10ae1 libsaria: Create generic function for reading numbered directories
I create directories with numbered files for the library and playlist,
this patch creates generic code for reading them during startup.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 261316fb5f libsaria: Clean out header files
Remove things that aren't being used anymore.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 0d05e14724 libsaria: Reload playlists on startup
I do this in another idle task, I also had to give the library a
function to find tracks based on (libid, trackid).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 60d2e4fcd8 libsaria: Save temporary playlists
I do this whenever the playlist changes (tracks added, removed or
playlist renumbered).  When playlists are deleted I remove the file.  I
also remove the file when new_number < cur_number.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 3caea974fe ocarina: Refilter the playlist
I don't change what can play as a result, but at least I can find songs
again!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 235ac70033 libsaria: Move filter code
From index.cpp to filter.cpp.  I also added in an "is_visible()"
function for testing visibility of tracks.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 7820b28534 libsaria: Search the index
And notify the renderer to update

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 556aad3344 libsaria: Introduce bare Index class
Right now I just add and remove songs from the index as they are added
and removed from the playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker 2fb2f97a43 libsaria: Fix compile errors
g++ must have gotten updated...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker dc57109d9e libsaria: Give access to pause_count
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 9d271740aa ocarina: Added automatic pause controls
Right now I just pause after the current song, but I eventually plan on
adding controls to pause after N songs.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 2cdfbde9be libsaria: Implement pause after N tracks
I keep a counter that is decremented after every call to next().  When
it reaches zero, pause after loading the next song.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 31ab70b37d libsaria: Remove tracks from a specific playlist
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 659a2208b8 libsaria: Remove files that no longer exist
I scan a library path, do an lstat() and remove the files that can't be
found.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker a1819dd5f9 libsaria: Only add new files during a library scan
I simply check if the file is already in the library before tagging it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 537dc3a22d ocarina: Support removing library paths
Use the "Delete" key for now.  I also added in using the plus key to add
new paths.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 6e97f04e85 libsaria: Remove library paths
- Delete the library file
- Remove tracks from each playlist
- Notify the renderer that tracks have been removed
- Notify library drivers that the path has been removed
- Remove the path from the list

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker a33e1e6d8d ocarina: Use the playlist number
- Create new notebook page at number
- Show number to left of label

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker bc800057e0 libsaria: Expand on numbered playlists
- Renumber when new playlists are either added or removed
- Finding nth playlist is much easier now
- Insert new playlists right before the library

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 4e046beb20 libsaria: Introduce playlist numbers
To track where in the deck they are.  Displaying and modifying them
comes next...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker 5194130db4 libsaria: Rename playlist stack to playlist deck
I'm going to make it less stack-ish because I was getting confused.
Turns out people don't think people have a hard time thinking about song
order starting from the end... :-(

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -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 fcc48dbccb ocarina: Show the length of the currently visible playlist
I should eventually format this better...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker e0ebe4c97f libsaria: Track the length of playlists
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 026b17a6a5 ocarina: Treeview keypresses
To add songs to already-created playlists.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker c6bf52a516 libsaria: Find nth playlist
Gives access to a specific playlist on the stack.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 6ae25ccdcb libsaria: Created a toggle_play() function
Switches between playing and paused.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker f67cecef0e ocarina: Add some keyboard shortcuts
0 - 9: Switch to playlist N
L / l: Switch to library
R / r: Switch to recent songs
N / n: Play next song
P / p: Play previous song
Escape: Give main window focus

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 691f74ee10 libsaria: Return nth renderer
Useful for switching to a specific list in the UI

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 6214136ee3 ocarina: Tab label improvements
- Respond to the renamed() callback
- Right-align / justify labels

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 2ae050fe47 libsaria: Automatically rename playlists when added or removed
The one on the top is always numbered "0"

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 5a272ef62e libsaria: Playlists know their own type
Useful for dynamically renaming them (see next patch).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 319d68e8d2 ocarina: Scroll to current song
Only on non-draining playlists when that playlist selects a song.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker acef058afa libsaria: Tell playlist renderers to goto a specific index
I want to use this to scroll the library list when a new song is picked.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 4116cd3ed2 ocarina: Show recent songs playlist
I also needed to add in a change to focus the library by default.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 3b3beb4625 libsaria: Track recent songs using a playlist
This way people can see what has played recently and directly select
from a list.  Generic playlist classes are awesome!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 5dc215d69a libsaria: Created Queue playlist class
This was much easier using inheritance...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 3f665712a1 Remove empty playlists when picking next song
Hopefully with fewer problems than 5.7 had...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 15aabfcff0 Create new playlists on the stack
- Only works for new sets
- Set a callback function when created
- Add a right-click menu to the ocarina treeview
- Remove songs from playlist when picking next song

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 78787d9cf5 libsaria: Play songs from outside the library
Pass in a file path and play!  I even created a button as a notebook
action widget.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker 297f81213d ocarina: Provide an open file button
To play random songs from the filesystem.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00