nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/core/text: fix unrecognized doc units
[nit.git]
/
lib
/
app
/
audio.nit
diff --git
a/lib/app/audio.nit
b/lib/app/audio.nit
index
0f1ab76
..
87b510f
100644
(file)
--- a/
lib/app/audio.nit
+++ b/
lib/app/audio.nit
@@
-27,18
+27,18
@@
import core::error
# Platform variations
import linux::audio is conditional(linux)
import android::audio is conditional(android)
# Platform variations
import linux::audio is conditional(linux)
import android::audio is conditional(android)
+import ios::audio is conditional(ios)
# Abstraction of a playable Audio
abstract class PlayableAudio
# Abstraction of a playable Audio
abstract class PlayableAudio
+ init do sounds.add self
+
# Path to the audio file in the assets folder
var path: String
# Last error on this sound, if any
# Path to the audio file in the assets folder
var path: String
# Last error on this sound, if any
- var error: nullable Error = null is writable
-
- # Is `self` already loaded?
- protected var is_loaded = false is writable
+ fun error: nullable Error do return null
# Load this playable audio
fun load do end
# Load this playable audio
fun load do end
@@
-62,3
+62,9
@@
end
class Music
super PlayableAudio
end
class Music
super PlayableAudio
end
+
+redef class Sys
+
+ # All instantiated sounds
+ var sounds = new Array[PlayableAudio]
+end