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>
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>
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>
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>
Most of this was already commented out, but I also took the time to
figure out what header files are no longer needed.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I'll know if a shortcut key is pressed, so I only want to print out
unhandled keys so I know their names.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
I use this to find the set of widgets associated with the current
playlist page. This also makes current_playlist() easy, since I can
just return the playlist from the widgets struct. I also moved these
functions to the top of the file so the filter entries can eventually
set focus when "slash" is pressed.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
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>
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>