Class: Rtmidi::MidiIn::Release
- Inherits:
-
Object
- Object
- Rtmidi::MidiIn::Release
- Defined in:
- lib/rtmidi/midi_in.rb
Instance Method Summary collapse
- #call ⇒ Object
- #free ⇒ Object
-
#initialize(handle) ⇒ Release
constructor
A new instance of Release.
Constructor Details
#initialize(handle) ⇒ Release
Returns a new instance of Release.
11 12 13 14 |
# File 'lib/rtmidi/midi_in.rb', line 11 def initialize(handle) @handle = handle @mutex = Mutex.new end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'lib/rtmidi/midi_in.rb', line 16 def call(*) free end |
#free ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/rtmidi/midi_in.rb', line 20 def free @mutex.synchronize do return if @handle.nil? || @handle.null? Native.rtmidi_in_free(@handle) @handle = nil end end |