@dcl/protocol 1.0.0-7716486147.commit-7433b10 → 1.0.0-8512299862.commit-a3dc095
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.
- package/out-js/decentraland/sdk/components/animator.gen.d.ts +3 -3
- package/out-js/decentraland/sdk/components/audio_source.gen.d.ts +11 -0
- package/out-js/decentraland/sdk/components/audio_source.gen.js +34 -2
- package/out-js/decentraland/sdk/components/audio_source.gen.js.map +1 -1
- package/out-ts/decentraland/sdk/components/animator.gen.ts +3 -3
- package/out-ts/decentraland/sdk/components/audio_source.gen.ts +48 -1
- package/package.json +2 -2
- package/proto/decentraland/sdk/components/animator.proto +8 -3
- package/proto/decentraland/sdk/components/audio_source.proto +10 -2
|
@@ -18,13 +18,13 @@ export interface PBAnimationState {
|
|
|
18
18
|
clip: string;
|
|
19
19
|
/** whether this animation is currently playing */
|
|
20
20
|
playing?: boolean | undefined;
|
|
21
|
-
/** the "weight" of this animation (see below, default: 1.0) */
|
|
21
|
+
/** @experimental the "weight" of this animation (see below, default: 1.0) */
|
|
22
22
|
weight?: number | undefined;
|
|
23
23
|
/** the playback speed (default: 1.0) */
|
|
24
24
|
speed?: number | undefined;
|
|
25
|
-
/** whether the animation repeats until stopped (default: true) */
|
|
25
|
+
/** whether the animation repeats (**) until is manually stopped (default: true) */
|
|
26
26
|
loop?: boolean | undefined;
|
|
27
|
-
/** whether the
|
|
27
|
+
/** whether the animation is restored to the initial state (*) when it changes from stopped to playing (default: false) */
|
|
28
28
|
shouldReset?: boolean | undefined;
|
|
29
29
|
}
|
|
30
30
|
export declare namespace PBAnimator {
|
|
@@ -10,6 +10,13 @@ export declare const protobufPackage = "decentraland.sdk.components";
|
|
|
10
10
|
* Note that the `audio_clip_url` is not actually a URL, but rather the path of a file bundled with
|
|
11
11
|
* the scene and declared in its manifest. The name was chosen because the URL use-case will
|
|
12
12
|
* eventually be supported.
|
|
13
|
+
*
|
|
14
|
+
* `playing=true` when it's previously `playing=true`
|
|
15
|
+
* a) if clip is playing and `current_time` is NOT SET, the clip remains in the current `current_time`
|
|
16
|
+
* b) if clip is stopped or `current_time` is set, the clip is played from the `current_time` (if set) or from the beginning
|
|
17
|
+
*
|
|
18
|
+
* If other property (volume, loop, pitch) is changed while playing, the clip is keep playing with the new properties
|
|
19
|
+
* Changing `audio_clip_url` while playing stops the current clip and plays the new one (as a new instance)
|
|
13
20
|
*/
|
|
14
21
|
export interface PBAudioSource {
|
|
15
22
|
/** whether the clip is currently playing. */
|
|
@@ -22,6 +29,10 @@ export interface PBAudioSource {
|
|
|
22
29
|
pitch?: number | undefined;
|
|
23
30
|
/** the clip path as given in the `files` array of the scene's manifest. */
|
|
24
31
|
audioClipUrl: string;
|
|
32
|
+
/** specifies the current playback time of the clip in seconds (default: 0). */
|
|
33
|
+
currentTime?: number | undefined;
|
|
34
|
+
/** whether the audio plays at constant volume across the scene. */
|
|
35
|
+
global?: boolean | undefined;
|
|
25
36
|
}
|
|
26
37
|
export declare namespace PBAudioSource {
|
|
27
38
|
function encode(message: PBAudioSource, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -8,7 +8,15 @@ exports.PBAudioSource = exports.protobufPackage = void 0;
|
|
|
8
8
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
9
|
exports.protobufPackage = "decentraland.sdk.components";
|
|
10
10
|
function createBasePBAudioSource() {
|
|
11
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
playing: undefined,
|
|
13
|
+
volume: undefined,
|
|
14
|
+
loop: undefined,
|
|
15
|
+
pitch: undefined,
|
|
16
|
+
audioClipUrl: "",
|
|
17
|
+
currentTime: undefined,
|
|
18
|
+
global: undefined,
|
|
19
|
+
};
|
|
12
20
|
}
|
|
13
21
|
var PBAudioSource;
|
|
14
22
|
(function (PBAudioSource) {
|
|
@@ -28,6 +36,12 @@ var PBAudioSource;
|
|
|
28
36
|
if (message.audioClipUrl !== "") {
|
|
29
37
|
writer.uint32(42).string(message.audioClipUrl);
|
|
30
38
|
}
|
|
39
|
+
if (message.currentTime !== undefined) {
|
|
40
|
+
writer.uint32(53).float(message.currentTime);
|
|
41
|
+
}
|
|
42
|
+
if (message.global !== undefined) {
|
|
43
|
+
writer.uint32(56).bool(message.global);
|
|
44
|
+
}
|
|
31
45
|
return writer;
|
|
32
46
|
}
|
|
33
47
|
PBAudioSource.encode = encode;
|
|
@@ -68,6 +82,18 @@ var PBAudioSource;
|
|
|
68
82
|
}
|
|
69
83
|
message.audioClipUrl = reader.string();
|
|
70
84
|
continue;
|
|
85
|
+
case 6:
|
|
86
|
+
if (tag !== 53) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
message.currentTime = reader.float();
|
|
90
|
+
continue;
|
|
91
|
+
case 7:
|
|
92
|
+
if (tag !== 56) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
message.global = reader.bool();
|
|
96
|
+
continue;
|
|
71
97
|
}
|
|
72
98
|
if ((tag & 7) === 4 || tag === 0) {
|
|
73
99
|
break;
|
|
@@ -84,6 +110,8 @@ var PBAudioSource;
|
|
|
84
110
|
loop: isSet(object.loop) ? Boolean(object.loop) : undefined,
|
|
85
111
|
pitch: isSet(object.pitch) ? Number(object.pitch) : undefined,
|
|
86
112
|
audioClipUrl: isSet(object.audioClipUrl) ? String(object.audioClipUrl) : "",
|
|
113
|
+
currentTime: isSet(object.currentTime) ? Number(object.currentTime) : undefined,
|
|
114
|
+
global: isSet(object.global) ? Boolean(object.global) : undefined,
|
|
87
115
|
};
|
|
88
116
|
}
|
|
89
117
|
PBAudioSource.fromJSON = fromJSON;
|
|
@@ -94,6 +122,8 @@ var PBAudioSource;
|
|
|
94
122
|
message.loop !== undefined && (obj.loop = message.loop);
|
|
95
123
|
message.pitch !== undefined && (obj.pitch = message.pitch);
|
|
96
124
|
message.audioClipUrl !== undefined && (obj.audioClipUrl = message.audioClipUrl);
|
|
125
|
+
message.currentTime !== undefined && (obj.currentTime = message.currentTime);
|
|
126
|
+
message.global !== undefined && (obj.global = message.global);
|
|
97
127
|
return obj;
|
|
98
128
|
}
|
|
99
129
|
PBAudioSource.toJSON = toJSON;
|
|
@@ -102,13 +132,15 @@ var PBAudioSource;
|
|
|
102
132
|
}
|
|
103
133
|
PBAudioSource.create = create;
|
|
104
134
|
function fromPartial(object) {
|
|
105
|
-
var _a, _b, _c, _d, _e;
|
|
135
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
106
136
|
const message = createBasePBAudioSource();
|
|
107
137
|
message.playing = (_a = object.playing) !== null && _a !== void 0 ? _a : undefined;
|
|
108
138
|
message.volume = (_b = object.volume) !== null && _b !== void 0 ? _b : undefined;
|
|
109
139
|
message.loop = (_c = object.loop) !== null && _c !== void 0 ? _c : undefined;
|
|
110
140
|
message.pitch = (_d = object.pitch) !== null && _d !== void 0 ? _d : undefined;
|
|
111
141
|
message.audioClipUrl = (_e = object.audioClipUrl) !== null && _e !== void 0 ? _e : "";
|
|
142
|
+
message.currentTime = (_f = object.currentTime) !== null && _f !== void 0 ? _f : undefined;
|
|
143
|
+
message.global = (_g = object.global) !== null && _g !== void 0 ? _g : undefined;
|
|
112
144
|
return message;
|
|
113
145
|
}
|
|
114
146
|
PBAudioSource.fromPartial = fromPartial;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio_source.gen.js","sourceRoot":"","sources":["../../../../out-ts/decentraland/sdk/components/audio_source.gen.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,iEAAqC;AAExB,QAAA,eAAe,GAAG,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"audio_source.gen.js","sourceRoot":"","sources":["../../../../out-ts/decentraland/sdk/components/audio_source.gen.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,iEAAqC;AAExB,QAAA,eAAe,GAAG,6BAA6B,CAAC;AA+C7D,SAAS,uBAAuB;IAC9B,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,MAA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,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
|
@@ -24,7 +24,7 @@ export interface PBAnimationState {
|
|
|
24
24
|
playing?:
|
|
25
25
|
| boolean
|
|
26
26
|
| undefined;
|
|
27
|
-
/** the "weight" of this animation (see below, default: 1.0) */
|
|
27
|
+
/** @experimental the "weight" of this animation (see below, default: 1.0) */
|
|
28
28
|
weight?:
|
|
29
29
|
| number
|
|
30
30
|
| undefined;
|
|
@@ -32,11 +32,11 @@ export interface PBAnimationState {
|
|
|
32
32
|
speed?:
|
|
33
33
|
| number
|
|
34
34
|
| undefined;
|
|
35
|
-
/** whether the animation repeats until stopped (default: true) */
|
|
35
|
+
/** whether the animation repeats (**) until is manually stopped (default: true) */
|
|
36
36
|
loop?:
|
|
37
37
|
| boolean
|
|
38
38
|
| undefined;
|
|
39
|
-
/** whether the
|
|
39
|
+
/** whether the animation is restored to the initial state (*) when it changes from stopped to playing (default: false) */
|
|
40
40
|
shouldReset?: boolean | undefined;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -13,6 +13,13 @@ export const protobufPackage = "decentraland.sdk.components";
|
|
|
13
13
|
* Note that the `audio_clip_url` is not actually a URL, but rather the path of a file bundled with
|
|
14
14
|
* the scene and declared in its manifest. The name was chosen because the URL use-case will
|
|
15
15
|
* eventually be supported.
|
|
16
|
+
*
|
|
17
|
+
* `playing=true` when it's previously `playing=true`
|
|
18
|
+
* a) if clip is playing and `current_time` is NOT SET, the clip remains in the current `current_time`
|
|
19
|
+
* b) if clip is stopped or `current_time` is set, the clip is played from the `current_time` (if set) or from the beginning
|
|
20
|
+
*
|
|
21
|
+
* If other property (volume, loop, pitch) is changed while playing, the clip is keep playing with the new properties
|
|
22
|
+
* Changing `audio_clip_url` while playing stops the current clip and plays the new one (as a new instance)
|
|
16
23
|
*/
|
|
17
24
|
export interface PBAudioSource {
|
|
18
25
|
/** whether the clip is currently playing. */
|
|
@@ -33,10 +40,24 @@ export interface PBAudioSource {
|
|
|
33
40
|
| undefined;
|
|
34
41
|
/** the clip path as given in the `files` array of the scene's manifest. */
|
|
35
42
|
audioClipUrl: string;
|
|
43
|
+
/** specifies the current playback time of the clip in seconds (default: 0). */
|
|
44
|
+
currentTime?:
|
|
45
|
+
| number
|
|
46
|
+
| undefined;
|
|
47
|
+
/** whether the audio plays at constant volume across the scene. */
|
|
48
|
+
global?: boolean | undefined;
|
|
36
49
|
}
|
|
37
50
|
|
|
38
51
|
function createBasePBAudioSource(): PBAudioSource {
|
|
39
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
playing: undefined,
|
|
54
|
+
volume: undefined,
|
|
55
|
+
loop: undefined,
|
|
56
|
+
pitch: undefined,
|
|
57
|
+
audioClipUrl: "",
|
|
58
|
+
currentTime: undefined,
|
|
59
|
+
global: undefined,
|
|
60
|
+
};
|
|
40
61
|
}
|
|
41
62
|
|
|
42
63
|
export namespace PBAudioSource {
|
|
@@ -56,6 +77,12 @@ export namespace PBAudioSource {
|
|
|
56
77
|
if (message.audioClipUrl !== "") {
|
|
57
78
|
writer.uint32(42).string(message.audioClipUrl);
|
|
58
79
|
}
|
|
80
|
+
if (message.currentTime !== undefined) {
|
|
81
|
+
writer.uint32(53).float(message.currentTime);
|
|
82
|
+
}
|
|
83
|
+
if (message.global !== undefined) {
|
|
84
|
+
writer.uint32(56).bool(message.global);
|
|
85
|
+
}
|
|
59
86
|
return writer;
|
|
60
87
|
}
|
|
61
88
|
|
|
@@ -101,6 +128,20 @@ export namespace PBAudioSource {
|
|
|
101
128
|
|
|
102
129
|
message.audioClipUrl = reader.string();
|
|
103
130
|
continue;
|
|
131
|
+
case 6:
|
|
132
|
+
if (tag !== 53) {
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
message.currentTime = reader.float();
|
|
137
|
+
continue;
|
|
138
|
+
case 7:
|
|
139
|
+
if (tag !== 56) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
message.global = reader.bool();
|
|
144
|
+
continue;
|
|
104
145
|
}
|
|
105
146
|
if ((tag & 7) === 4 || tag === 0) {
|
|
106
147
|
break;
|
|
@@ -117,6 +158,8 @@ export namespace PBAudioSource {
|
|
|
117
158
|
loop: isSet(object.loop) ? Boolean(object.loop) : undefined,
|
|
118
159
|
pitch: isSet(object.pitch) ? Number(object.pitch) : undefined,
|
|
119
160
|
audioClipUrl: isSet(object.audioClipUrl) ? String(object.audioClipUrl) : "",
|
|
161
|
+
currentTime: isSet(object.currentTime) ? Number(object.currentTime) : undefined,
|
|
162
|
+
global: isSet(object.global) ? Boolean(object.global) : undefined,
|
|
120
163
|
};
|
|
121
164
|
}
|
|
122
165
|
|
|
@@ -127,6 +170,8 @@ export namespace PBAudioSource {
|
|
|
127
170
|
message.loop !== undefined && (obj.loop = message.loop);
|
|
128
171
|
message.pitch !== undefined && (obj.pitch = message.pitch);
|
|
129
172
|
message.audioClipUrl !== undefined && (obj.audioClipUrl = message.audioClipUrl);
|
|
173
|
+
message.currentTime !== undefined && (obj.currentTime = message.currentTime);
|
|
174
|
+
message.global !== undefined && (obj.global = message.global);
|
|
130
175
|
return obj;
|
|
131
176
|
}
|
|
132
177
|
|
|
@@ -141,6 +186,8 @@ export namespace PBAudioSource {
|
|
|
141
186
|
message.loop = object.loop ?? undefined;
|
|
142
187
|
message.pitch = object.pitch ?? undefined;
|
|
143
188
|
message.audioClipUrl = object.audioClipUrl ?? "";
|
|
189
|
+
message.currentTime = object.currentTime ?? undefined;
|
|
190
|
+
message.global = object.global ?? undefined;
|
|
144
191
|
return message;
|
|
145
192
|
}
|
|
146
193
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/protocol",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-8512299862.commit-a3dc095",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "decentraland/protocol.git",
|
|
6
6
|
"homepage": "https://github.com/decentraland/protocol#readme",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"out-js",
|
|
30
30
|
"public"
|
|
31
31
|
],
|
|
32
|
-
"commit": "
|
|
32
|
+
"commit": "a3dc095a22a487801a52311f2384b146243bc94a"
|
|
33
33
|
}
|
|
@@ -14,13 +14,18 @@ message PBAnimator {
|
|
|
14
14
|
repeated PBAnimationState states = 1; // a collection of animations and their current state
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
// (*) initial state means what frame is set when the state is reset:
|
|
18
|
+
// - if `speed` >= 0 the frame set is the first one
|
|
19
|
+
// - if `speed` < 0 the frame set is the last one
|
|
20
|
+
// (**) repeating means going back to the initial state at the moment the given animation is finished and keeps playing
|
|
21
|
+
|
|
17
22
|
// AnimationState indicates the status and configuration of one available animation.
|
|
18
23
|
message PBAnimationState {
|
|
19
24
|
reserved 1; // deprecated `name` prop
|
|
20
25
|
string clip = 2; // the animation path in the `files` array of the scene manifest
|
|
21
26
|
optional bool playing = 3; // whether this animation is currently playing
|
|
22
|
-
optional float weight = 4; // the "weight" of this animation (see below, default: 1.0)
|
|
27
|
+
optional float weight = 4; // @experimental the "weight" of this animation (see below, default: 1.0)
|
|
23
28
|
optional float speed = 5; // the playback speed (default: 1.0)
|
|
24
|
-
optional bool loop = 6; // whether the animation repeats until stopped (default: true)
|
|
25
|
-
optional bool should_reset = 7; // whether the
|
|
29
|
+
optional bool loop = 6; // whether the animation repeats (**) until is manually stopped (default: true)
|
|
30
|
+
optional bool should_reset = 7; // whether the animation is restored to the initial state (*) when it changes from stopped to playing (default: false)
|
|
26
31
|
}
|
|
@@ -13,11 +13,19 @@ option (common.ecs_component_id) = 1020;
|
|
|
13
13
|
// Note that the `audio_clip_url` is not actually a URL, but rather the path of a file bundled with
|
|
14
14
|
// the scene and declared in its manifest. The name was chosen because the URL use-case will
|
|
15
15
|
// eventually be supported.
|
|
16
|
-
|
|
16
|
+
//
|
|
17
|
+
// `playing=true` when it's previously `playing=true`
|
|
18
|
+
// a) if clip is playing and `current_time` is NOT SET, the clip remains in the current `current_time`
|
|
19
|
+
// b) if clip is stopped or `current_time` is set, the clip is played from the `current_time` (if set) or from the beginning
|
|
20
|
+
//
|
|
21
|
+
// If other property (volume, loop, pitch) is changed while playing, the clip is keep playing with the new properties
|
|
22
|
+
// Changing `audio_clip_url` while playing stops the current clip and plays the new one (as a new instance)
|
|
23
|
+
message PBAudioSource {
|
|
17
24
|
optional bool playing = 1; // whether the clip is currently playing.
|
|
18
25
|
optional float volume = 2; // the audio volume (default: 1.0).
|
|
19
26
|
optional bool loop = 3; // whether the clip should restart when finished.
|
|
20
27
|
optional float pitch = 4; // the audio pitch (default: 1.0).
|
|
21
28
|
string audio_clip_url = 5; // the clip path as given in the `files` array of the scene's manifest.
|
|
29
|
+
optional float current_time = 6; // specifies the current playback time of the clip in seconds (default: 0).
|
|
30
|
+
optional bool global = 7; // whether the audio plays at constant volume across the scene.
|
|
22
31
|
}
|
|
23
|
-
|