Ajout de la glue pour simplifier la gestion des événements dans un module séparé.
[minwii.git] / src / gui / DummyInstrumentChoice.py
1 '''
2 Created on 21 janv. 2010
3
4 @author: samsam
5 '''
6
7 import pygame
8 import pygame.midi
9 import sys
10 import time
11 import pickle
12
13 from numpy import array
14 from numpy.linalg import norm
15
16 from math import floor
17
18 from gui.constants import *
19 from PlayingScreen import PlayingScreen
20 from instruments.Instrument import Instrument
21 from cursor.WarpingCursor import *
22 from controllers.Wiimote import Wiimote
23 from logging.EventLog import EventLog
24 from logging.PickleableEvent import PickleableEvent
25 from InstrumentChoice import InstrumentChoice
26
27 class DummyInstrumentChoice():
28 '''
29 classdocs
30 '''
31
32
33 def __init__(self,wiimotes, window, screen, clock, joys, portOffset, activeWiimotes, eventLog=None, replay = False, logFilePath = None, scaleFactor = 1):
34 '''
35 Constructor
36 '''
37 self.wiimotes =wiimotes
38 self.activeWiimotes =activeWiimotes
39 self.window = window
40 self.screen = screen
41 self.scaleFactor = scaleFactor
42 self.width = int(floor(screen.get_width()*self.scaleFactor))
43 self.height = int(floor(screen.get_height()*self.scaleFactor))
44 self.blitOrigin = ((self.screen.get_width()-self.width)/2,(self.screen.get_height()-self.height)/2)
45 self.clock = clock
46 self.savedScreen = pygame.Surface(self.screen.get_size())
47 self.savedScreen.fill((255, 255, 255))
48 self.playerScreen = pygame.Surface(self.savedScreen.get_size())
49 self.playerScreen.blit(self.savedScreen, (0, 0))
50 self.cursorPositions = []
51 for i in range(len(self.wiimotes)):
52 self.wiimotes[i].cursor.screen = self.playerScreen
53 self.cursorPositions.append(self.wiimotes[i].cursor.centerPosition)
54 self.joys = joys
55 self.portOffset = portOffset
56 self.eventLog = eventLog
57 self.replay = replay