Commit Graph

30 Commits

Author SHA1 Message Date
Zander Brown
c8a194cf32
Use gtk-rs 0.7.0 2019-09-02 23:55:56 +03:00
Jordan Petridis
4a7d3d5fc2
Use 2018 edition for the crates 2019-03-30 17:49:29 +02:00
Jordan Petridis
0ed6c8979e Upgrade crossbeam-channel 2019-03-03 17:45:43 +02:00
Felix Häcker
68fa547b06 Implement MPRIS pause and play methods.
Till now we were only using the play_pause method and
was enough for most of the usecases, but looks like
some mpris clients only use the individual methods.

https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:PlayPause

Close #115
2019-02-05 20:47:56 +00:00
Jordan Petridis
f9f0dad203
cargo fmt 2018-11-29 14:36:06 +02:00
Jordan Petridis
fd4128c364 Prepare for Rust 2018 edition 2018-11-18 12:59:01 +00:00
Jordan Petridis
98f105fda0 Player: Use a wrapper struct to write methods on &self
Previously, methods that required the Player to be ref counted,
were using static methods with s: &Rc<Self> as the first argument.

Now the wrapper type auto-derefs to the inner struct and you can
declare methods on just &self.
2018-11-18 12:59:01 +00:00
Jordan Petridis
32b257ec30
cargo fmt 2018-11-13 15:29:20 +02:00
Zander Brown
fbda4c76f0
player.rs: Improve the fast-forward handling
Previously if you hit fast-forward but the offset remaining was
let that the amount you wanted to seek, it would do nothing.
Now it resets the stream and seekbar to the start.

Eventually this will just move on to the next episode in the
Queue once that's implemented.
2018-11-07 00:46:40 +02:00
Zander Brown
85387a0a9b
Fix for https://gitlab.gnome.org/World/podcasts/issues/105
Wow that was a quick one
2018-11-05 17:55:46 +00:00
Jordan Petridis
5ac4f6dcf9
Mpris: Actually raise the window
This fixes a bug where can_raise was never registered on dbus,
but it also works around a wayland issue with the .present()
method.

https://gitlab.gnome.org/GNOME/gtk/issues/624
2018-11-04 21:05:09 +02:00
Jordan Petridis
6671f8c6fe
podcasts-gtk: Add per file license annotations 2018-11-04 19:35:35 +02:00
Jordan Petridis
990d830f24
cargo fmt 2018-10-23 13:23:01 +03:00
Jordan Petridis
e0b3dd9795
Mpris: Implement the raise method 2018-10-04 16:46:04 +03:00
Jordan Petridis
cd2b087006 Player: Check the episode id before triggering a smart rewind 2018-10-04 05:27:11 +00:00
Jordan Petridis
ef2940142c PlayerInfo: Store the id of the current playing episode 2018-10-04 05:27:11 +00:00
Jordan Petridis
e13b8b8827 Player: Tweak the smart rewind behavior
Check if time interval passed since the last pause, and only
rewind if the delta to indicates that the user had
switched their focus.

In other words, avoid rewinding if the track was just paused and
resumed.
2018-10-04 05:27:11 +00:00
Jordan Petridis
bcc6ab50e2 PlayerInfo: Minor refactor of the mpris cover 2018-10-04 02:19:56 +00:00
Jordan Petridis
23aa8c05ab Player: Do not duplicate the mpris instance 2018-10-04 02:19:56 +00:00
Jordan Petridis
986d898217 Player: Remove an unwrap 2018-10-04 02:19:56 +00:00
Felix Häcker
ede91da6f8 cargo fmt 2018-10-04 02:19:56 +00:00
Felix Häcker
1f18d4291f Player: implement fast forward / rewind for mpris 2018-10-04 02:19:56 +00:00
Felix Häcker
d066e8939d Player: implement mpris play/pause callbacks 2018-10-04 02:19:56 +00:00
Felix Häcker
e4c3435d34 Player: add basic mpris support 2018-10-04 02:19:56 +00:00
Jordan Petridis
cc4b3cce55
Player: Fix a refference cycle 2018-08-13 06:35:19 +03:00
Piotr Drąg
bfdd6b5f7c podcasts-gtk: Review ALL the strings! 2018-08-10 05:23:15 +00:00
Jordan Petridis
f6c7731377
Fix Rust 2018 edition warnings 2018-08-05 11:24:20 +03:00
Daniel García Moreno
bea4915317 Translation support and initial spanish translation
Added translation support based on the Fractal i18n. To do this I've
added the gettext-rs crate dep. I'm using my own fork because the
official gettext-rs release includes the gettext source files and that
increase the distribution package a lot and for distribution with
flatkap we don't need to build gettext, the lib is in the gnome sdk. So
this gettext-rs fork is the same, but removing the not needed gettext
source files.

The i18n.rs file adds some useful functions to translate strings. These
functions wraps the original gettext and adds more functionality, to be
able to translate compound strings, something that's not supported by
the gettext function.

The 'i18n' function works like the gettext, receives a plain string
without params.

The 'i18n_f' function receives a string with "{}" and a ref to an array
of &str with substitutions for the "{}" in the original string. The
substitution is done by order.

The 'i18n_k' function receives a string with "{named}" and a ref to an
array of (&str, &str) with substitutions for the "{named}" in the
original string. The substitution is done by name, where the first &str
in the tuple is the name and the second the string to use for the
replace.

This mod also include ni18n variants of the three functions for plural
and singular translations.

I've also created the spanish translation.

See #61

https://gitlab.gnome.org/World/podcasts/issues/61
2018-08-02 15:24:19 +02:00
Jordan Petridis
838320785e
Replace SendCell with fragile.
SendCell is depricated now and its advised to use the Fragile
crate instead.

https://github.com/sdroege/send-cell/issues/5
2018-07-28 19:46:01 +03:00
Jordan Petridis
04c68ba013
Initial massive renaming. 2018-07-25 03:26:35 +03:00