2009-12-22 00:29:19 -05:00
|
|
|
# This is a simple test plugin, to make sure everything is working
|
|
|
|
|
|
|
|
__author__="bjschuma"
|
|
|
|
__date__ ="$Dec 21, 2009 10:35:01 PM$"
|
|
|
|
|
|
|
|
|
|
|
|
global name, app, type, path, opt
|
2009-12-22 00:37:52 -05:00
|
|
|
name = "load"
|
2009-12-22 00:29:19 -05:00
|
|
|
app = "ocarina"
|
|
|
|
type = "core"
|
|
|
|
path = ""
|
|
|
|
opt = []
|
|
|
|
|
|
|
|
from bt.message import write
|
|
|
|
from bt.file import *
|
|
|
|
import settings
|
|
|
|
|
|
|
|
#from tools import gstream
|
|
|
|
import gstreamer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Called every time the plugin is enabled
|
|
|
|
def open():
|
|
|
|
pass
|
|
|
|
#write("Example plugin has been changed",True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Called every time the plugin is stopped
|
|
|
|
def close():
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Called when the plugin needs to perform some action
|
|
|
|
def run(args=None):
|
|
|
|
if args == None:
|
|
|
|
return
|
2009-12-22 21:56:58 -05:00
|
|
|
if len(args) == 1:
|
|
|
|
gstreamer.load(args[0])
|
|
|
|
else:
|
|
|
|
join = ' '
|
|
|
|
gstreamer.load(join.join(args))
|
2009-12-22 00:29:19 -05:00
|
|
|
#filename = expandPath(args[0])
|
|
|
|
#if checkPath(filename) == False:
|
|
|
|
# return
|
|
|
|
|
|
|
|
#write("loading file: "+filename)
|
|
|
|
#bin = gst.element_factory_make("playbin", None)
|
|
|
|
#bin.set_property("uri", "file://"+filename)
|
|
|
|
#bin.set_state(gst.STATE_PAUSED)
|
|
|
|
|
|
|
|
#pipeline = gst.Pipeline("player")
|
|
|
|
#pipeline.add(bin)
|
|
|
|
|