Commit Graph

2035 Commits

Author SHA1 Message Date
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 ef55c2f44a ocarina: Check if 0 songs were added to a playlist
If nothing was selected then we should tell the window to change tabs
instead.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 10:49:36 -04:00
Bryan Schumaker 7d4977aab8 ocarina: Delete selected songs from playlists
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>
2012-09-04 10:48:48 -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 88ea380f9c ocarina: Activate treeview rows when pressing enter
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>
2012-09-04 09:30:20 -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 0290ea8710 ocarina: Bugfix the j and k keys a bit
Don't try to navigate when there are no visible tree views...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 10:33:27 -04:00
Bryan Schumaker 04b4967275 ocarina: Filter entries respond to the enter key
I use it to focus the treeview, basically the same thing the window
keypress handler does.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 10:09:47 -04:00
Bryan Schumaker ee7d9fa8ff ocarina: Remove old window.cpp code
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>
2012-09-03 10:08:45 -04:00
Bryan Schumaker ab2ba772fe ocarina: Use j and k for treeview navigation
This makes me even more vim-like!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:59:29 -04:00
Bryan Schumaker 9b996a7bb1 ocarina: Store window height in ocarina.window.h
Width was a typo...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:55:38 -04:00
Bryan Schumaker df79e67f12 ocarina: Add songs to currently created playlists
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:24:18 -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 b125fa2595 ocarina: Store PlaylistTabs in a variable
This way I don't need to keep calling get_widget() and then casting to a
notebook.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 13:38:54 -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 95d8d83fa0 ocarina: Don't track currently focused entry
It's easier to check the widgets on the current page.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 13:06:23 -04:00
Bryan Schumaker 84ff25b3be ocarina: Add new playlists to front and back
I was waiting until I could renumber and rearrage tabs to do this.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 13:06:23 -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 fc5fe427a7 ocarina: Disable treeview searching
I have filtering to perform searches, so this gtk feature can be
disabled.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 12:21:13 -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 694bcb83d7 ocarina: Removed dead code from window.cpp
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>
2012-09-01 10:28:04 -04:00
Bryan Schumaker 0d5941d72f ocarina: Only print out unhandled keys
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>
2012-09-01 10:25:42 -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 a2e0375ac9 ocarina: add a current_widgets() function
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>
2012-09-01 10:01:10 -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 c026686a1b ocarina: Store maximization and size of window
Re-enable and clean up the code I used to have.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-31 10:30:25 -04:00
Bryan Schumaker fc46bea1d1 ocarina: Use a shorter timeout for progress bar updating
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>
2012-08-31 09:18:42 -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 ead70aef7d ocarina: Don't make playlist filters visible through get_widget()
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>
2012-08-29 00:10:29 -04:00
Bryan Schumaker ae39628b01 ocarina: Implement the banned playlist using GtkBuilder
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>
2012-08-26 21:34:40 -04:00
Bryan Schumaker 3ed02e221e ocarina: Create a GtkBuilder tab for the recent playlist
I also remove the old code for showing the recent playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-26 21:23:51 -04:00
Bryan Schumaker b138c24e6d ocarina: Remove old library tab
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>
2012-08-26 15:17:37 -04:00