projects
/
ardour.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Fixed error handling to use XSI strerror_r(), not the GNU version.
[ardour.git]
/
libs
/
surfaces
/
mackie
/
scripts
/
bank.rb
1
#! /usr/bin/ruby
2
3
class Bank
4
attr_accessor :routes, :strips, :current
5
6
def initialize( routes = 17, strips = 8, current = 0 )
7
@routes = routes
8
@strips = strips
9
@current = current
10
end
11
12
def left
13
new_initial = current - routes
14
if new_initial < 0
15
new_initial = 0
16
end
17
current = new_initial
18
self
19
end
20
21
def right
22
delta = routes - ( strips + current ) - 1
23
puts "delta: #{delta}"
24
if delta > strips
25
delta = strips
26
end
27
@current += delta
28
self
29
end
30
end
31
32
b=Bank.new