Commit Graph

791 Commits

Author SHA1 Message Date
Anna Schumaker a313160f94 gui: Put file chooser and notebook onto a stack
The eventual goal is to replace the notebook, but this is a good start.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:14 -04:00
Anna Schumaker 21eb09ced3 gui: Remove old TabToolbar code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:08 -04:00
Anna Schumaker bc9efade75 gui/queue: Add a switch to enable and disable tempqueues
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:01 -04:00
Anna Schumaker d19e0b2cc0 gui/queue: Add a search entry widget
This gets cleared every time the queue is changed and disabled when we
show pages that cannot be filtered.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:34:55 -04:00
Anna Schumaker 24f53d88b6 gui/queue: Respond to toggling the random and repeat buttons
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:34:48 -04:00
Anna Schumaker ddbc040a3b gui/queue: Set state of random and repeat buttons
I need to change the state of these toggle buttons whenever the
sidebar's current selection changes.  Some gtk themes have trouble
showing the state of toggle buttons, so I change the sensitivity of both
the button and associated image so users know the current state.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:34:40 -04:00
Anna Schumaker 410a784ede gui/queue: Add flags to the gui queue
This will be used to determine if the random and random buttons should
be enabled.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker ce8ec63886 gui/sidebar: Switch over to using the new gui queues
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker f098811a28 gui: Wire up gui_queue_{alloc|free}() in the queue operations
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker 2d6e42832b gui/queue: Add a text field to the gui queue
The sidebar is going to look at this when setting queue sizes.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker f85ad3a9c3 gui/queue: Add a new gui_queue struct
This will be used to store queue state once I no longer support notebook
tabs.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker 5bc9f65cd9 core/tempq: Add tempq_index() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker 2770403c61 core/tempq: Add tempq ops to queues durinig init
Rather than setting them after.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker 5419711409 core/queue: Add qop_deinit() queue operation
This function is used to notify a higher layer that a queue is being
deinitialized.  The higher layer should then clean up any state
associated with that queue.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker 8bb7a20ff4 core/queue: Add qop_init() queue operation
This function is used to notify a higher layer that a queue has been
initialized.  That higher layer can return a pointer to be attached to
the "private data" field of the queue.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-13 16:36:44 -04:00
Anna Schumaker 25211e93ac gui/collection: Convert checkbox into a right click menu
This feature isn't used very often, and keeping the checkbox in the
sidebar looks pretty ugly.

Fixes #50: Remove Collection checkbox
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-05 08:27:10 -04:00
Anna Schumaker d2c4a36945 gui/collection: Add icon to library paths
I'm surprised this wasn't already there.  I think the "folder" icon
works best, considering library paths are directories in the filesystem.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-04 16:51:52 -04:00
Anna Schumaker 02f5b13650 gui/collection: Remove image size from the collection liststore
This is to match the playlist treeview.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-02 11:18:35 -04:00
Anna Schumaker 79f79405a8 gui/playlist: Remove image size from the playlist liststore
It's easier just to set all images to have the same size, rather than
making the header's image slightly larger.

Fixes #39: Remove GtkIconSize from Playlist treeview
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 14:58:40 -04:00
Anna Schumaker b4c81a4441 gui/playlist: Change "Banned" to "Hidden" in the sidebar
I also update the icon to match what is on the "Hide Track" button.

Fixes #49: Hidden playlist still says "Banned" in sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 14:42:02 -04:00
Anna Schumaker 16b055f06b gui/sidebar: Add support for removing temporary queues
Either through the delete key or when the queue runs out of tracks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 839f4c4aa1 gui/sidebar: Add support for adding temporary queues
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker c663f287d4 gui/sidebar: Add sizes to Collection and History entries
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker eb137c4339 gui/sidebar: Change notebook page through the sidebar
And make sure other sidebar views are deselected.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 6c653c6a79 gui/sidebar: Add Collection and History entries to the sidebar
I could do this as a treeview, but creating this as a liststore in glade
is WAY easier!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 84ff59cf81 gui/playlist_tab: Remove custom list from tab
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 9ee00f9997 gui/sidebar: Add a function for deselecting treeviews
I'm using multiple treeviews, but only one should be selected at any
time.  Use this function to coordinate that.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 7439a2a73d gui/playlist: Change current playlist when selected
I also add a function to get the currently selected playlist.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker fde59a1868 gui/playlist: Add 5 playlists to the sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker be6895630d gui/playlist: Begin new playlist sidebar widget
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker ca88bca999 gui: Rename playlist.cpp -> playlist_tab.cpp
I will soon have playlist.c to control the playlist sidebar widgets.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 3c3f11b958 gui/collection: Remove old collection manager code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 8807f06fd6 gui/collection: Update collection on startup
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 2cae2cd525 gui/collection: Remove library paths with the Delete key
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 0afe46b5df gui/collection: Toggle library state through the gui
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 8dece02eed gui/collection: Update library paths when rows are clicked
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 2f9ee44000 gui/collection: Add library paths on startup
And change to them when selected.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker f34e2cb57b gui/collection: Change tab page when "Add new Path" is selected
I also add in code that reuses the current file chooser for picking
paths.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker eb81fa2e20 gui/collection: Add sidebar widget showing Collection header
And make it non-selectable.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 480090f78d gui: Rename collection.cpp -> collection_tab.cpp
I want to create a new file (collection.c) for the collection sidebar
code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 58d61f52e2 gui/sidebar: Add new sidebar widget
This is a GtkPaned that remembers its size between Ocarina sessions.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 870a2b769b gui/window: Save width and height between sessions
Saving maximized state is too complicated, so let's just store width and
height of the window when it is not maximized.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 0c214dd1a9 gui/window: Add gui_window_deinit()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 684d52c522 gui/window: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 0c8bcfa552 gui/window: Switch to C-style gtk widgets
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker 066d27a240 gui/window: Move keyboard shortcut handling into tabs.cpp
I handle the Escape key through gtkbuilder, so let's move the
tab-changing keys into the tabs source file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-29 13:04:45 -04:00
Anna Schumaker c01561831c gui/audio: Remove "By:" and "From:"
I replaced these with images that have similar meanings.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-25 11:38:20 -04:00
Anna Schumaker 6aa64f0bc1 gui/audio: Block accelerators when a gtk entry is focused
Otherwise pressing the spacebar while searching could toggle the play /
pause status.

Fixes #36: Button accelerators always triggered
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-12 11:25:49 -04:00
Anna Schumaker 2097f63f3d gui: Update playlists to say Hidden instead of Banned
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-11 15:34:21 -04:00
Anna Schumaker 627619c391 gui/audio: Convert o_progress widget to use seconds
This feels better than using units of nanoseconds.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:39:43 -04:00
Anna Schumaker 5e96f40cf8 gui/audio: Unit test can simulate button presses
This is better than calling audio_*() functions directly, since we can
make sure signals are wired up properly in glade.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:39:39 -04:00
Anna Schumaker d8754e9a45 gui/audio: Control keyboard shortcuts from GtkBuilder
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:30 -04:00
Anna Schumaker f95a6d02ed gui/audio: Redesign some of the interface
I moved the location of buttons and text boxes, and also resized some of
the widgets.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:27 -04:00
Anna Schumaker 286085d248 gui/audio: Configure pause-after-N through glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:25 -04:00
Anna Schumaker 2d45e9e5c4 gui/audio: Pass the progress bar to __audio_timeout
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:24 -04:00
Anna Schumaker 36b8b29b0b gui/audio: Add __audio prefix to internal functions
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:22 -04:00
Anna Schumaker e5e2c87a86 gui/audio: Define seek controls completely in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:20 -04:00
Anna Schumaker 50a7c83d61 gui/audio: Convert gst.cpp to audio.c
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:16:10 -04:00
Anna Schumaker c48e128d0a gui/gst: Configure timeout with the C interface
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:12:36 -04:00
Anna Schumaker 5368208a37 gui/gst: Remove gst :: pre_init() and rename gst_init()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 13:12:19 -04:00
Anna Schumaker dee8b948b0 gui/gst: Remove gst :: toggle()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker bf39724a40 gui/gst: Set ban and favorite buttons through the C interface
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 71c4e6a1aa gui/gst: Completely define the positon and duration labels in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 15da6b4249 gui/gst: Completely define title, artist, and album widgets in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker aacc1f876a gui/gst: Completely define the play button in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 6723ef88c7 gui/gst: Completely define the pause button in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 8ae31ed483 gui/gst: Completely define the stop button in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 00899873bd gui/gst: Completely define the previous button in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 6680cdbd0e gui/gst: Completely define the next button in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker f31a67f644 gui/gst: Use C-style gtk widgets
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 44d7f9a853 core/gst: Set ban / favorite status when tracks are loaded
It's easier to do this from the audio code than the plalist code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 61436d5ccd gui: Switch over to the new gui_builder system
Glib::wrap() all the things!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 0eb8521094 gui/builder: Get a widget from the GTK builder
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker d4b27316c0 gui/builder: Get an object from the builder
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 961659bc66 gui/builder: Add a test UI file
This file creates a button that calls the test_builder_activated()
function when clicked.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 3bc5b1db9e gui/builder: Add new file for accessing the GtkBuilder
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 27e09f47a6 gui/ocarina: Initialize settings on startup
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker c479042a86 gui/settings: Add gui_settings_has() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker d292879837 gui/settings: Read settings file on startup
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker a5f0da7a60 gui/settings: Store settings when changed
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker 92c1b64b1a gui/settings: Add functions for setting and getting values
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker f23fb9e0f5 gui/settings: Add new settings file
The settings layer will track various configuration options set by the
user.  This belongs in the gui, and not core, because it controls
settings specific to this gui implementation.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker ece432bb22 core/audio: audio_{load, next, prev}() should start playback
The GUI needed an extra function to do this manually, which means it's
something that core should do instead.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 0cf5187867 core/audio: Add on_state_change() audio operation
Called to notify when playback state has changed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 2586348921 core/audio: Convert file to C
I also convert core/core.c so the audio test can be converted at the
same time.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker a59a71eb38 core/core: Move core_deinit() out of the core namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 04291f4296 core/core: Move core_init() out of the core namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 03196c3efa core/audio: Set up the gstreamer bus for the gui
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker a5556ac10a core/audio: Move audio_eos() out of the AudioDriver
This change lets me remove the AudioDriver, too.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 276c56406a core/audio: Move audio_pause_after() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker d18d3dd214 core/audio: Move audio_prev() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 3f25369444 core/audio: Move audio_next() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 2511db3a08 core/audio: Add audio_cur_state() function
This replaces the is_playing() function of the AudioDriver class.  I can
also make the GUIs GstDriver static.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 0a1a9f1394 core/audio: Move audio_cur_track() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker d1d722a163 core/audio: Move audio_stop() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker e1abe94b28 core/audio: Move audio_duration() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 20bb01ef4e core/audio: Move audio_position() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:30 -04:00
Anna Schumaker 566ef3bb50 core/audio: Move audio_seek() out of the audio namespace 2016-03-28 08:01:30 -04:00
Anna Schumaker 9097bd0ffc core/audio: Move audio_pause() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker 16c4c23a42 core/audio: Move audio_play() out of the audio namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker e5c3d8f02e core/audio: Move audio_load() out of the audio namespace
And add the on_load() audio operation.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker e0c89556ed core/audio: Add audio_deinit() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker d9540b29d6 core/audio: Move audio_init() out of the audio namespace
I also move the gstreamer playbin back into core/

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-28 08:01:29 -04:00
Anna Schumaker 6358124ce8 gui: Check the return code from collection_check_library()
If the library isn't valid, then we shouldn't try to pick another track
until the user fixes things.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-23 09:58:17 -04:00
Anna Schumaker 08bf842767 gui: Don't update gui if zero tracks were cleared
I'm seeing Ocarina crash when a tempq finishes and gets removed.  For
now, let's only have the gui handle queue clearing if tracks were
actually removed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-22 16:04:25 -04:00
Anna Schumaker 76985c8842 gui: Fix setting Q_RANDOM flag
I had the condition reversed for enabling random on temporary queues, so
the flag was getting set whenever I didn't want it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-22 09:36:32 -04:00
Anna Schumaker 5979d1dcaf core/collection: Handle -EIO errors coming from the filesystem
One of my disks frequently returns this error, and has wiped out my
track database on more than one occasion.  Let's handle this error by
disabling the library until the user tells us it is safe to use again.

Fixes #33: Handle music directories disappearing better
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-21 08:36:48 -04:00
Anna Schumaker 2dd4f93bd0 gui: Don't call tempq_save() in the qop_cleared() handler
The first thing queue_deinit() does is clear the queue, so calling
tempq_save() here will overwrite any tempq state currently on disk.
This seems reasonable at first, but ends up erasing any temporary queues
during Ocarina shutdown.

Fixes #34: Temporary queues not saving
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-17 12:17:11 -04:00
Anna Schumaker 882ee6e1e7 core/tempq: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker 2102b1bfc9 core/tempq: Move tempq_save() out of the deck namespace
And remove the deck :: write() and TempQueue :: write() functions while
we're at it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker b3d95a06d4 core/tempq: Move tempq_next() out of the deck namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker ecda136015 core/tempq: Move tempq_move() out of the deck namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker c22b93b2cf core/tempq: Move tempq_get() out of the deck namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker 06d62240bb core/tempq: Move tempq_free() out of the deck namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker bce2ba33f7 core/tempq: Move tempq_alloc() out of the deck namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker 77d4815eb6 core/history: Move history queue into a new file
I think managing this separately from temporary queues will make the
code simpler.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-11 10:40:34 -05:00
Anna Schumaker b191a7f22c gui/ocarina: Deinitialize core first
This fixes a segfault I was getting when closing ocarina before the
directory scan finishes.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-09 09:59:06 -05:00
Anna Schumaker 8c8ab2a9eb core/idle: Add idle_cancel() function
This function is used to cancel all idle tasks and free the memory
allocated for them.  This needs to be called when Ocarina is shutting
down to prevent a possible hang with the gtk idle callback continuing to
process tasks.

Fixes #30: Closing Ocarina should cancel idle tasks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-03-01 08:27:13 -05:00
Anna Schumaker b3592e40c0 core/playlist: Rename PL_BANNED -> PL_HIDDEN
"Banning" a track is a bit harsh.  Let's talking about hiding tracks
instead, so that it sounds friendlier.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-29 13:22:31 -05:00
Anna Schumaker fef3ef3353 core: Initialize the playlist before the collection
I think it makes more sense to have the collection manage if banned
tracks are displayed or not, rather than doing this from the playlist
layer.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 20825613e9 core/playlist: playlist_add() can return a boolean
There is at least one place in the gui where it needs to know if a track
was actually added to a playlist.  Adding a return value is the best way
to know what happened.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 02c82c182e core/playlist: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker b7a4bb3872 core/playlist: Use playlist_t enum to access playlists
Using strings is pretty tedious, so let's restrict restrict playlist
access to known values.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 88f6fc526c core/playlist: Add a function to remove banned tracks
This replaces the get_tracks() function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 4e6028cf6e core/playlist: Move playlist_remove() out of the playlist namespace
I also remove redundant unit tests.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 0e3d6251d3 core/playlist: Move playlist_add() out of the playlist namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 82ed2f2dc0 core/playlist: Move playlist_get_queue() out of the playlist namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 6f0b95608a core/playlist: Move playlist_select() out of the playlist namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 1d3a762936 core/playlist: Move playlist_has() out of the playlist namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 219f8fa119 core/collection: Update collection on startup
This is much more convenient to users, since they don't need to update
the collection manually.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-23 07:55:56 -05:00
Anna Schumaker 7065b6312e core/collection: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:47:16 -05:00
Anna Schumaker f413d14720 core/collection: Move collection_save() out of the collection namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker 295a4424ed core/collection: Move collection_get_queue() out of the collection
namespace

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker 62f0606cd6 core/collection: move collection_set_enabled() out of the collection
namespace

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker 8a1f5403d0 core/collection: Move collection_update() out of the collection namespace
And bring collection_update_all() along with it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker 0cb16f5c64 core/collection: Move collection_remove() out of the collection
namespace

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker 6e39e17060 core/collection: Move collection_add() out of the collection namespace
This patch breaks later tests, since I needed to remove the old ogg
files.  This will be fixed in a few more patches.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-12 09:37:26 -05:00
Anna Schumaker e47540a84e core/queue: Add queue_clear()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 10:12:09 -05:00
Anna Schumaker 6a8e73375e gui/collection: Check for collection_q in on_track_removed()
So we don't segfault while removing banned tracks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 0a331a44f5 core/queue: Replace on_track_updated() with qop_updated()
This patch also removes the now-unused queue notifier class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker da0c96ac51 core/queue: Replace on_track_removed() with qop_removed()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker df06b444cf core/queue: Replace on_track_added() with qop_added()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker acc78a6667 core/queue: Move queue_remove_all() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker ea00b406e5 core/queue: Move queue_remove() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 8fe85b9782 core/queue: Move queue_add() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 4c4d0ab6ce core/queue: Move queue_sort() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 13723856fc core/queue: Move queue_{set|unset}_flag() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker be5d028fcf core/deck: Wire up the qop_save() function
So temporary queues can save when flags change or when sorted.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 9451a41ff1 core/collection: Wire up the qop_save() operation
This will be triggered both when queue flags are changed and when the
queue is sorted.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker ce55ef2421 core/queue: Add queue operations vector
And a function to help with saving queues.  This patch also adds the
Q_SAVE_FLAGS and Q_SAVE_SORT queue flags to control if the queue should
be saved when flags are changed or when the queue is sorted.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker b3a8fa293b core/queue: Move queue_has_flag() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker ff0c2a09a8 core/queue: Move queue_at() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker c259177dde core/queue: Move queue_size() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 6bd625f65b core/queue: Move queue_selected() out of the queue struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker d6ae61d915 core/queue: Remove queue :: set_notifier()
Let's just set the q_notify variable directly, rather than going through
a function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker a721a95604 core/queue: Remove queue :: length()
Let's just access the q_length variable directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 281947aded core/queue: Convert from class to struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-29 08:22:10 -05:00
Anna Schumaker 08c7323dfc core/tags/track: Move comparison fields into track.h
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker 58a983efd1 core/containers: Move index into the containers/ directory
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker c34f0c160d core/containers: Move database into the containers/ directory
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-15 15:10:44 -05:00
Anna Schumaker ad5726b542 core: Add core :: deinit() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker b5caf6faed core/tags/track: Convert std::string to gchar *
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker 9e3e3e514c core/tags/track: Replace constructor with a backwards pointer
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker 5cc4efb6ac core/tags/library: Replace constructor with a backwards pointer
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker 6c3d708576 core/tags/genre: Replace std::string with gchar *
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker c07d1e9024 core/tags/artist: Replace std:string with gchar *
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker ad48d24533 core/tags/album: Replace std::string with gchar *
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker ab837b1a18 core/idle: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker 8e25c4d89e core/idle: Move idle_run_task() out of the idle queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker f17a19fe57 core/idle: Move idle_progress() out of the idle namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker cfd8ca8d43 core/filter: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker f2664aa8f2 core/filter: Move filter_search() out of the filter namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-11 09:35:59 -05:00
Anna Schumaker 8e02001373 gui/queue: Stop space bar from selecting new tracks
From Josh: Single-clicking a track in the collection queue and pressing the
space bar loads the selected track, but users would expect this to
toggle the play / pause state instead.

The solution is to watch for the on_key_press signal and tell GTK that
we have handled it if we see that the space bar was pressed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-01-06 10:27:28 -05:00
Anna Schumaker 55a688cdcc core/index: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:19 -05:00
Anna Schumaker 1c22ecfda4 core/database: De-templatize the database
We now have an interface for controlling everything through struct
db_entry, so let's just have the database store a db_entry directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker 1bef380ba7 core/database: Introduce the dbe_key() database operation
And store the result in the db_entry struct for use later.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker 847e4c1925 core/database: Remove db_entry::index() function
Let's just access the dbe_index variable directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:48:18 -05:00
Anna Schumaker 33e20989fa core/tags/track: Directly inherit from DatabaseEntry
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker ee71786c09 core/tags/track: Move track_last_play() out of the track struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 90cdfd4cbd core/tags/track: Move track_path() out of the track struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 24d5c37a6c core/tags/track: Remove variable accessor functions
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 9c1cbbf8cb core/tags/track: Remove tag accessor functions
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker c8061e2868 core/tags/track: Move track_get() out of the tags namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 765079df94 core/tags/track: Convert Track class into a struct
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 24504c7de8 core/tags/library: Remove library size() and {inc|dec}_size() functions
We can just access this variable directly instead.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker ac2b4ad52c core/tags/library: Remove library enabled() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker f41235e5b2 core/tags/library: Replace tags :: library_size() with library_db_get()
It's easier to just pass off the library database rather than forcing
higher layers to iterate over the entire thing (including possible
invalid entries).

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker e1093f7eab core/tags/library: Move library_get() out of the tags namespace
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker ffa5e65ba7 core/tags/library: Convert Library class to a struct
I also have to replace the "library" namespace with the "collection"
namespace to avoid naming collisions.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker cc3becd566 core/tags/genre: Directly inherit from DatabaseEntry
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker fe3d7867d1 core/tags/artist: Directly inherit from DatabaseEntry
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker e5b0047812 core/tags/album: Directly inherit from DatabaseEntry
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker a7746cf901 core/tags/album: Remove album::year() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 45207ebd2e core/index: Replace index_entry iterators with struct set_iter
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker a91326551f core/index: Convert IndexEntry class to a struct
In addition, I added the prefix "ie_" to all member names.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00
Anna Schumaker 60678d1ddb core/string: Convert file to C
And convert the unit test while we're at it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:56:19 -04:00
Anna Schumaker 83fe822dc7 core/string: Move sec2str_detailed() out of "string" namespace
I also take the opportunity to rename the function to
string_sec2str_long().

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:46:30 -04:00
Anna Schumaker a314ee03ca core/string: Move sec2str() out of "string" namespace
And I replace it with a simple call to g_strdup_printf() that does the
exact same thing.  Note that callers are now required to free the
returned string with g_free().

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:33:50 -04:00
Anna Schumaker 82d1da491b core/string: Remove string :: utos()
I replace it with calls to g_strdup_printf().  This has the additional
benefit that I can do uint conversions at the same time as other
formatting options, so this seems like a win.  The only downside is that
I have to manually free the memory that glib allocates, but that's easy
enough.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 09:31:28 -04:00
Anna Schumaker 1d0f392835 gui: Give tab labels a set_size() function
This lets them set themselves whenever values change.  Additionally, I
update the Tab class to take a QueueLabel instead of the "size label"

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker 2c45cf3972 gui: Remove tab_finish_init()
It is no longer needed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker 9ddae1275f gui: Set up QueueWindow from a single place
I can't pack it directly into the tab_vbox because playlists need a way
to pack in their special window.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker d0212d47aa gui: Create QueueToolbar from a single place
Derived classes should already have this available to configure as they
see fit.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker 319838138a gui: Set up tab builder from a single place
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker 682dca2339 gui: Set up each tab page vbox from a single place
This is better than having the same code in 4 places.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-02 14:24:42 -04:00
Anna Schumaker c9ca2604ee gui: Move on_row_activated() into the QueueWindow
And out of the Tab class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 83414ca3ad gui: Trigger refiltering from the QueueToolbar
I also modify the QueueWindow to do the actual filtering.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 8c3b1489bd gui: Set up queue model and filter inside the QueueWindow
This lets me move functions affecting the treeview into the QueueWindow
class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 5bf861b9f3 gui: Remove Tab post_init() function
Nothing uses this anymore.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 3d89bf2563 gui: Set up the switch from inside the toolbar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 343426ddc3 gui: Tab labels should inherit from common type
This allows me to pass a pointer to the generic type to be used by other
classes.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 1423fe2b6e gui: Set up the repeat button from inside the toolbar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker fa2bf4637a gui: Set up the random button from inside the toolbar
This lets me change this variable to be completely internal to the
QueueToolbar.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker acbafd2361 gui: Give the QueueToolbar an init() function
GtkBuilder doesn't let me pass additional parameters to classes
constructed with get_widget_derived(), so I have to use an init()
function for flags and other parameters.

This patch adds flags for which buttons to show on the queue toolbar.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 3ed32813da gui: Force playing on GST_MESSAGE_ERROR
I frequently hit a problem where playback stops when a track has an
error.  My gstreamer code was written assuming that the pipeline stayed
in GST_STATE_PLAYING if there was an error, but I think this assumption
is wrong.  For now, let's always restart playing on error.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-08-25 10:06:58 -04:00
Anna Schumaker 8f570f1f24 gui: Convert the playlist tab to use the new template files
I also created a new PlaylistWindow class for displaying the names of
each playlist.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker b2b23bec46 gui: Convert the history tab to use the new template files
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker 3dd123fbfd gui: History tab cleanups
This is a statically defined class, so we don't need to separate out the
function definitions.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker a581b42649 gui: Convert the collection tab use the new template files
I expect most of the new constructor code to disappear once I start
using the .ui files in the parent class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker 2f1d0a3bb8 gui: Collection tab cleanups
This is a statically defined class, so we don't need to separate the
class and function code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker d746db6624 gui: Add a scrolled window around the treeview
I'm going to want this on all tab pages, so let's just add this to the
treeview widget definition.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker d9a9b2b9ca gui: Set queue scale factor using GtkBuilder
Now I don't need to keep resetting the label's markup.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker 494ef04e67 gui: Build TempLabel from a .ui file
This is better than needing to hard code in all of the widgets.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker da89012c7b gui: Build QueueToolbar from a separate file
This should help clean up the code a bit, especially once I convert all
queues to load with the template files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker 1e29ba8cc6 gui: Create a custom Gtk::TreeView for queues
The QueueView doesn't contain too much in terms of code, but the
corresponding QueueView.ui file lets me remove a lot of unnecessary
stuff from temporary queue creation!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:31 -04:00
Anna Schumaker 6dfb3c31e2 gui: Rename model.cpp -> queue/model.cpp
I'm going to have a lot of queue-related files soon, so let's make
things easier by keeping everything in a new directory.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-17 08:51:30 -04:00
Anna Schumaker 9edce54571 gui: xalign is deprecated
Remove references to it, fixing up the code where necessary.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-14 10:24:50 -04:00
Anna Schumaker 4a6c0dbaa5 gui: The treeview rules_hint property is deprecated
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-14 10:23:34 -04:00
Anna Schumaker 3375e921c4 gui: Use the search entry's "search_changed" signal
This greatly improves usability while searching, since we no longer have
to refilter the song list for every key press.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2015-04-14 09:06:45 -04:00
Anna Schumaker ec4d3b945e audio: Fix seeking on ARM
The on_seek() function needs to take an int64_t to avoid truncating on
ARM.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2015-04-14 09:05:09 -04:00
Anna Schumaker 657ce8f0f4 audio: Ensure position and duration results are 64 bits
A long int is shorter on ARM than x86, which could cause position and
duration values to get truncated.  Additionally, quering gstreamer with
a long int causes a compile error on ARM.  Let's just do the right thing
and make this value an int64_t.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2015-04-14 09:05:05 -04:00
Anna Schumaker 1ec9d830cc gui: Remove references to the on_remove() notification
It no longer exists.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-09 09:28:32 -04:00
Anna Schumaker 9ebb31e09b gui: Remove usage of Q_NOTIFY_REMOVE
The notification no longer exists, and the flag will soon be removed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-09 09:27:32 -04:00
Anna Schumaker f15ed8635a gui: Disable Q_NOTIFY_REMOVED for temporary queues
Using this notification was causing segmentation faults when Ocarina was
closed with at least one temporary queue.  I can handle everything I
need directly in the GUI without problems, so this notification really
isn't necessary.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-09 09:26:26 -04:00
Anna Schumaker c80468a739 callback: Remove all references to callbacks
Callbacks have no remaining users and can safely be removed :)

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:21:31 -04:00
Anna Schumaker e4ea994728 gui: QueueTabs should implement the on_remove() notification
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-04 10:21:15 -04:00
Anna Schumaker 44c702a302 gui: Implement on_track_updated() in the Tab class
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 20:59:01 -04:00
Anna Schumaker 3b206948e1 gui: Implement on_track_removed() in the Tab class
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:27:32 -04:00
Anna Schumaker 67228ef8b1 gui: Turn the Tab class into a QNotifier
Now we can respond to notifications directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-04-03 12:19:18 -04:00
Anna Schumaker 5026e80eab gui: Fix setting autopause count
Once the check box was enabled, we were never setting the count again.
This means that changing pause count from 1 to 2 did not change the
count in the backend.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-02-04 08:39:40 -05:00
Anna Schumaker cc6f4c9293 string: Add a function for creating a detailed time string
I use this to display the total running time of queues in the gui.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-29 08:27:25 -05:00
Anna Schumaker ed43fd3689 More utos() cleanups
I found a few other places where I can use utos() instead of
stringstreams.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 14:03:12 -05:00
Anna Schumaker 12260a3de9 string: Add a function for converting seconds to string
This is used to get a string representation of the number of seconds
passed in.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 09:23:14 -05:00
Anna Schumaker 6c6437c2bd string: Create a utos() function
This function converts unsigned ints into strings.  This allows me to
replace several almost identical functions with one function call.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-27 08:37:27 -05:00
Anna Schumaker e47eb69859 gui: Set a proper application_id
This silences a warning from gtk.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-26 17:13:09 -05:00
Anna Schumaker 5045e3a8c8 gui: Remove unnecessary #includes
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-22 08:19:45 -05:00
Anna Schumaker ec83acbdfe gui: Initialization cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 09:08:45 -05:00
Anna Schumaker 8b4d99c50c gui: Rename main.cpp to ocarina.cpp
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:44:38 -05:00
Anna Schumaker e6d9a58be2 gui: Remove CONFIG_TEST macros
I haven't had gui unit tests in months, so these can be removed for now.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:43:55 -05:00
Anna Schumaker 74a557739d lib: Remove rest of lib/
This is all contained in the gui code now.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:39:02 -05:00
Anna Schumaker dc3e770c28 gui: Move GtkBuilder object into the gui
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:29:59 -05:00
Anna Schumaker 7f6f6395d7 gui: Schedule timeout function from gstreamer code directly
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:10:59 -05:00
Anna Schumaker 4cae9aaf2b gui: Have collection manager handle keypresses directly
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:06:10 -05:00
Anna Schumaker 2824ac33eb gui: Start idle callbacks directly from the collection manager
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:03:48 -05:00
Anna Schumaker 0f61114e15 gui: Remove unused connect_button() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-20 08:48:32 -05:00
Anna Schumaker f5ed438735 gui: Move the queue TreeModel class into the gui code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-20 08:46:45 -05:00
Anna Schumaker c61dca7504 gui: Various collection manager cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-19 11:43:27 -05:00
Anna Schumaker 98ff0b79cd colmgr: Merge lib/ and gui/ code back together
The code is still messy now, but I'll be cleaning it up soon!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-17 13:19:41 -05:00
Anna Schumaker 1935cf9c5e gui: Various playlist cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-17 11:27:32 -05:00
Anna Schumaker 4bfdb2d0d4 gui: Merge lib/plist.cpp back into gui/plist.cpp
The lib/ experiment made the gui code a little more complicated than I
was expecting, so I'm going to begin merging everything back into gui/

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-17 10:41:04 -05:00
Anna Schumaker b4db3ba98f gui: Put exported gst functions in a new namespace
I intend to put most gui functions in their own namespaces eventually.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-17 10:19:31 -05:00
Anna Schumaker 6a5eaa32f8 gui: Preserve "is playing" status when banning tracks
Just calling audio :: next() will advance to the next song, but won't
change if we're playing music or not.  I think this is what we want to
do when banning tracks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-16 08:22:01 -05:00
Anna Schumaker ea49b374ee gui: Remove gui.cpp
This file doesn't do anything anymore, so move the init functions into
main.cpp and remove the file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-15 09:40:17 -05:00
Anna Schumaker 4643a5ff22 gui: Move pause count widgets into gst.cpp
These values affect audio playback, so they should go with the other
audio widgets.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-15 09:35:33 -05:00
Anna Schumaker d299bc464c gui: Move ban and favorite buttons into playlist code
These buttons directly change the playlists, so let's handle them there.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-15 09:08:02 -05:00
Anna Schumaker b940fe710c gui: Rearrange playlist tab
Other files in the gui implement their classes directly, rather than
making extra functions.  Let's do that here, too.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-15 08:33:20 -05:00
Anna Schumaker 300acde068 gui: Set artist, album, title, and duration from gst code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 20:16:28 -05:00
Anna Schumaker 6fec8876a9 gui: Rename position and duration widgets
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 19:57:15 -05:00
Anna Schumaker ed88bb08bd gui: Move toggle function to gst code
This lets me remove the controls.cpp and controls.h files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 19:50:26 -05:00
Anna Schumaker 434b278b61 gui: Move position tracking into gst code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 19:50:25 -05:00
Anna Schumaker e539a2d208 gui: Move remaining buttons into gstreamer code
These buttons directly affect audio playback, so let's move them with
the rest of the audio buttons.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-14 19:19:50 -05:00
Anna Schumaker 694d3f0316 build: Add gstreamer package from gui/Sconscript
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-02 10:31:14 -05:00
Anna Schumaker 92d264d4ac audio: Move Driver into audio.h
I also rename from Driver -> AudioDriver.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:48:07 -05:00
Anna Schumaker 50147ef070 gui: Handle pause counts from the GSTDriver
I think it makes sense to handle this directly from the driver, rather
than going through a callback.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:27:18 -05:00
Anna Schumaker cd8c76e1b2 gst: Move play and pause button handling into gst code
I can handle these widgets directly from within the gst driver.  I think
this is easier (and more straightforward) than handling this in a
separate file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 15:02:17 -05:00
Anna Schumaker 6a117c762e driver: play() and pause() shouldn't return a boolean
This value is never used in the audio layer so let's stop returning it
from the driver.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 14:32:31 -05:00
Anna Schumaker b633f3fa0c gst: Update the "now playing" fields through the GST driver
This lets me remove the on_track_loaded() callback function by handling
this event directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 12:05:22 -05:00
Anna Schumaker d7113cb124 driver: Pass Tracks to the load() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 12:01:38 -05:00
Anna Schumaker 9aaa8649ce gst: More driver cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 11:49:22 -05:00
Anna Schumaker 3da3c8aeea gst: Move the on_message() function out of the driver
This function doesn't use anything in the driver class anymore, so it
can be removed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 11:34:29 -05:00
Anna Schumaker 955129edce gst: Various driver cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 11:16:19 -05:00
Anna Schumaker a4ad0aa79b driver: Fold eos() into the driver
With this patch I no longer need a Driver :: init() function to handle
picking the next track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 11:04:14 -05:00
Anna Schumaker 882da67480 gst: Begin reworking gst driver
I removed the need for an overridden constructor and destructor.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 10:47:17 -05:00
Anna Schumaker fd2a251c14 audio: Initialize GST from the gui layer
This means I no longer need to pass argc and argv parameters to core/,
so I can eventually work towards removing the Driver :: init() function.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-20 10:16:44 -05:00
Anna Schumaker e7a8ad54bd Audio: Remove the driver on_error() callback function
This was used to get around layering issues with the gstreamer driver.
Now that the gstreamer implementation is in the gui code we can have it
call audio::next() directly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 17:26:39 -05:00
Anna Schumaker b9d4c6749d audio: Move the get_driver() function into the audio namespace
It's already in the audio.cpp file, so just reshuffle things a little
bit.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:54:12 -05:00
Anna Schumaker 1d2b52cc98 driver: Move the GST driver into the gui
This is a straight copy-and-paste of the header file and the code
implementing it.  I intent to clean this up with future patches.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:25:59 -05:00
Anna Schumaker c12dbae73a driver: Track current driver with a pointer
This will let me implement drivers outside of this file allowing for
easier customization.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-19 14:20:30 -05:00
Anna Schumaker c7fe5b18d5 tagdb: Rip out most tagdb functions
Most of this are a straight replacement with the new versions in
tags/track.cpp.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:52 -05:00
Anna Schumaker cdd20da5c0 Track: Convert length_str into a function
I don't think this value needs to be stored anywhere in the Track class
since it's fairly easy to calculate.  Let's convert it into a function
for now and reevaluate later!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 2540a6aa7a Track: Use GenericTag's _name and _lowercase fields
This lets me remove the duplicate title and title_lowercase fields from
the Track tag.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker c6029f13f2 Track: Hide the album tag from the public
And set it using the new constructor.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 0a6ace3c14 Track: Hide the artist tag from the public
Also set it using our new constructor.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:51 -05:00
Anna Schumaker 2d9d87afc9 Album: Move Album tag into a new file
Also make it inherit from the GenericTag base class.  Also also, add a
unit test specific to Album tags.  Finally, I remove the corresponding
section of the DESIGN file since it is no longer needed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:49 -05:00
Anna Schumaker a9fc53964c Artist: The ArtistTag should inherit from GenericTag
The GenericTag class provides most of the implementation, so use it!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-03 13:03:11 -05:00
Anna Schumaker 48b25945cc DatabaseEntry: Rename id to _index (and make it private)
This variable should only be set by the Database when a DatabaseItem is
first created.  This means I should hide _index from the rest of the
world to prevent accidental modifications.  I also add an accessor
function for other code that needs to read _index.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-02 10:25:41 -05:00
Anna Schumaker 1be4c57244 gui: Use Gtk::Application() instead of Gtk::Main()
Gtk::Main() is deprecated, and causes several warnings to show up when
closing Ocarina.  I guess it's time to switch to Gtk::Application()!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-10-29 18:08:28 -04:00
Anna Schumaker 5eeebe7854 gui: Move idle function into the collection manager
The collection manager is the only thing that uses the idle queue, so
let's keep all this code together.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-12 08:16:26 -04:00
Anna Schumaker 0b5478c591 lib: Move idle function setup into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-12 08:07:12 -04:00
Anna Schumaker bc5e53a423 gui: Store pointers to play and pause buttons
We use these every half-second, so let's not waste time looking them up
every call.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:28:23 -04:00
Anna Schumaker a2987c2952 gui: Call on_track_loaded() during startup
Also move the controls_init() function to be with other init()
functions.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:23:23 -04:00
Anna Schumaker 8152327f65 gui: Move o_seek() into controls.cpp
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:16:36 -04:00
Anna Schumaker 5e7a25e007 gui: Store position and progress widgets
Now we don't need to keep looking them up, and the code looks a little
bit cleaner =)

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:09:57 -04:00
Anna Schumaker 62cdc4c909 gui: Move remaning window setup into window.cpp
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:03:57 -04:00
Anna Schumaker acdeb785f5 gui: Move window keypress handling to window.cpp
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:08 -04:00
Anna Schumaker 253898e9b5 gui: Set tab size and runtime on startup
This used to happen by itself, but changing the order of how tabs are
initialized broke this.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:08 -04:00
Anna Schumaker 9b98788106 gui: Begin breaking out window code
I think this will help with maintainability.  We'll see ...

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:08 -04:00
Anna Schumaker df0d1496de lib: Create a schedule() function
This lets me clean up some of the code in controls.cpp

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:07 -04:00
Anna Schumaker 1c437c4957 gui: Move init() steps into controls.cpp
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:07 -04:00
Anna Schumaker 922830a2ab gui: Move o_next() into the controls.cpp file
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-11 08:01:06 -04:00
Anna Schumaker 78624a6d98 gui: Fix up how the gui pauses
I make it look more like o_play().

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-09 08:28:18 -04:00
Anna Schumaker d68d5f2b40 gui: Create o_play() for handling the play function
This calls the audio :: play() function, rather than having the button
call into the audio layer directly.  With this patch, the on_play()
callback is unused.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-09-08 17:21:40 -04:00
Anna Schumaker 412dc67e1f Merge branch 'master' into Ocarina-next
Conflicts:
	Sconstruct
	gui/collection_mgr.cpp
2014-08-19 08:08:55 -04:00
Anna Schumaker 41506f3177 gui: Remove banned songs from Collection when re-enabling
I wasn't doing this before, so banned songs were showing up in the
collection list again.  I think this is kind of an ugly fix, though.
Perhaps there is a better way to do it?

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-08-17 17:17:29 -04:00
Anna Schumaker cfa61fa816 gui: Play next song after banning
If the user tells us they don't like the current song then we shouldn't
keep playing it!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-08-17 17:01:52 -04:00
Anna Schumaker 2890819cd3 playlist tab cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-07-27 11:52:36 -04:00
Anna Schumaker 160d2ac3be plist: Move more playlist functions into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-07-27 11:41:40 -04:00
Anna Schumaker 97a8646977 plist: Move liststore into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-07-27 11:25:12 -04:00
Anna Schumaker 09af8d81d2 model: Move the custom TreeModel from gui/ to lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-29 10:48:23 -04:00
Anna Schumaker 76f0b7b55f lib: Move keyval parsing into lib/
I'll eventually add in checks for keypad vs top row number keys.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 11:42:01 -04:00
Anna Schumaker 80bed8b956 collection manager: Rename widgets in the glade file
o_collection_* was easily confused with widgets on the collection tab,
so I renamed everything to be less confusing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 11:19:05 -04:00
Anna Schumaker fdb31916a6 gui: Change chooser directory when selected path is changed
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 10:41:46 -04:00
Anna Schumaker 2094227f91 collection_mgr: Rename functions
Since these are all static functions, I don't need the _collection
part.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 10:22:05 -04:00
Anna Schumaker 3d067878f2 colmgr: Add a function for updating a specific path
On the gui end, call this function when a row in the "collected paths"
list is double-clicked.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 10:14:23 -04:00
Anna Schumaker 42ec504b90 gui: Collection manager cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-21 12:44:22 -04:00
Anna Schumaker a5f47e46a8 colmgr: Move some collection manager code into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-21 12:27:34 -04:00
Anna Schumaker 194a09bed4 lib: Initialize the GtkBuilder from the middle layer
This will provide an interface for accessing widgets, and make it easier
to swap out different builder files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-15 11:31:04 -04:00
Anna Schumaker 4ed36c79df lib: Add support for looking up files from share/ocarina/
I replace the /proc/self/exe method with a simple hard-coded string.
This means that binaries run from the source directory need to be run
from the root of the source directory.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-15 10:12:55 -04:00
Anna Schumaker 5b3f8b13e0 lib: Initialize core libraries from a new middle layer
My hope is that putting lib/ between core/ and gui/ will help clean up
gui code, since everything will no longer be in a single place.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-14 20:06:07 -04:00
Anna Schumaker ec2bd92bef gui: collection manager fixes
- Fill out the list of library paths
- Update size during scan

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-06 09:20:50 -04:00
Anna Schumaker 43c8130ecc gui: Fix adding tracks to an existing queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-05 11:05:40 -04:00
Anna Schumaker 95064e4537 Rename lib/ -> core/
I plan to introduce a new lib/ that sits between the gui and the backend
files (similar to how glibc sits between the kernel and userspace).
This gets the rename out of the way before I change my mind again.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-05 10:21:32 -04:00
Anna Schumaker 87af56ba85 Header file roundup
Create include/lib/ and include/gui/.  Move header files into the
appropriate directory.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-04 13:59:42 -04:00
Anna Schumaker 72a51fb78f gui: Properly create queue tabs
Changes to the deck removed the on_pq_created() callback that we looked
for to create new tabs.  This patch creates tabs correctly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-04 09:35:41 -04:00
Anna Schumaker 06b36afec6 gui: Updates for the recent audio changes
Now the gui compiles again, yay!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-01 17:59:27 -04:00
Anna Schumaker 36322a6ff8 Update code to match new deck layout
This patch actually breaks a bunch of things, but I just want to be done
with the deck changes for now.  I'll go back and fix things before
releasing!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-26 22:33:16 -04:00
Anna Schumaker 9ba4dbc218 Updates for recent library changes
This fixes the gui, deck, and audio code due to the library changes I
just did.

NOTE: Library updating callbacks have been disabled in the gui.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-24 13:07:54 -04:00
Anna Schumaker 208e53c7e9 library: Update the code and unit test
Lots of changes here!  I switched from using track and library ids to
passing pointers, renamed some functions, and made the code much
cleaner.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-24 12:48:47 -04:00
Anna Schumaker 11df56139d playlist: Update the design and unit test
I updated the code to better match how I use playlists and to make sure
that everything is tested.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-18 21:34:14 -04:00
Anna Schumaker 9a5caa29b3 queue: Update sorting code
I now have a single function rather than 4 individual functions.  The
code is cleaner, and I've added it to the unit test.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-18 14:12:16 -04:00
Anna Schumaker 7aa5f22777 Add valgrind support to testing
To help find memory leaks!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-14 17:49:03 -04:00
Anna Schumaker 38ae4ba0f3 queue: Fix up queue :: add()
It should take a Track pointer, rather than a track_id.  This makes the
code easier to work with.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-11 10:41:50 -04:00
Anna Schumaker 24fe8e7ee2 queue: Fix compile errors related to recent changes
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-11 09:20:42 -04:00
Anna Schumaker 5ff68140b5 Rip out import stuff
I only needed this to make the jump from Ocarina 5.10 -> Ocarina 6.0.
It's not needed anymore, now that 6.0 is out.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-10 08:42:53 -04:00
Anna Schumaker 1c743239a0 Rename playqueue -> queue
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 21:10:08 -04:00
Anna Schumaker a14f6145a5 Switch over to the new tagdb implementation
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 21:10:08 -04:00
Anna Schumaker 2960b72967 audio: Save and load current trackid
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker 959cac0fe1 Database: Update design for database entries
I changed primary_key() into a function since it is only called once,
and there is no point in using more mmemory than I need to.  I also
created a basic unit test for everything that database entries are
supposed to do.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 2e727ed704 gui: Add a switch to enable / disable queues
I also select the first enabled queue during startup.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 1394aaf37c gui: Show the first tab on startup
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00