I'm only using this function for updating the progress bar now, so it
doesn't need a faster response time. I can drop CPU usage a little bit
by adding a longer delay between updates, without really noticing the
difference.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
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>
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>
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>
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>
Instead, I implement a new struct for grouping together the important
widgets of a playlist tab. I should be able to re-use this structure
for dynamic playlists.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I don't have a way to ban songs using GtkBuilder yet... that's coming,
but for now I'll just assume it works :)
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I've re-implemented everything using GtkBuilder, so now I don't need the
ocarina::Playlist for the library.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
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>
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>
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>
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>
The library treeview uses a cell renderer that needs the "toggled"
signal. Since this isn't a widget, I've been seeing a gtk warning when
I get_widget() tries to use the GTK_WIDGET() macro on it.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I moved it to the GtkNotebook action-area for the playlist tabs since I
ran out of room in the "Now Playing" section. I made the widgets
accessable through my get_widget() function, but it would be nice to
figure out how to add them in GtkBuilder.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I use this to select songs anywhere in the filesystem, not necessarily
in the library. I also renamed LibraryPathChooser to DirectoryChooser.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
There is some other problem with updating the renderer, but I'm more
concerned with working on the gui and moving on to other stuff. I'll
fix it later...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
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>
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>
And also
- Show / hide the play and pause buttons
- Remove the scrollbar from the now playing display
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
Only the duration label changes, I don't do anything with the others
yet. I'll work on it later (once I get the rest of the UI converted
over).
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>