[gnome-games] retro: Make RetroRunner use MediaSet
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro: Make RetroRunner use MediaSet
- Date: Fri, 19 Aug 2016 21:09:35 +0000 (UTC)
commit 47a81e0a6b3b3f0c0da65623442b460f3ce93a86
Author: Ricard Gascons <gascons1995 gmail com>
Date: Fri Aug 19 14:56:06 2016 +0200
retro: Make RetroRunner use MediaSet
Make RetroRunner use MediaSet which stores URIs and filename titles
from sources.
This is part of a series of commits to add multi-source support.
src/retro/retro-runner.vala | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 26e4d5a..07f0783 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -49,7 +49,6 @@ public class Games.RetroRunner : Object, Runner {
private string module_basename;
private string[] mime_types;
- private string uri;
private Uid uid;
private bool core_supports_snapshotting;
@@ -75,8 +74,10 @@ public class Games.RetroRunner : Object, Runner {
is_ready = false;
should_save = false;
+ var game_media = new Media (uri);
+ _media_set = new MediaSet ({ game_media });
+
this.module_basename = module_basename;
- this.uri = uri;
this.uid = uid;
this.core_supports_snapshotting = core_supports_snapshotting;
}
@@ -86,9 +87,23 @@ public class Games.RetroRunner : Object, Runner {
is_ready = false;
should_save = false;
+ var game_media = new Media (uri);
+ _media_set = new MediaSet ({ game_media });
+
+ this.mime_types = mime_types;
+ this.module_basename = module_basename;
+ this.uid = uid;
+ this.core_supports_snapshotting = core_supports_snapshotting;
+ }
+
+ public RetroRunner.for_media_set (MediaSet media_set, Uid uid, string[] mime_types, string
module_basename, bool core_supports_snapshotting) {
+ is_initialized = false;
+ is_ready = false;
+ should_save = false;
+
+ this._media_set = media_set;
this.mime_types = mime_types;
this.module_basename = module_basename;
- this.uri = uri;
this.uid = uid;
this.core_supports_snapshotting = core_supports_snapshotting;
}
@@ -160,6 +175,10 @@ public class Games.RetroRunner : Object, Runner {
video.visible = true;
input_manager = new RetroInputManager (widget);
+ var media_number = media_set.selected_media_number;
+ var media = media_set.get_selected_media (media_number);
+ var uri = media.uri;
+
prepare_core (module_basename, uri);
core.shutdown.connect (on_shutdown);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]