testing multiple tracks
This commit is contained in:
@@ -9,8 +9,6 @@ from ui.widgets.project_settings import ProjectSettings
|
||||
class AppUI(App):
|
||||
CSS_PATH = "../assets/style.tcss"
|
||||
|
||||
theme = "atom-one-dark"
|
||||
|
||||
def __init__(self, project):
|
||||
super().__init__()
|
||||
self.zoom_level = 0.05
|
||||
|
||||
@@ -14,7 +14,7 @@ from ui.widgets.chunk_types.chunk import Chunk
|
||||
class AudioChunk(Chunk):
|
||||
DEFAULT_CSS = """
|
||||
AudioChunk {
|
||||
border: tab $accent;
|
||||
border: tab $secondary;
|
||||
PlotWidget {
|
||||
height: 1fr;
|
||||
|
||||
@@ -51,7 +51,7 @@ class AudioChunk(Chunk):
|
||||
def on_mount(self):
|
||||
for plot in self.query(PlotWidget):
|
||||
plot: PlotWidget = plot # just for type checking
|
||||
|
||||
|
||||
plot.margin_top = 0
|
||||
plot.margin_left = 0
|
||||
plot.margin_bottom = 0
|
||||
@@ -91,7 +91,7 @@ class AudioChunk(Chunk):
|
||||
x,
|
||||
y,
|
||||
1.0,
|
||||
bar_style=self.app.theme_variables["warning"],
|
||||
bar_style=self.app.theme_variables["secondary"],
|
||||
hires_mode=HiResMode.BRAILLE
|
||||
)
|
||||
|
||||
@@ -114,8 +114,6 @@ class AudioChunk(Chunk):
|
||||
samples.append(self.audio[channel, sample])"""
|
||||
|
||||
yield PlotWidget(allow_pan_and_zoom=False, id=f"channel-{channel}")
|
||||
|
||||
#yield Sparkline(data=samples)
|
||||
|
||||
|
||||
else:
|
||||
@@ -125,6 +123,4 @@ class AudioChunk(Chunk):
|
||||
for sample in range(0, self.num_samples, int(self.sample_rate*0.1)):
|
||||
samples.append(self.audio[sample])"""
|
||||
|
||||
yield PlotWidget(allow_pan_and_zoom=False)
|
||||
|
||||
#yield Sparkline(data=samples)
|
||||
yield PlotWidget(allow_pan_and_zoom=False)
|
||||
@@ -80,6 +80,11 @@ class Timeline(Vertical):
|
||||
for bar_line in self.query(Rule):
|
||||
if not isinstance(bar_line, PlayHead):
|
||||
bar_line.offset = (self.bar_offset * bar_line.index, 0)
|
||||
|
||||
if self.app.zoom_level >= 0.09 and bar_line.has_class("beat-line"):
|
||||
bar_line.display = False
|
||||
else:
|
||||
bar_line.display = True
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
|
||||
@@ -98,7 +103,7 @@ class Timeline(Vertical):
|
||||
yield Chunk(chunk_name=chunk.name, bar_pos=chunk.position)
|
||||
elif chunk.chunk_type == ChunkType.AUDIO:
|
||||
yield AudioChunk(chunk.audio_data, chunk.sample_rate, chunk.name, chunk.position)
|
||||
|
||||
|
||||
for i in range(1, 17):
|
||||
bar = None
|
||||
if i % 4 == 0:
|
||||
@@ -113,4 +118,4 @@ class Timeline(Vertical):
|
||||
|
||||
|
||||
|
||||
#yield PlayHead()
|
||||
yield PlayHead()
|
||||
Reference in New Issue
Block a user