summaryrefslogtreecommitdiffstats
path: root/freej/python/playeffect.src
blob: 2340f8b56c52f285442e5613eb60c200267d32ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# FreeJ python - file play and filter example

import threading
import time
import sys

import freej

# initialize FreeJ creating a Contex
cx = freej.Context()

# create an output Screen
scr = freej.SdlScreen()
scr.init(400, 300, 32)

# adds the Screen to the Context
cx.add_screen( scr )

# refreshes the list of available filter effects
cx.plugger.refresh(cx)

# 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
filt = cx.filters["vertigo"]

# adds the filter to the layer
lay.add_filter( filt )

# start the layer thread
lay.start()

# adds the layer to the freej context
scr.add_layer(lay)

# starts freej in a separate thread
th = threading.Thread(target = cx.start , name = "freej")
th.start();