David Robillard
99904735e0
git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf
33 lines
522 B
Ruby
33 lines
522 B
Ruby
#! /usr/bin/ruby
|
|
|
|
class Bank
|
|
attr_accessor :routes, :strips, :current
|
|
|
|
def initialize( routes = 17, strips = 8, current = 0 )
|
|
@routes = routes
|
|
@strips = strips
|
|
@current = current
|
|
end
|
|
|
|
def left
|
|
new_initial = current - routes
|
|
if new_initial < 0
|
|
new_initial = 0
|
|
end
|
|
current = new_initial
|
|
self
|
|
end
|
|
|
|
def right
|
|
delta = routes - ( strips + current ) - 1
|
|
puts "delta: #{delta}"
|
|
if delta > strips
|
|
delta = strips
|
|
end
|
|
@current += delta
|
|
self
|
|
end
|
|
end
|
|
|
|
b=Bank.new
|