[gnome-games] retro-runner: Use video filter from gsettings
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro-runner: Use video filter from gsettings
- Date: Fri, 17 Feb 2017 12:55:25 +0000 (UTC)
commit 4d599548d4e10c9f79457a53e844b02850b8e50a
Author: theawless <theawless gmail com>
Date: Sat Feb 11 02:17:33 2017 +0530
retro-runner: Use video filter from gsettings
Add setup_video_filter() and connect it to gsettings.
https://bugzilla.gnome.org/show_bug.cgi?id=777987
src/retro/retro-runner.vala | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 6fe2210..eb525c7 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -49,6 +49,7 @@ public class Games.RetroRunner : Object, Runner {
private RetroCoreSource core_source;
private Uid uid;
private InputCapabilities input_capabilities;
+ private Settings settings;
private bool _running;
private bool running {
@@ -93,6 +94,10 @@ public class Games.RetroRunner : Object, Runner {
_media_set.notify["selected-media-number"].connect (on_media_number_changed);
}
+ construct {
+ settings = new Settings ("org.gnome.Games");
+ }
+
~RetroRunner () {
if (!is_initialized)
return;
@@ -173,6 +178,8 @@ public class Games.RetroRunner : Object, Runner {
return;
video = new Retro.CairoDisplay ();
+ settings.changed["video-filter"].connect (setup_video_filter);
+ setup_video_filter ();
widget = new Gtk.EventBox ();
widget.add (video);
@@ -201,6 +208,8 @@ public class Games.RetroRunner : Object, Runner {
if (!is_initialized)
return;
+ settings.changed["video-filter"].disconnect (setup_video_filter);
+
core = null;
video = null;
audio = null;
@@ -214,6 +223,10 @@ public class Games.RetroRunner : Object, Runner {
should_save = false;
}
+ private void setup_video_filter () {
+ video.set_filter ((Retro.VideoFilter) settings.get_enum ("video-filter"));
+ }
+
private void prepare_core (string uri) throws Error {
var module_path = core_source.get_module_path ();
core = new Retro.Core (module_path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]