Skip to content

Commit

Permalink
outputs all devices. still has bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
HolbyFPV committed Nov 16, 2024
1 parent 78d482d commit df99c68
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 131 deletions.
2 changes: 1 addition & 1 deletion examples/boilerplate-solid-ts/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>Zebar</title>
<script type="module" crossorigin src="./assets/index-0iu8mdoa.js"></script>
<script type="module" crossorigin src="./assets/index-BY0d1KB4.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DhTpoJOY.css">
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion examples/boilerplate-solid-ts/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function App() {
return (
<div class="app">
<div class="chip">
vol: {output.audio?.volume} dev: {output.audio?.currentDevice}
{output.audio?.devices[output.audio?.defaultDevice!].name} :
{output.audio?.devices[output.audio?.defaultDevice!].volume}
</div>
<div class="chip">CPU usage: {output.cpu?.usage}</div>
<div class="chip">
Expand Down
11 changes: 9 additions & 2 deletions packages/client-api/src/providers/audio/audio-provider-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ export interface AudioProviderConfig {

export type AudioProvider = Provider<AudioProviderConfig, AudioOutput>;

export interface AudioOutput {
export interface AudioDeviceInfo {
deviceId: string;
name: string;
volume: number;
currentDevice: string;
isDefault: boolean;
}

export interface AudioOutput {
devices: Record<string, AudioDeviceInfo>;
defaultDevice: string | null;
}

Loading

0 comments on commit df99c68

Please sign in to comment.