Class: Bitwig::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/bitwig/controllers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, tracks, channel_number, logger:) ⇒ Channel

Returns a new instance of Channel.



103
104
105
106
107
108
# File 'lib/bitwig/controllers.rb', line 103

def initialize(controller, tracks, channel_number, logger:)
  @controller = controller
  @tracks = tracks
  @channel_number = channel_number
  @logger = logger
end

Instance Attribute Details

#channel_numberObject (readonly)

Returns the value of attribute channel_number.



110
111
112
# File 'lib/bitwig/controllers.rb', line 110

def channel_number
  @channel_number
end

#nameObject

Returns the value of attribute name.



110
111
112
# File 'lib/bitwig/controllers.rb', line 110

def name
  @name
end

Instance Method Details

#outputObject



119
120
121
# File 'lib/bitwig/controllers.rb', line 119

def output
  @controller.midi_device.channels[@channel_number]
end

#to_sObject



123
124
125
# File 'lib/bitwig/controllers.rb', line 123

def to_s
  "<Channel #{@channel_number} '#{@name}' on port '#{@controller.port_name}' (controller '#{@controller.name}')>"
end