WE CAN HEAR THE AUDIO!!!! but uhh rendering to a file is cooked lmao
This commit is contained in:
@@ -14,17 +14,27 @@ class TimelineRow(Horizontal):
|
||||
background: $surface-lighten-1;
|
||||
height: 8;
|
||||
margin-bottom: 1;
|
||||
width: 100;
|
||||
|
||||
&.-muted {
|
||||
background: $error 25%;
|
||||
}
|
||||
|
||||
&.-solo {
|
||||
background: $warning 25%;
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
class Timeline(Vertical):
|
||||
DEFAULT_CSS = """
|
||||
Timeline {
|
||||
overflow-x: auto;
|
||||
|
||||
#rows {
|
||||
hatch: "-" $surface-lighten-1;
|
||||
padding: 0 0;
|
||||
overflow-x: auto;
|
||||
|
||||
|
||||
|
||||
.beat-line {
|
||||
color: $surface-lighten-1;
|
||||
@@ -58,6 +68,9 @@ class Timeline(Vertical):
|
||||
def calc_bar_offset(self):
|
||||
self.bar_offset = self.app.project.bpm / 8 * (0.03333333333 / self.app.zoom_level)
|
||||
|
||||
for row in self.query(TimelineRow):
|
||||
row.styles.width = self.bar_offset * self.app.project.song_length
|
||||
|
||||
@on(events.MouseScrollDown)
|
||||
async def mouse_scroll_down(self, event: events.MouseScrollDown):
|
||||
self.app.zoom_level += (self.app.scroll_sensitivity_x / 200)
|
||||
@@ -93,18 +106,17 @@ class Timeline(Vertical):
|
||||
|
||||
|
||||
with VerticalScroll(id="rows"):
|
||||
|
||||
|
||||
|
||||
for channel in self.app.project.channels:
|
||||
with TimelineRow():
|
||||
with TimelineRow() as row:
|
||||
row.styles.width = self.bar_offset * self.app.project.song_length
|
||||
|
||||
for chunk in channel.chunks:
|
||||
if chunk.chunk_type == ChunkType.CHUNK:
|
||||
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):
|
||||
for i in range(1, self.app.project.song_length):
|
||||
bar = None
|
||||
if i % 4 == 0:
|
||||
bar = Rule.vertical(classes="bar-line", line_style="double")
|
||||
|
||||
Reference in New Issue
Block a user