Class: ScreenRecorder::Window

Inherits:
Common
  • Object
show all
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 inherited from Common

#discard, #screenshot, #start, #stop

Constructor Details

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

Window recording mode.

Since:

  • 1.0.0-beta11



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

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



23
24
25
26
# File 'lib/screen-recorder/window.rb', line 23

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