Commit d4bd7e2e authored by Zander's avatar Zander Committed by Jordan Petridis

Add 1.72 & 2x speeds

parent 58017369
Pipeline #66759 passed with stages
in 10 minutes and 20 seconds
......@@ -339,6 +339,42 @@ Tobias Bernard
<property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkRadioButton" id="rate_2_00">
<property name="label" translatable="yes">2.00×</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">2 speed rate</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="draw_indicator">True</property>
<property name="group">normal_rate</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="rate_1_75">
<property name="label" translatable="yes">1.75×</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">1.75 speed rate</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="draw_indicator">True</property>
<property name="group">normal_rate</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="rate_1_50">
<property name="label" translatable="yes">1.50×</property>
......@@ -354,7 +390,7 @@ Tobias Bernard
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">2</property>
</packing>
</child>
<child>
......@@ -372,7 +408,7 @@ Tobias Bernard
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">3</property>
</packing>
</child>
<child>
......@@ -390,7 +426,7 @@ Tobias Bernard
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">4</property>
</packing>
</child>
</object>
......
......@@ -177,6 +177,8 @@ fn format_duration(seconds: u32) -> String {
#[derive(Debug, Clone)]
struct PlayerRate {
radio200: gtk::RadioButton,
radio175: gtk::RadioButton,
radio150: gtk::RadioButton,
radio125: gtk::RadioButton,
radio_normal: gtk::RadioButton,
......@@ -277,6 +279,8 @@ impl Default for PlayerWidget {
episode_id: RefCell::new(None),
};
let radio200 = builder.get_object("rate_2_00").unwrap();
let radio175 = builder.get_object("rate_1_75").unwrap();
let radio150 = builder.get_object("rate_1_50").unwrap();
let radio125 = builder.get_object("rate_1_25").unwrap();
let radio_normal = builder.get_object("normal_rate").unwrap();
......@@ -284,6 +288,8 @@ impl Default for PlayerWidget {
let btn = builder.get_object("rate_button").unwrap();
let label = builder.get_object("rate_label").unwrap();
let rate = PlayerRate {
radio200,
radio175,
radio150,
radio125,
radio_normal,
......@@ -583,6 +589,18 @@ impl PlayerWrapper {
.connect_toggled(clone!(weak => move |_| {
weak.upgrade().map(|p| p.on_rate_changed(1.50));
}));
self.rate
.radio175
.connect_toggled(clone!(weak => move |_| {
weak.upgrade().map(|p| p.on_rate_changed(1.75));
}));
self.rate
.radio200
.connect_toggled(clone!(weak => move |_| {
weak.upgrade().map(|p| p.on_rate_changed(2.00));
}));
}
fn connect_mpris_buttons(&self, sender: &Sender<Action>) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment