Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Util
diff options
context:
space:
mode:
authorjaberg <james@localhost.localdomain>2007-01-08 06:38:26 (GMT)
committer jaberg <james@localhost.localdomain>2007-01-08 06:38:26 (GMT)
commit17c2220bf0fcd29eb2d16fbc3a3b29b0b39103fc (patch)
tree236c2db1512cd42231da118629a06e0acdf1c6a6 /Util
parent2dc31155018d0a09b561a2dc8b9a24e3ed7ce047 (diff)
parent10621ebbb7a9a63bd738626df28f103f3ce17b3f (diff)
merged
Diffstat (limited to 'Util')
-rw-r--r--Util/NoteLooper.py12
-rw-r--r--Util/ThemeWidgets.py18
2 files changed, 22 insertions, 8 deletions
diff --git a/Util/NoteLooper.py b/Util/NoteLooper.py
index 1c99cfd..bcb8e4a 100644
--- a/Util/NoteLooper.py
+++ b/Util/NoteLooper.py
@@ -79,24 +79,24 @@ class NoteLooper:
if pitch in GenerationConstants.DRUMPITCH:
pitch = GenerationConstants.DRUMPITCH[ pitch ]
- iflag = CSoundConstants.DRUM1INSTRUMENTS[ pitch ]
+ iflag = Config.DRUM1INSTRUMENTS[ pitch ]
pitch = 1
else:
iflag = self.inst[ trackId ]
pitch = GenerationConstants.TRANSPOSE[ pitch - 24 ]
# condition for tied notes
- if CSoundConstants.INSTRUMENTS[ iflag ].csoundInstrumentId == 101 and tied and fullDuration:
+ if Config.INSTRUMENTS[ iflag ].csoundInstrumentID == 101 and tied and fullDuration:
duration= -1.0
# condition for overlaped notes
- if CSoundConstants.INSTRUMENTS[ iflag ].csoundInstrumentId == 102 and overlap:
+ if Config.INSTRUMENTS[ iflag ].csoundInstrumentID == 102 and overlap:
duration += 1.0
attack = max( 0.002, duration * attack)
decay = max( 0.002, duration * decay)
- rval = CSoundConstants.PLAY_NOTE_COMMAND_MINUS_DELAY % \
- ( CSoundConstants.INSTRUMENTS[ iflag ].csoundInstrumentId,
+ rval = Config.PLAY_NOTE_COMMAND_MINUS_DELAY % \
+ ( Config.INSTRUMENTS[ iflag ].csoundInstrumentID,
trackId,
'%f', #delay,
duration,
@@ -104,7 +104,7 @@ class NoteLooper:
reverbSend,
amplitude,
pan,
- CSoundConstants.INSTRUMENT_TABLE_OFFSET + CSoundConstants.INSTRUMENTS[ iflag ].instrumentId,
+ Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[ iflag ].instrumentID,
attack,
decay,
filterType, filterCutoff )
diff --git a/Util/ThemeWidgets.py b/Util/ThemeWidgets.py
index 0a4cff9..7b7d470 100644
--- a/Util/ThemeWidgets.py
+++ b/Util/ThemeWidgets.py
@@ -3,7 +3,7 @@ pygtk.require( '2.0' )
import gtk
class ImageHScale( gtk.HScale ):
- def __init__( self, image_name, adjustment = None, slider_border = 0, insensitive_name = None, trough_color = "#333", snap = False ):
+ def __init__( self, image_name, adjustment = None, slider_border = 0, insensitive_name = None, trough_color = "#3D403A", snap = False ):
gtk.HScale.__init__( self, adjustment )
if snap: self.snap = 1/snap
@@ -45,6 +45,7 @@ widget "*%s*" style "scale_style"
self.connect( "expose-event", self.expose )
self.connect( "size-allocate", self.size_allocate )
self.connect( "button-release-event", self.button_release )
+ adjustment.connect( "value-changed", self.value_changed )
def size_allocate( self, widget, allocation ):
self.alloc = allocation
@@ -55,6 +56,12 @@ widget "*%s*" style "scale_style"
if snap: self.snap = 1/snap
else: self.snap = False
self.queue_draw()
+
+ def value_changed( self, adjustment ):
+ if self.snap:
+ val = round(self.snap*self.get_value())/self.snap
+ if val != self.get_value():
+ self.set_value( val )
def expose( self, widget, event ):
@@ -87,7 +94,7 @@ widget "*%s*" style "scale_style"
self.set_value( round(self.snap*self.get_value())/self.snap )
class ImageVScale( gtk.VScale ):
- def __init__( self, image_name, adjustment = None, slider_border = 0, insensitive_name = None, trough_color = "#333", snap = False ):
+ def __init__( self, image_name, adjustment = None, slider_border = 0, insensitive_name = None, trough_color = "#3D403A", snap = False ):
gtk.VScale.__init__( self, adjustment )
if snap: self.snap = 1/snap
@@ -129,6 +136,7 @@ widget "*%s*" style "scale_style"
self.connect( "expose-event", self.expose )
self.connect( "size-allocate", self.size_allocate )
self.connect( "button-release-event", self.button_release )
+ adjustment.connect( "value-changed", self.value_changed )
def size_allocate( self, widget, allocation ):
self.alloc = allocation
@@ -139,6 +147,12 @@ widget "*%s*" style "scale_style"
if snap: self.snap = 1/snap
else: self.snap = False
self.queue_draw()
+
+ def value_changed( self, adjustment ):
+ if self.snap:
+ val = round(self.snap*self.get_value())/self.snap
+ if val != self.get_value():
+ self.set_value( val )
def expose( self, widget, event ):