Check if the D-Bus connection has been successfully created before launching the thread. This way we can handle the error before anything occurs. Should fix https://github.com/aome510/spotify-player/issues/170
Check if the thread isn't running or has panicked at every method call of MediaControls.
This release should not break previous usages of MediaControls with the dbus backend. The plan is to merge this PR and release 0.7.0, so the apps can implement the volume controls without waiting for the major refactor which is coming.
After this PR, I'm planning to migrate to zbus completely, since the library we use for dbus can be a bit annoying to work with at times because of the usage of the underlying C library, which has various side effects, e.g. places weird constraints on lifetimes, has a black-box error dbus::Error which is just a string, has non-static interface generation. This are most probably the hard limitations of the library being a C wrapper.
It was probably better to split these changes into different PRs but well, here we are.
This PR includes:
dbus
module:MediaControls
.dbus
andzbus
modules. Fixes https://github.com/Sinono3/souvlaki/issues/36This release should not break previous usages of MediaControls with the
dbus
backend. The plan is to merge this PR and release 0.7.0, so the apps can implement the volume controls without waiting for the major refactor which is coming.After this PR, I'm planning to migrate to zbus completely, since the library we use for
dbus
can be a bit annoying to work with at times because of the usage of the underlying C library, which has various side effects, e.g. places weird constraints on lifetimes, has a black-box errordbus::Error
which is just a string, has non-static interface generation. This are most probably the hard limitations of the library being a C wrapper.