class Lolcommits::CaptureWindows

Public Instance Methods

capture() click to toggle source
# File lib/lolcommits/capturer/capture_windows.rb, line 5
def capture
  _stdin, stdout, _stderr = Open3.popen3("#{executable_path} /filename #{capture_path}#{delay_arg}")

  # need to read the output for something to happen
  stdout.read
end

Private Instance Methods

delay_arg() click to toggle source
# File lib/lolcommits/capturer/capture_windows.rb, line 14
def delay_arg
  # CommandCam delay is in milliseconds
  if capture_delay.positive?
    " /delay #{capture_delay * 1000}"
  else
    # DirectShow takes a while to show, default to 3 sec delay
    ' /delay 3000'
  end
end
executable_path() click to toggle source
# File lib/lolcommits/capturer/capture_windows.rb, line 24
def executable_path
  File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')
end