差分発生行の前後
無視リスト:
コミット日時:
2009/05/22 23:00:42 (3 年前)
コミッタ:
keim
ログメッセージ:

サウンドライブラリ SiON ver0.5.3 更新 tutrial 追加など

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/SiOPM/trunk/samples/SiOPMJavaScriptBridge/SiOPMJavaScriptBridge.as

    r2625 r2697  
    2929            driver = new SiONDriver(); 
    3030            data = new SiONData(); 
    31             addChild(driver)
     31            driver.autoStop = true
    3232             
    3333            //new pcmExample(driver); 
     
    5050            driver.addEventListener(SiONEvent.STREAM_START,   _onStreamStart); 
    5151            driver.addEventListener(SiONEvent.STREAM_STOP,    _onStreamStop); 
     52            driver.addEventListener(SiONEvent.FADE_IN_COMPLETE,  _onFadeInComplete); 
     53            driver.addEventListener(SiONEvent.FADE_OUT_COMPLETE, _onFadeOutComplete); 
    5254             
    5355            // callback onLoad 
     
    6668        private function _onStreamStop(e:SiONEvent)      : void { ExternalInterface.call('SIOPM._internal_onStreamStop'); } 
    6769        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'); } 
    6872         
    6973         
     
    117121            return driver.position; 
    118122        } 
     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        } 
    119145    } 
    120146} 
     
    141167    function pcmExample(driver:SiONDriver) 
    142168    { 
    143         driver.setPCMData(0, new hit_mp3()); 
    144         driver.setWaveData(60, new kick_mp3()); //o5c 
    145         driver.setWaveData(62, new sdw_mp3());  //o5d 
    146         driver.setWaveData(64, new sds_mp3());  //o5e 
    147         driver.setWaveData(65, new toml_mp3()); //o5f 
    148         driver.setWaveData(67, new tomh_mp3()); //o5g 
    149         driver.setWaveData(48, new hatc_mp3()); //o4c 
    150         driver.setWaveData(50, new hath_mp3()); //o4d 
    151         driver.setWaveData(52, new hato_mp3()); //o4e 
    152         driver.setWaveData(53, new crash_mp3()); //o4f 
    153         driver.setWaveData(55, new bell_mp3());  //o4g 
     169        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 
    154180    } 
    155181} 
  • as3/SiOPM/trunk/samples/SiOPMJavaScriptBridge/siopm.js

    r2526 r2697  
    2020// version informations 
    2121//------------------------------ 
    22 SIOPM.VERSION = '0.3.0'; 
     22SIOPM.VERSION = '0.4.0'; 
    2323SIOPM.SWF_VERSION = 'SWF has not loaded.'; 
    2424SIOPM.toString = function() { return 'SIOPM_VERSION: ' + SIOPM.VERSION + '/ SWF_VERSION: ' + SIOPM.SWF_VERSION; }; 
     
    7979SIOPM.onStreamStop = function() {}; 
    8080 
     81// call back after fading in. 
     82SIOPM.onFadeInComplete = function() {}; 
     83 
     84// call back after fading out. 
     85SIOPM.onFadeOutComplete = function() {}; 
     86 
    8187// call back when error appears. 
    8288SIOPM.onError = function() {}; 
     
    111117// control/refer position by Number (unit in milli-second), you can refer the position to call this without any arguments. 
    112118SIOPM.position = function() { return SIOPM.mmlPlayer._position(arguments[0]); } 
     119 
     120// fade in time (unit in second). 
     121SIOPM.fadeIn = function() { return SIOPM.mmlPlayer._fadeIn(arguments[0]); } 
     122 
     123// fade out time (unit in second). 
     124SIOPM.fadeOut = function() { return SIOPM.mmlPlayer._fadeOut(arguments[0]); } 
    113125 
    114126// initialize. call this first of all. ussualy call this in body.onLoad(). this calls back onLoad() when the SiOPM is initialized successfully. 
     
    203215    SIOPM.onStreamStop(); 
    204216} 
    205  
    206  
     217SIOPM._internal_onFadeInComplete = function () { 
     218    SIOPM.onFadeInComplete(); 
     219
     220SIOPM._internal_onFadeOutComplete = function () { 
     221    SIOPM.onFadeOutComplete(); 
     222
     223 
     224