Commit Graph

1970 Commits

Author SHA1 Message Date
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
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
0402930098 ocarina: Remove old body/ files
I don't need these files now that I have GtkBuilder to help with the UI.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-19 09:13:56 -04:00
Bryan Schumaker
34f43cc96e ocarina: Use get_object() for connecting signals
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>
2012-08-19 09:03:17 -04:00
Bryan Schumaker
56148e58fe ocarina: Add back the "ban track" button
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>
2012-08-19 08:51:40 -04:00
Bryan Schumaker
2221bca25e ocarina: Create a FileChooser dialog
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>
2012-08-17 08:08:30 -04:00
Bryan Schumaker
22694e1bfe ocarina: Remove old library.cpp
I've re-implemented everything here with GtkBuilder, so this file is now
obsolete.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-13 08:21:11 -04:00
Bryan Schumaker
01d8eb15d8 ocarina: Add keyboard shortcuts to the library treeview
Delete deletes the selected library path, plus opens the chooser to add
a new path.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-13 08:18:13 -04:00