lib/rdvd-slideshow/slideshow_input.rb in rdvd-slideshow-0.0.1 vs lib/rdvd-slideshow/slideshow_input.rb in rdvd-slideshow-0.0.2
- old
+ new
@@ -61,10 +61,14 @@
def fadeout(duration,options={})
write_line("fadeout",duration,options,[:subtitle])
end
+ def background(duration,options={})
+ write_line("background",duration,options,[:subtitle,:image])
+ end
+
#
# Adds an exit command
#
def exit
@file.puts "exit"
@@ -79,9 +83,12 @@
def write_line(keyword,duration,options={},sorted_keys=[])
@file.puts build_line(keyword,duration,options,sorted_keys)
end
def build_line(keyword,duration,options={},sorted_keys=[])
+ # Keep only values for authorized keys (defined in sorted_keys)
+ options.delete_if { |key, value| !sorted_keys.include?(key) }
+ #
line = keyword + separator + format_duration(duration)
index = 0
remaining_options = options.values.length
while remaining_options > 0
line << separator
\ No newline at end of file