35 lines
727 B
Python
35 lines
727 B
Python
#! /usr/bin/python
|
|
|
|
# To change this template, choose Tools | Templates
|
|
# and open the template in the editor.
|
|
|
|
__author__="bjschuma"
|
|
__date__ ="$May 11, 2010 10:55:54 PM$"
|
|
|
|
import gst
|
|
from ocarina import events
|
|
from gstreamer import player
|
|
from ct import call
|
|
|
|
|
|
def getstate():
|
|
state = player.get_state()[1]
|
|
call.write("Gstreamer state: "+str(state), 3)
|
|
return player.get_state()[1]
|
|
|
|
|
|
def play():
|
|
player.set_state(gst.STATE_PLAYING)
|
|
if getstate() != gst.STATE_PLAYING:
|
|
events.stop(events.OCARINA_PLAY)
|
|
|
|
|
|
def pause():
|
|
player.set_state(gst.STATE_PAUSED)
|
|
if getstate() != gst.STATE_PAUSED:
|
|
events.stop(events.OCARINA_PAUSE)
|
|
|
|
|
|
events.invite(events.OCARINA_PLAY, play, 50)
|
|
events.invite(events.OCARINA_PAUSE, pause, 50)
|