25 lines
1.0 KiB
Python
25 lines
1.0 KiB
Python
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)) |