lib/patchmaster/dsl.rb in patchmaster-0.0.4 vs lib/patchmaster/dsl.rb in patchmaster-0.0.5
- old
+ new
@@ -96,11 +96,18 @@
yield @conn if block_given?
end
alias_method :conn, :connection
alias_method :c, :connection
- def prog_chg(prog)
- @conn.pc_prog = prog
+ # If only +bank_or_prog+ is specified, then it's a program change. If
+ # both, then it's bank number.
+ def prog_chg(bank_or_prog, prog=nil)
+ if prog
+ @conn.bank = bank_or_prog
+ @conn.pc_prog = prog
+ else
+ @conn.pc_prog = bank_or_prog
+ end
end
alias_method :pc, :prog_chg
# If +start_or_range+ is a Range, use that. Else either or both params may
# be nil.