Class: Voicemeeter::Recorder::Base
- Inherits:
-
Object
- Object
- Voicemeeter::Recorder::Base
- Extended by:
- MetaFunctions
- Includes:
- IRemote, Mixins::Outputs
- Defined in:
- lib/voicemeeter/recorder.rb
Overview
Base class for Recorder
Instance Attribute Summary collapse
-
#armbus ⇒ Object
readonly
Returns the value of attribute armbus.
-
#armstrip ⇒ Object
readonly
Returns the value of attribute armstrip.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
- #filetype(val) ⇒ Object
- #goto(timestr) ⇒ Object
- #identifier ⇒ Object
-
#initialize(remote) ⇒ Base
constructor
A new instance of Base.
- #load(filepath) ⇒ Object
Methods included from Mixins::Outputs
Methods included from IRemote
Methods included from Logging
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
#armbus ⇒ Object (readonly)
Returns the value of attribute armbus.
16 17 18 |
# File 'lib/voicemeeter/recorder.rb', line 16 def armbus @armbus end |
#armstrip ⇒ Object (readonly)
Returns the value of attribute armstrip.
16 17 18 |
# File 'lib/voicemeeter/recorder.rb', line 16 def armstrip @armstrip end |
#mode ⇒ Object (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 |
#identifier ⇒ Object
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 |