Class: ScreenRecorder::Window

Inherits:
Common
  • Object
show all
Includes:
Screenshot
Defined in:
lib/screen-recorder/window.rb

Overview

Since:

  • 1.0.0-beta11

Constant Summary

Constants inherited from Common

Common::PROCESS_TIMEOUT

Instance Attribute Summary

Attributes inherited from Common

#options, #video

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Screenshot

#screenshot, #screenshot_cmd

Methods inherited from Common

#discard, #start, #stop

Constructor Details

#initialize(title:, output:, advanced: {}) ⇒ Window

Window recording mode.

Since:

  • 1.0.0-beta11



10
11
12
13
14
# File 'lib/screen-recorder/window.rb', line 10

def initialize(title:, output:, advanced: {})
  raise 'Window recording is only supported on Microsoft Windows.' unless OS.windows?

  super(input: %("title=#{title}"), output: output, advanced: advanced)
end

Class Method Details

.fetch_title(process_name) ⇒ Array

Returns a list of available window titles for the given process (application) name.

Examples:

ScreenRecorder::Window.fetch_title('chrome')
#=> ["New Tab - Google Chrome"]

Returns:

  • (Array)

Since:

  • 1.0.0-beta11



25
26
27
28
# File 'lib/screen-recorder/window.rb', line 25

def fetch_title(process_name)
  ScreenRecorder.logger.debug "Retrieving window title from '#{process_name}'"
  window_title_for process_name
end