- コミット日時:
- 2009/05/22 23:00:42 (3 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/SiOPM/trunk/samples/SiOPMJavaScriptBridge/SiOPMJavaScriptBridge.as
r2625 r2697 29 29 driver = new SiONDriver(); 30 30 data = new SiONData(); 31 addChild(driver);31 driver.autoStop = true; 32 32 33 33 //new pcmExample(driver); … … 50 50 driver.addEventListener(SiONEvent.STREAM_START, _onStreamStart); 51 51 driver.addEventListener(SiONEvent.STREAM_STOP, _onStreamStop); 52 driver.addEventListener(SiONEvent.FADE_IN_COMPLETE, _onFadeInComplete); 53 driver.addEventListener(SiONEvent.FADE_OUT_COMPLETE, _onFadeOutComplete); 52 54 53 55 // callback onLoad … … 66 68 private function _onStreamStop(e:SiONEvent) : void { ExternalInterface.call('SIOPM._internal_onStreamStop'); } 67 69 private function _onCompileComplete(e:SiONEvent) : void { ExternalInterface.call('SIOPM._internal_onCompileComplete', data.title); } 70 private function _onFadeInComplete(e:SiONEvent) : void { ExternalInterface.call('SIOPM._internal_onFadeInComplete'); } 71 private function _onFadeOutComplete(e:SiONEvent) : void { ExternalInterface.call('SIOPM._internal_onFadeOutComplete'); } 68 72 69 73 … … 117 121 return driver.position; 118 122 } 123 124 125 private function _fadeIn(t:*) : void 126 { 127 var time:Number = Number(t); 128 if (!isNaN(time)) { 129 driver.fadeIn(time); 130 } else { 131 driver.fadeIn(3); 132 } 133 } 134 135 136 private function _fadeOut(t:*) : void 137 { 138 var time:Number = Number(t); 139 if (!isNaN(time)) { 140 driver.fadeOut(time); 141 } else { 142 driver.fadeOut(3); 143 } 144 } 119 145 } 120 146 } … … 141 167 function pcmExample(driver:SiONDriver) 142 168 { 143 driver.setPCM Data(0, new hit_mp3());144 driver.set WaveData(60, new kick_mp3()); //o5c145 driver.set WaveData(62, new sdw_mp3()); //o5d146 driver.set WaveData(64, new sds_mp3()); //o5e147 driver.set WaveData(65, new toml_mp3()); //o5f148 driver.set WaveData(67, new tomh_mp3()); //o5g149 driver.set WaveData(48, new hatc_mp3()); //o4c150 driver.set WaveData(50, new hath_mp3()); //o4d151 driver.set WaveData(52, new hato_mp3()); //o4e152 driver.set WaveData(53, new crash_mp3()); //o4f153 driver.set WaveData(55, new bell_mp3()); //o4g169 driver.setPCMSound(0, new hit_mp3()); 170 driver.setSamplerSound(60, new kick_mp3()); //o5c 171 driver.setSamplerSound(62, new sdw_mp3()); //o5d 172 driver.setSamplerSound(64, new sds_mp3()); //o5e 173 driver.setSamplerSound(65, new toml_mp3()); //o5f 174 driver.setSamplerSound(67, new tomh_mp3()); //o5g 175 driver.setSamplerSound(48, new hatc_mp3()); //o4c 176 driver.setSamplerSound(50, new hath_mp3()); //o4d 177 driver.setSamplerSound(52, new hato_mp3()); //o4e 178 driver.setSamplerSound(53, new crash_mp3()); //o4f 179 driver.setSamplerSound(55, new bell_mp3()); //o4g 154 180 } 155 181 } as3/SiOPM/trunk/samples/SiOPMJavaScriptBridge/siopm.js
r2526 r2697 20 20 // version informations 21 21 //------------------------------ 22 SIOPM.VERSION = '0. 3.0';22 SIOPM.VERSION = '0.4.0'; 23 23 SIOPM.SWF_VERSION = 'SWF has not loaded.'; 24 24 SIOPM.toString = function() { return 'SIOPM_VERSION: ' + SIOPM.VERSION + '/ SWF_VERSION: ' + SIOPM.SWF_VERSION; }; … … 79 79 SIOPM.onStreamStop = function() {}; 80 80 81 // call back after fading in. 82 SIOPM.onFadeInComplete = function() {}; 83 84 // call back after fading out. 85 SIOPM.onFadeOutComplete = function() {}; 86 81 87 // call back when error appears. 82 88 SIOPM.onError = function() {}; … … 111 117 // control/refer position by Number (unit in milli-second), you can refer the position to call this without any arguments. 112 118 SIOPM.position = function() { return SIOPM.mmlPlayer._position(arguments[0]); } 119 120 // fade in time (unit in second). 121 SIOPM.fadeIn = function() { return SIOPM.mmlPlayer._fadeIn(arguments[0]); } 122 123 // fade out time (unit in second). 124 SIOPM.fadeOut = function() { return SIOPM.mmlPlayer._fadeOut(arguments[0]); } 113 125 114 126 // initialize. call this first of all. ussualy call this in body.onLoad(). this calls back onLoad() when the SiOPM is initialized successfully. … … 203 215 SIOPM.onStreamStop(); 204 216 } 205 206 217 SIOPM._internal_onFadeInComplete = function () { 218 SIOPM.onFadeInComplete(); 219 } 220 SIOPM._internal_onFadeOutComplete = function () { 221 SIOPM.onFadeOutComplete(); 222 } 223 224

