Dart DocumentationstagexlMockSound

MockSound class

class MockSound extends Sound {

 MockSound() {

 }

 //-------------------------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------------------------

 static Future<Sound> load(String url, [SoundLoadOptions soundLoadOptions = null]) {
   return new Future<Sound>.value(new MockSound());
 }

 //-------------------------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------------------------

 num get length {
   // ToDo: We could load the WAV-file, parse the header and get the correct length!
   return double.NAN;
 }


 SoundChannel play([bool loop = false, SoundTransform soundTransform]) {

   if (soundTransform == null) {
     soundTransform = new SoundTransform();
   }

   return new MockSoundChannel(this, loop, soundTransform);
 }
}

Extends

Sound > MockSound

Static Methods

Future<Sound> load(String url, [SoundLoadOptions soundLoadOptions = null]) #

static Future<Sound> load(String url, [SoundLoadOptions soundLoadOptions = null]) {
 return new Future<Sound>.value(new MockSound());
}

Constructors

new MockSound() #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
MockSound() {

}

Properties

final num length #

num get length {
 // ToDo: We could load the WAV-file, parse the header and get the correct length!
 return double.NAN;
}

Methods

SoundChannel play([bool loop = false, SoundTransform soundTransform]) #

SoundChannel play([bool loop = false, SoundTransform soundTransform]) {

 if (soundTransform == null) {
   soundTransform = new SoundTransform();
 }

 return new MockSoundChannel(this, loop, soundTransform);
}