forked from Drachenkaetzchen/nocturn-game
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTestDriver.py
executable file
·45 lines (34 loc) · 1.15 KB
/
TestDriver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python2
# Standard stuff to import
import array
import sys
import time
from NocturnModel import *
from NocturnHardware import *
from NocturnActions import *
class TestNocturnView( NocturnView ):
def __init__( self, subject ):
super( TestNocturnView, self ).__init__( subject )
self.numPages = 0
def notify( self ):
numPages = self.subject.getNumPages()
for pp in range( numPages ):
curPage = nocturn.getPage( pp )
for cc in range( curPage.numControllers() ):
pass
#print("Page %s %s : %s" % (pp, curPage.getController( cc ).getLabel(), nocturn.getValue( pp, cc ) ) )
nocturn = NocturnModel()
testView = TestNocturnView( nocturn )
nocturn.registerObserver( testView )
for ii in range (0,6):
newPage = NocturnPage( nocturn )
for controller in newPage.getControllers():
ma = MIDIAction()
ma.setMIDICommand( ii )
controller.setAction( ma )
nocturn.addPage( newPage )
nocturn.setActivePage( 0 )
nocturn.setPermaAction( 3, PagerAction( 1 ) )
nocturn.setPermaAction( 2, PagerAction( -1 ) )
while( True ):
nocturn.poll()