Documentation
    Preparing search index...

    Variable audioManagerConst

    audioManager: {
        get count(): number;
        get version(): number;
        clear(): void;
        get(windowId: string): AudioSource | undefined;
        getSources(): Map<string, AudioSource>;
        has(windowId: string): boolean;
        mute(windowId: string, muted: boolean): void;
        register(windowId: string, nappletClass: string, title: string): void;
        unregister(windowId: string): void;
        updateState(windowId: string, update: { title?: string }): void;
    } = ...

    Registry of active audio sources across all napplet windows. Emits 'napplet:audio-changed' CustomEvents when the registry changes.

    Type Declaration

    • get count(): number

      Number of active audio sources.

    • get version(): number

      Current version counter (incremented on every change).

    • clear: function
    • get: function
    • getSources: function
    • has: function
      • Check if a window has a registered audio source.

        Parameters

        • windowId: string

          The window identifier

        Returns boolean

        True if the window has an active audio source

    • mute: function
      • Mute or unmute an audio source and notify the napplet via postMessage.

        Parameters

        • windowId: string

          The window identifier

        • muted: boolean

          True to mute, false to unmute

        Returns void

        audioManager.mute('win-1', true); // mute
        audioManager.mute('win-1', false); // unmute
    • register: function
      • Register a new audio source for a window.

        Parameters

        • windowId: string

          The window identifier

        • nappletClass: string

          The napplet class/type (e.g., 'music-player')

        • title: string

          Human-readable title for the audio source

        Returns void

    • unregister: function
      • Unregister an audio source for a window.

        Parameters

        • windowId: string

          The window identifier to remove

        Returns void

    • updateState: function
      • Update the state of an audio source (e.g., change title).

        Parameters

        • windowId: string

          The window identifier

        • update: { title?: string }

          Partial update with optional title

        Returns void

    import { audioManager } from '@kehto/shell';

    audioManager.register('win-1', 'music', 'My Song');
    audioManager.mute('win-1', true);