Class: Lolcommits::CaptureMac

Inherits:
Capturer
  • Object
show all
Defined in:
lib/lolcommits/capturer/capture_mac.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



8
9
10
11
12
13
14
15
16
17
# File 'lib/lolcommits/capturer/capture_mac.rb', line 8

def capture
  # TODO: check we have a webcam we can capture from first. See issue #219
  # operating laptop in clamshell (lid closed) from 2nd desktop screen,
  # needs to better handle  the capturer (imagesnap, videosnap
  # CommandCam, mplayer) return code or check with an option before
  # attempting capture. Alt solution is puttin in prompt mode option :(
  call_str = "#{executable_path} -q \"#{snapshot_location}\" -w #{capture_delay} #{capture_device_string}"
  debug "Capturer: making system call for #{call_str}"
  system(call_str)
end

#capture_device_stringObject



4
5
6
# File 'lib/lolcommits/capturer/capture_mac.rb', line 4

def capture_device_string
  @capture_device.nil? ? nil : "-d \"#{@capture_device}\""
end

#executable_pathObject



19
20
21
# File 'lib/lolcommits/capturer/capture_mac.rb', line 19

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