Try to parse into a number as much of the string as possible, without caring
about a sign suffix. This way input will be more forgiving instead of resetting
itself to lowest allowed number.
Also when a number exceeds allowed range, set it to maximal allowed value
instead of once again resetting to minimum.
When creating JSON data, we must ensure that our decimal numbers are converted
to a string with a "." as separator, otherwise it would be an invalid JSON.
As the SpinButton input callback attempted to parse the value inserted
as a string by printf using g_ascii_strtod, only if the language also
used . (full stop / u002E) as decimal seperator worked correctly.
Otherwise, parsing would fail and result (after a few iterations) in the
lowest value being set.
The usually correct approach is to use g_ascii_dtostr / g_ascii_formatd
instead of printf to format a decimal number, but given that this number
is actually presented to the user, going with g_strtod seems like a
better choice (I've decided against just using the stdlib strtod as to
allow the SpinButton to also recognize manual user input containing the
full stop instead of their languages native decimal seperator (not
that that'll ever happen, given the user can't focus the SpinButton
entry while media is running).
I've also fixed this for the volume SpinButton too, but it wasn't really
affected in the first place as it appearently always gets rounded up to
a number without decimal places.
Signed-off-by: Florian "sp1rit" <sp1rit@disroot.org>
This causes meson to automatically build the clapper gsettings schemas
and set GSETTINGS_SCHEMA_DIR to the correct location within the devenv.
This means that can now be ran without needing to install it somewhere
using:
meson devenv -C <builddir>
clapper
exit
More devenv overrides should be investigated (such as automatically
adopting the correct directory for translated locales etc.)
Signed-off-by: Florian "sp1rit" <sp1rit@disroot.org>
A rewritten Clapper video player made using "Clapper" and "ClapperGtk" libraries.
Since both libraries from this repo are in C, newly rewritten Clapper binary is also in C to
avoid mixing different programming languages in a single repo, thus making maintenance easier.
Not depending on GJS gives us also an additional benefit of supporting different operating
systems or linux shells without pulling GJS as dependency.
Licensed under GPL-3.0-or-later.
An easy to use GTK integration library. Meant as a GtkVideo alternative.
While GtkVideo is more of a simple example of video playback under GTK4, this
acts as a full-fledged video player in the form of a GtkWidget that can be placed
anywhere within application.
The widget offers customization options for both top header and bottom playback
controls panels. The Clapper playback API is exposed under widget "player" property
making it easy for the programmer to set media and control playback programically.
The new library will be distributed with Clapper player. This includes public headers
and GObject Introspection support.
Licensed under LGPL-2.1-or-later.
An easy to use media playback library (libclapper) as a GstPlayer replacement.
Previously we tried to use upstream `gstplayer` library to control playback and
pass all events from multiple threads GStreamer uses into an app main thread.
Since this caused some thread racy problems and we needed additional ABI breaking
changes to better suit our needs, we ended up with a modified fork of said library
renamed to `gstclapper` as a temporary solution.
This new library simply named `clapper` replaces our previous `gstclapper` solution
and is written completely from scratch by myself. The aim here is to have an easy to
use playback library better suited to work with (but not limited to) GTK and GObject
properties bindings by relying on "notify" signals.
Major differences include:
* Operates on a playback queue (inherits `GListModel` interface) instead of a single URI
* Uses "notify" signals for property changes always dispatched to app thread
* Time is passed/read as decimal number in seconds instead of int64 in nanoseconds
* Integrates `GstDiscoverer` to figure out media info (such as title) before playback
* Easy to use MPRIS support as part of library
* Optional playback remote controls with WebSocket messages
The new library will be distributed with Clapper player. This includes public headers
and GObject Introspection support.
Licensed under LGPL-2.1-or-later.
Enjoy
Listen on all network interfaces for incoming connections.
Previous soup_server_listen_local() only listens on local
loopback device preventing access from network, so use
listen_all() instead to allow access through any interface.
Fixes#362
We no longer ship the web app that was reusing parts of this code.
Combine it into single file without additional subclass.
Also put window creation inside first activate code instead of startup
in order to fix running app as a gapplication service.
Use brand new clapper video sink for video output. Also add "CLAPPER_USE_LEGACY_SINK" env
to still allow the usage of old video sink if any problems arise.
With all apps and modules/plugins porting itself to libsoup3 we also need to do so.
It would appear as a good idea to conditionally import "3.0" and fallback to "2.4"
bindings here, but its not as loaded GStreamer plugins might use libsoup3 already
and we cannot have both libsoup2 and libsoup3 in a single process.
It used Broadway as an easy "reuse the same code into web application" way for me, but Broadway
is not very good for this. This feature should be made using some better dedicated framework for
building websites (so it can work better and support different screen sizes).
All the WebSocket functionality needed for this will remain (and be documented at a later point
when expanded and stable), so if anyone would like to make such remote controlling app, will be
free to do so (outside of Clapper code).
Recent libadwaita has renamed "can-swipe-back" into "can-navigate-back".
Set both in JS code instead of UI file in order to support all libadwaita versions.
Fixes#185
Latest libadwaita (for reasons unknown to me) totally ignores/breaks dark theme usage with gtk_application_prefer_dark_theme property. Lets just try using the new Adw.StyleManager without asking questions why.
Capture phase runs from the toplevel down to the event widget and is meant to be used
in containers that might possibly handle events before their children, like our OSD layer.
This avoids an issue where pressing an OSD button does not emit cancelled signal,
accidentally triggering long press gesture signal handler.
Fixes#170
The clipboard.read_text_finish method might throw an error when something goes wrong. Catch it and print in debug message. There is no alternative clipboard reading, so simply ignore.
Add missing PiP icons from web devel kit. Also add play/pause
icons at the right size and remove all workarounds/scaling
implemented or these two.
Playback icons are always two bars for pause and triangle for play,
so hopefully this will not be problematic, as this guaranties the
right size for them that Adwaita unfortunately cannot provide.