Class: Lolcommits::CaptureCygwin

Inherits:
Capturer
  • Object
show all
Defined in:
lib/lolcommits/capturer/capture_cygwin.rb

Instance Attribute Summary

Attributes inherited from Capturer

#animated_duration, #capture_delay, #capture_device, #frames_location, #snapshot_location, #video_location

Instance Method Summary collapse

Methods inherited from Capturer

#initialize

Constructor Details

This class inherits a constructor from Lolcommits::Capturer

Instance Method Details

#captureObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/lolcommits/capturer/capture_cygwin.rb', line 4

def capture
  # DirectShow takes a while to show... at least for me anyway
  delaycmd = ' /delay 3000'
  if capture_delay > 0
    # CommandCam delay is in milliseconds
    delaycmd = " /delay #{capture_delay * 1000}"
  end

  _stdin, stdout, _stderr = Open3.popen3("#{executable_path} /filename `cygpath -w #{snapshot_location}`#{delaycmd}")

  # looks like we still need to read the output for something to happen
  stdout.read
end

#executable_pathObject



18
19
20
# File 'lib/lolcommits/capturer/capture_cygwin.rb', line 18

def executable_path
  File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')
end