From 2fa8060b7fd790b3260e65d225a4eca5080683a7 Mon Sep 17 00:00:00 2001 From: Oli Date: Thu, 10 Apr 2008 03:30:59 +0000 Subject: On the way to respect security policy --- (limited to 'common/Util') diff --git a/common/Util/CSoundClient.py b/common/Util/CSoundClient.py index 7e8ef78..69ed50f 100644 --- a/common/Util/CSoundClient.py +++ b/common/Util/CSoundClient.py @@ -95,7 +95,10 @@ class _CSoundClientPlugin: def load_instruments( self ): for instrumentSoundFile in self.instrumentDB.instNamed.keys(): if instrumentSoundFile[0:3] == 'mic' or instrumentSoundFile[0:3] == 'lab' or self.instrumentDB.instNamed[instrumentSoundFile].category == 'mysounds': - fileName = Config.SNDS_DIR + '/' + instrumentSoundFile + try: + fileName = Config.JAM_DIR + '/' + instrumentSoundFile + except: + fileName = Config.SNDS_DIR + '/' + instrumentSoundFile else: fileName = Config.SOUNDS_DIR + "/" + instrumentSoundFile instrumentId = Config.INSTRUMENT_TABLE_OFFSET + self.instrumentDB.instNamed[ instrumentSoundFile ].instrumentId @@ -104,7 +107,10 @@ class _CSoundClientPlugin: def load_instrument(self, inst): if not inst in loadedInstruments: if inst[0:3] == 'mic' or inst[0:3] == 'lab' or self.instrumentDB.instNamed[inst].category == 'mysounds': - fileName = Config.SNDS_DIR + '/' + inst + try: + fileName = Config.JAM_DIR + '/' + inst + except: + fileName = Config.SNDS_DIR + '/' + inst else: fileName = Config.SOUNDS_DIR + "/" + inst instrumentId = Config.INSTRUMENT_TABLE_OFFSET + self.instrumentDB.instNamed[ inst ].instrumentId diff --git a/common/Util/Instruments.py b/common/Util/Instruments.py index 12e755a..ef22bce 100644 --- a/common/Util/Instruments.py +++ b/common/Util/Instruments.py @@ -1,6 +1,7 @@ import os import common.Config as Config import common.Util.InstrumentDB as InstrumentDB +from sugar.activity.activity import get_bundle_name LOW = Config.LOW MID = Config.MID @@ -182,6 +183,8 @@ try: except: pass +#jamId = os.path.split(os.path.realpath("/home/olpc/isolation/1/bundle_id_to_gid/org.laptop.TamTamJam"))[1] + DRUM1KIT = { 24 : "drum1kick", 26 : "drum1floortom", diff --git a/common/Util/LoopSettings.py b/common/Util/LoopSettings.py index a717089..f389275 100644 --- a/common/Util/LoopSettings.py +++ b/common/Util/LoopSettings.py @@ -136,7 +136,7 @@ class LoopSettings( gtk.VBox ): self.show_all() def handleCheck(self, widget): - ofile = open(Config.PREF_DIR + "/sounds_settings", 'a') + ofile = open(Config.DATA_DIR + "/sounds_settings", 'a') name = self.nameEntry.get_text() if self.loopedSound: tied = str(Config.INST_TIED) -- cgit v0.9.1