Module: ScreenRecorder Private

Defined in:
lib/screen-recorder.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/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, Screenshot, Titles, TypeChecker Classes: 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.6.0'.freeze

Class Method Summary collapse

Class Method Details

.ffmpeg_binaryObject

Returns path to ffmpeg binary or raises DependencyNotFound

Since:

  • 1.0.0.beta11



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

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



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

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



46
47
48
49
50
# File 'lib/screen-recorder.rb', line 46

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



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

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



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

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



55
56
57
# File 'lib/screen-recorder.rb', line 55

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