Class: PM::MockInputPort

Inherits:
Object
  • Object
show all
Defined in:
lib/patchmaster/instrument.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ MockInputPort

Constructor param is ignored; it’s required by MIDIEye.



107
108
109
110
# File 'lib/patchmaster/instrument.rb', line 107

def initialize(arg)
  @name = "MockInputPort #{arg}"
  @buffer = []
end

Instance Attribute Details

#bufferObject

Returns the value of attribute buffer.



99
100
101
# File 'lib/patchmaster/instrument.rb', line 99

def buffer
  @buffer
end

#nameObject (readonly)

Returns the value of attribute name.



98
99
100
# File 'lib/patchmaster/instrument.rb', line 98

def name
  @name
end

Class Method Details

.is_compatible?(input) ⇒ Boolean

For MIDIEye::Listener

Returns:

  • (Boolean)


102
103
104
# File 'lib/patchmaster/instrument.rb', line 102

def self.is_compatible?(input)
  true
end

Instance Method Details

#clear_bufferObject



120
121
# File 'lib/patchmaster/instrument.rb', line 120

def clear_buffer
end

#getsObject



112
113
114
# File 'lib/patchmaster/instrument.rb', line 112

def gets
  [{:data => [], :timestamp => 0}]
end

#poll {|gets| ... } ⇒ Object

Yields:



116
117
118
# File 'lib/patchmaster/instrument.rb', line 116

def poll
  yield gets
end