Sha256: 15d72fcf63c54397c397287568b757cb50cb49f5988e5fd777601178604b7c16

Contents?: true

Size: 687 Bytes

Versions: 2

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

module Lolcommits
  class CaptureWindows < Capturer
    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 #{snapshot_location}#{delaycmd}")

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lolcommits-0.13.1 lib/lolcommits/capturer/capture_windows.rb
lolcommits-0.13.0 lib/lolcommits/capturer/capture_windows.rb