Class: MusaLCEServer::Bitwig::Track
- Inherits:
-
Object
- Object
- MusaLCEServer::Bitwig::Track
- Defined in:
- lib/bitwig/tracks.rb
Overview
Represents a track in Bitwig with dynamic MIDI output.
Uses DynamicProxy to allow the output to be reassigned when channel mappings change.
Instance Attribute Summary collapse
- #name ⇒ Object readonly
Instance Method Summary collapse
-
#_channel=(new_channel) ⇒ void
private
Sets the channel for this track.
-
#_forget_channel ⇒ void
private
Disconnects the current channel from this track.
-
#initialize(name, logger:) ⇒ Track
constructor
Creates a new track.
-
#out ⇒ Musa::Extension::DynamicProxy::DynamicProxy
Returns the MIDI output for this track.
Constructor Details
#initialize(name, logger:) ⇒ Track
Creates a new track.
69 70 71 72 73 74 |
# File 'lib/bitwig/tracks.rb', line 69 def initialize(name, logger:) @name = name @logger = logger @output = Musa::Extension::DynamicProxy::DynamicProxy.new end |
Instance Attribute Details
#name ⇒ Object (readonly)
78 79 80 |
# File 'lib/bitwig/tracks.rb', line 78 def name @name end |
Instance Method Details
#_channel=(new_channel) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Sets the channel for this track.
91 92 93 94 |
# File 'lib/bitwig/tracks.rb', line 91 def _channel=(new_channel) @logger.info "Assigning #{new_channel} to track '#{@name}'" @output.receiver = new_channel.output end |
#_forget_channel ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Disconnects the current channel from this track.
83 84 85 |
# File 'lib/bitwig/tracks.rb', line 83 def _forget_channel @output.receiver = nil end |
#out ⇒ Musa::Extension::DynamicProxy::DynamicProxy
Returns the MIDI output for this track.
99 100 101 |
# File 'lib/bitwig/tracks.rb', line 99 def out @output end |