From b30076f625912643b16d651e16ce8277e6d71ba2 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Thu, 22 Oct 2026 22:34:44 +0200 Subject: Multitrack support and minor improvements in web UI --- web-project/src/solo_tool_web.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'web-project/src/solo_tool_web.py') diff --git a/web-project/src/solo_tool_web.py b/web-project/src/solo_tool_web.py index ea27778..c69e5ff 100644 --- a/web-project/src/solo_tool_web.py +++ b/web-project/src/solo_tool_web.py @@ -118,12 +118,23 @@ def sessionPage(sessionId: str): ui.button(icon='fullscreen', on_click=fullscreen.toggle) \ .props(f'flat dense round color=white size={buttonSize}') - # Key points list + # Key points and track list with ui.right_drawer(top_corner=True, bottom_corner=True).props('width=120 behavior=desktop'): - ui.label("Key Points").classes('text-lg') - keyPointList(st) - def addKeyPoint() -> None: st.keyPoints += [st.keyPoint] - ui.button(icon='add', on_click=addKeyPoint).props('flat round dense color=white') + with ui.tabs().classes('w-full') as tabs: + ui.tab('kp', label='', icon='where_to_vote').classes('w-0') + ui.tab('t', label='', icon='tune').classes('w-0') + with ui.tab_panels(tabs, value='kp').classes('w-full'): + with ui.tab_panel('kp').style('padding: 0'): + keyPointList(st) + def addKeyPoint() -> None: st.keyPoints += [st.keyPoint] + ui.button(icon='add', on_click=addKeyPoint).props('flat round dense color=white') + with ui.tab_panel('t').style('padding: 0'): + tracks = ['Vocal', 'Guitar', 'Bass', 'Piano', 'Drum', 'Other'] + for track in tracks: + ui.switch(track) \ + .props('size=xs') \ + .bind_enabled(st, 'tracksSupported') \ + .bind_value(st, f'{track.lower()}TrackEnabled') # Song list with ui.left_drawer(bottom_corner=True).props('overlay breakpoint=8000') as songDrawer: @@ -145,7 +156,7 @@ def sessionPage(sessionId: str): buttonSize = "20px" ui.button(icon='skip_previous', on_click=handlers.restartOrPreviousSong(st, 0.01)).props(f"size={buttonSize}").style('flex: 1') ui.button(color='positive', on_click=handlers.playPause(st)).bind_icon_from(st, "playing", lambda playing: "pause" if playing else "play_arrow").props(f"size={buttonSize}").style('flex: 1') - ui.button(icon='vertical_align_bottom', on_click=handlers.positionToKeyPoint(st), color='negative').props(f"size={buttonSize}").style('flex: 2') + ui.button(icon='pin_drop', on_click=handlers.positionToKeyPoint(st), color='negative').props(f"size={buttonSize}").style('flex: 2') ui.button(icon='undo', on_click=st.jump, color='secondary').props(f"size={buttonSize}").style('flex: 2') ui.button(icon='skip_next', on_click=handlers.songRelative(st, 1)).props(f"size={buttonSize}").style('flex: 1') @@ -201,7 +212,7 @@ def start(port, refresh, reload, sessionPath, bufferSize, samplingRate, deviceNa @click.command() @click.option("--port", type=int, default=8080, help="Port on which to bind.") @click.option("--refresh", type=float, default=0.5, help="Refresh interval in seconds.") -@click.option("--reload/--no-reload", default=True, help="Auto-reload when files change.") +@click.option("--reload/--no_reload", default=True, help="Auto-reload when files change.") @click.option("--session_path", default="https://files.0xf7.com", help="Look for sessions in this location.") @click.option("--buffer_size", type=int, default=128, help="Audio buffer size for recording.") @click.option("--sampling_rate", type=int, default=48000, help="Audio sampling rate for recording.") -- cgit v1.2.3