summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2009-06-13 13:10:36 (GMT)
committer Jaromil <jaromil@dyne.org>2009-06-13 13:10:36 (GMT)
commit96654302b85519f3e0837e74ff2e2559846cf322 (patch)
tree3d51e7d9de3d8471290fbd5440ffa6bee3e9b44f
parent362c376136bb8c3268170eb46805e763c4beb4da (diff)
updated scripts for the new initalization scheme
-rw-r--r--freej/python/controller.src7
-rw-r--r--freej/python/helloworld.src9
-rw-r--r--freej/python/playeffect.src33
3 files changed, 34 insertions, 15 deletions
diff --git a/freej/python/controller.src b/freej/python/controller.src
index a0694d3..57d39e5 100644
--- a/freej/python/controller.src
+++ b/freej/python/controller.src
@@ -2,8 +2,11 @@
import threading
import freej
-cx = freej.Context()
-cx.init(400,300,0,0)
+# context and screen initialization
+cx = freej.Context()
+scr = freej.SdlScreen( 400, 300 )
+cx.add_screen( scr )
+
### declare the Trigger Controller
class Frame(freej.TriggerController):
diff --git a/freej/python/helloworld.src b/freej/python/helloworld.src
index 521d2d8..8659db6 100644
--- a/freej/python/helloworld.src
+++ b/freej/python/helloworld.src
@@ -4,9 +4,14 @@ import time
import freej
-# creates and initializes the freej context at give size
+# initializes FreeJ creating a Contex
cx = freej.Context()
-cx.init(400,300,0,0)
+
+# creates a screen of given size
+scr = freej.SdlScreen( 400, 300 )
+
+# adds the screen
+cx.add_screen(scr)
# create an instance of a TextLayer
txt = freej.TextLayer()
diff --git a/freej/python/playeffect.src b/freej/python/playeffect.src
index b9c28db..fa034a6 100644
--- a/freej/python/playeffect.src
+++ b/freej/python/playeffect.src
@@ -1,32 +1,43 @@
-# system wide useful modules
+ # system wide useful modules
import threading
import time
import sys
import freej
-# creates and initializes the freej context at give size
+ # initializes FreeJ creating a Contex
cx = freej.Context()
-cx.init(400,300,0,0)
-# refreshes the list of available filter effects
+ # creates a screen of given size
+scr = freej.SdlScreen( 400, 300 )
+
+ # adds the screen
+cx.add_screen(scr)
+
+ # refreshes the list of available filter effects
cx.plugger.refresh(cx)
-# opens the file given on commandline as a layer
+ # check that we have an argument
+if(sys.argv.__len__()<2):
+ print "[!] this script needs an argument: file to play"
+ quit()
+
+ # opens the file given on commandline as a layer
lay = cx.open(sys.argv[1])
-# gets the vertigo filter effect
+
+ # gets the vertigo filter effect
filt = cx.filters["vertigo"]
-# adds the filter to the layer
-lay.add_filter(filt)
+ # adds the filter to the layer
+lay.add_filter( filt )
-# start the layer thread
+ # start the layer thread
lay.start()
-# adds the layer to the freej context
+ # adds the layer to the freej context
cx.add_layer(lay)
-# starts freej in a separate thread
+ # starts freej in a separate thread
th = threading.Thread(target = cx.start , name = "freej")
th.start();