adjusted item_selection and created a module 'beatplayer'
This commit is contained in:
25
beatplayer.py
Normal file
25
beatplayer.py
Normal file
@ -0,0 +1,25 @@
|
||||
from .item_selection import ItemSelection
|
||||
|
||||
class BeatPlayer:
|
||||
|
||||
def __init__(self, screen):
|
||||
self.screen = screen
|
||||
self.max_name_width = 200
|
||||
self.clip_selection = ItemSelection(self.max_name_width)
|
||||
self.track_selection = ItemSelection(self.max_name_width)
|
||||
self.show_selection = False
|
||||
|
||||
def set_clip_names(self, clips):
|
||||
self.clip_selection.set_items(clips)
|
||||
|
||||
def set_track_names(self, tracks):
|
||||
self.track_selection.set_items(tracks)
|
||||
|
||||
def update(self):
|
||||
if self.show_selection:
|
||||
self.track_selection.update()
|
||||
self.clip_selection.update()
|
||||
self.screen.blit(self.track_selection.surface, ((self.screen.get_width()/4),
|
||||
(self.screen.get_height() - self.track_selection.surface.get_height())/2))
|
||||
self.screen.blit(self.clip_selection.surface, ((self.screen.get_width()/4 + self.max_name_width) + 100,
|
||||
(self.screen.get_height() - self.clip_selection.surface.get_height())/2))
|
||||
Reference in New Issue
Block a user