app::audio: update doc
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 28 Aug 2016 13:05:58 +0000 (09:05 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sun, 28 Aug 2016 16:58:59 +0000 (12:58 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/app/audio.nit

index 761ba25..a48cb92 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# App audio abstraction
-# Default behaviour is loading the audio from the `assets` folder of the project with its name and extension
-# Platforms implementations can modify this comportement
+# Services to load and play `Sound` and `Music` from the assets folder
 #
-# Once the application has started (after `App.setup`)
-# use `App.load_sound` to get a sound
-# then `Sound.play` to play it
+# Get a handle to a sound using `new Sound` or `new Music` at any time.
+# Call `load` at or after `App::on_create` or leave it to be loaded
+# on demand by the first call to `play`.
 module audio
 
 import app_base
@@ -36,31 +34,31 @@ abstract class PlayableAudio
        # Name of this playable audio
        var name: String
 
-       # Error which is not null if an error happened
+       # Last error on this sound, if any
        var error: nullable Error = null is writable
 
-       # Is this already loaded ?
+       # Is `self` already loaded?
        protected var is_loaded = false is writable
 
        # Load this playable audio
        fun load is abstract
 
-       # Plays the sound
+       # Play the sound
        fun play is abstract
 
-       # Pauses the sound
+       # Pause the sound
        fun pause is abstract
 
-       # Resumes the sound
+       # Resume the sound
        fun resume is abstract
 end
 
-# Abstraction of a short sound
+# Short sound
 class Sound
        super PlayableAudio
 end
 
-# Abstraction of a long song, that can bee looped
+# Long sound that can bee looped
 class Music
        super PlayableAudio
 end