X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fswig%2Fruby%2Fplay.rb;fp=mlt%2B%2B%2Fswig%2Fruby%2Fplay.rb;h=0c548643bd613d30bb1611b97b4a4b12489aa9b2;hb=ccdf1f8b1a0a81a30058240818e0e6e221c84bb6;hp=0000000000000000000000000000000000000000;hpb=b61d43804b15c0ddf8a3579cdcd2146105d9be26;p=melted diff --git a/mlt++/swig/ruby/play.rb b/mlt++/swig/ruby/play.rb new file mode 100755 index 0000000..0c54864 --- /dev/null +++ b/mlt++/swig/ruby/play.rb @@ -0,0 +1,37 @@ +#!/usr/bin/ruby + +# Import required modules +require 'mltpp' + +# Create the mlt system +Mltpp::Factory::init + +# Get and check the argument +file = ARGV.shift +raise "Usage: test.rb file" if file.nil? + +# Create the producer +producer = Mltpp::Factory::producer( file ) +raise "Unable to load #{file}" if producer.is_valid == 0 + +# Create the consumer +consumer = Mltpp::Factory::consumer( "sdl" ) +raise "Unable to open sdl consumer" if consumer.is_valid == 0 + +# Turn off the default rescaling +consumer.set( "rescale", "none" ) + +# Start the consumer +consumer.start + +# Connect the producer to the consumer +consumer.connect( producer ) + +# Wait until the user stops the consumer +while consumer.is_stopped == 0 + sleep( 1 ) +end + +# Clean up consumer +consumer.stop +