]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/sound.js
1 qwebirc
.sound
.domReady
= false;
2 window
.addEvent("domready", function() {
3 qwebirc
.sound
.domReady
= true;
6 qwebirc
.sound
.SoundPlayer
= new Class({
8 initialize: function() {
9 this.loadingSWF
= false;
10 this.loadedSWF
= false;
12 var sb
= qwebirc
.global
.staticBaseURL
;
13 if(qwebirc
.global
.baseURL
.substr(qwebirc
.global
.baseURL
.length
- 1, 1) == "/" && sb
.substr(0, 1) == "/")
16 this.soundURL
= qwebirc
.global
.baseURL
+ sb
+ "sound/";
19 if(qwebirc
.sound
.domReady
) {
20 this.loadSoundManager();
22 window
.addEvent("domready", function() {
23 this.loadSoundManager();
27 loadSoundManager: function() {
30 this.loadingSWF
= true;
32 var debugMode
= false;
34 window
.soundManager
= new SoundManager();
36 var sb
= qwebirc
.global
.staticBaseURL
;
37 if(qwebirc
.global
.baseURL
.substr(-1) == "/" && sb
.substr(0, 1) == "/")
40 window
.soundManager
.url
= this.soundURL
;
41 window
.soundManager
.debugMode
= debugMode
;
42 window
.soundManager
.useConsole
= debugMode
;
43 window
.soundManager
.onload = function() {
44 this.loadedSWF
= true;
45 this.fireEvent("ready");
47 window
.soundManager
.beginDelayedInit();
49 createSound: function(name
, src
) {
51 soundManager
.createSound(name
, src
);
53 /* ignore... flashblock triggers this */
56 playSound: function(name
) {
58 soundManager
.play(name
);
64 if(!this.beepLoaded
) {
65 this.createSound("beep", this.soundURL
+ "beep3.mp3");
66 this.beepLoaded
= true;
68 this.playSound("beep");