diff options
author | Oli <olpc@localhost.localdomain> | 2007-02-04 08:22:43 (GMT) |
---|---|---|
committer | Oli <olpc@localhost.localdomain> | 2007-02-04 08:22:43 (GMT) |
commit | 46e3316abd38001f86f3e8006a1c4d6f6e346f51 (patch) | |
tree | 387bf8735ed314fe0b5eaf77c562203859e01588 /Util/CSoundClient.py | |
parent | 2e0b154865aae4aa0bad9ae32f871c404800e6e4 (diff) |
loading of snds after building interface
Diffstat (limited to 'Util/CSoundClient.py')
-rw-r--r-- | Util/CSoundClient.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Util/CSoundClient.py b/Util/CSoundClient.py index f70d6f2..0862282 100644 --- a/Util/CSoundClient.py +++ b/Util/CSoundClient.py @@ -184,23 +184,32 @@ class CSoundClientPlugin( CSoundClientBase ): self.on = False self.masterVolume = 80.0 + def load_instruments( self ): + for instrumentSoundFile in Config.INSTRUMENTS.keys(): + if instrumentSoundFile[0:3] == 'mic' or instrumentSoundFile[0:3] == 'lab': + fileName = Config.PREF_DIR + '/' + instrumentSoundFile + else: + fileName = Config.SOUNDS_DIR + "/" + instrumentSoundFile + instrumentId = Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[ instrumentSoundFile ].instrumentId + sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) + def connect( self, init = True ): def reconnect(): - def load_instruments( ): - for instrumentSoundFile in Config.INSTRUMENTS.keys(): - if instrumentSoundFile[0:3] == 'mic' or instrumentSoundFile[0:3] == 'lab': - fileName = Config.PREF_DIR + '/' + instrumentSoundFile - else: - fileName = Config.SOUNDS_DIR + "/" + instrumentSoundFile - instrumentId = Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[ instrumentSoundFile ].instrumentId - sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) +# def load_instruments( ): +# for instrumentSoundFile in Config.INSTRUMENTS.keys(): +# if instrumentSoundFile[0:3] == 'mic' or instrumentSoundFile[0:3] == 'lab': +# fileName = Config.PREF_DIR + '/' + instrumentSoundFile +# else: +# fileName = Config.SOUNDS_DIR + "/" + instrumentSoundFile +# instrumentId = Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[ instrumentSoundFile ].instrumentId +# sc_inputMessage( Config.CSOUND_LOAD_INSTRUMENT % (instrumentId, fileName) ) if sc_start() : print 'ERROR connecting' else: self.on = True sc_setMasterVolume(self.masterVolume) - load_instruments() + #load_instruments() time.sleep(0.2) def disconnect(): if sc_stop() : |