-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new "simulatePlatform" value which can be used to select whic…
…h simulation mode the iTunes Emulator will run in. Setting it to "AppleTV" for example will expose the getSystemSounds object which can be used to generate navigation sounds. Added support for "AppleTV" simulation. Some properties are NOT available on AppleTV and so are removed if this platform is selected; however there are also some features unique to the AppleTV. Mainly this is the SystemSounds object which allows you to generate navigation sounds. Added navigations sounds for AppleTV simulation.
- Loading branch information
Showing
7 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
function SystemSounds() | ||
{ | ||
/* Constants */ | ||
this.SystemSoundSelect = 10000; | ||
this.SystemSoundToggle = 10001; | ||
this.SystemSoundScrollStart = 10002; | ||
this.SystemSoundScrollLimit = 10003; | ||
this.SystemSoundExit = 10004; | ||
this.SystemSoundError = 4294965796; | ||
|
||
/* Audio Engine */ | ||
this._audioEngine = new Audio(); | ||
this._audioEngine.style.display = "none"; | ||
|
||
this._audioEngine.loop = false; | ||
this._audioEngine.volume = 1; | ||
|
||
function _initAudioEngine(aContext){ | ||
if (document.body) { | ||
document.body.appendChild(aContext._audioEngine); | ||
} else { | ||
setTimeout(_initAudioEngine, 50, aContext); | ||
} | ||
} | ||
|
||
_initAudioEngine(this); | ||
} | ||
|
||
SystemSounds.prototype.playSystemSound = function(aSystemSound) | ||
{ | ||
switch (aSystemSound) { | ||
case this.SystemSoundSelect: | ||
case this.SystemSoundToggle: | ||
this._play("emulator/sounds/Selection.aif"); | ||
break; | ||
case this.SystemSoundScrollStart: | ||
this._play("emulator/sounds/SelectionChange.aif"); | ||
break; | ||
case this.SystemSoundScrollLimit: | ||
this._play("emulator/sounds/Limit.aif"); | ||
break; | ||
case this.SystemSoundExit: | ||
this._play("emulator/sounds/Exit.aif"); | ||
break; | ||
case this.SystemSoundError: | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
SystemSounds.prototype._play = function(aFile) | ||
{ | ||
this._audioEngine.pause(); | ||
|
||
this._audioEngine.src = window.iTunes._baseURL + aFile; | ||
this._audioEngine.load(); | ||
this._audioEngine.play(); | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters