Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2008-12-19 21:00:13 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2008-12-19 23:50:58 (GMT)
commit757076c22902ccce95717e8d4fcc38e158d2f079 (patch)
tree7343f40190e8a62d2af31802905ad611c640074a /common
parent1e4c788150ed45dfb9a63448d7edb3b8113aaa5b (diff)
add FEATURES_* tags to Config.py
Diffstat (limited to 'common')
-rw-r--r--common/Config.py17
-rw-r--r--common/Util/Instruments.py17
2 files changed, 18 insertions, 16 deletions
diff --git a/common/Config.py b/common/Config.py
index fee725c..4fdb2dd 100644
--- a/common/Config.py
+++ b/common/Config.py
@@ -6,10 +6,10 @@ import logging
#QUICKLOAD = os.path.isfile("QUICKLOAD") # skip loading inessential comenents to speed things up
-if os.path.exists('/ofw'):
- XO = True
-else:
- XO = None
+FEATURES_OGG = True
+FEATURES_MIC = None
+FEATURES_LAB = None
+FEATURES_NEWSOUNDS = None
if os.path.isfile("DEBUG"):
f = open("DEBUG")
@@ -30,7 +30,7 @@ TMP_DIR = os.path.join(get_activity_root(), 'tmp')
logging.debug('INFO: loaded TAMTAM_ROOT=%s' % TAM_TAM_ROOT)
-if XO:
+if os.path.exists('/ofw'): # XO
DATA_DIR = os.path.join(get_activity_root(), 'data')
SNDS_INFO_DIR = os.path.join(get_activity_root(), 'data', 'snds_info')
FILES_DIR = os.path.join(TAM_TAM_ROOT, "..", "TamTamEdit.activity", "common", "Resources")
@@ -62,8 +62,6 @@ PLUGIN_NPERIODS = 2
## SOUNDS
##############
-MIC = False
-
ARECORD = "arecord " + os.getenv("TAMTAM_ARECORD",
"-f S16_LE -t wav -r 16000 -c2 -D hw:0,0")
@@ -75,7 +73,10 @@ INST_TIED = 5001
INST_SIMP = 5011
INST_PERC = 5021
-CATEGORIES = ['all','animals','concret','keyboard','people','percussions','strings','winds', 'mysounds']
+CATEGORIES = ['all','animals','concret','keyboard','people','percussions','strings','winds']
+
+if FEATURES_MIC or FEATURES_LAB:
+ CATEGORIES.append('mysounds')
#CSOUND COMMANDS
CSOUND_LOAD_INSTRUMENT = 'f%d 0 0 -1 "%s" 0 0 0'
diff --git a/common/Util/Instruments.py b/common/Util/Instruments.py
index 970d15c..4f5b987 100644
--- a/common/Util/Instruments.py
+++ b/common/Util/Instruments.py
@@ -20,13 +20,13 @@ instrumentDB = InstrumentDB.getRef()
def _addInstrument( name, csoundInstrumentId, instrumentRegister, category, loopStart, loopEnd, crossDur, ampScale = 1, kit = None, kitStage = False, volatile = False ):
instrumentDB.addInstrumentFromArgs( name, csoundInstrumentId, instrumentRegister, loopStart, loopEnd, crossDur, ampScale, kit, name, Config.IMAGE_ROOT+"/"+name+".png", category, kitStage = kitStage, volatile = volatile )
-if Config.MIC:
+if Config.FEATURES_MIC:
_addInstrument( "mic1", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1, volatile = True )
_addInstrument( "mic2", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1, volatile = True )
_addInstrument( "mic3", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1, volatile = True )
_addInstrument( "mic4", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1, volatile = True )
-if not Config.XO:
+if Config.FEATURES_LAB:
_addInstrument( "lab1", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1, volatile = True )
_addInstrument( "lab2", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1, volatile = True )
_addInstrument( "lab3", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1, volatile = True )
@@ -179,12 +179,13 @@ _addInstrument( "guit2", INST_TIED, MID, 'strings', 1.186341406, 1.929568266, .2
_addInstrument( "plane", INST_SIMP, MID, 'concret', 0, 0, 0, 0.6 )
_addInstrument( "slap", INST_SIMP, MID, 'concret', 0, 0, 0, 0.7 )
-try:
- files = os.listdir(Config.SNDS_INFO_DIR)
- for file in files:
- instrumentDB.addInstrument(Config.SNDS_INFO_DIR + '/' + file)
-except:
- pass
+if Config.FEATURES_NEWSOUNDS:
+ try:
+ files = os.listdir(Config.SNDS_INFO_DIR)
+ for file in files:
+ instrumentDB.addInstrument(Config.SNDS_INFO_DIR + '/' + file)
+ except:
+ pass
#jamId = os.path.split(os.path.realpath("/home/olpc/isolation/1/bundle_id_to_gid/org.laptop.TamTamJam"))[1]