Permalink
Browse files

Connection#midi_out doesn't need to take instrument arg since it alwa…

…ys uses @output.
  • Loading branch information...
1 parent d1eac3b commit 7571aaed88d5be6f0fbb15208dabfaa098301f2c @jimm committed Apr 11, 2012
Showing with 7 additions and 10 deletions.
  1. +0 −3 TODO.rdoc
  2. +6 −6 lib/patchmaster/connection.rb
  3. +1 −1 test/test_helper.rb
View
@@ -1,8 +1,5 @@
= To Do
-* Connection#midi_out doesn't need to take instrument arg since it always
- uses @output.
-
* Windows observe contents to minimize redraws. Perhaps only need to observe
PatchMaster itself?
@@ -25,13 +25,13 @@ def initialize(input, input_chan, output, output_chan, filter=nil, opts={})
end
def start(start_bytes=nil)
- midi_out(@output, start_bytes) if start_bytes
- midi_out(@output, [PROGRAM_CHANGE + @output_chan, @pc_prog]) if pc?
+ midi_out(start_bytes) if start_bytes
+ midi_out([PROGRAM_CHANGE + @output_chan, @pc_prog]) if pc?
@input.add_connection(self)
end
def stop(stop_bytes=nil)
- midi_out(@output, stop_bytes) if stop_bytes
+ midi_out(stop_bytes) if stop_bytes
@input.remove_connection(self)
end
@@ -63,12 +63,12 @@ def midi_in(bytes)
bytes = @filter.call(self, bytes) if @filter
if bytes && bytes.size > 0
- midi_out(@output, bytes)
+ midi_out(bytes)
end
end
- def midi_out(instrument, bytes)
- instrument.midi_out(bytes)
+ def midi_out(bytes)
+ @output.midi_out(bytes)
end
def pc?
View
@@ -43,7 +43,7 @@ class TestConnection < PM::Connection
def midi_in(bytes)
@bytes_received ||= []
@bytes_received += bytes
- midi_out(@output, bytes)
+ midi_out(bytes)
end
end

0 comments on commit 7571aae

Please sign in to comment.