foo-webview-sdk
    Preparing search index...

    Variable configConst

    config: {
        export: () => Promise<ConfigExportResponse>;
        get: (key: string, defaultValue?: JsonValue) => Promise<ConfigGetResponse>;
        getActiveDspPreset: () => Promise<ConfigGetActiveDspPresetResponse>;
        getAdvancedConfig: (
            parentGuid?: string,
        ) => Promise<ConfigGetAdvancedConfigResponse>;
        getAdvancedConfigValue: (
            guid: string,
        ) => Promise<ConfigGetAdvancedConfigValueResponse>;
        getAll: () => Promise<ConfigGetAllResponse>;
        getComponents: () => Promise<ConfigGetComponentsResponse>;
        getCursorFollowPlayback: () => Promise<
            ConfigGetCursorFollowPlaybackResponse,
        >;
        getDspPresets: () => Promise<ConfigGetDspPresetsResponse>;
        getLibraryFilePatterns: () => Promise<ConfigGetLibraryFilePatternsResponse>;
        getLibraryStatus: () => Promise<ConfigGetLibraryStatusResponse>;
        getOutputConfig: () => Promise<ConfigGetOutputConfigResponse>;
        getOutputDevices: () => Promise<ConfigGetOutputDevicesResponse>;
        getPlaybackFollowCursor: () => Promise<
            ConfigGetPlaybackFollowCursorResponse,
        >;
        getPreferencesPages: () => Promise<ConfigGetPreferencesPagesResponse>;
        getPreferencesStandardGuids: () => Promise<
            ConfigGetPreferencesStandardGuidsResponse,
        >;
        getReplaygainMode: () => Promise<ConfigGetReplaygainModeResponse>;
        getVersionInfo: () => Promise<ConfigGetVersionInfoResponse>;
        remove: (key: string) => Promise<ConfigRemoveResponse>;
        resetAdvancedConfig: (
            guid: string,
        ) => Promise<ConfigResetAdvancedConfigResponse>;
        set: (key: string, value: JsonValue) => Promise<ConfigSetResponse>;
        setActiveDspPreset: (
            index: number,
        ) => Promise<ConfigSetActiveDspPresetResponse>;
        setAdvancedConfigValue: (
            guid: string,
            value: JsonValue,
        ) => Promise<ConfigSetAdvancedConfigValueResponse>;
        setCursorFollowPlayback: (
            enabled: boolean,
        ) => Promise<ConfigSetCursorFollowPlaybackResponse>;
        setOutputBuffer: {
            (ms: number): Promise<ConfigSetOutputBufferResponse>;
            (
                opts: ConfigSetOutputBufferParams,
            ): Promise<ConfigSetOutputBufferResponse>;
        };
        setOutputDevice: (
            outputId: string,
            deviceId: string,
        ) => Promise<ConfigSetOutputDeviceResponse>;
        setPlaybackFollowCursor: (
            enabled: boolean,
        ) => Promise<ConfigSetPlaybackFollowCursorResponse>;
        setReplaygainMode: (
            mode: ReplaygainSourceMode | ReplaygainSourceModeName,
        ) => Promise<ConfigSetReplaygainModeResponse>;
        showLibraryPreferences: () => Promise<ConfigShowLibraryPreferencesResponse>;
    } = ...

    config — output / DSP / advanced / portable-config namespace.

    Type Declaration

    • export: () => Promise<ConfigExportResponse>

      Read the whole store both as a map and as one JSON text.

    • get: (key: string, defaultValue?: JsonValue) => Promise<ConfigGetResponse>

      Reads the value stored under key. A key that is not stored is not an error: the response has found: false and value set to defaultValue, or null when no default is given.

    • getActiveDspPreset: () => Promise<ConfigGetActiveDspPresetResponse>

      Report which DSP preset is selected.

    • getAdvancedConfig: (parentGuid?: string) => Promise<ConfigGetAdvancedConfigResponse>

      foobar2000's Advanced preferences from the root, or from below parentGuid, in entries; each branch has its entries nested in children.

    • getAdvancedConfigValue: (guid: string) => Promise<ConfigGetAdvancedConfigValueResponse>

      Read one Advanced preferences entry by GUID.

    • getAll: () => Promise<ConfigGetAllResponse>

      Full snapshot of the portable-config cache. Returns the { success, items, configs, count } envelope; items and configs are interchangeable aliases of the same map.

    • getComponents: () => Promise<ConfigGetComponentsResponse>

      The installed components, in components.

    • getCursorFollowPlayback: () => Promise<ConfigGetCursorFollowPlaybackResponse>

      Report foobar2000's "cursor follows playback" setting.

    • getDspPresets: () => Promise<ConfigGetDspPresetsResponse>

      The stored DSP presets, in presets.

    • getLibraryFilePatterns: () => Promise<ConfigGetLibraryFilePatternsResponse>

      Each pattern is present only when foobar2000 has it configured, so with neither configured the response is { success: true } alone.

    • getLibraryStatus: () => Promise<ConfigGetLibraryStatusResponse>

      Report whether the media library is enabled and loaded, and how many items it holds.

    • getOutputConfig: () => Promise<ConfigGetOutputConfigResponse>

      Report the output settings in effect: module, device, buffer length, bit depth, dithering and fades.

    • getOutputDevices: () => Promise<ConfigGetOutputDevicesResponse>

      The devices of every output module, in devices, flagged when one is in effect.

    • getPlaybackFollowCursor: () => Promise<ConfigGetPlaybackFollowCursorResponse>

      Report foobar2000's "playback follows cursor" setting.

    • getPreferencesPages: () => Promise<ConfigGetPreferencesPagesResponse>

      Every preferences page, then every preferences branch, in pages.

    • getPreferencesStandardGuids: () => Promise<ConfigGetPreferencesStandardGuidsResponse>

      Report the GUIDs of foobar2000's standard preferences parents.

    • getReplaygainMode: () => Promise<ConfigGetReplaygainModeResponse>

      Resolve the active ReplayGain source mode.

      The host returns the mode as an integer (0 = none, 1 = track, 2 = album, 3 = byPlaybackOrder). Use the REPLAYGAIN_SOURCE_MODE constant dictionary exported alongside the response type to compare against named entries:

      const r = await config.getReplaygainMode();
      if (r.mode === REPLAYGAIN_SOURCE_MODE.track) { ... }
      

      The value field is an alias of mode retained for compatibility with older host builds.

    • getVersionInfo: () => Promise<ConfigGetVersionInfoResponse>

      Report the foobar2000 version, this component's version and the profile folder.

    • remove: (key: string) => Promise<ConfigRemoveResponse>

      Delete a key from the component's configuration store.

    • resetAdvancedConfig: (guid: string) => Promise<ConfigResetAdvancedConfigResponse>

      Return one Advanced preferences entry to its default value.

    • set: (key: string, value: JsonValue) => Promise<ConfigSetResponse>

      Stores any JSON value under key. A top-level null is refused with an INVALID_PARAMS failure envelope; clear a key with config.remove instead.

    • setActiveDspPreset: (index: number) => Promise<ConfigSetActiveDspPresetResponse>

      Select a preset by its index from config.getDspPresets. An index past the end resolves with an INVALID_INDEX failure envelope.

    • setAdvancedConfigValue: (
          guid: string,
          value: JsonValue,
      ) => Promise<ConfigSetAdvancedConfigValueResponse>

      Write one Advanced preferences entry: a boolean for a checkbox or radio entry, a string or a number for a string or integer entry. A value of the wrong kind resolves with an INVALID_PARAMS failure envelope.

    • setCursorFollowPlayback: (enabled: boolean) => Promise<ConfigSetCursorFollowPlaybackResponse>

      Turn foobar2000's "cursor follows playback" setting on or off.

    • setOutputBuffer: {
          (ms: number): Promise<ConfigSetOutputBufferResponse>;
          (opts: ConfigSetOutputBufferParams): Promise<ConfigSetOutputBufferResponse>;
      }

      Set the output buffer length.

      Accepts either a single numeric argument (milliseconds, matching the original (ms) signature) or an options object that lets callers pick the unit explicitly:

      • milliseconds — buffer in ms, from 50 to 2000.
      • bufferLength — buffer in seconds (the host's native unit), from 0.05 to 2.

      If both fields are present the host uses milliseconds, though it still refuses a bufferLength outside its range. Out-of-range values and a call with neither field resolve with an INVALID_PARAMS failure envelope.

      Numeric milliseconds, or an options object with milliseconds and/or bufferLength.

    • setOutputDevice: (outputId: string, deviceId: string) => Promise<ConfigSetOutputDeviceResponse>

      Switch output to a device of an output module; take both GUIDs from config.getOutputDevices.

    • setPlaybackFollowCursor: (enabled: boolean) => Promise<ConfigSetPlaybackFollowCursorResponse>

      Turn foobar2000's "playback follows cursor" setting on or off.

    • setReplaygainMode: (
          mode: ReplaygainSourceMode | ReplaygainSourceModeName,
      ) => Promise<ConfigSetReplaygainModeResponse>

      Set the active ReplayGain source mode.

      Accepts either an integer (0-3, see REPLAYGAIN_SOURCE_MODE), sent as mode, or a name, sent as sourceMode ('none' | 'track' | 'album' | 'byPlaybackOrder' | 'auto'). 'auto' is treated by the host as an alias of 'byPlaybackOrder' and yields integer mode 3.

    • showLibraryPreferences: () => Promise<ConfigShowLibraryPreferencesResponse>

      Open foobar2000's Media Library preferences page.