Commit Graph

1948 Commits

Author SHA1 Message Date
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
Bryan Schumaker
448acf1181 ocarina: Look for toggled signals from the CellRendererToggle
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>
2012-08-10 08:24:29 -04:00
Bryan Schumaker
5d2631d19a ocarina: Implement the "Add Library" button
To add new paths to the library.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-09 08:29:41 -04:00
Bryan Schumaker
97a7edce41 ocarina: Add an update_all() button
Click to update all library paths.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-08 08:22:33 -04:00
Bryan Schumaker
34dd1a1088 ocarina: Show paths in the library
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>
2012-08-07 19:29:18 -04:00
Bryan Schumaker
aebcfaab45 ocarina: Re-enable automatic pause
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>
2012-08-05 09:26:47 -04:00
Bryan Schumaker
761842869e ocarina: Show and hide the idle bar
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>
2012-08-04 13:31:47 -04:00
Bryan Schumaker
fdecd7bbdf ocarina: Get the progress bar working again
This was easy, just copy over the old code to status.cpp.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-04 11:57:31 -04:00
Bryan Schumaker
4a764fcc8d ocarina: Remove old controls code
This has already been reimplemented in gtk builder.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 08:09:03 -04:00
Bryan Schumaker
54d1ff991d ocarina: Set the length label
The length label is part of the gtk builder description.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 08:00:08 -04:00
Bryan Schumaker
5a1b8555db ocarina: Clean out old gtk and button code
Now that I'm using gtk builder I don't need gtk convenience functions.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 07:52:08 -04:00
Bryan Schumaker
22e64d64ca ocarina: Connect signals to buttons
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>
2012-08-02 08:34:46 -04:00
Bryan Schumaker
90355962e4 ocarina: Initialize playlists during startup
I plan on replacing the playlist code eventually, but for now I want to
see how everything looks.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-01 08:19:31 -04:00
Bryan Schumaker
a11613d3ad ocarina: Add a notebook for playlist tabs
I'll eventually fill this in with playlist data.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-01 08:08:54 -04:00
Bryan Schumaker
56f082142a ocarina: Add more widgets to the UI
I added a notebook for AutoPause and a few other tabs.  Widgets still
don't do anything.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-31 08:25:56 -04:00
Bryan Schumaker
40bcff7063 ocarina: Add control buttons to the UI
These buttons don't do anything yet.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-30 08:26:57 -04:00
Bryan Schumaker
9eb181d263 ocarina: Add in the slider and position / duration labels
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>
2012-07-30 07:59:27 -04:00
Bryan Schumaker
bb56dc4d2a ocarina: Remove idle_add() from the ocarina namespace
It's only used in ocarina.cpp, and it's already static there.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 16:09:20 -04:00
Bryan Schumaker
ff0f4a2c66 ocarina: Add back Title / Artist / Album labels
Using GtkBuilder now...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 16:04:22 -04:00
Bryan Schumaker
037577850f ocarina: Add the timeout poll back
I want to create the now playing widgets next, so this is needed now.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:19:55 -04:00
Bryan Schumaker
693692766d ocarina: Change window default size
It needed to be bigger.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:13:59 -04:00
Bryan Schumaker
4585d90a32 ocarina: Remove window.h and lots of gtk shortcuts
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>
2012-07-29 15:11:36 -04:00
Bryan Schumaker
1ddcb9f2fc ocarina: Initialize the window from window.cpp
Eventually this will support all the same features of the old ocarina
window...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:01:20 -04:00