Source

pygamekit / sound.pxd

Full commit

from gkmath cimport *
import gkmath

from gameobject cimport *

cdef extern from "Sound/gkSound.h":
    cppclass gkSound:
        gkSoundStream* getStream()
        gkSource* createSource()
        void destroySource(gkSource*)
        void stopPlayback()
        
        bool loadToMemory(char* file)
        bool load(char* file)
        #bool load(void* handle, UTsize len)
        
cdef extern from "Sound/gkSource.h":
    cppclass gkSoundProperties:
        gkSoundProperties()
        
        gkScalar    m_volume
        gkScalar    m_pitch
        bool    m_loop


        bool    m_3dSound

        gkScalar    m_refDistance
        gkScalar    m_maxDistance
        gkVector2   m_gainClamp
        gkScalar    m_rolloff
        gkScalar    m_coneOuterGain
        gkVector2   m_coneAngle

        gkVector3       m_position
        gkVector3       m_velocity
        gkVector3       m_direction
        gkQuaternion    m_orientation
        gkScalar    m_height
        
    cppclass gkSource:
        gkSource(gkSound* sound)
        
        bool                  isStopped()
        bool                  isPlaying()
        bool                  isBound()
        bool                  isLooped()
        gkSoundProperties&    getProperties()
        gkSound*              getCreator()

        void setProperties(gkSoundProperties& props)

        void updatePropsForObject(gkGameObject* obj)

        bool isPaused()

        void play()
        void pause()
        void stop()
        void loop(bool v)

        void resetPlayable()

cdef extern from "Sound/gkSoundStream.h":
    cppclass gkSoundStream
    
cdef extern from "Sound/gkSoundManager.h":
    cppclass gkSoundManager "gkSoundManager::getSingleton":
        gkSound* getByName "getByName<gkSound>"(gkString&)
        gkSound* create "create<gkSound>"(gkString&)
        void stopAllSounds()

#cdef extern from "gkResourceName.h":
    #cppclass gkResourceName:
        #gkResourceName(char* inName, char* inGroup)