Changeset 447 for lang/javascript/jsmml

Show
Ignore:
Timestamp:
10/10/07 18:26:27 (7 years ago)
Author:
secondlife
Message:

lang/javascript/jsmml: release 1.0.0, include flmml source.

Location:
lang/javascript/jsmml/trunk
Files:
19 added
1 removed
3 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/jsmml/trunk/src/JSMML.as

    r396 r447  
    44 * 
    55 * The MIT Licence. 
     6 * 
     7 * require FlMML ver 0.51 
    68 */ 
    79 
     
    1517 
    1618    public class JSMML extends Sprite { 
     19        public static const VERSION:String = '1.0.0'; 
     20 
    1721        public var mmlPlayers:Object = {}; 
    1822 
     
    2226        } 
    2327 
    24         public const CALLBACKS:Array = ['create', 'play', 'stop' ,'pause', 'time', 'destroy']; 
     28        public const CALLBACKS:Array = ['create', 'play', 'stop' ,'pause', 'destroy']; 
    2529        public function initJS():void { 
     30            ExternalInterface.call('JSMML.setSWFVersion', JSMML.VERSION); 
    2631            for each(var cName:String in CALLBACKS) { 
    2732                ExternalInterface.addCallback('_' + cName, this[cName]); 
     
    5257        } 
    5358 
     59        /* 
    5460        public function time(uNum:Number):Number { 
    5561            return player(uNum).time; 
    5662        } 
     63        */ 
    5764 
    5865        public function setMML(uNum:Number, mml:String):void { 
     
    96103    // original code form MML#play 
    97104    public function setMML(str:String):void { 
    98         m_string = str.toLowerCase(); 
    99  
    100105        m_sequencer.disconnectAll(); 
    101106        m_tracks = new Array(); 
     
    113118        m_form = MOscillator.PULSE; 
    114119 
    115         m_letter = 0; 
    116         while(m_letter < m_string.length) { 
    117             first(); 
    118         } 
     120        preProcess(str); 
     121        process(); 
     122 
     123        // add ends of tracks 
    119124        for(var i:int = 0; i < m_tracks.length; i++) { 
    120125            m_tracks[i].recRest(384); 
     
    123128    } 
    124129 
     130    /* 
    125131    public function get time():Number { 
    126132        return m_sequencer.now; 
    127133    } 
     134    */ 
    128135 
    129136    // MML#proxy don't override because the method call on arg. 
     
    141148        m_sequencer.stop(); 
    142149    } 
     150 
    143151} 
  • lang/javascript/jsmml/trunk/src/JSMML.js

    r396 r447  
    1212  } 
    1313})(); 
     14 
     15JSMML.VESION = '1.0.0'; 
     16JSMML.setSWFVersion = function(v) { JSMML.SWF_VERSION = v }; 
     17JSMML.SWF_VERSION = 'SWF don\'t load, yet.'; 
     18JSMML.toString = function() { 
     19    return 'JSMML VERSION: ' + JSMML.VESION + ', SWF_VERSION: ' + JSMML.SWF_VERSION; 
     20}; 
    1421 
    1522JSMML.swfurl = 'JSMML.swf'; 
     
    8895        this.mmlPlayer._destroy(this.uNum); 
    8996        delete JSMML.instances[this.uNum]; 
    90     }, 
     97    } 
     98    /* 
     99    , 
    91100    time: function() { 
    92101        return this.mmlPlayer._time(this.uNum); 
    93102    } 
     103    */ 
    94104}; 
    95105