-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feat/focused-window-p…
…rovider
- Loading branch information
Showing
59 changed files
with
2,804 additions
and
341 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type DockConfig = { | ||
enabled: boolean; | ||
edge: 'top' | 'bottom' | 'left' | 'right' | null; | ||
windowMargin: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './monitor-selection'; | ||
export * from './dock-config'; | ||
export * from './widget-config'; | ||
export * from './widget-placement'; | ||
export * from './widget-preset'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/client-api/src/providers/audio/audio-provider-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { Provider } from '../create-base-provider'; | ||
|
||
export interface AudioProviderConfig { | ||
type: 'audio'; | ||
} | ||
|
||
export type AudioProvider = Provider<AudioProviderConfig, AudioOutput>; | ||
|
||
export interface AudioOutput { | ||
defaultPlaybackDevice: AudioDevice; | ||
playbackDevices: AudioDevice[]; | ||
} | ||
|
||
export interface AudioDevice { | ||
deviceId: string; | ||
name: string; | ||
volume: number; | ||
isDefault: boolean; | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/client-api/src/providers/audio/create-audio-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { z } from 'zod'; | ||
|
||
import { createBaseProvider } from '../create-base-provider'; | ||
import { onProviderEmit } from '~/desktop'; | ||
import type { | ||
AudioOutput, | ||
AudioProvider, | ||
AudioProviderConfig, | ||
} from './audio-provider-types'; | ||
|
||
const audioProviderConfigSchema = z.object({ | ||
type: z.literal('audio'), | ||
}); | ||
|
||
export function createAudioProvider( | ||
config: AudioProviderConfig, | ||
): AudioProvider { | ||
const mergedConfig = audioProviderConfigSchema.parse(config); | ||
|
||
return createBaseProvider(mergedConfig, async queue => { | ||
return onProviderEmit<AudioOutput>(mergedConfig, ({ result }) => { | ||
if ('error' in result) { | ||
queue.error(result.error); | ||
} else { | ||
queue.output(result.output); | ||
} | ||
}); | ||
}); | ||
} |
Oops, something went wrong.