@matjash/pixi-native-linux-x64 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,63 @@
1
+ export interface NativeVoiceOptions {
2
+ ownerId: number;
3
+ id: number;
4
+ source: string;
5
+ ffmpegPath: string;
6
+ offsetSeconds: number;
7
+ durationSeconds?: number;
8
+ volume: number;
9
+ muted: boolean;
10
+ loop: boolean;
11
+ streaming: boolean;
12
+ playbackRate: number;
13
+ inputArgs: string[];
14
+ outputArgs: string[];
15
+ }
16
+
17
+ export interface NativeCommandOptions {
18
+ ownerId: number;
19
+ command: string;
20
+ id?: number;
21
+ value?: number;
22
+ boolValue?: boolean;
23
+ from?: number;
24
+ to?: number;
25
+ durationMs?: number;
26
+ fadeVersion?: number;
27
+ }
28
+
29
+ export interface NativeAudioEvent {
30
+ ownerId: number;
31
+ event: string;
32
+ id?: number;
33
+ message?: string;
34
+ }
35
+
36
+ export interface NativeAudioDiagnostics {
37
+ activeVoices: number;
38
+ queuedMs: number;
39
+ underruns: number;
40
+ }
41
+
42
+ export class NativeAudioEngine {
43
+ public constructor(eventNotifier: () => void);
44
+ public createVoice(options: NativeVoiceOptions): void;
45
+ public preload(
46
+ ownerId: number,
47
+ requestId: number,
48
+ source: string,
49
+ ffmpegPath: string,
50
+ offsetSeconds: number,
51
+ durationSeconds?: number,
52
+ ): void;
53
+ public command(options: NativeCommandOptions): void;
54
+ public unloadOwner(ownerId: number): void;
55
+ public currentTime(id: number): number | null;
56
+ public currentVolume(id: number): number | null;
57
+ public setGlobalVolume(value: number): void;
58
+ public setGlobalMuted(value: boolean): void;
59
+ public drainEvents(): NativeAudioEvent[];
60
+ public diagnostics(): NativeAudioDiagnostics;
61
+ public stopAll(): void;
62
+ public shutdown(): void;
63
+ }
@@ -0,0 +1,5 @@
1
+ const { createRequire } = require("node:module");
2
+ const { getBindingPath } = require("../binding-path.js");
3
+
4
+ const requireNative = createRequire(__filename);
5
+ module.exports = requireNative(getBindingPath());
@@ -0,0 +1,5 @@
1
+ #![deny(clippy::all)]
2
+
3
+ mod audio_impl;
4
+
5
+ pub use audio_impl::*;
@@ -1,24 +1,24 @@
1
1
  {
2
- "name": "@pixi-native/native-gpu",
3
- "version": "0.1.0",
4
- "private": true,
5
- "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
7
- "scripts": {
8
- "native:build": "node scripts/build.mjs"
2
+ "name": "@pixi-native/native-gpu",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "scripts": {
8
+ "native:build": "node scripts/build.mjs"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/matjazPrijatelj/node-pixi8-wgpu.git"
13
+ },
14
+ "config": {
15
+ "depotTools": {
16
+ "url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git",
17
+ "commit": "5b7fcc4bb71bbbf952a5283fbd621256905be31b"
9
18
  },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/matjazPrijatelj/node-pixi8-wgpu.git"
13
- },
14
- "config": {
15
- "depotTools": {
16
- "url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git",
17
- "commit": "5b7fcc4bb71bbbf952a5283fbd621256905be31b"
18
- },
19
- "dawn": {
20
- "url": "https://dawn.googlesource.com/dawn",
21
- "commit": "053ad3188bd2cda62388d2382626317dda275fe7"
22
- }
19
+ "dawn": {
20
+ "url": "https://dawn.googlesource.com/dawn",
21
+ "commit": "053ad3188bd2cda62388d2382626317dda275fe7"
23
22
  }
23
+ }
24
24
  }
@@ -1,12 +1,16 @@
1
- const Path = require('path')
1
+ const Path = require("path");
2
2
 
3
- const getPlatformDirectory = (platform = process.platform, arch = process.arch) => `${platform}-${arch}`
3
+ const getPlatformDirectory = (
4
+ platform = process.platform,
5
+ arch = process.arch,
6
+ ) => `${platform}-${arch}`;
4
7
 
5
- const getBindingPath = (platform = process.platform, arch = process.arch) => Path.resolve(
6
- __dirname,
7
- '../dist',
8
- getPlatformDirectory(platform, arch),
9
- 'pixi_native_gpu.node',
10
- )
8
+ const getBindingPath = (platform = process.platform, arch = process.arch) =>
9
+ Path.resolve(
10
+ __dirname,
11
+ "../dist",
12
+ getPlatformDirectory(platform, arch),
13
+ "pixi_native_gpu.node",
14
+ );
11
15
 
12
- module.exports = { getBindingPath, getPlatformDirectory }
16
+ module.exports = { getBindingPath, getPlatformDirectory };