Skip to content

Commit

Permalink
[chore] Remove obsolete code for 0.18.0 release (#1021)
Browse files Browse the repository at this point in the history
* Remove obsolete code for 0.18.0 release
* Update changelog
  • Loading branch information
jedeen authored and eonarheim committed Aug 4, 2018
1 parent 175e725 commit d762e46
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 41 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Breaking Changes

- `Sound.setVolume()` replaced with `Sound.volume`
- `Sound.setLoop()` replaced with `Sound.loop`

### Added

- Add `Scene.isActorInDrawTree` method to determine if an actor is in the scene's draw tree.
Expand Down
2 changes: 1 addition & 1 deletion sandbox/src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var imageBlocks = new ex.Texture('../images/BlockA0.png');
var spriteFontImage = new ex.Texture('../images/SpriteFont.png');
var jump = new ex.Sound('../sounds/jump.wav', '../sounds/jump.mp3');

jump.setVolume(0.3);
jump.volume = 0.3;

var loader = new ex.Loader();
loader.addResource(heartTex);
Expand Down
2 changes: 1 addition & 1 deletion sandbox/tests/audio/longsound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ game.on('hidden', () => {
});

game.start(loader).then(() => {
testSound.setLoop(true);
testSound.loop = true;
testSound.play();

setTimeout(() => testSound.play(), 2000);
Expand Down
2 changes: 1 addition & 1 deletion sandbox/tests/audio/setvolume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ button.on('pointerup', function() {
//change volume of the sound after 2000 ms to show that
//initial setting worked
setTimeout(function() {
testSound.setVolume(1);
testSound.volume = 1;
}, 2000);
}
});
Expand Down
12 changes: 0 additions & 12 deletions src/engine/Interfaces/IAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ export interface IAudio {
*/
volume: number;

/**
* Whether the audio should loop (repeat forever)
* @param loop true to enable loop
*/
setLoop(loop: boolean): void;

/**
* Sets the volume of the sound clip
* @param volume A volume value between 0-1.0
*/
setVolume(value: number): void;

/**
* Whether or not any audio is playing
*/
Expand Down
13 changes: 0 additions & 13 deletions src/engine/Resources/Sound/AudioInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { IAudio } from '../../Interfaces/IAudio';
import { Promise } from '../../Promises';
import * as Util from '../../Util/Util';
import { AudioContextFactory } from './AudioContext';
import { obsolete } from '../../Util/Decorators';

/**
* Internal class for producing of AudioInstances
Expand Down Expand Up @@ -54,18 +53,6 @@ export class AudioInstance implements IAudio {

constructor(protected _src: string | AudioBuffer) {}

/** @obsolete will be removed in v0.18, use loop */
@obsolete({ message: 'will be removed in v0.18, use loop instead' })
public setLoop(loop: boolean) {
this.loop = loop;
}

/** @obsolete will be removed in v0.18, use volume */
@obsolete({ message: 'will be removed in v0.18, use volume instead' })
public setVolume(volume: number) {
this.volume = volume;
}

public isPlaying() {
return this._isPlaying;
}
Expand Down
13 changes: 0 additions & 13 deletions src/engine/Resources/Sound/Sound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Resource } from '../Resource';
import { AudioInstance, AudioInstanceFactory } from './AudioInstance';
import { AudioContextFactory } from './AudioContext';
import { NativeSoundEvent } from '../../Events/MediaEvents';
import { obsolete } from '../../Util/Decorators';
import { Promise } from '../../Promises';
import { canPlayFile } from '../../Util/Sound';

Expand Down Expand Up @@ -93,18 +92,6 @@ export class Sound extends Resource<Blob | ArrayBuffer> implements IAudio {
}
}

/** @obsolete will be removed in v0.18, use loop */
@obsolete({ message: 'will be removed in v0.18, use loop instead' })
public setLoop(loop: boolean) {
this.loop = loop;
}

/** @obsolete will be removed in v0.18, use volume */
@obsolete({ message: 'will be removed in v0.18, use volume instead' })
public setVolume(volume: number) {
this.volume = volume;
}

public wireEngine(engine: Engine) {
if (engine) {
this._engine = engine;
Expand Down

0 comments on commit d762e46

Please sign in to comment.