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>
If the current playlist is the library or banned list, I toggle the
banned state. Otherwise, I remove them from the current playlist.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
I already use "Return" for focusing the treeview from the main window or
from the filter entry. If the treeview is already focused, I have it
begin playing whatever song is under the cursor.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
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>
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>
It was commented out and unused. I also commented out the "Unhandled
key: " message to keep from filling up terminal screens when treeviews
respond to a keypress.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
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>
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>