Re: [seedkit-list] can't run seedkit-viewer examples



Hello,

Il 08/08/2011 21:24, Riccardo Magliocchetti ha scritto:
Hello,

every demo (notification, gio, gstreamer) i've tried gives me this message:

** Message: console message: undefined @0: [object Object]

seedkit and seedkit view are latest git, seed is 3.0.0 on debian sid.

Today i've played a bit with seedkit-viewer again and i've an update on this. The notification examples started to work, that was probably something wrong on notification gir stuff or something missing on my machine.

Then i've patched the gstreamer one to actually play an annoying sound. I've added a missing Gst.init() and switch from pipeline.link_many (which looks it does not work) to a pipeline.link. I've tried the seed-examples/n-oscillator.js and it segfault here when i enable a switch. So again it does not look like a seedkit issue.

Finally i have not figured out what's wrong with the gio one but i've updated the js to use the same api of seed-examples/quine.js but still does not work. The only difference in practice is that read_contents() does not close manually the stream but anyway it's dying before that. I've noticed that jquery reads a fake path, but even hardcoding one does not make the thing work. This looks like a seedkit issue since quine.js works fine.

Please take a look at the attached patches.

thanks,
riccardo
diff --git a/examples/gst/ui.js b/examples/gst/ui.js
index 6696090..09f72bd 100644
--- a/examples/gst/ui.js
+++ b/examples/gst/ui.js
@@ -31,16 +31,14 @@ GLib = imports.gi.GLib;
 Gst = imports.gi.Gst;
 GObject = imports.gi.GObject;
 
-var unique_id = "test";
+Gst.init(0, []);
 var pipeline = new Gst.Pipeline({name: "test"});
+
+var unique_id = "test";
 var audiosrc = Gst.ElementFactory.make("audiotestsrc", "source" + unique_id);
 var audiosink = Gst.ElementFactory.make("alsasink", "sink" + unique_id);
-var volume = Gst.ElementFactory.make("volume", "volume" + unique_id);
-
-print(pipeline);
-//pipeline.add(audiosink);
-//pipeline.add(volume);
-audiosrc.link_many(volume, audiosink);
- pipeline.set_state(Gst.State.PLAYING);
 
-alert("DEDE");
+pipeline.add(audiosrc);
+pipeline.add(audiosink);
+audiosrc.link(audiosink)
+pipeline.set_state(Gst.State.PLAYING);
diff --git a/examples/gio/ui.js b/examples/gio/ui.js
index 8712cc3..07bf079 100644
--- a/examples/gio/ui.js
+++ b/examples/gio/ui.js
@@ -1,22 +1,15 @@
 
 function readFile(path) {
-	var inputFile = Gio.file_new_for_path(path);
-	var fstream = inputFile.read();
-	var dstream = new Gio.DataInputStream.c_new(fstream);
-	var line = dstream.read_until("", 0);
-	fstream.close();
-
-	return line;
+	var file = Gio.file_new_for_path(path);
+	var input = file.read();
+	return input.get_contents();
 }
 
 $(document).ready(function(){
+	Gio = imports.gi.Gio;
 
-Gio = imports.gi.Gio;
-
-$("#file-chooser").change( function() {	
-	$("#editor").text(readFile($(this).attr("value")));
-});
-
+	$("#file-chooser").change( function() {
+		var filename = $(this).attr("value");
+		$("#editor").text(readFile(filename));
+	});
 });
-
-


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]