Commit graph

6 commits

Author SHA1 Message Date
Joshua Strobl
62de9c2032 Get to the point where we are fairly happy with our uncrustify config. Fixes #6. 2021-05-11 20:05:04 +03:00
Joshua Strobl
3e0e21e246 Implement Notification support. Fixes #8.
Implemented Notification support using notify-send as opposed to libnotify. This is because notify_notification_send does a synchronous dbus call to org.freedesktop.Notification and typically results in DBus timeouts. In the near future we will rewrite this to just use our own proxy and do an async send.

Refactored our GVariant metadata generation for a KotoIndexedTrack into a dedicated koto_indexed_track_get_metadata_vardict function. This can then be used across our playback engine and MPRIS.
2021-05-11 18:31:13 +03:00
Joshua Strobl
b4ffba62c7 Implement koto_utils_is_valid_string to replace repetitive NULL and g_strcmp0 code.
Reduce usage of g_return_if_fail since it results in unnecessary warnings.
2021-05-07 21:57:21 +03:00
Joshua Strobl
f2164b2ade Start work on playlist creation dialog
Started work on the playlist creation dialog. To facilitate my desired UX for dialogs, I changed the immediate child of KotoWindow to being a GtkOverlay, with the "child" being the primary layout GtkBox and the "overlay" being any active dialog.

There is no background on the dialogs yet, or really anything meaningful in it besides the GtkImage to show the playlist image as well as a GtkEntry for the label. Upon clicking the image, you will be presented with a GtkFileChooserNative, which will allow us to support various platforms aside from Linux (if we desire) but more importantly support desktop portals and the appropriate picker for each desktop environment.

This dialog is currently hooked into the + button in the Playlist nav section.

The intent is to also support drag-and-drop when possible, so you can drag an image file onto the GtkImage for it to set it to the playlist image.

Fixed various compiler warnings, such as:

- Unused variables (cast these as void so compiler knows to ignore them).
- Use g_hash_table_add instead of g_hash_table_insert since value does not matter and will complain about not casting TRUE as a pointer.
- Fixed some casting.

Fixed up Desktop file and fleshed out Appstream data. Use validate-relax in the appstream test or it gets cranky about screenshots missing. I know...the app is not ready yet. Get over it AppStream.

Added Visual Studio Code tasks and some C/C++ Extension setting files.
2021-04-07 13:17:33 +03:00
Joshua Strobl
43ebe6d041 Implement explicit functions for setting track repeat and shuffling in KotoPlaybackEngine.
Use these new functions as well as new signals to simplify toggle state in playerbar, as well as ensure changes over MPRIS allow for the updating of our UX.

Implement method handlers and relevant setters for MPRIS support, as well as a koto_update_mpris_playback_state used to notify on state changes.

Clean up some debugging.
2021-04-06 13:56:29 +03:00
Joshua Strobl
07c3c00f1e Implement mimetype support reporting for MPRIS, start implementation of bulk of getters.
Implemented the following getters for MPRIS:

- CanQuit
- CanRaise
- HasTrackList
- Identity
- DesktopEntry
- SupportedUriSchemas
- SupportedMimeTypes
- Metadata
- CanPlay / CanPause / CanSeek
- CanControl
- PlaybackStatus

Implemented a koto_push_track_info_to_builder function that enables us to easily push KotoIndexedTrack as well as associated album and artist info to a GVariantBuilder for use in a GVariant for various getters.

Implemented a koto_update_mpris_info_for_track function that emits a signal for PropertiesChanged + "Metadata" when our track info changes.
2021-04-06 10:45:11 +03:00