Move 'sound' module
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from smnp.module import system, mic, note, iterable
|
||||
from smnp.module import system, mic, note, iterable, sound
|
||||
|
||||
functions = [ *system.functions, *mic.functions, *note.functions, *iterable.functions ]
|
||||
methods = [ *system.methods, *mic.methods, *note.methods, *iterable.methods ]
|
||||
functions = [ *system.functions, *mic.functions, *note.functions, *iterable.functions, *sound.functions ]
|
||||
methods = [ *system.methods, *mic.methods, *note.methods, *iterable.methods, *sound.methods ]
|
||||
4
smnp/module/sound/__init__.py
Normal file
4
smnp/module/sound/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from smnp.module.sound.function import play, sound
|
||||
|
||||
functions = [ sound.function ]
|
||||
methods = [ play.function ]
|
||||
0
smnp/module/sound/function/__init__.py
Normal file
0
smnp/module/sound/function/__init__.py
Normal file
@@ -2,6 +2,7 @@ from smnp.library.model import Function
|
||||
from smnp.library.signature import signature, ofType
|
||||
from smnp.type.model import Type
|
||||
|
||||
|
||||
_signature = signature(ofType(Type.SOUND))
|
||||
def _function(env, sound):
|
||||
sound.value.play()
|
||||
@@ -3,8 +3,10 @@ from smnp.library.model import Function
|
||||
from smnp.library.signature import signature, ofType
|
||||
from smnp.type.model import Type
|
||||
|
||||
|
||||
_signature = signature(ofType(Type.STRING))
|
||||
def _function(env, file):
|
||||
return Type.sound(Sound(file.value))
|
||||
|
||||
|
||||
function = Function(_signature, _function, 'Sound')
|
||||
Reference in New Issue
Block a user