Commit Graph

1278 Commits

Author SHA1 Message Date
Anna Schumaker 41cb325ad0 buttons: Give the SplitButton an activate() function
This is a keybinding function that calls into the primary button
activate() function. At the same time, I add an "activate-primary"
signal that is emitted when the primary button is activated.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-09 10:04:28 -04:00
Anna Schumaker 0c1e5fcace header: Add keyboard accelerators
I add accelerators for opening files, changing the volume, toggling
background mode, and running the settings editor.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-09 10:04:25 -04:00
Anna Schumaker 9cb927aabb header: Give the volume button public {inc,dec}rement() funcs
I made these functions part of the public interface with option
arguments so they can be used in accelerator callbacks for increasing or
decreasing the volume.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-09 09:50:22 -04:00
Anna Schumaker 397c693aef window: Add a keyboard accelerator
I use the "Escape" key as a shortcut for resetting the currently focused
widget.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-09 09:50:19 -04:00
Anna Schumaker eb162154b5 window: Add a "user-editing" property
I use the current focus widget to set the "user-editing" property, which
can be used to enable or disable accelerator actions.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-09 09:46:10 -04:00
Anna Schumaker 2b5cdaa197 action: Add an ActionEntry class
This is inspried by the Gio.ActionEntry struct, which I can't figure out
how to get working in Python. I add on a few extra helpful features,
such as:

  - Automatically creating a Gio.SimpleAction
  - Tracking the desired accelerator keys
  - Binding the "enabled" state to a specificed property at construction

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-09 09:45:58 -04:00
Anna Schumaker c5f9608c49 tracklist: Commit the database after adding, moving, or removing tracks
Otherwise we could lose the changes if the app crashes.

Fixes: #63 ("The database isn't being committed enough")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-07 14:58:19 -04:00
Anna Schumaker cae93cae11 sidebar: Commit the database after creating a new playlist
Otherwise we could have data loss if the application crashes.

Fixes: #63 ("The database isn't being committed enough")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-07 14:58:19 -04:00
Anna Schumaker 01a37dbbc1 db: Commit the database after deleting a Table Row
Fixes: #63 ("The database isn't being committed enough")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-07 14:54:32 -04:00
Anna Schumaker 14c487c295 db: Commit the database when a Track has been started or stopped
Leaving the database in a dirty state could cause unintentional data
loss if the app crashes.

Fixes: #63 ("The database isn't being committed enough")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-07 13:26:55 -04:00
Anna Schumaker 57dd2c280e db: Don't notify if the active-playlist doesn't change
This lets us skip a handful of database calls if we detect that we're
setting the active playlist to the same value.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-06 09:29:16 -04:00
Anna Schumaker 59fb7d12f3 db: Set the Queued Tracks playlist as active when adding tracks
I do this unconditionally, so even if the track is already on the
playlist we set it as active. I think this is what the user would
expect, but I'm open to revising this approach later.

Fixes: #62 ("Queueing tracks doesn't activate the Queued Tracks playlist")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-06 09:22:22 -04:00
Anna Schumaker 93cdd9137a Remove 'data/' directory
This should have been done with the 3.0 release, but was overlooked.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:47:04 -04:00
Anna Schumaker 45e95cc8c1 Rename emmental.desktop
The Makefile was updated to point to
com.nowheycreamery.emmental.desktop, but the file was never renamed.
Oops.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:46:10 -04:00
Anna Schumaker fa5cd55fce Emmental 3.0.1 AUR commit
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:34:24 -04:00
Anna Schumaker f307c92edb Emmental 3.0.1
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:14:40 -04:00
Anna Schumaker 8afd1a6240 audio: Replace the playbin audio-filter with the new filter
And wire up the bg-enabled and bg-volume properties from the header to
the playbin properties with the same name.

Implements: #50 ("Background Music Mode")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:13:48 -04:00
Anna Schumaker 84fbd94aa1 audio: Create a new audio filter for ReplayGain and Background Mode
This links together our ReplayGain filter with a volume element that is
set to the user configured background volume when background listening
mode is enabled, and 100% when background listening mode is disabled.

Implements: #50 ("Background Music Mode")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:13:46 -04:00
Anna Schumaker 7155fa9db5 header: Add an icon for background mode to the Header
I also update the button tooltip to display the background listening
status along with the current volume level.

Implements: #50 ("Background Music Mode")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:13:44 -04:00
Anna Schumaker 0e40e6a4e8 header: Add a BackgroundRow to the popover menu
And wire up the properties so we can save the user's current setting.

Implements: #50 ("Background Music Mode")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:13:42 -04:00
Anna Schumaker deea9caa37 header: Create a BackgroundRow ListBox row
This widget will be added to the Volume popover and allow configuring a
lower volume for background listening while focusing on tasks.

Implements: #50 ("Background Music Mode")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-06-01 11:13:39 -04:00
Anna Schumaker a626a1f3c4 header: Convert the volume button box to a Gtk.ListBox
And give it the boxed-list style class so it looks nice.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-31 16:31:31 -04:00
Anna Schumaker dae588bfaf header: Convert the ReplayGain selector into an Adw.ExpanderRow
This will be added to a ListBox with the volume controls. Expanding the
row will enable ReplayGain and give the user a menu to select ReplayGain
mode.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-31 16:31:31 -04:00
Anna Schumaker 03e5b9ad1b header: Convert the volume controls into a ListBoxRow
The plan is to convert the volume control panel into a Gtk.ListBox for a
more modern appearance.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-31 16:31:30 -04:00
Anna Schumaker 5b0a0f54e4 header: Add tooltips to the Header widgets
This is nice to have so users know what to expect from each button. I do
take some liberties, such as putting version numbers of our dependencies
as the tooltip for the Title widget. I also display the current volume
level in the volume button tooltip.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-30 13:54:21 -04:00
Anna Schumaker dd9d6268ff gsetup: Rework version string handling
I split the function into two. Calling env_string() will return the
string we generate with the versions of the various modules we depend
on. Calling print_env() will print this string.

I need env_string() so we can set the environment as a tooltip in the
header.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-30 13:19:51 -04:00
Anna Schumaker a86ce6165d Emmental: Add a MICRO_VERSION
And set it to '1' to start, since we have a few extra commits on top of
3.0 already.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-25 10:19:51 -04:00
Anna Schumaker e624566919 Makefile: Makefile updates
- Install emmental.desktop as com.nowheycreamery.emmental.desktop
- Fix up variables used in the 'uninstall' target

Fixes: #61 (Rename .desktop file)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-24 15:05:10 -04:00
Anna Schumaker b9a25ce5af emmental.desktop: Set the StartupWMClass key
We need to set this to emmental.py so the Gnome dock knows what to do
with emmental.py when it is started by our launcher shell script.

Fixes: #60 (Set StartupWMClass in the emmental.desktop file)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-24 15:05:03 -04:00
Anna Schumaker bb9ecdbb5d Emmental 3.0 AUR commit
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-24 14:48:15 -04:00
Anna Schumaker 8b249b4b3e README: Write a README for v3.0
Expand on the current README.md file to include information about
Emmental and its dependencies.

Implements: #49 (Write README)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-23 10:53:24 -04:00
Anna Schumaker 55d7eb3d45 db: Raise an exception if the user_version is too new
Future proof. If we update the database schema, then we'll bump the
user_version field. If the user then tries to open the new database with
an old Emmental version then there could be a lot of issues. Let's
detect this and raise an error with a description of the problem.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-23 09:16:52 -04:00
Anna Schumaker 8b1be777c1 install: Update the install target for Emmental 3.x
Instead of calling out to a separate tools, I can use the `find` and
`install` programs to easily install the files to the right place.

I also take this opportunity to update the emmental.desktop file for v3,
including filling out as many audio-related mime types as I can find and
using the `desktop-file-install` command to not only install the file
but properly set the "Exec" and "Icon" fields based on the PREFIX=
passed to `make`

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-23 09:16:52 -04:00
Anna Schumaker 50474c7fd1 Rename emmental3.py --> emmental.py
Now that we are getting ready for a release, update the launcher script
name.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:42 -04:00
Anna Schumaker 6e4e83cb40 Remove obsolete Emmental 2.x code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:42 -04:00
Anna Schumaker 78ea2904a1 tracklist: Add Move Down and Move Up buttons to the OSD
These are used to manually rearrange the Tracks in the Playlist. The
buttons are only marked sensitive if one item is selected.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker a6f59d9378 tracklist: Add an Add Tracks button to the TrackView OSD
The Add Tracks button is a popover button configured to display a list
of playlists that tracks could be added to. I take some extra care to
make sure we only display playlists that have their user-tracks property
set to True, and to hide the currently visible playlist from the list.

Additionally, I create a horizontal size group so the Add and Remove
buttons are the same size.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker ff9724a274 tracklist: Add a Remove Tracks button to the TrackView
The button is placed inside a Gtk.Overlay, and is hidden by default. The
button will be shown when tracks are selected if the current Playlist
has its "user-tracks" property set to True.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker 911aeb84a1 tracklist: Add a Footer widget
This widget displays the number of visible tracks, number of selected
tracks, and runtime of the current playlist. I wire it up to these
properties from the trackview.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker ee1152bcc4 tracklist: Add a SortButton
This is a Popover Button containing a Gtk.ListView to display the Sort
Order Model for the currently visible Playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker ed4a484a31 tracklist: Add a SortFieldWidget
This Widget is intended to be used as the child widget in a Gtk.ListView
to display and change the sort order of the current playlist. I use
arrow buttons from the icon library to represent sort order

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker 83355f7e96 tracklist: Add a SortOrderModel
This is a Gio.ListStore with some extra functions for enabling,
disabling, rearranging, and reversing sort fields. It also has a
sort-string property for getting the current sort order to save
to the database.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker b326320156 tracklist: Add a SortField object
The SortField object is used to represent a single column in the
Tracklist that the user could sort by.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker 0c77e509c3 tracklist: Add a ShuffleButton
This is an ImageToggle button that adjusts its opacity based on if it is
active or not.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker ed1d990e74 tracklist: Add a LoopButton
This is an ImageToggle button that has been configured to cycle between
3 states corresponding to no looping, playlist looping, and track
looping.

I also update the Tracklist to look for changes in the visible Playlist
to update the Loop button.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker 2d19d78eb6 tracklist: Add an Unselect All button
This button will unselect any selected tracks when clicked.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker f1e18549ff tracklist: Add a VisibleColumns button
This button shows a popover menu to set the visibility of our columns.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker ff1d772a05 tracklist: Add a Selection OSD to the TrackView
The OSD will eventually contain buttons for modifying playlists, but for
now it just has functions and properties for mananging the current track
selection.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker a485a3806b tracklist: Scroll to the requested Track
And wire this up to not only the Now Playing "jump" signal, but also the
next track pickers so we scroll when tracks are changed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00
Anna Schumaker 481c4856c7 tracklist: Request a Track when it is activated
And wire up a handler for the factory track-requested signal in the main
application code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-05-10 17:42:27 -04:00