Module: ScreenRecorder Private

Defined in:
lib/screen-recorder.rb,
lib/screen-recorder/os.rb,
lib/screen-recorder/common.rb,
lib/screen-recorder/errors.rb,
lib/screen-recorder/titles.rb,
lib/screen-recorder/window.rb,
lib/screen-recorder/desktop.rb,
lib/screen-recorder/options.rb,
lib/screen-recorder/version.rb,
lib/screen-recorder/screenshot.rb,
lib/screen-recorder/childprocess.rb,
lib/screen-recorder/type_checker.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0-beta11

Defined Under Namespace

Modules: Errors, OS, Screenshot, Titles, TypeChecker Classes: ChildProcess, Common, Desktop, Options, Window

Constant Summary collapse

VERSION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0-beta11

'1.7.0'.freeze

Class Method Summary collapse

Class Method Details

.ffmpeg_binaryObject

Returns path to ffmpeg binary or raises DependencyNotFound

Since:

  • 1.0.0.beta11



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

def self.ffmpeg_binary
  FFMPEG.ffmpeg_binary
rescue Errno::ENOENT # Raised when binary is not set in project or found in ENV
  raise Errors::DependencyNotFound
end

.ffmpeg_binary=(bin) ⇒ Object

Uses user given FFMPEG binary

Examples:

ScreenRecorder.ffmpeg_binary = 'C:\ffmpeg.exe'

Since:

  • 1.0.0.beta11



12
13
14
15
16
17
# File 'lib/screen-recorder.rb', line 12

def self.ffmpeg_binary=(bin)
  ScreenRecorder.logger.debug 'Setting ffmpeg path...'
  FFMPEG.ffmpeg_binary = bin
  ScreenRecorder.logger.debug "ffmpeg path set: #{bin}"
  ScreenRecorder.ffmpeg_binary
end

.ffprobe_binaryObject

Returns path to ffprobe binary or raises DependencyNotFound

Since:

  • 1.0.0.beta11



44
45
46
47
48
# File 'lib/screen-recorder.rb', line 44

def self.ffprobe_binary
  FFMPEG.ffprobe_binary
rescue Errno::ENOENT # Raised when binary is not set in project or found in ENV
  raise Errors::DependencyNotFound
end

.ffprobe_binary=(bin) ⇒ Object

Uses user given ffprobe binary

Examples:

ScreenRecorder.ffprobe_binary= = 'C:\ffprobe.exe'

Since:

  • 1.0.0.beta11



34
35
36
37
38
39
# File 'lib/screen-recorder.rb', line 34

def self.ffprobe_binary=(bin)
  ScreenRecorder.logger.debug 'Setting ffprobe path...'
  FFMPEG.ffprobe_binary = bin
  ScreenRecorder.logger.debug "ffprobe path set: #{bin}"
  ScreenRecorder.ffmpeg_binary
end

.loggerObject

ScreenRecorder.logger

Since:

  • 1.0.0.beta11



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/screen-recorder.rb', line 60

def self.logger
  return @logger if @logger

  logger = Logger.new($stdout)
  logger.level = Logger::ERROR
  logger.progname = 'ScreenRecorder'
  logger.formatter = proc do |severity, time, progname, msg|
    "#{time.strftime('%F %T')} #{progname} - #{severity} - #{msg}\n"
  end
  logger.debug 'Logger initialized.'
  @logger = logger
end

.logger=(log) ⇒ Object

Set external logger if you want.

Since:

  • 1.0.0.beta11



53
54
55
# File 'lib/screen-recorder.rb', line 53

def self.logger=(log)
  @logger = log
end