MCPcopy Create free account
hub / github.com/FastLED/FastLED / main

Function main

ci/wasm_audio_drag_drop_test.py:174–869  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173
174async def main() -> None:
175 args = parse_args()
176
177 mp3_path = args.mp3
178 if mp3_path:
179 mp3_path = Path(mp3_path)
180 if not mp3_path.exists():
181 console.print(f"[bold red]Error:[/bold red] MP3 file not found: {mp3_path}")
182 sys.exit(1)
183
184 console.print()
185 steps = [
186 f" [green]1.[/green] Launch headless Chromium with autoplay enabled",
187 f" [green]2.[/green] Load [bold]{args.example}[/bold] WASM example",
188 f" [green]3.[/green] Wait for FastLED init + audio UI",
189 ]
190 if mp3_path:
191 steps.append(
192 f" [green]4.[/green] Load MP3 file via file input: [bold]{mp3_path}[/bold]"
193 )
194 else:
195 steps.append(
196 f" [green]4.[/green] Let URL auto-load proceed (intercept SoundHelix -> local serve)"
197 )
198 steps.append(f" [green]5.[/green] Verify audio samples reach C++ ring buffer")
199 if args.enable_vibe_reactive:
200 steps.append(
201 f" [green]6.[/green] Enable 'Vibe Reactive' checkbox and monitor for {args.monitor_duration}s"
202 )
203 steps.append(
204 f" [green]{'7' if args.enable_vibe_reactive else '6'}.[/green] Check diagnostic messages in console"
205 )
206
207 console.print(
208 Panel.fit(
209 f"[bold cyan]FastLED WASM Audio Pipeline Test[/bold cyan]\n\n"
210 f"[yellow]Will:[/yellow]\n" + "\n".join(steps),
211 title="[bold magenta]Test Plan[/bold magenta]",
212 border_style="cyan",
213 )
214 )
215 console.print()
216
217 install_playwright_browsers()
218
219 port = _find_free_port(8080)
220 console.print(f"[dim]Using port: {port}[/dim]")
221
222 os.chdir(str(PROJECT_ROOT))
223 directory = Path(f"examples/{args.example}/fastled_js")
224
225 if not directory.exists():
226 console.print(f"[bold red]Error:[/bold red] Directory not found: {directory}")
227 console.print(
228 f"[yellow]Hint:[/yellow] Run: bash compile wasm --examples {args.example}"
229 )
230 sys.exit(1)
231

Callers 1

Calls 15

get_frame_countFunction · 0.85
CounterClass · 0.85
anyFunction · 0.85
onMethod · 0.80
routeMethod · 0.80
timeMethod · 0.80
terminateMethod · 0.80
parse_argsFunction · 0.70
_find_free_portFunction · 0.70

Tested by

no test coverage detected