Skip to content

Commit

Permalink
device ify a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp committed Oct 19, 2012
1 parent 514eb62 commit 13ceb86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/simple_gui_creator/ffmpeg_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def self.enumerate_directshow_devices
audio_names = parse_with_indexes audio
video_names = parse_with_indexes video
out = {:audio => audio_names, :video => video_names}
p out
out
end

Expand All @@ -52,8 +51,8 @@ def self.escape_for_input name
end

# name is a non-escaped name, like video-screen-capture-device
def self.get_options_video_device name
ffmpeg_get_options_command = "ffmpeg -list_options true -f dshow -i video=\"#{escape_for_input name}\" 2>&1"
def self.get_options_video_device name, idx = 0
ffmpeg_get_options_command = "ffmpeg -list_options true -f dshow -i video=\"#{escape_for_input name}\" -video_device_number #{idx} 2>&1"
enum = `#{ffmpeg_get_options_command}`
out = []
lines = enum.scan(/(pixel_format|vcodec)=([^ ]+) min s=(\d+)x(\d+) fps=([^ ]+) max s=(\d+)x(\d+) fps=([^ ]+)$/)
Expand Down
2 changes: 2 additions & 0 deletions lib/simple_gui_creator/swing_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def go_selected_index
raise 'did not select, exited early ' + @prompt unless @selected_idx
@selected_idx
end

alias go_selected_idx go_selected_index

def go_selected_value
puts 'select from dropdown window ' + @drop_down_elements[-1] + ' ...' if $simple_creator_show_console_prompts
Expand Down

0 comments on commit 13ceb86

Please sign in to comment.