Commit Graph

791 Commits

Author SHA1 Message Date
Anna Schumaker f2597a8e6c gui/playlist: Add library playlists to the playlist sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 8abc45b1ae gui/playlist: Store the playlist type in the sidebar treemodel
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 871bf88b94 gui/queue: Store playlist in the gui queue
I'll need to know the playlist type to set artist information properly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker cfeca9ae4b core/playlist: Add playlist_type enum
I'm going to use this to distinguish between various playlist types that
are about to be added.  Let's update the playlist functions first, and
then add more types in a future patch.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 004d4578d4 gui/queue: Set gq_queue->gq_search to NULL after freeing
Otherwise we can attempt to free the search text again when the queue is
destroyed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 08:26:00 -04:00
Anna Schumaker 085701ad9d gui/queue: Set gq_queue->gq_visible to NULL after destroying
Otherwise the existance check will still pass the next time
__queue_filter() is called, and we will attempt to destroy it again.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 08:21:22 -04:00
Anna Schumaker f7e9e8b321 gui/queue: Remember search text when switching queues
I wasn't doing this, but I also wasn't refiltering queues when they were
changed.  This resulted in showing a filtered queue, but without a way
to clear it.  Remembering the text lets me simply set the text, instead
of refiltering queues whenever they are changed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-10 07:31:03 -04:00
Anna Schumaker 44a6ad0d78 gui/playlist: Make sure we free text from tree_model_get()
Otherwise this leads to a memory leak.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-01 12:06:25 -04:00
Anna Schumaker 34447007f9 core/history: Remove unused queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:09:38 -04:00
Anna Schumaker 5a54fb69b6 core/collection: Remove unused queue
And remove collection_ops from the core initdata

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:09:33 -04:00
Anna Schumaker dc07d637f6 gui/history: Remove unused gui queue code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 64fc5a9a0d gui/collection: Remove unused gui queue code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 15ed068e13 gui/playlist: Select Collection playlist during startup
This preserves the original behavior, where the collection is always
selected from the beginning.  This can be improved upon later, once
queued tracks are implemented as a playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-29 17:06:06 -04:00
Anna Schumaker 696173b03e gui/playlist: Add Collection and History playlists to the sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker dfae74dd50 gui/playlist: Set gui queue name based on passed playlist
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 5d4de9c5b0 core/playlist: Add playlist_sort() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:03 -04:00
Anna Schumaker 44a57ed863 core/queue: Add extra paramater to queue_init()
This is used to pass through a value to the GUI during queue
initialization.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:03 -04:00
Anna Schumaker 93fb40360d core/filter: filter_search() returns a new GHashTable
I think this is cleaner than having an upper layer allocate the results
set manually.  This also lets me return NULL in the case that there were
no results.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:05:59 -04:00
Anna Schumaker fda3f761a0 core/filter: Call GHashTable functions directly
Implements #43: Filter code can use a GHashTable directly
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:05:54 -04:00
Anna Schumaker 29b2b6f6f4 core/filter: Store track pointers directly
I was storing database indexes, but this assumes that database indexes
are constant.  I intend to change this with database defragmentation.

Implements #46: Filter stores a track pointer
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:05:47 -04:00
Anna Schumaker 3098282382 gui/artwork: Don't destroy objects twice
The file filter and preview widget are both cleaned up when the file
chooser dialog is destroyed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:51:59 -04:00
Anna Schumaker 3b62125135 gui/artwork: Show hidden folders when selecting new images
Sometimes Ocarina gets the correct image for CD1, but not for CD2.
Allow traversing into hidden folders so users can select the correct
image out of the artwork cache.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:51:42 -04:00
Anna Schumaker 4de869d691 gui/artwork: Clear __artwork_cur_album when selecting album art
Otherwise the new image will never be updated due to the "did the album
change?" check in __artwork_set_pixbuf()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:48:13 -04:00
Anna Schumaker 160295a6cc gui/artwork: Add a preview widget to the file chooser dialog
This lets users actually see images before selecting them for ablum art.

Implements #59: Add preview widget to album art chooser
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:45:59 -04:00
Anna Schumaker 343dec5d8d gui/artwork: Fix blurry album art
Using gdk_pixbuf_new_from_file_at_scale() can result in a blurry image
due to something in the gdk backend.  I want to have a sharper image, so
we need to perform the scale manually through Cairo.

Fixes issue #60: Album art is blurry
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-25 10:00:09 -04:00
Anna Schumaker 7dff5412bc gui/artwork: Reduce time spent polling for artwork
Since MusicBrainz limits us to one request each second, it doesn't
really make sense to poll for new artwork every half second.  Instead,
let's just put this into a new timeout function that gets called every
two seconds.  This should also let us stop polling once artwork has been
found.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-22 09:40:03 -04:00
Anna Schumaker 83724c5f6f gui/artwork: Split out album art functions into a new file
I think this is cleaner, and it should make it easier to maintain this
code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-22 09:40:03 -04:00
Anna Schumaker e24ab97545 gui/playlist: Add size information to playlist sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 00dd72d46e core/playlist: Remove unused playlist_t enum
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 5e9b6bc975 core/playlist: Access playlists through a string
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 151c446635 core/playlist: Use separate queues for favorite and hidden playlists
Implements issue #6: Store playlists as queues
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:04 -04:00
Anna Schumaker db01ed3208 core/queue: Use a GQueue directly
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 4f1f76b764 gui/audio: Update album art when manually setting
If the user is fixing broken album art then we need to update the image
immediately, otherwise the user will be confused.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-14 13:36:33 -04:00
Anna Schumaker c62a88ce09 gui/audio: Add support for manually setting album art
Implements #58: Manually set album art
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-14 11:37:53 -04:00
Anna Schumaker 86b63298a5 gui/idle: Show the idle progress as a tooltip
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 20:07:50 -04:00
Anna Schumaker ecc7843ea5 gui: Clean up setting album art
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 10:28:17 -04:00
Anna Schumaker dd66b10dfa gui: Properly load a pixbuf
Using gdk_pixbuf_new_from_file_at_scale() will load a scaled pixbuf,
which looks better than loading a height x height square.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 10:28:17 -04:00
Anna Schumaker cbb9631877 gui: Add a function for determining the height of widgets
It's eaiser to do it in the builder code, rather than repeating this
code in several places.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 08:18:11 -04:00
Anna Schumaker 54af68a57f gui/audio: Add album art support
Also add the "o_cover" widget to the glade file for setting album art.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 97c8f80393 core/idle: Add a way to reschedule idle tasks
This will be needed to reschedule MusicBrainz requests if the server is
busy.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 6b52775e58 core/idle: Add support for running idle tasks in a new thread
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 6a44f9e1a1 core/idle: Add idle_sync_t enum
I intend to use this to select between sync and async idle tasks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 9e0f017e61 core/file: Build in minimum version checks
I don't think it makes sense that callers of file_open() are expected to
check the file version after opening.  This should be something handled
by the file code so we can print a consistent error message.

Implements issue #5: Better file versioning
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker bc513532c1 gui/idle: Add a function to disable processing idle tasks
This is needed during ocarina shutdown to prevent a segfault.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:39 -04:00
Anna Schumaker fff2da5439 gui/ocarina: Deinitialize gui with the GtkApplication "shutdown" signal
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:38 -04:00
Anna Schumaker d0179a9bfa gui/ocarina: Initialize gui with the GtkApplication "startup" signal
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:34 -04:00
Anna Schumaker bd1e20bc56 core/tempq: Load the tempq file through an idle task
This will help reduce disk accesses during thet main startup sequence.

Implements #12: Load temporary queues through an idle task
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:05:11 -04:00
Anna Schumaker cb6d451fb1 gui/collection: Add library paths through an idle task
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-13 09:47:46 -04:00
Anna Schumaker f01cce3b47 gui/idle: Split out idle queue functions
I want to use this outside of the collection, so let's move these
functions into a new file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-13 09:47:46 -04:00
Anna Schumaker f50c1541a1 gui/view: Scrolling improvements
This patch fixes two issues.  First, I disable scrolling when the user
has manually selected a track.  I've found that extra scrolling in this
case can be disorienting, and frequently ends up with the wrong track
selected due to how queue iterators are set so it's probably best just
to disable scrolling in this case.

This patch also changes the order of calls to set_cursor() and
scroll_to_cell().  I've found that scrolling before setting the cursor
causes the GtkTreeView to ignore alignment settings unless the row is
already on the screen.  Switching the order makes everything work
properly.

Fixes #57: Wrong track is sometimes scrolled to
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-08 08:23:53 -04:00
Anna Schumaker dfb023a0fc gui/model: Set text to bold for the currently playing track
This patch adds support for changing a rows font face to bold for the
currently playing track.  This should make it easier to find what track
is playing while quickly skimming through the list.

Fixes #22: Highlight the currently-playing song in the collection
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-07 09:14:52 -04:00
Anna Schumaker 1ad112e217 gui/sidebar: Select first enabled queue during startup
Otherwise the list of tracks is left blank, which the user might not be
expecting.

Fixes #55: Collection should be selected by default
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-04 13:52:09 -04:00
Anna Schumaker df93ad06df gui/tempq: Don't save queues from __tempq_cleared()
Cleared is only called during Ocarina shutdown, so calling save here
wipes out any temporary queues as they are written to disk.

Fixes #24: Temporary queues not saving
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-04 13:41:21 -04:00
Anna Schumaker 061dbc4575 gui/ocarina: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 4dbaf12701 gui/ocarina: Switch to C-style GtkApplication
The right way to do this would be to respond to the "activate",
"startup", and "shutdown" signals.  I can't to this easily, because
gstreamer needs argc and argv.  Let's fake things up now and sort it out
later.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 108dbacf41 gui/ocarina: Replace share_file() with find_file_path()
And don't keep the result around any longer than we need to.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 2c65584e2d gui: Remove o_notebook
Now that nothing uses it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker e97939a9cd gui: Remove old Tab and QueueTab code
Now that nothing uses it

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker c0a6c663d1 gui: Move tempq operations into tempq.c
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker bd22c8da6d gui/collection: Move collection_ops into collection.c
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 27a4cc23ed gui: Remove C++ collection tab code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker e290552812 gui/history: Convert file to C
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 5a9c6a1dd1 gui/history: Remove obsolete HistoryTab code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker d769140e35 gui: Remove C++ playlist code
And notebook switching code in playlist.c

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 7995e381c0 gui/playlist: Move playlist_ops into playlist.c
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker a1c6502226 gui/audio: Handle favorite and hide buttons
This lets me remove gui/playlist_tab.cpp

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker f328b1686d gui/view: Scroll to the current queue's iterator position
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker d5c365ddf0 gui/view: Show sort indicators on columns
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker cacd344741 gui/view: Sort queue when columns are clicked
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 8e6b963eb8 gui/view: Add a right-click menu
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker c9eb9d724b gui/view: Add keypress events
- Press "f" to add tracks to the Favorites playlist
- Press "q" to create a new temporary queue
- Press "r" to create a new temporary queue with Q_RANDOM set
- Press 0 .. 9 to add tracks to a temporary queue
- Delete to remove tracks from a queue

I also removed the corresponding keypress events from the C++ code to
make progress easier to track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker aee4764a2c core/queue: Add queue_erase() and qop_erase()
This function is similar to queue_remove(), except the remove can be
prevented if qop_erase() returns false.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 8d2b0caf6c core/tempq: Store queue operations passed to tempq_init()
We don't need different operations for each queue.  If we store this
then a higher layer doesn't need to keep passing the same structure over
and over again.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 87c59ce888 gui/queue: Control runtime display
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 2d1ddd5a35 gui/view: Load a track when treeview is double clicked
And remove this feature from the C++ code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker bbf111ecb0 gui/view: Add gui_view_set_model()
To set the currently displayed treemodel

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 76a6eba537 gui/queue: Add functions to filter the currently displayed queue
And remove the ability to filter from the C++ code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 4c784366d7 gui/view: Save and restore column widths
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker 13525eda22 gui/queue: Add a single treeview instance
And swap out the model when queues are shown.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-27 12:01:43 -04:00
Anna Schumaker b59b2a2daf gui/audio: Remove old pause after configuration code
And rearrange UI widgets a bit

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 12:03:53 -04:00
Anna Schumaker bf73685098 gui/audio: Add new GtkComboBox for controlling automatic pausing
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 11:55:46 -04:00
Anna Schumaker ada392550a gui: Switch over to using a GuiQueueModel
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:37:24 -04:00
Anna Schumaker ea149d57df gui/model: Convert iters and paths into tracks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:37:17 -04:00
Anna Schumaker 87e547d85d gui: Wire up gui_queue functions to various tabs
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:37:11 -04:00
Anna Schumaker e8681e4c92 gui/queue: Add functions to update the model
These are simple passthrough functions to convert a struct queue into a
GuiQueueModel.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:37:03 -04:00
Anna Schumaker 70803cc199 gui/queue: Create a GuiQueueModel as part of the gui_queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:56 -04:00
Anna Schumaker 4fd370ceb6 gui/model: Send tree model signals
"row-inserted", "row-deleted", and "row-changed"

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:50 -04:00
Anna Schumaker dd2adc6307 gui/model: Add support for gtk_tree_model_iter_parent()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:43 -04:00
Anna Schumaker ccf6e4c61f gui/model: Add support for gtk_tree_model_iter_nth_child()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:36 -04:00
Anna Schumaker ba59d6bd29 gui/model: Add support for gtk_tree_model_iter_n_children()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:30 -04:00
Anna Schumaker 13223427c1 gui/model: Add support for gtk_tree_model_iter_has_children()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:23 -04:00
Anna Schumaker b34fd6d522 gui/model: Add support for gtk_tree_model_iter_children()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:16 -04:00
Anna Schumaker ed69e3d2b8 gui/model: Add support for gtk_tree_model_iter_next()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:09 -04:00
Anna Schumaker e59617ffa7 gui/model: Add support for gtk_tree_model_get_value()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:36:03 -04:00
Anna Schumaker 9c3adf2b09 gui/model: Add support for gtk_tree_model_get_path()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:56 -04:00
Anna Schumaker eb481b8d09 gui/model: Add support for gtk_tree_model_get_iter()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:50 -04:00
Anna Schumaker ff81af24fc gui/model: Add support for gtk_tree_model_get_column_type()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:40 -04:00
Anna Schumaker 6acee801ab gui/model: Add support for gtk_tree_model_get_n_columns()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:33 -04:00
Anna Schumaker f5fba1680a gui/model: Add support for gtk_tree_model_get_flags()
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:27 -04:00
Anna Schumaker ddcb973d8e gui/model: Begin new custom tree model for queues
I'm not even going to try converting my C++ code.  Let's just start
fresh, and write unit tests as we build this up.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-05-14 07:35:20 -04:00
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