diff --git a/.github/workflows/check-js-generated.yml b/.github/workflows/check-js-generated.yml new file mode 100644 index 000000000..c0111b264 --- /dev/null +++ b/.github/workflows/check-js-generated.yml @@ -0,0 +1,36 @@ +name: Check Generated JS + +on: + push: + paths-ignore: ['**.md'] + branches-ignore: [staging] + pull_request: + paths-ignore: ['**.md'] + branches-ignore: [staging] + +permissions: + contents: read + +jobs: + check-js-generated: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install dependencies + run: | + corepack enable + corepack prepare yarn@4.14.1 --activate + yarn install --immutable + + - name: Regenerate js/ outputs + run: yarn run build:javascript + + - name: Fail if generated files are stale + run: ./ci/check-js-generated.sh diff --git a/README.md b/README.md index 7569ae22a..13b08dd9b 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,10 @@ scan-build --keep-empty -internal-stats -stats -v -v -v -o check ninja.exe ``` Step with `"fixing"` errors is important as code base and especially third-party code are not ready to be build with clang. And files which failed to compile will not be scanned for errors. +#### Generated JS surface (`js/module.{js,d.ts}`) + +`js/module.ts` is the source of truth. `js/module.js` and `js/module.d.ts` (and the `index.*` / `type_check.*` siblings) are tsc outputs of `js/tsconfig.json` — the npm package ships them as-is, so they're committed. Regenerate with `yarn build:javascript`. `yarn local:build` already chains it. CI rejects stale outputs via `.github/workflows/check-js-generated.yml` (`ci/check-js-generated.sh`). + ### Tests The tests for obs studio node are written in Typescript and use Mocha as test framework, with electron-mocha pacakage to make Mocha run in Electron, and Chai as assertion framework. diff --git a/ci/check-js-generated.sh b/ci/check-js-generated.sh new file mode 100755 index 000000000..74a386c00 --- /dev/null +++ b/ci/check-js-generated.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Verify that the committed tsc outputs under js/ match what regenerating +# from js/module.ts would produce. CI runs `yarn build:javascript` first, +# so any change under js/ at this point is a stale generated file. +dirty=$(git status --porcelain -- js/) + +set +x +if [[ $dirty ]]; then + echo "=================================================" + echo "Generated JS files are stale. Run locally:" + echo " yarn build:javascript" + echo "and commit the regenerated files." + echo "" + echo "Stale files:" + echo "$dirty" + echo "=================================================" + exit 1 +fi diff --git a/js/module.d.ts b/js/module.d.ts index 0c6db4fb4..cdcb50121 100644 --- a/js/module.d.ts +++ b/js/module.d.ts @@ -296,7 +296,6 @@ export declare const InputFactory: IInputFactory; export declare const SceneFactory: ISceneFactory; export declare const FilterFactory: IFilterFactory; export declare const TransitionFactory: ITransitionFactory; -export declare const DisplayFactory: IDisplayFactory; export declare const VolmeterFactory: IVolmeterFactory; export declare const FaderFactory: IFaderFactory; export declare const Audio: IAudio; @@ -351,8 +350,6 @@ export interface IIPC { disconnect(): void; } export interface IGlobal { - startup(locale: string, path?: string): void; - shutdown(): void; getOutputFlagsFromId(id: string): number; setOutputSource(channel: number, input: ISource): void; getOutputSource(channel: number): ISource; @@ -360,10 +357,8 @@ export interface IGlobal { removeSceneFromBackstage(input: ISource): void; readonly totalFrames: number; readonly laggedFrames: number; - readonly initialized: boolean; locale: string; multipleRendering: boolean; - readonly version: number; readonly cpuPercentage: number; readonly currentFrameRate: number; readonly averageFrameRenderTime: number; @@ -424,7 +419,6 @@ export interface INumberDetails { readonly step: number; } export interface IProperty { - readonly status: number; readonly name: string; readonly description: string; readonly longDescription: string; @@ -433,11 +427,14 @@ export interface IProperty { readonly type: EPropertyType; readonly value: any; next(): IProperty; + previous(): IProperty; + is_first(): boolean; + is_last(): boolean; modified(): boolean; } export interface IProperties { - readonly status: number; first(): IProperty; + last(): IProperty; count(): number; get(name: string): IProperty; } @@ -522,8 +519,9 @@ export interface IInput extends ISource { sendFocus(focus: boolean): void; sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; setFilterOrder(filter: IFilter, movement: EOrderMovement): void; - setFilterOrder(filter: IFilter, movement: EOrderMovement): void; + copyFilters(other: IInput): boolean; readonly filters: IFilter[]; + readonly active: boolean; readonly width: number; readonly height: number; getDuration(): number; @@ -532,6 +530,8 @@ export interface IInput extends ISource { pause(): void; restart(): void; stop(): void; + getMediaState(): number; + load(): void; } export interface ISceneFactory { create(name: string): IScene; @@ -547,6 +547,13 @@ export interface IScene extends ISource { findItem(id: string | number): ISceneItem; getItemAtIdx(idx: number): ISceneItem; getItems(): ISceneItem[]; + getItemsInRange(fromIndex: number, toIndex: number): ISceneItem[]; + load(): void; + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } export interface ISceneItem { readonly source: IInput; @@ -588,6 +595,12 @@ export interface ITransition extends ISource { clear(): void; set(input: ISource): void; start(ms: number, input: ISource): void; + load(): void; + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } export interface IConfigurable { update(settings: ISettings): void; @@ -631,26 +644,6 @@ export interface IVolmeter { } export interface ICallbackData { } -export interface IDisplayFactory { - create(source?: IInput): IDisplay; -} -export interface IDisplay { - destroy(): void; - setPosition(x: number, y: number): void; - getPosition(): IVec2; - setSize(x: number, y: number): void; - getSize(): IVec2; - getPreviewOffset(): IVec2; - getPreviewSize(x: number, y: number): void; - shouldDrawUI: boolean; - paddingSize: number; - setPaddingColor(r: number, g: number, b: number, a: number): void; - setBackgroundColor(r: number, g: number, b: number, a: number): void; - setOutlineColor(r: number, g: number, b: number, a: number): void; - setGuidelineColor(r: number, g: number, b: number, a: number): void; - setResizeBoxOuterColor(r: number, g: number, b: number, a: number): void; - setResizeBoxInnerColor(r: number, g: number, b: number, a: number): void; -} export interface IVideoInfo { fpsNum: number; fpsDen: number; @@ -691,22 +684,18 @@ export interface IAudioFactory { disableAudioDucking: boolean; disableAudioDuckingLegacy: boolean; } -export interface IModuleFactory extends IFactoryTypes { +export interface IModuleFactory { open(binPath: string, dataPath: string): IModule; - loadAll(): void; - addPath(path: string, dataPath: string): void; - logLoaded(): void; modules(): String[]; } export interface IModule { initialize(): void; - filename(): string; - name(): string; - author(): string; - description(): string; - binPath(): string; - dataPath(): string; - status(): number; + readonly fileName: string; + readonly name: string; + readonly author: string; + readonly description: string; + readonly binaryPath: string; + readonly dataPath: string; } export declare function addItems(scene: IScene, sceneItems: ISceneItemInfo[]): ISceneItem[]; export interface FilterInfo { @@ -795,7 +784,6 @@ export interface IVideoEncoderFactory { create(id: string, name: string, settings?: ISettings): IVideoEncoder; } export interface IStreaming { - // Video encoder value is only ignored in the Enhanced Broadcasting mode, otherwise it should be set videoEncoder?: IVideoEncoder; service: IService; enforceServiceBitrate: boolean; @@ -806,7 +794,7 @@ export interface IStreaming { video: IVideo; signalHandler: (signal: EOutputSignal) => void; getAvailableEncoders(): IEncoderOption[]; - start(): void; // throws + start(): void; stop(force?: boolean): void; droppedFrames: number; totalFrames: number; @@ -847,9 +835,7 @@ export interface IAdvancedStreamingFactory { legacySettings: IAdvancedStreaming; } export interface IEnhancedBroadcastingAdvancedStreaming extends IAdvancedStreaming { - // If set, the Enhanced Broadcasting stream will be in the Dual Output mode. - // This value should be initialized before the stream start. - additionalVideo?: IVideo, + additionalVideo?: IVideo; } export interface IEnhancedBroadcastingAdvancedStreamingFactory { create(): IEnhancedBroadcastingAdvancedStreaming; @@ -857,9 +843,7 @@ export interface IEnhancedBroadcastingAdvancedStreamingFactory { legacySettings: IEnhancedBroadcastingAdvancedStreaming; } export interface IEnhancedBroadcastingSimpleStreaming extends ISimpleStreaming { - // If set, the Enhanced Broadcasting stream will be in the Dual Output mode. - // This value should be initialized before the stream start. - additionalVideo?: IVideo, + additionalVideo?: IVideo; } export interface IEnhancedBroadcastingSimpleStreamingFactory { create(): IEnhancedBroadcastingSimpleStreaming; diff --git a/js/module.js b/js/module.js index 61471a348..e4acf6ceb 100644 --- a/js/module.js +++ b/js/module.js @@ -1,13 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.NodeObs = exports.getSourcesSize = exports.createSources = exports.addItems = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.AdvancedStreamingFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.DisplayFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; +exports.NodeObs = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; +exports.addItems = addItems; +exports.createSources = createSources; +exports.getSourcesSize = getSourcesSize; const path = require("path"); const fs = require("fs"); -// Mac- search for optional OSN.app bundle (Chromium requires an app bundle to find obs64 helper apps) const hasDeveloperApp = process.platform === 'darwin' && fs.existsSync(path.join(__dirname, 'OSN.app')); const obs = hasDeveloperApp - ? require('./OSN.app/distribute/obs-studio-node/obs_studio_client.node') - : require('./obs_studio_client.node'); + ? require('./OSN.app/distribute/obs-studio-node/obs_studio_client.node') + : require('./obs_studio_client.node'); exports.DefaultD3D11Path = path.resolve(__dirname, `libobs-d3d11.dll`); exports.DefaultOpenGLPath = path.resolve(__dirname, `libobs-opengl.dll`); exports.DefaultDrawPluginPath = path.resolve(__dirname, `simple_draw.dll`); @@ -23,7 +25,6 @@ exports.InputFactory = obs.Input; exports.SceneFactory = obs.Scene; exports.FilterFactory = obs.Filter; exports.TransitionFactory = obs.Transition; -exports.DisplayFactory = obs.Display; exports.VolmeterFactory = obs.Volmeter; exports.FaderFactory = obs.Fader; exports.Audio = obs.Audio; @@ -60,7 +61,6 @@ function addItems(scene, sceneItems) { } return items; } -exports.addItems = addItems; function createSources(sources) { const items = []; if (Array.isArray(sources)) { @@ -68,11 +68,11 @@ function createSources(sources) { let newSource = null; try { newSource = obs.Input.create(source.type, source.name, source.settings); - } catch (error) { + } + catch (error) { console.error(`[OSN] Failed to create input for source "${source.name}":`, error instanceof Error ? error.message : error); - return; // Skip the rest of this iteration if input creation fails + return; } - if (newSource) { if (newSource.audioMixers) { newSource.muted = source.muted ?? false; @@ -82,17 +82,16 @@ function createSources(sources) { newSource.deinterlaceMode = source.deinterlaceMode; newSource.deinterlaceFieldOrder = source.deinterlaceFieldOrder; items.push(newSource); - const filters = source.filters; if (Array.isArray(filters)) { filters.forEach(function (filter) { let ObsFilter = null; try { ObsFilter = obs.Filter.create(filter.type, filter.name, filter.settings); - } catch (filterError) { + } + catch (filterError) { console.error(`[OSN] Failed to create filter "${filter.name}" for source "${source.name}":`, filterError instanceof Error ? filterError.message : filterError); } - if (ObsFilter) { ObsFilter.enabled = filter.enabled ?? true; newSource.addFilter(ObsFilter); @@ -100,16 +99,17 @@ function createSources(sources) { } }); } - } else { + } + else { console.warn(`[OSN] Input creation failed for source: ${source.name}`); } }); - } else { + } + else { console.error(`[OSN] Invalid sources array provided:`, sources); } return items; } -exports.createSources = createSources; function getSourcesSize(sourcesNames) { const sourcesSize = []; if (Array.isArray(sourcesNames)) { @@ -122,10 +122,10 @@ function getSourcesSize(sourcesNames) { } return sourcesSize; } -exports.getSourcesSize = getSourcesSize; +; const appleBinaryFolder = hasDeveloperApp - ? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin') - : path.join(__dirname, 'bin'); + ? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin') + : path.join(__dirname, 'bin'); if (fs.existsSync(path.resolve(appleBinaryFolder, 'obs64').replace('app.asar', 'app.asar.unpacked'))) { obs.IPC.setServerPath(path.resolve(appleBinaryFolder, `obs64`).replace('app.asar', 'app.asar.unpacked'), path.resolve(appleBinaryFolder).replace('app.asar', 'app.asar.unpacked')); } diff --git a/js/module.ts b/js/module.ts index 03b4885f8..a1ec21878 100644 --- a/js/module.ts +++ b/js/module.ts @@ -381,7 +381,6 @@ export const InputFactory: IInputFactory = obs.Input; export const SceneFactory: ISceneFactory = obs.Scene; export const FilterFactory: IFilterFactory = obs.Filter; export const TransitionFactory: ITransitionFactory = obs.Transition; -export const DisplayFactory: IDisplayFactory = obs.Display; export const VolmeterFactory: IVolmeterFactory = obs.Volmeter; export const FaderFactory: IFaderFactory = obs.Fader; export const Audio: IAudio = obs.Audio; @@ -491,18 +490,6 @@ export interface IIPC { } export interface IGlobal { - /** - * Initializes libobs global context - * @param locale - Locale to be used within libobs - * @param path - Data path of libobs - */ - startup(locale: string, path?: string): void; - - /** - * Uninitializes libobs global context - */ - shutdown(): void; - /** * @param id - String ID of the source * @returns - The output flags (capabilities) of the source type @@ -558,11 +545,6 @@ export interface IGlobal { */ readonly laggedFrames: number; - /** - * Current status of the global libobs context - */ - readonly initialized: boolean; - /** * Current locale of current libobs context */ @@ -573,15 +555,6 @@ export interface IGlobal { */ multipleRendering: boolean; - /** - * Version of current libobs context. - * Represented as a 32-bit unsigned integer. - * First 2 bytes are major. - * Second 2 bytes are minor. - * Last 4 bytes are patch. - */ - readonly version: number; - /** * Percentage of CPU being used */ @@ -697,9 +670,6 @@ export interface INumberDetails { * Class representing an entry in a properties list (Properties). */ export interface IProperty { - /** The validity of the current property instance */ - readonly status: number; - /** * The name associated with the property * You can use this name to fetch from the source @@ -734,6 +704,19 @@ export interface IProperty { * Otherwise or if end of the list, returns false. */ next(): IProperty; + + /** + * Uses the current object to obtain the previous property in the list. + * Returns undefined when the current property is the first. + */ + previous(): IProperty; + + /** True when this property is the first in the list. */ + is_first(): boolean; + + /** True when this property is the last in the list. */ + is_last(): boolean; + modified(): boolean; } @@ -745,12 +728,12 @@ export interface IProperty { */ export interface IProperties { - /** Obtains the status of the list */ - readonly status: number; - /** Obtains the first property in the list. */ first(): IProperty; + /** Obtains the last property in the list. */ + last(): IProperty; + count(): number; /** @@ -931,18 +914,22 @@ export interface IInput extends ISource { setFilterOrder(filter: IFilter, movement: EOrderMovement): void; /** - * Move a filter up, down, top, or bottom in the filter list. - * @param filter - The filter to move within the input source. - * @param movement - The movement to make within the list. + * Copy all filters from this input source onto another. + * @param other - Destination input that will receive copies of this source's filters. + * @returns - True on success, false if the IPC call failed. */ - setFilterOrder(filter: IFilter, movement: EOrderMovement): void; - + copyFilters(other: IInput): boolean; /** * Obtain a list of all filters associated with the input source */ readonly filters: IFilter[]; + /** + * Whether the input is currently active (rendering / producing data). + */ + readonly active: boolean; + /** * Width of the underlying source */ @@ -982,6 +969,16 @@ export interface IInput extends ISource { * stop media source */ stop(): void; + + /** + * Get the current media playback state of the source. + */ + getMediaState(): number; + + /** + * Re-trigger the source's load step (re-reads serialized state on the server). + */ + load(): void; } export interface ISceneFactory { @@ -1069,6 +1066,24 @@ export interface IScene extends ISource { * @returns - The array of item instances */ getItems(): ISceneItem[]; + + /** + * Fetch a contiguous range of items within the scene. + * @param fromIndex - Inclusive start index. + * @param toIndex - Inclusive end index. + */ + getItemsInRange(fromIndex: number, toIndex: number): ISceneItem[]; + + /** + * Re-trigger the scene's load step on the server. + */ + load(): void; + + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } /** @@ -1225,6 +1240,17 @@ export interface ITransition extends ISource { * @param input - Source to transition to */ start(ms: number, input: ISource): void; + + /** + * Re-trigger the transition's load step on the server. + */ + load(): void; + + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } export interface IConfigurable { @@ -1268,7 +1294,13 @@ export interface ISource extends IConfigurable, IReleasable { */ save(): void; + /** + * Forward a serializable message to the underlying source plugin. + * Note: only registered on input sources on the native side; calling on + * a filter, scene, or transition will throw at runtime. + */ sendMessage(message: ISettings): void; + /** * The validity of the source */ @@ -1408,33 +1440,6 @@ export interface IVolmeter { export interface ICallbackData { } -export interface IDisplayFactory { - create(source?: IInput): IDisplay; -} - -export interface IDisplay { - destroy(): void; - - setPosition(x: number, y: number): void; - getPosition(): IVec2; - - setSize(x: number, y: number): void; - getSize(): IVec2; - - getPreviewOffset(): IVec2; - getPreviewSize(x: number, y: number): void; - - shouldDrawUI: boolean; - paddingSize: number; - - setPaddingColor(r: number, g: number, b: number, a: number): void; - setBackgroundColor(r: number, g: number, b: number, a: number): void; - setOutlineColor(r: number, g: number, b: number, a: number): void; - setGuidelineColor(r: number, g: number, b: number, a: number): void; - setResizeBoxOuterColor(r: number, g: number, b: number, a: number): void; - setResizeBoxInnerColor(r: number, g: number, b: number, a: number): void; -} - /** * This represents a obs_video_info structure from within libobs */ @@ -1491,23 +1496,19 @@ export interface IAudioFactory { disableAudioDuckingLegacy: boolean; // Windows only } -export interface IModuleFactory extends IFactoryTypes { +export interface IModuleFactory { open(binPath: string, dataPath: string): IModule; - loadAll(): void; - addPath(path: string, dataPath: string): void; - logLoaded(): void; modules(): String[]; } export interface IModule { initialize(): void; - filename(): string; - name(): string; - author(): string; - description(): string; - binPath(): string; - dataPath(): string; - status(): number; + readonly fileName: string; + readonly name: string; + readonly author: string; + readonly description: string; + readonly binaryPath: string; + readonly dataPath: string; } export function addItems(scene: IScene, sceneItems: ISceneItemInfo[]): ISceneItem[] { diff --git a/js/tsconfig.json b/js/tsconfig.json index 1d879be1e..508dcbadb 100644 --- a/js/tsconfig.json +++ b/js/tsconfig.json @@ -2,7 +2,7 @@ "compileOnSave": true, "compilerOptions": { "declaration": true, - "target": "es6", + "target": "es2020", "module": "commonjs", "moduleResolution": "node", "isolatedModules": false, @@ -10,7 +10,6 @@ "noImplicitAny": true, "noImplicitThis": true, "removeComments": true, - "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "strictNullChecks": false, "emitDecoratorMetadata": true diff --git a/js/type_check.js b/js/type_check.js index e77704d1c..b38ce4473 100644 --- a/js/type_check.js +++ b/js/type_check.js @@ -1,47 +1,47 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEmptyProperty = exports.isFontProperty = exports.isCaptureProperty = exports.isColorProperty = exports.isButtonProperty = exports.isBooleanProperty = exports.isEditableListProperty = exports.isListProperty = exports.isPathProperty = exports.isTextProperty = exports.isNumberProperty = void 0; +exports.isNumberProperty = isNumberProperty; +exports.isTextProperty = isTextProperty; +exports.isPathProperty = isPathProperty; +exports.isListProperty = isListProperty; +exports.isEditableListProperty = isEditableListProperty; +exports.isBooleanProperty = isBooleanProperty; +exports.isButtonProperty = isButtonProperty; +exports.isColorProperty = isColorProperty; +exports.isCaptureProperty = isCaptureProperty; +exports.isFontProperty = isFontProperty; +exports.isEmptyProperty = isEmptyProperty; function isNumberProperty(property) { return property.type === 2 || property.type === 3; } -exports.isNumberProperty = isNumberProperty; function isTextProperty(property) { return property.type === 4; } -exports.isTextProperty = isTextProperty; function isPathProperty(property) { return property.type === 5; } -exports.isPathProperty = isPathProperty; function isListProperty(property) { return property.type === 6; } -exports.isListProperty = isListProperty; function isEditableListProperty(property) { return property.type === 10; } -exports.isEditableListProperty = isEditableListProperty; function isBooleanProperty(property) { return property.type === 1; } -exports.isBooleanProperty = isBooleanProperty; function isButtonProperty(property) { return property.type === 8; } -exports.isButtonProperty = isButtonProperty; function isColorProperty(property) { return property.type === 7; } -exports.isColorProperty = isColorProperty; function isCaptureProperty(property) { return property.type === 14; } -exports.isCaptureProperty = isCaptureProperty; function isFontProperty(property) { return property.type === 9; } -exports.isFontProperty = isFontProperty; function isEmptyProperty(property) { switch (property.type) { case 1: @@ -53,4 +53,3 @@ function isEmptyProperty(property) { } return false; } -exports.isEmptyProperty = isEmptyProperty; diff --git a/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp b/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp index 80bb976aa..2a8c2253f 100644 --- a/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp +++ b/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp @@ -43,8 +43,6 @@ Napi::Object osn::EnhancedBroadcastingSimpleStreaming::Init(Napi::Env env, Napi: &osn::EnhancedBroadcastingSimpleStreaming::SetEnforceServiceBirate), InstanceAccessor("enableTwitchVOD", &osn::EnhancedBroadcastingSimpleStreaming::GetEnableTwitchVOD, &osn::EnhancedBroadcastingSimpleStreaming::SetEnableTwitchVOD), - InstanceAccessor("audioEncoder", &osn::EnhancedBroadcastingSimpleStreaming::GetAudioEncoder, - &osn::EnhancedBroadcastingSimpleStreaming::SetAudioEncoder), InstanceAccessor("useAdvanced", &osn::EnhancedBroadcastingSimpleStreaming::GetUseAdvanced, &osn::EnhancedBroadcastingSimpleStreaming::SetUseAdvanced), InstanceAccessor("customEncSettings", &osn::EnhancedBroadcastingSimpleStreaming::GetCustomEncSettings, diff --git a/package.json b/package.json index 7dcdfd9eb..b2b350484 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "build:javascript": "tsc -p js", "build:docs": "typedoc --out docs", "local:config": "yarn install && git submodule update --init --recursive --force && cmake -Bbuild -H. -G\"Visual Studio 16 2019\" -A\"x64\" -DCMAKE_INSTALL_PREFIX=\"./obs-studio-node\" -DLIBOBS_BUILD_TYPE=\"debug\" -DCMAKE_PREFIX_PATH=%CD%/build/libobs-src/cmake/", - "local:build": "cmake --build build --target install --config Debug", + "local:build": "yarn run build:javascript && cmake --build build --target install --config Debug", "local:clean": "rm -rf build/*", "test": "electron-mocha -t 80000 --js-flags=\"--expose-gc\" --color -r ts-node/register tests/osn-tests/src/**/*.ts --reporter tests/osn-tests/util/list-reporter.js", "test:ci": "yarn run test --retries 2"