Move 'sound' module

This commit is contained in:
Bartłomiej Pluta
2019-07-09 22:23:28 +02:00
parent e3f9cb6551
commit 2193cf27c8
5 changed files with 10 additions and 3 deletions

View File

@@ -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 ]

View File

@@ -0,0 +1,4 @@
from smnp.module.sound.function import play, sound
functions = [ sound.function ]
methods = [ play.function ]

View File

View 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()

View File

@@ -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')