project loading fixes, also some zoom improvements
This commit is contained in:
@@ -10,7 +10,8 @@ from ui.widgets.project_settings import ProjectSettings
|
||||
from ui.widgets.channel import Channel
|
||||
from ui.widgets.context_menu import ContextMenu, NoSelectStatic
|
||||
|
||||
from project import ProjectChannel, Project
|
||||
from project import ProjectChannel, Project, ChunkType
|
||||
from ui.widgets.chunk_types.audio import AudioChunk, Chunk
|
||||
|
||||
|
||||
class AppUI(App):
|
||||
@@ -71,8 +72,9 @@ class AppUI(App):
|
||||
|
||||
self.push_screen(FileSave(
|
||||
filters=Filters(
|
||||
("Any", lambda _: True),
|
||||
("TerminalDAW Project File", lambda p: p.suffix.lower() == ".tdp")
|
||||
("TerminalDAW Project File", lambda p: p.suffix.lower() == ".tdp"),
|
||||
("Any", lambda _: True)
|
||||
|
||||
)
|
||||
), callback=callback)
|
||||
|
||||
@@ -113,6 +115,7 @@ class AppUI(App):
|
||||
|
||||
|
||||
row.styles.width = timeline.bar_offset * self.project.song_length
|
||||
rows.mount(row)
|
||||
|
||||
for chunk in channel.chunks:
|
||||
|
||||
@@ -121,14 +124,14 @@ class AppUI(App):
|
||||
elif chunk.chunk_type == ChunkType.AUDIO:
|
||||
row.mount(AudioChunk(chunk.audio_data, chunk.sample_rate, chunk.name, chunk.position))
|
||||
|
||||
rows.mount(row)
|
||||
|
||||
self.notify(f"Loaded \"{path}\"")
|
||||
|
||||
self.push_screen(FileOpen(
|
||||
filters=Filters(
|
||||
("Any", lambda _: True),
|
||||
("TerminalDAW Project File", lambda p: p.suffix.lower() == ".tdp")
|
||||
("TerminalDAW Project File", lambda p: p.suffix.lower() == ".tdp"),
|
||||
("Any", lambda _: True)
|
||||
|
||||
)
|
||||
), callback=callback)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user