Class: MusaLCEServer::Bitwig::Tracks Private
- Inherits:
-
Object
- Object
- MusaLCEServer::Bitwig::Tracks
- Includes:
- Enumerable
- Defined in:
- lib/bitwig/tracks.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Collection of tracks for Bitwig.
Tracks are created dynamically based on channel names received from the Bitwig controller extension.
Instance Method Summary collapse
-
#[](name) ⇒ Track?
private
Retrieves a track by name.
-
#[]=(name, track) ⇒ Track
private
Sets a track by name.
-
#create(name) ⇒ Track
private
Creates a new track with the given name.
-
#each {|Track| ... } ⇒ Enumerator
private
Iterates over all tracks.
-
#initialize(logger:) ⇒ Tracks
constructor
private
Creates a new tracks collection.
Constructor Details
#initialize(logger:) ⇒ Tracks
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.
Creates a new tracks collection.
17 18 19 20 |
# File 'lib/bitwig/tracks.rb', line 17 def initialize(logger:) @logger = logger @tracks = {} end |
Instance Method Details
#[](name) ⇒ Track?
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.
Retrieves a track by name.
46 47 48 |
# File 'lib/bitwig/tracks.rb', line 46 def [](name) @tracks[name] end |
#[]=(name, track) ⇒ Track
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.
Sets a track by name.
55 56 57 |
# File 'lib/bitwig/tracks.rb', line 55 def []=(name, track) @tracks[name] = track end |
#create(name) ⇒ Track
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.
Creates a new track with the given name.
26 27 28 |
# File 'lib/bitwig/tracks.rb', line 26 def create(name) @tracks[name] = Track.new(name, logger: @logger) end |
#each {|Track| ... } ⇒ Enumerator
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.
Iterates over all tracks.
34 35 36 37 38 39 40 |
# File 'lib/bitwig/tracks.rb', line 34 def each(&block) if block_given? @tracks.values.each(&block) else @tracks.values.each end end |