Experimental swig bindings
[melted] / mlt++ / swig / python / play.py
diff --git a/mlt++/swig/python/play.py b/mlt++/swig/python/play.py
new file mode 100755 (executable)
index 0000000..70be84d
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+
+# Import required modules
+import mltpp
+import time
+import sys
+
+# Start the mlt system
+mltpp.Factory.init( )
+
+# Create the producer
+p = mltpp.Producer( sys.argv[1] )
+
+if p:
+       # Create the consumer
+       c = mltpp.Consumer( "sdl" )
+
+       # Turn off the default rescaling
+       c.set( "rescale", "none" )
+       
+       # Connect the producer to the consumer
+       c.connect( p )
+       
+       # Start the consumer
+       c.start( )
+       
+       # Wait until the user stops the consumer
+       while c.is_stopped( ) == 0:
+               time.sleep( 1 )
+else:
+       # Diagnostics
+       print "Unable to open ", sys.argv[ 1 ]
+