Class: Voicemeeter::Recorder::Base

Inherits:
Object
  • Object
show all
Extended by:
MetaFunctions
Includes:
IRemote, Mixins::Outputs
Defined in:
lib/voicemeeter/recorder.rb

Overview

Base class for Recorder

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mixins::Outputs

#make_attr_outputs

Methods included from IRemote

#apply, #to_s

Methods included from Logging

#logger

Constructor Details

#initialize(remote) ⇒ Base

Returns a new instance of Base.



21
22
23
24
25
26
27
# File 'lib/voicemeeter/recorder.rb', line 21

def initialize(remote)
  super
  make_attr_outputs(*remote.kind.outs)
  @mode = RecorderMode.new(remote)
  @armstrip = (0...remote.kind.num_strip).map { RecorderArmStrip.new(remote, _1) }
  @armbus = (0...remote.kind.num_bus).map { RecorderArmBus.new(remote, _1) }
end

Instance Attribute Details

#armbusObject (readonly)

Returns the value of attribute armbus.



16
17
18
# File 'lib/voicemeeter/recorder.rb', line 16

def armbus
  @armbus
end

#armstripObject (readonly)

Returns the value of attribute armstrip.



16
17
18
# File 'lib/voicemeeter/recorder.rb', line 16

def armstrip
  @armstrip
end

#modeObject (readonly)

Returns the value of attribute mode.



16
17
18
# File 'lib/voicemeeter/recorder.rb', line 16

def mode
  @mode
end

Instance Method Details

#filetype(val) ⇒ Object



47
48
49
50
# File 'lib/voicemeeter/recorder.rb', line 47

def filetype(val)
  opts = {wav: FileTypeEnum::WAV, aiff: FileTypeEnum::AIFF, bwf: FileTypeEnum::BWF, mp3: FileTypeEnum::MP3}
  setter("filetype", opts[val])
end

#goto(timestr) ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'lib/voicemeeter/recorder.rb', line 37

def goto(timestr)
  unless /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/.match?(timestr)
    logger.error "goto got: '#{timestr}', but expects a time string in the format 'hh:mm:ss'"
    return
  end
  dt = DateTime.parse(timestr)
  seconds = dt.hour * 3600 + dt.min * 60 + dt.second
  setter("goto", seconds)
end

#identifierObject



29
30
31
# File 'lib/voicemeeter/recorder.rb', line 29

def identifier
  :recorder
end

#load(filepath) ⇒ Object



33
34
35
# File 'lib/voicemeeter/recorder.rb', line 33

def load(filepath)
  setter("load", filepath)
end