Skip to content

Commit

Permalink
feat: follow pdi-types@1.13.0-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xnv committed Nov 13, 2023
1 parent 6bd451d commit 03c8d0c
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 35 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 1.5.0-beta.0
* @akashic/pdi-types を 1.13.0-beta.0 に追従

## 1.4.0
* @akashic/pdi-types を 1.10.0 に更新

Expand Down
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@akashic/pdi-common-impl",
"version": "1.4.0",
"version": "1.5.0-beta.0",
"description": "Common implementation of PDI",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand All @@ -27,7 +27,7 @@
"package.json"
],
"dependencies": {
"@akashic/pdi-types": "^1.10.0",
"@akashic/pdi-types": "^1.13.0-beta.0",
"@akashic/trigger": "^2.0.0"
},
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion src/AudioAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export abstract class AudioAsset extends Asset implements pdi.AudioAsset {
loop: boolean;
hint: pdi.AudioAssetHint;
offset: number | undefined;
loopOffset: number | undefined;

/**
* @private
Expand All @@ -34,7 +35,8 @@ export abstract class AudioAsset extends Asset implements pdi.AudioAsset {
system: pdi.AudioSystem,
loop: boolean,
hint: pdi.AudioAssetHint,
offset: number | undefined
offset: number | undefined,
loopOffset: number | undefined
) {
super(id, assetPath);
this.duration = duration;
Expand All @@ -43,6 +45,7 @@ export abstract class AudioAsset extends Asset implements pdi.AudioAsset {
this._system = system;
this.data = undefined;
this.offset = offset;
this.loopOffset = loopOffset;
}

play(): pdi.AudioPlayer {
Expand Down
3 changes: 2 additions & 1 deletion src/ResourceFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export abstract class ResourceFactory implements pdi.ResourceFactory {
system: pdi.AudioSystem,
loop: boolean,
hint: pdi.AudioAssetHint,
offset?: number
offset?: number,
loopOffset?: number
): AudioAsset;

abstract createTextAsset(id: string, assetPath: string): TextAsset;
Expand Down
7 changes: 5 additions & 2 deletions src/__tests__/AssetSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ describe("test Asset", () => {
const system = new AudioSystem(id, 10);
const hint = { streaming: true };
const offset = 10;
const asset = new AudioAsset(0, id, path, duration, system, true, hint, offset);
const loopOffset = 20;
const asset = new AudioAsset(0, id, path, duration, system, true, hint, offset, loopOffset);
expect(asset.id).toBe(id);
expect(asset.path).toBe(path);
expect(asset.originalPath).toBe(path);
Expand All @@ -17,6 +18,7 @@ describe("test Asset", () => {
expect(asset.loop).toBe(true);
expect(asset.hint).toBe(hint);
expect(asset.offset).toBe(10);
expect(asset.loopOffset).toBe(20);
});

it("AudioAsset 初期化 offset なし", () => {
Expand All @@ -25,7 +27,7 @@ describe("test Asset", () => {
const duration = 1984;
const system = new AudioSystem(id, 10);
const hint = { streaming: true };
const asset = new AudioAsset(0, id, path, duration, system, true, hint, undefined);
const asset = new AudioAsset(0, id, path, duration, system, true, hint, undefined, undefined);
expect(asset.id).toBe(id);
expect(asset.path).toBe(path);
expect(asset.originalPath).toBe(path);
Expand All @@ -34,6 +36,7 @@ describe("test Asset", () => {
expect(asset.loop).toBe(true);
expect(asset.hint).toBe(hint);
expect(asset.offset).toBe(undefined);
expect(asset.loopOffset).toBe(undefined);
});

it("VideoAsset 初期化", () => {
Expand Down
5 changes: 3 additions & 2 deletions src/__tests__/helpers/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ export class AudioAsset extends pci.AudioAsset {
system: pdi.AudioSystem,
loop: boolean,
hint: pdi.AudioAssetHint,
offset: number | undefined
offset: number | undefined,
loopOffset: number | undefined
) {
super(id, assetPath, duration, system, loop, hint, offset);
super(id, assetPath, duration, system, loop, hint, offset, loopOffset);
}
_load(_loader: pdi.AssetLoadHandler): void {
// do nothing
Expand Down

0 comments on commit 03c8d0c

Please sign in to comment.