Wiki

Changes between Version 17 and Version 18 of AllOfCobraInOnePage

Show
Ignore:
Timestamp:
01/10/14 06:54:18 (11 years ago)
Author:
kobi7
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AllOfCobraInOnePage

    v17 v18  
    5252 
    5353class WavPacket implements IAudioPacket 
    54         cue init(bytes as uint8[]) 
    55                 base.init 
    56                 # ... create the wav packet format, using the bytes 
     54        cue init(bytes as uint8[]) # cue init is the syntax for constructor (ctor) 
     55                base.init # it must call a base ctor. 
     56                # ... etc: create the wav packet format, using the bytes 
    5757         
    5858        def toWavPacket as WavPacket 
     
    6262        var bytes as uint8[] 
    6363        def toWavPacket as WavPacket 
    64                 wavBytes = Mp3Utils.decode(.bytes) 
    65                 wavpack = WavPacket(wavBytes) 
     64                wavBytes = Mp3Utils.decode(.bytes)  
     65                # methods without arguments, getters and some variables are accessed uniformly, with a '.' before their name. 
     66                #local variables don't have the dot. 
     67                wavpack = WavPacket(wavBytes) # instantiating a class. No need for the 'new' keyword in cobra. 
    6668                return wavpack 
    6769