Class: Voicemeeter::Vban::RequestVbanStream

Inherits:
Object
  • Object
show all
Defined in:
lib/voicemeeter/vban.rb

Class Method Summary collapse

Class Method Details

.for(remote, i, dir) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/voicemeeter/vban.rb', line 55

def self.for(remote, i, dir)
  vban_in, vban_out, midi, _ = remote.kind.vban
  case dir
  when :in
    if i < vban_in
      VbanAudioInstream.new(remote, i)
    elsif i < vban_in + midi
      VbanMidiInstream.new(remote, i)
    else
      VbanTextInstream.new(remote, i)
    end
  when :out
    if i < vban_out
      VbanAudioOutstream.new(remote, i)
    elsif i < vban_out + midi
      VbanMidiOutstream.new(remote, i)
    end
  end
end