Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramartin <olpc@localhost.localdomain>2007-01-08 06:28:57 (GMT)
committer amartin <olpc@localhost.localdomain>2007-01-08 06:28:57 (GMT)
commit10621ebbb7a9a63bd738626df28f103f3ce17b3f (patch)
tree773cad069f3205062508ce62dabcce5ac8dd08cd
parent81d464fb6bd13f9a93b52b90d537afc3b391f322 (diff)
more cleanup
sliders in edit mode
-rw-r--r--Config.py2
-rw-r--r--Edit/MainWindow.py349
-rw-r--r--Edit/MixerWindow.py2
-rw-r--r--Edit/NoteInterface.py29
-rw-r--r--Edit/TrackInterface.py134
-rw-r--r--Edit/TuneInterface.py34
-rw-r--r--Edit/rm/BackgroundView.py (renamed from Edit/BackgroundView.py)0
-rw-r--r--Edit/rm/NoteView.py (renamed from Edit/NoteView.py)0
-rw-r--r--Edit/rm/PageBankView.py (renamed from Edit/PageBankView.py)0
-rw-r--r--Edit/rm/PageView.py (renamed from Edit/PageView.py)0
-rw-r--r--Edit/rm/PositionIndicator.py (renamed from Edit/PositionIndicator.py)0
-rw-r--r--Edit/rm/TrackView.py (renamed from Edit/TrackView.py)0
-rw-r--r--Edit/rm/TunePageView.py (renamed from Edit/TunePageView.py)0
-rw-r--r--Edit/rm/TuneView.py (renamed from Edit/TuneView.py)0
-rw-r--r--Generation/VariationRythm.py2
-rwxr-xr-xResources/Images/sliderDrum.pngbin0 -> 3941 bytes
-rwxr-xr-xResources/Images/sliderEditTempo.pngbin0 -> 3909 bytes
-rwxr-xr-xResources/Images/sliderEditVolume.pngbin0 -> 3881 bytes
-rwxr-xr-xResources/Images/sliderInst1.pngbin0 -> 3927 bytes
-rwxr-xr-xResources/Images/sliderInst2.pngbin0 -> 3898 bytes
-rwxr-xr-xResources/Images/sliderInst3.pngbin0 -> 3911 bytes
-rwxr-xr-xResources/Images/sliderInst4.pngbin0 -> 3913 bytes
-rwxr-xr-xTamTam.py2
-rw-r--r--Util/NoteLooper.py19
-rw-r--r--Util/ThemeWidgets.py4
25 files changed, 279 insertions, 298 deletions
diff --git a/Config.py b/Config.py
index 068162a..a677b0c 100644
--- a/Config.py
+++ b/Config.py
@@ -420,7 +420,7 @@ ModKeys = _ModKeys()
#DEFAULTS
DEFAULT_TEMPO = 120
-DEFAULT_VOLUME = 0.8
+DEFAULT_VOLUME = 80
#NUMERICAL CONSTANTS
NUMBER_OF_POSSIBLE_PITCHES = 25.0
diff --git a/Edit/MainWindow.py b/Edit/MainWindow.py
index 2a7ab8e..f18b97c 100644
--- a/Edit/MainWindow.py
+++ b/Edit/MainWindow.py
@@ -3,30 +3,23 @@ pygtk.require( '2.0' )
import gtk
import gobject
-from GUI.Core.ThemeWidgets import *
+from Util.ThemeWidgets import *
import time
-from Framework.Constants import Constants
-from Framework.CSound.CSoundConstants import CSoundConstants
-from Framework.Generation.Generator import GenerationParameters
+import Config
-from GUI.GUIConstants import GUIConstants
-from GUI.GUIConstants import ModKeys
-from GUI.Core.MixerWindow import MixerWindow
-from GUI.Core.PageView import PageView
-from GUI.Core.TuneView import TuneView
-from GUI.Core.PageBankView import PageBankView
-from GUI.Generation.GenerationParametersWindow import GenerationParametersWindow
-from TrackInterface import TrackInterface
-from TuneInterface import TuneInterface
-from PositionIndicator import PositionIndicator
+from Edit.MixerWindow import MixerWindow
+from Generation.GenerationConstants import GenerationConstants
+from Generation.GenerationParametersWindow import GenerationParametersWindow
+from Edit.TrackInterface import TrackInterface
+from Edit.TuneInterface import TuneInterface
-from Framework.Core.Profiler import TP
+from Util.Profiler import TP
-from Framework.Generation.Generator import generator1, variate
+from Generation.Generator import generator1, variate
-from Framework.NoteLooper import *
+from Util.NoteLooper import *
def note_from_CSoundNote( csnote ):
note = {}
@@ -53,14 +46,14 @@ def note_from_CSoundNote( csnote ):
# The main TamTam window
#-----------------------------------
class MainWindow( gtk.EventBox ):
-
+
def __init__( self, CSoundClient ):
self.csnd = CSoundClient
def formatRoundBox( box, fillcolor ):
- box.set_radius( 10 )
+ box.set_radius( 7 )
box.set_border_width( 1 )
box.set_fill_color( fillcolor )
- box.set_border_color( "#EEE" )
+ box.set_border_color( "#FFF" )
return box
def init_GUI():
@@ -72,7 +65,7 @@ class MainWindow( gtk.EventBox ):
instrumentMenu = gtk.Menu()
instrumentMenuItem.set_submenu( instrumentMenu )
- instrumentNames = [ k for k in CSoundConstants.INSTRUMENTS.keys() if k[0:4] != 'drum' ] + ['drum1kit']
+ instrumentNames = [ k for k in Config.INSTRUMENTS.keys() if k[0:4] != 'drum' ] + ['drum1kit']
instrumentNames.sort()
for i in instrumentNames:
menuItem = gtk.MenuItem( i )
@@ -86,82 +79,119 @@ class MainWindow( gtk.EventBox ):
#-------------------------------------------------------------------------
# left panel
self.GUI["2leftPanel"] = gtk.VBox()
- # + edit panel
- self.GUI["2editPanel"] = gtk.HBox()
- # + + instrument panel
+ self.GUI["2leftPanel"].set_size_request( 137, -1 )
+ # + instrument panel
self.GUI["2instrumentPanel"] = gtk.VBox()
- self.GUI["2instrumentPanel"].set_size_request( 80, -1 )
- # + + + instrument 1 box
- self.GUI["2instrument1Box"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.GUI["2instrument1volumeAdjustment"] = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
+ # + + instrument 1 box
+ self.GUI["2instrument1Box"] = formatRoundBox( RoundHBox(), "#6C9790" )
+ self.GUI["2instrument1Box"].set_size_request( -1, 137 )
+ self.GUI["2instrument1volumeAdjustment"] = gtk.Adjustment( self._data["track_volume"][1], 0, 100, 1, 1, 0 )
self.GUI["2instrument1volumeAdjustment"].connect( "value_changed", self.onTrackVolumeChanged, 0 )
- self.GUI["2instrument1volumeSlider"] = gtk.VScale( self.GUI["2instrument1volumeAdjustment"] )
- self.GUI["2instrument1Box"].pack_start( self.GUI["2instrument1volumeSlider"] )
+ self.GUI["2instrument1volumeSlider"] = ImageVScale( Config.IMAGE_ROOT+"sliderInst1.png", self.GUI["2instrument1volumeAdjustment"], 6 )
+ self.GUI["2instrument1volumeSlider"].set_inverted(True)
+ self.GUI["2instrument1volumeSlider"].set_size_request( 30, -1 )
+ self.GUI["2instrument1volumeAdjustment"].connect( "value-changed", self.handleTrackVolume, 0 )
+ self.GUI["2instrument1Box"].pack_start( self.GUI["2instrument1volumeSlider"], False, False, 0 )
#self.GUI["2instrument1Button"] = gtk.Button("Inst 1")
#self.GUI["2instrument1Box"].pack_start( self.GUI["2instrument1Button"] )
self.GUI["2instrument1Box"].pack_start( track_menu(0,'?') )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2instrument1Box"] )
- # + + + instrument 2 box
- self.GUI["2instrument2Box"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.GUI["2instrument2volumeAdjustment"] = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
+ # + + instrument 2 box
+ self.GUI["2instrument2Box"] = formatRoundBox( RoundHBox(), "#6C9790" )
+ self.GUI["2instrument2Box"].set_size_request( -1, 137 )
+ self.GUI["2instrument2volumeAdjustment"] = gtk.Adjustment( self._data["track_volume"][1], 0, 100, 1, 1, 0 )
self.GUI["2instrument2volumeAdjustment"].connect( "value_changed", self.onTrackVolumeChanged, 1 )
- self.GUI["2instrument2volumeSlider"] = gtk.VScale( self.GUI["2instrument2volumeAdjustment"] )
- self.GUI["2instrument2Box"].pack_start( self.GUI["2instrument2volumeSlider"] )
+ self.GUI["2instrument2volumeSlider"] = ImageVScale( Config.IMAGE_ROOT+"sliderInst2.png", self.GUI["2instrument2volumeAdjustment"], 6 )
+ self.GUI["2instrument2volumeSlider"].set_inverted(True)
+ self.GUI["2instrument2volumeSlider"].set_size_request( 30, -1 )
+ self.GUI["2instrument2volumeAdjustment"].connect( "value-changed", self.handleTrackVolume, 1 )
+ self.GUI["2instrument2Box"].pack_start( self.GUI["2instrument2volumeSlider"], False, False, 0 )
#self.GUI["2instrument2Button"] = gtk.Button("Inst 2")
#self.GUI["2instrument2Box"].pack_start( self.GUI["2instrument2Button"] )
self.GUI["2instrument2Box"].pack_start( track_menu(1,'?') )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2instrument2Box"] )
- # + + + instrument 3 box
- self.GUI["2instrument3Box"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.volumeAdjustment = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
- self.GUI["2instrument3volumeAdjustment"] = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
+ # + + instrument 3 box
+ self.GUI["2instrument3Box"] = formatRoundBox( RoundHBox(), "#6C9790" )
+ self.GUI["2instrument3Box"].set_size_request( -1, 137 )
+ self.GUI["2instrument3volumeAdjustment"] = gtk.Adjustment( self._data["track_volume"][2], 0, 100, 1, 1, 0 )
self.GUI["2instrument3volumeAdjustment"].connect( "value_changed", self.onTrackVolumeChanged, 2 )
- self.GUI["2instrument3volumeSlider"] = gtk.VScale( self.GUI["2instrument3volumeAdjustment"] )
- self.GUI["2instrument3Box"].pack_start( self.GUI["2instrument3volumeSlider"] )
+ self.GUI["2instrument3volumeSlider"] = ImageVScale( Config.IMAGE_ROOT+"sliderInst3.png", self.GUI["2instrument3volumeAdjustment"], 6 )
+ self.GUI["2instrument3volumeSlider"].set_inverted(True)
+ self.GUI["2instrument3volumeSlider"].set_size_request( 30, -1 )
+ self.GUI["2instrument3volumeAdjustment"].connect( "value-changed", self.handleTrackVolume, 2 )
+ self.GUI["2instrument3Box"].pack_start( self.GUI["2instrument3volumeSlider"], False, False, 0 )
#self.GUI["2instrument3Button"] = gtk.Button("Inst 3")
#self.GUI["2instrument3Box"].pack_start( self.GUI["2instrument3Button"] )
self.GUI["2instrument3Box"].pack_start( track_menu(2,'?') )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2instrument3Box"] )
- # + + + instrument 4 box
- self.GUI["2instrument4Box"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.GUI["2instrument4volumeAdjustment"] = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
+ # + + instrument 4 box
+ self.GUI["2instrument4Box"] = formatRoundBox( RoundHBox(), "#6C9790" )
+ self.GUI["2instrument4Box"].set_size_request( -1, 137 )
+ self.GUI["2instrument4volumeAdjustment"] = gtk.Adjustment( self._data["track_volume"][3], 0, 100, 1, 1, 0 )
self.GUI["2instrument4volumeAdjustment"].connect( "value_changed", self.onTrackVolumeChanged, 3 )
- self.GUI["2instrument4volumeSlider"] = gtk.VScale( self.GUI["2instrument4volumeAdjustment"] )
- self.GUI["2instrument4Box"].pack_start( self.GUI["2instrument4volumeSlider"] )
+ self.GUI["2instrument4volumeSlider"] = ImageVScale( Config.IMAGE_ROOT+"sliderInst4.png", self.GUI["2instrument4volumeAdjustment"], 6 )
+ self.GUI["2instrument4volumeSlider"].set_inverted(True)
+ self.GUI["2instrument4volumeSlider"].set_size_request( 30, -1 )
+ self.GUI["2instrument4volumeAdjustment"].connect( "value-changed", self.handleTrackVolume, 3 )
+ self.GUI["2instrument4Box"].pack_start( self.GUI["2instrument4volumeSlider"], False, False, 0 )
#self.GUI["2instrument4Button"] = gtk.Button("Inst 4")
#self.GUI["2instrument4Box"].pack_start( self.GUI["2instrument4Button"] )
self.GUI["2instrument4Box"].pack_start( track_menu(3,'?') )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2instrument4Box"] )
- # + + + drum box
- self.GUI["2drumBox"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.GUI["2drumvolumeAdjustment"] = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
+ # + + drum box
+ self.GUI["2drumBox"] = formatRoundBox( RoundHBox(), "#6C9790" )
+ self.GUI["2drumBox"].set_size_request( -1, 165 )
+ self.GUI["2drumvolumeAdjustment"] = gtk.Adjustment( self._data["track_volume"][4], 0, 100, 1, 1, 0 )
self.GUI["2drumvolumeAdjustment"].connect( "value_changed", self.onTrackVolumeChanged, 4 )
- self.GUI["2drumvolumeSlider"] = gtk.VScale( self.GUI["2drumvolumeAdjustment"] )
- self.GUI["2drumBox"].pack_start( self.GUI["2drumvolumeSlider"] )
+ self.GUI["2drumvolumeSlider"] = ImageVScale( Config.IMAGE_ROOT+"sliderDrum.png", self.GUI["2drumvolumeAdjustment"], 6 )
+ self.GUI["2drumvolumeSlider"].set_inverted(True)
+ self.GUI["2drumvolumeSlider"].set_size_request( 30, -1 )
+ self.GUI["2drumvolumeAdjustment"].connect( "value-changed", self.handleTrackVolume, 4 )
+ self.GUI["2drumBox"].pack_start( self.GUI["2drumvolumeSlider"], False, False, 0 )
self.GUI["2drumButton"] = gtk.Button("?")
self.GUI["2drumBox"].pack_start( self.GUI["2drumButton"] )
#self.GUI["2instrument1Box"].pack_start( track_menu(4,'?') )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2drumBox"] )
- self.GUI["2editPanel"].pack_start( self.GUI["2instrumentPanel"], False )
- # + + track interface
+ self.GUI["2leftPanel"].pack_start( self.GUI["2instrumentPanel"], False )
+ # + volume panel
+ self.GUI["2volumePanel"] = formatRoundBox( RoundHBox(), "#6C9790" )
+ # + + volume box
+ self.GUI["2volumeBox"] = gtk.VBox()
+ self.GUI["2volumeImage"] = gtk.Image()
+ self.GUI["2volumeImage"].set_from_file( Config.IMAGE_ROOT+"volume2.png" )
+ self.GUI["2volumeBox"].pack_start( self.GUI["2volumeImage"], False )
+ self.GUI["2volumeAdjustment"] = gtk.Adjustment( self._data["volume"], 0, 100, 1, 1, 0 )
+ self.GUI["2volumeSlider"] = ImageVScale( Config.IMAGE_ROOT+"sliderEditVolume.png", self.GUI["2volumeAdjustment"], 6 )
+ self.GUI["2volumeSlider"].set_inverted(True)
+ self.GUI["2volumeAdjustment"].connect( "value-changed", self.handleVolume )
+ self.GUI["2volumeBox"].pack_start( self.GUI["2volumeSlider"] )
+ self.GUI["2volumePanel"].pack_start( self.GUI["2volumeBox"] )
+ # + + tempo box
+ self.GUI["2tempoBox"] = gtk.VBox()
+ self.GUI["2tempoImage"] = gtk.Image()
+ self.GUI["2tempoImage"].set_from_file( Config.IMAGE_ROOT+"tempo3.png" )
+ self.GUI["2tempoBox"].pack_start( self.GUI["2tempoImage"], False )
+ self.GUI["2tempoAdjustment"] = gtk.Adjustment( self._data["tempo"], 40, 240, 1, 1, 0 )
+ self.GUI["2tempoSlider"] = ImageVScale( Config.IMAGE_ROOT+"sliderEditTempo.png", self.GUI["2tempoAdjustment"], 6 )
+ self.GUI["2tempoSlider"].set_inverted(True)
+ self.GUI["2tempoAdjustment"].connect( "value-changed", self.handleTempo )
+ self.GUI["2tempoBox"].pack_start( self.GUI["2tempoSlider"] )
+ self.GUI["2volumePanel"].pack_start( self.GUI["2tempoBox"] )
+ self.GUI["2leftPanel"].pack_start( self.GUI["2volumePanel"] )
+ self.GUI["2main"].pack_start( self.GUI["2leftPanel"], False )
+
+ #------------------------------------------------------------------------
+ # right panel
+ self.GUI["2rightPanel"] = gtk.VBox()
+ # + track interface
self.trackInterface = TrackInterface( self.onTrackInterfaceNoteDrag )
- self.GUI["2editPanel"].pack_start( self.trackInterface )
- self.GUI["2leftPanel"].pack_start( self.GUI["2editPanel"] )
- # + tune box
- self.GUI["2tuneBox"] = formatRoundBox( RoundVBox(), "#9FB" )
- self.GUI["2tuneBox"].set_size_request( -1, 80 )
- self.GUI["2tuneScrolledWindow"] = gtk.ScrolledWindow()
- self.GUI["2tuneScrolledWindow"].set_policy( gtk.POLICY_ALWAYS, gtk.POLICY_NEVER )
- self.GUI["2tuneScrolledWindow"].set_shadow_type(gtk.SHADOW_NONE)
- self.tuneInterface = TuneInterface( self )
- self.GUI["2tuneScrolledWindow"].add_with_viewport( self.tuneInterface )
- self.GUI["2tuneBox"].pack_start( self.GUI["2tuneScrolledWindow"] )
- self.GUI["2leftPanel"].pack_start( self.GUI["2tuneBox"], False )
+ self.trackInterface.set_size_request( -1, 713 )
+ self.GUI["2rightPanel"].pack_start( self.trackInterface, False, False, 0 )
# + tool panel
self.GUI["2toolPanel"] = gtk.HBox()
- self.GUI["2toolPanel"].set_size_request( -1, 80 )
+ self.GUI["2toolPanel"].set_size_request( -1, 75 )
# + + page box
- self.GUI["2pageBox"] = formatRoundBox( RoundHBox(), "#9FB" )
+ self.GUI["2pageBox"] = formatRoundBox( RoundHBox(), "#6C9790" )
self.GUI["2pageDeleteButton"] = gtk.Button("Delete")
self.GUI["2pageDeleteButton"].connect( "clicked", lambda a1:self.removePages() )
self.GUI["2pageBox"].pack_start( self.GUI["2pageDeleteButton"] )
@@ -173,7 +203,7 @@ class MainWindow( gtk.EventBox ):
self.GUI["2pageBox"].pack_start( self.GUI["2pageDuplicateButton"] )
self.GUI["2toolPanel"].pack_start( self.GUI["2pageBox"], False )
# + + transport box
- self.GUI["2transportBox"] = formatRoundBox( RoundHBox(), "#9FB" )
+ self.GUI["2transportBox"] = formatRoundBox( RoundHBox(), "#6C9790" )
#self.GUI["2pageBox"].set_size_request( 120, -1 )
self.GUI["2generateButton"] = gtk.Button("Gen")
self.GUI["2generateButton"].connect( "clicked", self.handleGenerate, None )
@@ -189,88 +219,54 @@ class MainWindow( gtk.EventBox ):
self.GUI["2transportBox"].pack_start( self.GUI["2loopButton"] )
self.GUI["2toolPanel"].pack_start( self.GUI["2transportBox"] )
# + + tool box
- self.GUI["2toolBox"] = formatRoundBox( RoundHBox(), "#9FB" )
+ self.GUI["2toolBox"] = formatRoundBox( RoundHBox(), "#6C9790" )
self.GUI["2toolPencilButton"] = gtk.Button("Pencil")
self.GUI["2toolBox"].pack_start( self.GUI["2toolPencilButton"] )
self.GUI["2toolPointerButton"] = gtk.Button("Pointer")
self.GUI["2toolBox"].pack_start( self.GUI["2toolPointerButton"] )
self.GUI["2toolPanel"].pack_start( self.GUI["2toolBox"] )
- self.GUI["2leftPanel"].pack_start( self.GUI["2toolPanel"], False )
- self.GUI["2main"].pack_start( self.GUI["2leftPanel"] )
-
- #------------------------------------------------------------------------
- # right panel
- self.GUI["2rightPanel"] = gtk.VBox()
- self.GUI["2rightPanel"].set_size_request( 80, -1 )
- # + mode panel
- self.GUI["2modePanel"] = gtk.HBox()
- self.GUI["2modePanel"].set_size_request( -1, 30 )
- # + + mode 1 box
- self.GUI["2mode1Box"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.GUI["2mode1Button"] = gtk.Button("I")
- self.GUI["2mode1Box"].pack_start( self.GUI["2mode1Button"] )
- self.GUI["2modePanel"].pack_start( self.GUI["2mode1Box"] )
- # + + mode 3 box
- self.GUI["2mode3Box"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.GUI["2mode3Button"] = gtk.Button("III")
- self.GUI["2mode3Box"].pack_start( self.GUI["2mode3Button"] )
- self.GUI["2modePanel"].pack_start( self.GUI["2mode3Box"] )
- self.GUI["2rightPanel"].pack_start( self.GUI["2modePanel"], False )
- # + title box
- self.GUI["2titleBox"] = formatRoundBox( RoundVBox(), "#9FB" )
- self.GUI["2titleImage"] = gtk.Image()
- self.GUI["2titleImage"].set_from_file( "Resources/Images/add.png" )
- self.GUI["2titleBox"].pack_start( self.GUI["2titleImage"] )
- self.GUI["2rightPanel"].pack_start( self.GUI["2titleBox"] )
- # + save box
- self.GUI["2saveBox"] = formatRoundBox( RoundVBox(), "#9FB" )
- self.GUI["2saveBox"].set_size_request( -1, 120 )
- self.GUI["2saveButton"] = gtk.Button("Save")
- self.GUI["2saveBox"].pack_start( self.GUI["2saveButton"] )
- self.GUI["2meshButton"] = gtk.Button("Mesh")
- self.GUI["2saveBox"].pack_start( self.GUI["2meshButton"] )
- self.GUI["2rightPanel"].pack_start( self.GUI["2saveBox"], False )
- self.GUI["2saveButton"].connect("clicked", self.handleSave, None )
- self.GUI["2meshButton"].connect("clicked", self.handleLoad, None )
-
- # + volume box
- self.GUI["2volumeBox"] = formatRoundBox( RoundHBox(), "#9FB" )
- self.GUI["2volumeAdjustment"] = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
- self.GUI["2volumeSlider"] = ImageVScale( "Resources/Images/sliderbutbleu.png", self.GUI["2volumeAdjustment"], 22 )
- self.GUI["2volumeBox"].pack_start( self.GUI["2volumeSlider"] )
- self.GUI["2tempoAdjustment"] = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
- self.GUI["2tempoSlider"] = ImageVScale( "Resources/Images/sliderbutbleu.png", self.GUI["2tempoAdjustment"], 22 )
- self.GUI["2volumeBox"].pack_start( self.GUI["2tempoSlider"] )
- self.GUI["2rightPanel"].pack_start( self.GUI["2volumeBox"] )
- self.GUI["2main"].pack_start( self.GUI["2rightPanel"], False )
+ self.GUI["2rightPanel"].pack_start( self.GUI["2toolPanel"], False )
+ # + tune box
+ self.GUI["2tuneBox"] = formatRoundBox( RoundVBox(), "#6C9790" )
+ self.GUI["2tuneScrolledWindow"] = gtk.ScrolledWindow()
+ self.GUI["2tuneScrolledWindow"].set_policy( gtk.POLICY_ALWAYS, gtk.POLICY_NEVER )
+ self.GUI["2tuneScrolledWindow"].set_shadow_type(gtk.SHADOW_NONE)
+ self.tuneInterface = TuneInterface( self )
+ self.GUI["2tuneScrolledWindow"].add_with_viewport( self.tuneInterface )
+ self.GUI["2tuneBox"].pack_start( self.GUI["2tuneScrolledWindow"] )
+ self.GUI["2rightPanel"].pack_start( self.GUI["2tuneBox"] )
+ self.GUI["2main"].pack_start( self.GUI["2rightPanel"] )
self.add( self.GUI["2main"] )
self.addPage( 0, 4 ) # yeah! a page!
+
def init_data( ):
self._data = {}
#[ volume, ... ]
- self._data['track_volume'] = [ Constants.DEFAULT_VOLUME ] * Constants.NUMBER_OF_TRACKS
- self._data['track_mute'] = [ 1.0 ] * Constants.NUMBER_OF_TRACKS
+ self._data['track_volume'] = [ Config.DEFAULT_VOLUME ] * Config.NUMBER_OF_TRACKS
+ self._data['track_mute'] = [ 1.0 ] * Config.NUMBER_OF_TRACKS
#[ instrument index, ... ]
track_inst = [
- CSoundConstants.FLUTE,
- CSoundConstants.KOTO,
- CSoundConstants.GAM,
- CSoundConstants.GUIT,
- CSoundConstants.DRUM1KIT ]
- if len(track_inst) != Constants.NUMBER_OF_TRACKS: raise 'error'
-
- self._data['track_inst'] = track_inst + [CSoundConstants.FLUTE] * (Constants.NUMBER_OF_TRACKS - len( track_inst) )
+ Config.FLUTE,
+ Config.KOTO,
+ Config.GAM,
+ Config.GUIT,
+ Config.DRUM1KIT ]
+ if len(track_inst) != Config.NUMBER_OF_TRACKS: raise 'error'
+
+ self._data['track_inst'] = track_inst + [Config.FLUTE] * (Config.NUMBER_OF_TRACKS - len( track_inst) )
#{ pageId: { [track 0 = note list], [track 2 = note list], ... ] }
npages = 40
nbeats = 4
+ self._data['volume'] = Config.DEFAULT_VOLUME
self._data['page_beats'] = [nbeats for p in range(npages)]
- self._data['tempo'] = Constants.DEFAULT_TEMPO
+ self._data['tempo'] = Config.DEFAULT_TEMPO
+ self._data['ticks_per_sec'] = self._data['tempo'] * 0.2 # 12 BPM / 60 SPM
self._data['tune'] = []
self._data['notebin'] = []
self._noteId = {}
@@ -334,22 +330,6 @@ class MainWindow( gtk.EventBox ):
self.tamTamLabel = gtk.Label( " TAM - TAM " )
self.globalControlsBox.pack_start( self.tamTamLabel )
- self.mainSlidersBox = gtk.HBox()
- self.volumeAdjustment = gtk.Adjustment( 50, 0, 100, 1, 1, 0 )
- self.volumeAdjustment.connect( "value_changed", self.onVolumeChanged, None )
- self.volumeSlider = gtk.VScale( self.volumeAdjustment )
- self.volumeSlider.set_draw_value( False )
- self.volumeSlider.set_digits( 0 )
- self.volumeSlider.set_inverted( True )
- self.mainSlidersBox.pack_start( self.volumeSlider, True, True, 4 )
-
- self.tempoAdjustment = gtk.Adjustment( 100, 60, 180, 1, 1, 0 )
- self.tempoAdjustment.connect( "value_changed", self.onTempoChanged, None )
- self.tempoSlider = gtk.VScale( self.tempoAdjustment )
- self.tempoSlider.set_draw_value( False )
- self.tempoSlider.set_digits( 0 )
- self.tempoSlider.set_inverted( True )
- self.mainSlidersBox.pack_start( self.tempoSlider )
self.beatsPerPageAdjustment = gtk.Adjustment( 4, 1, 8, 1, 1, 0 )
self.beatsPerPageAdjustment.connect( "value_changed", self.updateNumberOfBars, None )
@@ -359,9 +339,9 @@ class MainWindow( gtk.EventBox ):
self.barsSlider.set_inverted( True )
self.barsSlider.set_increments( 1, 1 )
self.barsSlider.set_update_policy( gtk.UPDATE_DELAYED )
- self.mainSlidersBox.pack_start( self.barsSlider )
+ #self.mainSlidersBox.pack_start( self.barsSlider )
- self.globalControlsBox.pack_start( self.mainSlidersBox )
+ #self.globalControlsBox.pack_start( self.mainSlidersBox )
self.olpcLabel = gtk.Label( "OLPC" )
self.globalControlsBox.pack_start( self.olpcLabel )
@@ -401,7 +381,7 @@ class MainWindow( gtk.EventBox ):
def setupTrackControls( ):
self.trackControlsBox = gtk.VBox()
self.instrumentRecordButtons = {}
- for trackId in range( Constants.NUMBER_OF_TRACKS):
+ for trackId in range( Config.NUMBER_OF_TRACKS):
trackControlsBox = gtk.HBox()
#setup instrument controls
@@ -412,7 +392,7 @@ class MainWindow( gtk.EventBox ):
instrumentMenuItem.set_submenu( instrumentMenu )
instrumentNames = []
- instrumentFolderNames = CSoundConstants.INSTRUMENTS.keys()
+ instrumentFolderNames = Config.INSTRUMENTS.keys()
for instrumentName in instrumentFolderNames:
if not instrumentName[0: 4] == 'drum':
instrumentNames.append( instrumentName )
@@ -486,17 +466,17 @@ class MainWindow( gtk.EventBox ):
self.noteLooper = NoteLooper(
0.2,
- Constants.DEFAULT_TEMPO * 0.2, #0.2 currently converts beats per second to seconds_per_tick
+ Config.DEFAULT_TEMPO * 0.2, #0.2 currently converts beats per second to seconds_per_tick
[e for e in self._data['track_inst']],
[e for e in self._data['track_volume']],
[e for e in self._data['track_mute']])
self.csnd.setMasterVolume( self.getVolume() )
- #for pageId in range( GUIConstants.NUMBER_OF_PAGE_BANK_ROWS * GUIConstants.NUMBER_OF_PAGE_BANK_COLUMNS ):
+ #for pageId in range( GUIConfig.NUMBER_OF_PAGE_BANK_ROWS * GUIConfig.NUMBER_OF_PAGE_BANK_COLUMNS ):
# self.pageBankView.addPage( pageId, False )
- for tid in range(Constants.NUMBER_OF_TRACKS):
+ for tid in range(Config.NUMBER_OF_TRACKS):
self.handleInstrumentChanged( ( tid, self._data['track_inst'][tid] ) )
#self.handleConfigureEvent( None, None ) # needs to come after pages have been added in initialize()
@@ -524,15 +504,15 @@ class MainWindow( gtk.EventBox ):
def handlePlay( self, widget, data ):
def shutOffCSound():
- for track in range( Constants.NUMBER_OF_TRACKS ):
+ for track in range( Config.NUMBER_OF_TRACKS ):
for i in range( 3 ):
csoundInstrument = i + 5001
- self.csnd.sendText( CSoundConstants.PLAY_NOTE_OFF_COMMAND % ( csoundInstrument, track ) )
+ self.csnd.sendText( Config.PLAY_NOTE_OFF_COMMAND % ( csoundInstrument, track ) )
if widget.get_active(): #play
#TODO: check for track activation, to not take all
- trackset = set(range(Constants.NUMBER_OF_TRACKS))
+ trackset = set(range(Config.NUMBER_OF_TRACKS))
self.noteLooper.clear() #erase all loaded notes
notes = []
@@ -542,12 +522,12 @@ class MainWindow( gtk.EventBox ):
for p in self.pages_playing:
notes += [(n['onset'] + pagedelay, n) for n in self._data['notebin'] \
if n['pageId']==p and n['trackId'] in trackset ]
- pagedelay += self._data['page_beats'][p] * Constants.TICKS_PER_BEAT
+ pagedelay += self._data['page_beats'][p] * Config.TICKS_PER_BEAT
self.noteLooper.insert(notes)
self.noteLooper.setDuration( pagedelay )
self.noteLooper.setTick(0) #TODO: get playback head position
- self.noteLooper.setRate( round( self.tempoAdjustment.value, 0 ) * 0.2 )
+ self.noteLooper.setRate( self._data['ticks_per_sec'] )
self.csnd.startTime()
cmds = self.noteLooper.next()
@@ -572,7 +552,7 @@ class MainWindow( gtk.EventBox ):
self.updateFPS()
curtick = self.noteLooper.getCurrentTick(0,True, time.time())
- curIdx = curtick / ( 4 * Constants.TICKS_PER_BEAT) #TODO handle each pages_playing length
+ curIdx = curtick / ( 4 * Config.TICKS_PER_BEAT) #TODO handle each pages_playing length
self.tuneInterface.displayPage( self.pages_playing[curIdx], 0 )
self.trackInterface.displayPage(self.pages_playing[curIdx], 4 ) #TODO: use page_beats
@@ -598,23 +578,30 @@ class MainWindow( gtk.EventBox ):
self.noteLooper.setInstrument(id, instrumentName)
recordButton = self.instrumentRecordButtons[ id ]
- if instrumentName in CSoundConstants.RECORDABLE_INSTRUMENTS:
+ if instrumentName in Config.RECORDABLE_INSTRUMENTS:
recordButton.show()
recordButton.connect( "clicked",
self.handleMicRecord,
- CSoundConstants.RECORDABLE_INSTRUMENT_CSOUND_IDS[ instrumentName ] )
+ Config.RECORDABLE_INSTRUMENT_CSOUND_IDS[ instrumentName ] )
else:
recordButton.hide()
- def onVolumeChanged( self, widget, data ):
- self.csnd.setMasterVolume(self.getVolume())
-
- def onTempoChanged( self, widget, data ):
- tempo = round( self.tempoAdjustment.value, 0 )
- ticks_per_sec = tempo * 0.2 # 12 BPM / 60 SPM
-
- self._data['tempo'] = tempo
- self.noteLooper.setRate(ticks_per_sec)
+ def handleVolume( self, widget ):
+ self._data["volume"] = round( widget.get_value() )
+ self.csnd.setMasterVolume(self._data["volume"])
+ img = min(3,int(4*self._data["volume"]/100)) # volume 0-3
+ self.GUI["2volumeImage"].set_from_file( Config.IMAGE_ROOT+"volume"+str(img)+".png" )
+
+ def handleTrackVolume( self, widget, track ):
+ self._data["track_volume"][track] = round( widget.get_value() )
+
+ def handleTempo( self, widget ):
+ self._data['tempo'] = round( widget.get_value() )
+ self._data['ticks_per_sec'] = self._data['tempo'] * 0.2 # 12 BPM / 60 SPM
+ self.noteLooper.setRate(self._data['ticks_per_sec'])
+ img = min(7,int(8*(self._data["tempo"]-widget.lower)/(widget.upper-widget.lower)))+1# tempo 1-8
+ self.GUI["2tempoImage"].set_from_file( Config.IMAGE_ROOT+"tempo"+str(img)+".png" )
+
def onKeyboardButton( self, widget, data ):
self.kb_active = widget.get_active()
@@ -689,13 +676,13 @@ class MainWindow( gtk.EventBox ):
def recompose( self, algo, params):
def none_to_all(tracks):
print 'tracks = ',tracks
- if tracks == []: return set(range(0,Constants.NUMBER_OF_TRACKS))
+ if tracks == []: return set(range(0,Config.NUMBER_OF_TRACKS))
else: return set(tracks)
dict = {}
- for t in range(Constants.NUMBER_OF_TRACKS):
+ for t in range(Config.NUMBER_OF_TRACKS):
dict[t] = {}
- for p in range(Constants.NUMBER_OF_PAGES):
+ for p in range(Config.NUMBER_OF_PAGES):
dict[t][p] = []
newtracks = none_to_all( self.trackInterface.getSelectedTracks())
@@ -946,11 +933,11 @@ class MainWindow( gtk.EventBox ):
#-----------------------------------
def onKeyPress(self,widget,event):
- ModKeys.keyPress( event.hardware_keycode )
+ Config.ModKeys.keyPress( event.hardware_keycode )
key = event.hardware_keycode
- if key == 53 and ModKeys.ctrlDown: # q == 53
+ if key == 53 and Config.ModKeys.ctrlDown: # q == 53
self.destroy( self )
if not self.kb_active:
@@ -977,14 +964,14 @@ class MainWindow( gtk.EventBox ):
instrument = self._data['track_inst'][min(self.getSelectedtrackIds())]
if instrument == 'drum1kit':
- if GenerationConstants.DRUMPITCH.has_key( pitch ):
- instrument = CSoundConstants.DRUM1INSTRUMENTS[ GenerationConstants.DRUMPITCH[ pitch ] ]
+ if GenerationConfig.DRUMPITCH.has_key( pitch ):
+ instrument = Config.DRUM1INSTRUMENTS[ GenerationConfig.DRUMPITCH[ pitch ] ]
else:
- instrument = CSoundConstants.DRUM1INSTRUMENTS[ pitch ]
+ instrument = Config.DRUM1INSTRUMENTS[ pitch ]
pitch = 36
duration = 100
- if CSoundConstants.INSTRUMENTS[instrument].csoundInstrumentID == 102:
+ if Config.INSTRUMENTS[instrument].csoundInstrumentID == 102:
duration = 100
# Create and play the note
@@ -1001,7 +988,7 @@ class MainWindow( gtk.EventBox ):
def onKeyRelease(self,widget,event):
- ModKeys.keyRelease( event.hardware_keycode )
+ Config.ModKeys.keyRelease( event.hardware_keycode )
if not self.kb_active:
return
@@ -1055,11 +1042,11 @@ class MainWindow( gtk.EventBox ):
#def handleConfigureEvent( self, widget, event ):
# mainBoxRect = self.trackPagesBox.get_allocation()
- #self.tuneView.set_size_request( mainBoxRect.width, GUIConstants.PAGE_HEIGHT +
+ #self.tuneView.set_size_request( mainBoxRect.width, GUIConfig.PAGE_HEIGHT +
# self.tuneView.get_hscrollbar().get_allocation().height + 10 )
#self.tuneView.show_all()
- #self.pageBankView.set_size_request( mainBoxRect.width, GUIConstants.PAGE_HEIGHT * GUIConstants.NUMBER_OF_PAGE_BANK_ROWS )
+ #self.pageBankView.set_size_request( mainBoxRect.width, GUIConfig.PAGE_HEIGHT * GUIConfig.NUMBER_OF_PAGE_BANK_ROWS )
#self.pageBankView.show_all()
#mainViewRect = self.mainView.get_allocation()
@@ -1072,7 +1059,7 @@ class MainWindow( gtk.EventBox ):
# access functions (not sure if this is the best way to go about doing this)
#-----------------------------------
def getVolume( self ):
- return round( self.volumeAdjustment.value, 0 )
+ return self._data["volume"]
def getTempo( self ):
return round( self.tempoAdjustment.value, 0 )
diff --git a/Edit/MixerWindow.py b/Edit/MixerWindow.py
index b630856..12cd46b 100644
--- a/Edit/MixerWindow.py
+++ b/Edit/MixerWindow.py
@@ -2,7 +2,7 @@ import pygtk
pygtk.require('2.0')
import gtk
-from Framework.Constants import Constants
+import Config
class MixerWindow( gtk.Window ):
def __init__(self):
diff --git a/Edit/NoteInterface.py b/Edit/NoteInterface.py
index 93ffed3..43ae376 100644
--- a/Edit/NoteInterface.py
+++ b/Edit/NoteInterface.py
@@ -2,8 +2,7 @@ import pygtk
pygtk.require( '2.0' )
import gtk
-from Framework.Constants import Constants
-from GUI.GUIConstants import GUIConstants
+import Config
class NoteInterface:
@@ -16,7 +15,7 @@ class NoteInterface:
self.x = 0
self.y = 0
self.width = 1
- self.height = GUIConstants.NOTE_HEIGHT
+ self.height = Config.NOTE_HEIGHT
self.updateParams( pitch, onset, duration, amplitude )
@@ -77,9 +76,9 @@ class NoteInterface:
def updateDragLimits( self, dragLimits, leftBound, rightBound, widthBound ):
left = leftBound - self.onset
right = rightBound - self.duration - self.onset
- up = Constants.MAXIMUM_PITCH - self.pitch
- down = Constants.MINIMUM_PITCH - self.pitch
- short = Constants.MINIMUM_NOTE_DURATION - self.duration
+ up = Config.MAXIMUM_PITCH - self.pitch
+ down = Config.MINIMUM_PITCH - self.pitch
+ short = Config.MINIMUM_NOTE_DURATION - self.duration
long = widthBound - self.duration - self.onset
if dragLimits[0][0] < left: dragLimits[0][0] = left
@@ -127,11 +126,11 @@ class NoteInterface:
if event.type == gtk.gdk._2BUTTON_PRESS: # select bar
self.potentialDeselect = False
start = 0
- check = self.onset - Constants.TICKS_PER_BEAT
- while start <= check: start += Constants.TICKS_PER_BEAT
- stop = start + Constants.TICKS_PER_BEAT
+ check = self.onset - Config.TICKS_PER_BEAT
+ while start <= check: start += Config.TICKS_PER_BEAT
+ stop = start + Config.TICKS_PER_BEAT
check += self.duration
- while stop < check: stop += Constants.TICKS_PER_BEAT
+ while stop < check: stop += Config.TICKS_PER_BEAT
emitter.selectNotesByBar( self.track, start, stop )
elif event.type == gtk.gdk._3BUTTON_PRESS: # select track
self.potentialDeselect = False
@@ -254,12 +253,12 @@ class NoteInterface:
if False:
- context.set_line_width( GUIConstants.NOTE_BORDER_SIZE )
+ context.set_line_width( Config.NOTE_BORDER_SIZE )
- context.move_to( self.x + GUIConstants.NOTE_BORDER_SIZE_DIV2, self.y + GUIConstants.NOTE_BORDER_SIZE_DIV2 )
- context.rel_line_to( self.width - GUIConstants.NOTE_BORDER_SIZE, 0 )
- context.rel_line_to( 0, self.height - GUIConstants.NOTE_BORDER_SIZE )
- context.rel_line_to( -self.width + GUIConstants.NOTE_BORDER_SIZE, 0 )
+ context.move_to( self.x + Config.NOTE_BORDER_SIZE_DIV2, self.y + Config.NOTE_BORDER_SIZE_DIV2 )
+ context.rel_line_to( self.width - Config.NOTE_BORDER_SIZE, 0 )
+ context.rel_line_to( 0, self.height - Config.NOTE_BORDER_SIZE )
+ context.rel_line_to( -self.width + Config.NOTE_BORDER_SIZE, 0 )
context.close_path()
context.rectangle(self.x, self.y, self.width, self.height )
diff --git a/Edit/TrackInterface.py b/Edit/TrackInterface.py
index 2490da7..cb46c0c 100644
--- a/Edit/TrackInterface.py
+++ b/Edit/TrackInterface.py
@@ -4,13 +4,11 @@ import gtk
from math import floor
-from Framework.Constants import Constants
-from GUI.GUIConstants import GUIConstants
-from GUI.Core.NoteInterface import NoteInterface
-from GUI.Core.MainWindow import ModKeys
+import Config
+from Edit.NoteInterface import NoteInterface
#from GUI.Core.NoteParametersWindow import NoteParametersWindow
-from Framework.Core.Profiler import TP
+from Util.Profiler import TP
class SELECTNOTES:
ALL = -1
@@ -51,7 +49,7 @@ class TrackInterface( gtk.EventBox ):
self.trackSelected = []
self.selectedNotes = []
- for i in range(0,Constants.NUMBER_OF_TRACKS):
+ for i in range(0,Config.NUMBER_OF_TRACKS):
self.trackSelected.insert( 0, False )
self.selectedNotes.insert( 0, [] )
@@ -95,13 +93,13 @@ class TrackInterface( gtk.EventBox ):
p = noteParams["page"][i]
t = noteParams["track"][i]
if p not in at:
- at[p] = [0] * Constants.NUMBER_OF_TRACKS
+ at[p] = [0] * Config.NUMBER_OF_TRACKS
#at[p] = []
- #for j in range(Constants.NUMBER_OF_TRACKS): at[p].append(0)
+ #for j in range(Config.NUMBER_OF_TRACKS): at[p].append(0)
if p not in self.note:
- self.note[p] = map(lambda x:[], range(Constants.NUMBER_OF_TRACKS))
+ self.note[p] = map(lambda x:[], range(Config.NUMBER_OF_TRACKS))
#self.note[p] = []
- #for j in range(Constants.NUMBER_OF_TRACKS):
+ #for j in range(Config.NUMBER_OF_TRACKS):
#self.note[p].append( [] )
self.pageBeatCount[p] = noteParams["beatCount"][i]
self.pageNoteCount[p] = 0
@@ -148,7 +146,7 @@ class TrackInterface( gtk.EventBox ):
del modified[p]
for page in modified:
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
j = len(self.note[page][i])-1
while j >= 0:
if self.note[page][i][j] == None: del self.note[page][i][j]
@@ -164,7 +162,7 @@ class TrackInterface( gtk.EventBox ):
if page not in self.note: # create a blank page if the page doesn't already exist
self.note[page] = []
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
self.note[page].append( [] )
self.pageBeatCount[page] = beatCount
self.pageNoteCount[page] = 0
@@ -175,14 +173,14 @@ class TrackInterface( gtk.EventBox ):
self.beatCount = beatCount
# make sure this matches the calculation in size_allocate
- self.beatSpacing = (self.fullWidth - GUIConstants.BORDER_SIZE_MUL2 + GUIConstants.BEAT_LINE_SIZE)/self.beatCount
- self.width = self.beatSpacing * self.beatCount + GUIConstants.BORDER_SIZE_MUL2
- self.ticksPerPixel = float(self.beatCount * Constants.TICKS_PER_BEAT) / (self.width-2*GUIConstants.BORDER_SIZE)
+ self.beatSpacing = (self.fullWidth - Config.BORDER_SIZE_MUL2 + Config.BEAT_LINE_SIZE)/self.beatCount
+ self.width = self.beatSpacing * self.beatCount + Config.BORDER_SIZE_MUL2
+ self.ticksPerPixel = float(self.beatCount * Config.TICKS_PER_BEAT) / (self.width-2*Config.BORDER_SIZE)
self.pixelsPerTick = 1/self.ticksPerPixel
if self.pageBeatCount[self.curPage] != beatCount:
self.pageBeatCount[self.curPage] = beatCount
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
track = self.note[self.curPage][i]
map( lambda note:note.updateTransform( True ), track )
@@ -190,9 +188,9 @@ class TrackInterface( gtk.EventBox ):
self.invalidate_rect( 0, 0, self.fullWidth, self.height )
def setPlayhead( self, ticks ):
- self.invalidate_rect( self.playheadX, 0, GUIConstants.PLAYHEAD_SIZE, self.height )
- self.playheadX = self.ticksToPixels( ticks ) + GUIConstants.BORDER_SIZE
- self.invalidate_rect( self.playheadX, 0, GUIConstants.PLAYHEAD_SIZE, self.height )
+ self.invalidate_rect( self.playheadX, 0, Config.PLAYHEAD_SIZE, self.height )
+ self.playheadX = self.ticksToPixels( ticks ) + Config.BORDER_SIZE
+ self.invalidate_rect( self.playheadX, 0, Config.PLAYHEAD_SIZE, self.height )
def getSelectedTracks( self ):
r = []
@@ -203,7 +201,7 @@ class TrackInterface( gtk.EventBox ):
# private
def updateNoteMap( self, page ):
self.noteMap[page] = {}
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
for j in range(len(self.note[page][i])):
self.noteMap[page][self.note[page][i][j].getId()] = j
@@ -216,29 +214,29 @@ class TrackInterface( gtk.EventBox ):
self.drawingArea.set_size_request( width, height )
- self.trackHeight = (height - (Constants.NUMBER_OF_TRACKS-1)*GUIConstants.TRACK_SPACING) / Constants.NUMBER_OF_TRACKS
- self.height = self.trackHeight*Constants.NUMBER_OF_TRACKS + GUIConstants.TRACK_SPACING*(Constants.NUMBER_OF_TRACKS-1)
+ self.trackHeight = (height - (Config.NUMBER_OF_TRACKS-1)*Config.TRACK_SPACING) / Config.NUMBER_OF_TRACKS
+ self.height = self.trackHeight*Config.NUMBER_OF_TRACKS + Config.TRACK_SPACING*(Config.NUMBER_OF_TRACKS-1)
self.trackLimits = []
self.trackOrigin = []
- for i in range(Constants.NUMBER_OF_TRACKS):
- start = i*(self.trackHeight+GUIConstants.TRACK_SPACING)
+ for i in range(Config.NUMBER_OF_TRACKS):
+ start = i*(self.trackHeight+Config.TRACK_SPACING)
self.trackLimits.insert( i, (start,start+self.trackHeight) )
- self.trackOrigin.insert( i, (GUIConstants.BORDER_SIZE,start+GUIConstants.BORDER_SIZE) )
+ self.trackOrigin.insert( i, (Config.BORDER_SIZE,start+Config.BORDER_SIZE) )
self.fullWidth = width - 2 # cut off 2 pixels cause otherwise we try to draw on an area that gets cut off!?
# make sure this matches the calculations in updateBeatCount
- self.beatSpacing = (self.fullWidth - GUIConstants.BORDER_SIZE_MUL2 + GUIConstants.BEAT_LINE_SIZE)/self.beatCount
- self.width = self.beatSpacing * self.beatCount + GUIConstants.BORDER_SIZE_MUL2
- self.ticksPerPixel = float(self.beatCount * Constants.TICKS_PER_BEAT) / (self.width-2*GUIConstants.BORDER_SIZE)
+ self.beatSpacing = (self.fullWidth - Config.BORDER_SIZE_MUL2 + Config.BEAT_LINE_SIZE)/self.beatCount
+ self.width = self.beatSpacing * self.beatCount + Config.BORDER_SIZE_MUL2
+ self.ticksPerPixel = float(self.beatCount * Config.TICKS_PER_BEAT) / (self.width-2*Config.BORDER_SIZE)
self.pixelsPerTick = 1/self.ticksPerPixel
- self.pitchPerPixel = float(Constants.NUMBER_OF_POSSIBLE_PITCHES-1) / (self.trackHeight-2*GUIConstants.BORDER_SIZE-GUIConstants.NOTE_HEIGHT)
- self.pixelsPerPitch = float(self.trackHeight-2*GUIConstants.BORDER_SIZE-GUIConstants.NOTE_HEIGHT)/(Constants.MAXIMUM_PITCH - Constants.MINIMUM_PITCH)
+ self.pitchPerPixel = float(Config.NUMBER_OF_POSSIBLE_PITCHES-1) / (self.trackHeight-2*Config.BORDER_SIZE-Config.NOTE_HEIGHT)
+ self.pixelsPerPitch = float(self.trackHeight-2*Config.BORDER_SIZE-Config.NOTE_HEIGHT)/(Config.MAXIMUM_PITCH - Config.MINIMUM_PITCH)
# this could potentially take a loooong time, make sure they don't resize the window very often
for page in self.note:
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
track = self.note[page][i]
map( lambda note:note.updateTransform( False ), track )
@@ -256,12 +254,12 @@ class TrackInterface( gtk.EventBox ):
self.clickLoc = [ event.x, event.y ]
# check if we clicked on the playhead
- if event.x >= self.playheadX and event.x <= self.playheadX + GUIConstants.PLAYHEAD_SIZE:
+ if event.x >= self.playheadX and event.x <= self.playheadX + Config.PLAYHEAD_SIZE:
self.setCurrentAction( "playhead-drag", self )
TP.ProfileEnd( "TI::handleButtonPress" )
return
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
if self.trackLimits[i][0] > event.y: break
if self.trackLimits[i][1] < event.y: continue
@@ -294,7 +292,7 @@ class TrackInterface( gtk.EventBox ):
TP.ProfileBegin( "TI::handleButtonRelease" )
if not self.curAction: #do track selection stuff here so that we can also handle marquee selection
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
if self.trackLimits[i][0] > event.y: break
if self.trackLimits[i][1] < event.y: continue
if event.button == 1:
@@ -388,7 +386,7 @@ class TrackInterface( gtk.EventBox ):
def toggleTrack( self, trackN, exclusive ):
if exclusive:
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
self.trackSelected[i] = False
self.trackSelected[trackN] = True
self.invalidate_rect( 0, 0, self.width, self.height )
@@ -439,33 +437,33 @@ class TrackInterface( gtk.EventBox ):
self.selectedNotes[trackN].remove( notes[n] )
def selectNotesByBar( self, trackN, start, stop ):
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
if i == trackN:
notes = []
track = self.note[self.curPage][trackN]
for n in range(len(track)):
if track[n].testOnset( start, stop ): notes.append(track[n])
- if not ModKeys.ctrlDown: self.applyNoteSelection( SELECTNOTES.EXCLUSIVE, trackN, notes )
+ if not Config.ModKeys.ctrlDown: self.applyNoteSelection( SELECTNOTES.EXCLUSIVE, trackN, notes )
else: self.applyNoteSelection( SELECTNOTES.ADD, trackN, notes )
else:
- if not ModKeys.ctrlDown: self.applyNoteSelection( SELECTNOTES.NONE, i, [] )
+ if not Config.ModKeys.ctrlDown: self.applyNoteSelection( SELECTNOTES.NONE, i, [] )
self.selectionChanged()
def selectNotesByTrack( self, trackN ):
- if ModKeys.ctrlDown:
+ if Config.ModKeys.ctrlDown:
self.applyNoteSelection( SELECTNOTES.ALL, trackN, [] )
else:
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
if i == trackN: self.applyNoteSelection( SELECTNOTES.ALL, trackN, [] )
else: self.applyNoteSelection( SELECTNOTES.NONE, i, [] )
self.selectionChanged()
def selectNotes( self, noteDic ):
- if ModKeys.ctrlDown:
+ if Config.ModKeys.ctrlDown:
for i in noteDic:
self.applyNoteSelection( SELECTNOTES.FLIP, i, noteDic[i] )
else:
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
if i in noteDic: self.applyNoteSelection( SELECTNOTES.EXCLUSIVE, i, noteDic[i] )
else: self.applyNoteSelection( SELECTNOTES.NONE, i, [] )
self.selectionChanged()
@@ -476,15 +474,15 @@ class TrackInterface( gtk.EventBox ):
self.selectionChanged()
def clearSelectedNotes( self ):
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
self.applyNoteSelection( SELECTNOTES.NONE, i, [] )
self.selectionChanged()
def updateDragLimits( self ):
self.dragLimits = [ [-9999,9999], [-9999,9999], [-9999,9999] ] # initialize to big numbers!
- maxRightBound = self.beatCount * Constants.TICKS_PER_BEAT
+ maxRightBound = self.beatCount * Config.TICKS_PER_BEAT
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
if not len(self.selectedNotes[i]): continue # no selected notes here
track = self.note[self.curPage][i]
@@ -517,7 +515,7 @@ class TrackInterface( gtk.EventBox ):
dp = 0
dd = 0
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
self.onNoteDrag( [ note.noteDrag(self, do, dp, dd) for note in self.selectedNotes[i] ] )
def noteDragDuration( self, event ):
@@ -526,7 +524,7 @@ class TrackInterface( gtk.EventBox ):
dd = self.pixelsToTicks( event.x - self.clickLoc[0] )
dd = min( self.dragLimits[2][1], max( self.dragLimits[2][0], dd ) )
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
self.onNoteDrag( [ note.noteDrag(self, do, dp, dd) for note in self.selectedNotes[i] ] )
def noteDragPitch( self, event ):
@@ -535,11 +533,11 @@ class TrackInterface( gtk.EventBox ):
dp = min( self.dragLimits[1][1], max( self.dragLimits[1][0], dp ) )
dd = 0
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
self.onNoteDrag( [ note.noteDrag(self, do, dp, dd) for note in self.selectedNotes[i] ] )
def doneNoteDrag( self ):
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
for note in self.selectedNotes[i]:
note.doneNoteDrag( self )
@@ -584,7 +582,7 @@ class TrackInterface( gtk.EventBox ):
select = {}
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
intersectionY = [ max(self.marqueeRect[0][1],self.trackLimits[i][0]), min(stop[1],self.trackLimits[i][1]) ]
if intersectionY[0] > intersectionY[1]:
continue
@@ -607,23 +605,23 @@ class TrackInterface( gtk.EventBox ):
self.invalidate_rect( self.marqueeRect[0][0]-1, self.marqueeRect[0][1]-1, self.marqueeRect[1][0]+2, self.marqueeRect[1][1]+2 )
def updatePlayhead( self, event ):
- x = min( self.width - GUIConstants.BORDER_SIZE_MUL2 - self.pixelsPerTick, max( GUIConstants.BORDER_SIZE, event.x ) )
+ x = min( self.width - Config.BORDER_SIZE_MUL2 - self.pixelsPerTick, max( Config.BORDER_SIZE, event.x ) )
self.setPlayhead( self.pixelsToTicks( x ) )
def donePlayhead( self, event ):
- x = min( self.width - GUIConstants.BORDER_SIZE_MUL2, max( GUIConstants.BORDER_SIZE, event.x ) )
+ x = min( self.width - Config.BORDER_SIZE_MUL2, max( Config.BORDER_SIZE, event.x ) )
ticks = self.pixelsToTicks( x )
print "set playhead to %d ticks" % (ticks)
def updateTooltip( self, event ):
# check clicked the playhead
- if event.x >= self.playheadX and event.x <= self.playheadX + GUIConstants.PLAYHEAD_SIZE:
+ if event.x >= self.playheadX and event.x <= self.playheadX + Config.PLAYHEAD_SIZE:
self.setCursor("drag-playhead")
return
- for i in range(Constants.NUMBER_OF_TRACKS):
+ for i in range(Config.NUMBER_OF_TRACKS):
if self.trackLimits[i][0] > event.y: break
if self.trackLimits[i][1] < event.y: continue
@@ -665,17 +663,17 @@ class TrackInterface( gtk.EventBox ):
context = drawingArea.window.cairo_create()
context.set_antialias(0) # I don't know what to set this to to turn it off, and it doesn't seem to work anyway!?
- for i in range( Constants.NUMBER_OF_TRACKS):
+ for i in range( Config.NUMBER_OF_TRACKS):
if startY > self.trackLimits[i][1]: continue
if stopY < self.trackLimits[i][0]: break
if False:
- context.set_line_width( GUIConstants.BORDER_SIZE )
+ context.set_line_width( Config.BORDER_SIZE )
- context.move_to( GUIConstants.BORDER_SIZE_DIV2, self.trackLimits[i][0] + GUIConstants.BORDER_SIZE_DIV2 )
- context.rel_line_to( self.width - GUIConstants.BORDER_SIZE, 0 )
- context.rel_line_to( 0, self.trackHeight - GUIConstants.BORDER_SIZE )
- context.rel_line_to( -self.width + GUIConstants.BORDER_SIZE, 0 )
+ context.move_to( Config.BORDER_SIZE_DIV2, self.trackLimits[i][0] + Config.BORDER_SIZE_DIV2 )
+ context.rel_line_to( self.width - Config.BORDER_SIZE, 0 )
+ context.rel_line_to( 0, self.trackHeight - Config.BORDER_SIZE )
+ context.rel_line_to( -self.width + Config.BORDER_SIZE, 0 )
context.close_path()
#draw background
@@ -683,7 +681,7 @@ class TrackInterface( gtk.EventBox ):
context.fill_preserve()
else:
- context.rectangle(GUIConstants.BORDER_SIZE_DIV2, self.trackLimits[i][0] + GUIConstants.BORDER_SIZE_DIV2 , self.width, self.height)
+ context.rectangle(Config.BORDER_SIZE_DIV2, self.trackLimits[i][0] + Config.BORDER_SIZE_DIV2 , self.width, self.height)
context.set_source_rgb( 0.75, 0.75, 0.75 )
context.fill()
@@ -693,12 +691,12 @@ class TrackInterface( gtk.EventBox ):
context.stroke()
# draw beat lines
- context.set_line_width( GUIConstants.BEAT_LINE_SIZE )
- beatStart = GUIConstants.BORDER_SIZE + GUIConstants.BEAT_LINE_SIZE_DIV2
+ context.set_line_width( Config.BEAT_LINE_SIZE )
+ beatStart = Config.BORDER_SIZE + Config.BEAT_LINE_SIZE_DIV2
context.set_source_rgb( 0.4, 0.4, 0.4 )
for j in range(1,self.beatCount):
- context.move_to( beatStart + j*self.beatSpacing, self.trackLimits[i][0] + GUIConstants.BORDER_SIZE )
- context.rel_line_to( 0, self.trackHeight - GUIConstants.BORDER_SIZE_MUL2 )
+ context.move_to( beatStart + j*self.beatSpacing, self.trackLimits[i][0] + Config.BORDER_SIZE )
+ context.rel_line_to( 0, self.trackHeight - Config.BORDER_SIZE_MUL2 )
context.stroke()
# draw notes
@@ -707,8 +705,8 @@ class TrackInterface( gtk.EventBox ):
if not notes[n].draw( context, startX, stopX ): break
# draw playhead
- context.set_line_width( GUIConstants.PLAYHEAD_SIZE )
- context.move_to( self.playheadX + GUIConstants.PLAYHEAD_SIZE_DIV2, 0 )
+ context.set_line_width( Config.PLAYHEAD_SIZE )
+ context.move_to( self.playheadX + Config.PLAYHEAD_SIZE_DIV2, 0 )
# do some fancy shit here to grey out muted tracks!?
context.rel_line_to( 0, self.height )
context.set_source_rgb( 0, 0, 0 )
@@ -745,6 +743,6 @@ class TrackInterface( gtk.EventBox ):
def pixelsToTicks( self, pixels ):
return int(round( pixels * self.ticksPerPixel ))
def pitchToPixels( self, pitch ):
- return int(round( ( Constants.MAXIMUM_PITCH - pitch ) * self.pixelsPerPitch ))
+ return int(round( ( Config.MAXIMUM_PITCH - pitch ) * self.pixelsPerPitch ))
def pixelsToPitch( self, pixels ):
return int(round(-pixels*self.pitchPerPixel))
diff --git a/Edit/TuneInterface.py b/Edit/TuneInterface.py
index c6fda09..366378f 100644
--- a/Edit/TuneInterface.py
+++ b/Edit/TuneInterface.py
@@ -2,11 +2,9 @@ import pygtk
pygtk.require( '2.0' )
import gtk
-from Framework.Constants import Constants
-from GUI.GUIConstants import GUIConstants
-from GUI.Core.MainWindow import ModKeys
+import Config
-from Framework.Core.Profiler import TP
+from Util.Profiler import TP
class TuneInterface( gtk.EventBox ):
@@ -35,8 +33,8 @@ class TuneInterface( gtk.EventBox ):
self.clickX = -1
self.set_size_request( self.width, self.height )
- self.pageSpacing = GUIConstants.PAGE_THUMBNAIL_WIDTH + GUIConstants.PAGE_THUMBNAIL_PADDING_MUL2
- self.pageOffset = GUIConstants.PAGE_THUMBNAIL_PADDING + GUIConstants.PAGE_THUMBNAIL_PADDING_DIV2
+ self.pageSpacing = Config.PAGE_THUMBNAIL_WIDTH + Config.PAGE_THUMBNAIL_PADDING_MUL2
+ self.pageOffset = Config.PAGE_THUMBNAIL_PADDING + Config.PAGE_THUMBNAIL_PADDING_DIV2
self.dragMode = None
self.dropAt = -1
@@ -56,7 +54,7 @@ class TuneInterface( gtk.EventBox ):
self.height = allocation.height
self.drawingArea.set_size_request( self.width, self.height )
- self.pageY = (self.height-GUIConstants.PAGE_THUMBNAIL_HEIGHT)//2
+ self.pageY = (self.height-Config.PAGE_THUMBNAIL_HEIGHT)//2
if self.scrollTo >= 0:
self.mainWindow.scrollTune( self.scrollTo )
@@ -66,7 +64,7 @@ class TuneInterface( gtk.EventBox ):
def updateSize( self ):
if not self.alloced: return
- width = len(self.pages)*(GUIConstants.PAGE_THUMBNAIL_WIDTH + GUIConstants.PAGE_THUMBNAIL_PADDING_MUL2) + GUIConstants.PAGE_THUMBNAIL_PADDING_MUL2
+ width = len(self.pages)*(Config.PAGE_THUMBNAIL_WIDTH + Config.PAGE_THUMBNAIL_PADDING_MUL2) + Config.PAGE_THUMBNAIL_PADDING_MUL2
self.waitingForAlloc = True
self.set_size_request( max( self.baseWidth, width), -1 )
@@ -83,7 +81,7 @@ class TuneInterface( gtk.EventBox ):
self.selectPage( id )
self.mainWindow.displayPage( id )
else:
- if ModKeys.ctrlDown:
+ if Config.ModKeys.ctrlDown:
if id in self.selectedIds: # ctrl click, selected page -> remove page from selection
if self.deselectPage( id ):
self.dragMode = self.DRAG_DESELECT
@@ -109,7 +107,7 @@ class TuneInterface( gtk.EventBox ):
def handleMotion( self, widget, event ):
- if ModKeys.ctrlDown and (self.dragMode == None or self.dragMode == self.DRAG_MOVE):
+ if Config.ModKeys.ctrlDown and (self.dragMode == None or self.dragMode == self.DRAG_MOVE):
self.dropAt = -1
self.dragMode = self.DRAG_SELECT
@@ -123,7 +121,7 @@ class TuneInterface( gtk.EventBox ):
self.dragMode = self.DRAG_MOVE
if self.dragMode == self.DRAG_MOVE:
- self.dropAt = int(event.x-self.pageOffset+GUIConstants.PAGE_THUMBNAIL_WIDTH_DIV2)//self.pageSpacing
+ self.dropAt = int(event.x-self.pageOffset+Config.PAGE_THUMBNAIL_WIDTH_DIV2)//self.pageSpacing
if self.dropAt > len(self.pages): self.dropAt = len(self.pages)
self.invalidate_rect( 0, 0, self.width, self.height )
@@ -278,7 +276,7 @@ class TuneInterface( gtk.EventBox ):
context.fill_preserve()
# draw pages
- x = GUIConstants.PAGE_THUMBNAIL_PADDING_MUL2 # double padding on first page!
+ x = Config.PAGE_THUMBNAIL_PADDING_MUL2 # double padding on first page!
l = len(self.selectedIds)
j = 0
for pageId in self.pages:
@@ -292,9 +290,9 @@ class TuneInterface( gtk.EventBox ):
context.set_source_rgb( 0.05, 0.75, 0.0 )
context.move_to( x, self.pageY )
- context.rel_line_to( GUIConstants.PAGE_THUMBNAIL_WIDTH, 0 )
- context.rel_line_to( 0, GUIConstants.PAGE_THUMBNAIL_HEIGHT )
- context.rel_line_to( -GUIConstants.PAGE_THUMBNAIL_WIDTH, 0 )
+ context.rel_line_to( Config.PAGE_THUMBNAIL_WIDTH, 0 )
+ context.rel_line_to( 0, Config.PAGE_THUMBNAIL_HEIGHT )
+ context.rel_line_to( -Config.PAGE_THUMBNAIL_WIDTH, 0 )
context.close_path()
context.stroke()
@@ -302,10 +300,10 @@ class TuneInterface( gtk.EventBox ):
# draw drop marker
if self.dropAt >= 0:
- context.set_line_width( GUIConstants.PAGE_THUMBNAIL_PADDING )
+ context.set_line_width( Config.PAGE_THUMBNAIL_PADDING )
context.set_source_rgb( 0.0, 0.0, 0.0 )
- context.move_to( GUIConstants.PAGE_THUMBNAIL_PADDING + self.pageSpacing*self.dropAt, self.pageY - 4 )
- context.rel_line_to( 0, GUIConstants.PAGE_THUMBNAIL_HEIGHT + 8 )
+ context.move_to( Config.PAGE_THUMBNAIL_PADDING + self.pageSpacing*self.dropAt, self.pageY - 4 )
+ context.rel_line_to( 0, Config.PAGE_THUMBNAIL_HEIGHT + 8 )
context.stroke()
def invalidate_rect( self, x, y, width, height ):
diff --git a/Edit/BackgroundView.py b/Edit/rm/BackgroundView.py
index ff6e75f..ff6e75f 100644
--- a/Edit/BackgroundView.py
+++ b/Edit/rm/BackgroundView.py
diff --git a/Edit/NoteView.py b/Edit/rm/NoteView.py
index ac139a1..ac139a1 100644
--- a/Edit/NoteView.py
+++ b/Edit/rm/NoteView.py
diff --git a/Edit/PageBankView.py b/Edit/rm/PageBankView.py
index 8643b24..8643b24 100644
--- a/Edit/PageBankView.py
+++ b/Edit/rm/PageBankView.py
diff --git a/Edit/PageView.py b/Edit/rm/PageView.py
index eddf0d1..eddf0d1 100644
--- a/Edit/PageView.py
+++ b/Edit/rm/PageView.py
diff --git a/Edit/PositionIndicator.py b/Edit/rm/PositionIndicator.py
index aadc4f4..aadc4f4 100644
--- a/Edit/PositionIndicator.py
+++ b/Edit/rm/PositionIndicator.py
diff --git a/Edit/TrackView.py b/Edit/rm/TrackView.py
index 0b66abd..0b66abd 100644
--- a/Edit/TrackView.py
+++ b/Edit/rm/TrackView.py
diff --git a/Edit/TunePageView.py b/Edit/rm/TunePageView.py
index f708587..f708587 100644
--- a/Edit/TunePageView.py
+++ b/Edit/rm/TunePageView.py
diff --git a/Edit/TuneView.py b/Edit/rm/TuneView.py
index 63cf468..63cf468 100644
--- a/Edit/TuneView.py
+++ b/Edit/rm/TuneView.py
diff --git a/Generation/VariationRythm.py b/Generation/VariationRythm.py
index 460f4f4..7506762 100644
--- a/Generation/VariationRythm.py
+++ b/Generation/VariationRythm.py
@@ -1,6 +1,6 @@
import random
-from Framework.Constants import Constants
+import Config
# remplacer position dans notesList par l'attribut de CSoundNote
class RythmShuffle:
diff --git a/Resources/Images/sliderDrum.png b/Resources/Images/sliderDrum.png
new file mode 100755
index 0000000..35151a4
--- /dev/null
+++ b/Resources/Images/sliderDrum.png
Binary files differ
diff --git a/Resources/Images/sliderEditTempo.png b/Resources/Images/sliderEditTempo.png
new file mode 100755
index 0000000..7425dc5
--- /dev/null
+++ b/Resources/Images/sliderEditTempo.png
Binary files differ
diff --git a/Resources/Images/sliderEditVolume.png b/Resources/Images/sliderEditVolume.png
new file mode 100755
index 0000000..0ee771f
--- /dev/null
+++ b/Resources/Images/sliderEditVolume.png
Binary files differ
diff --git a/Resources/Images/sliderInst1.png b/Resources/Images/sliderInst1.png
new file mode 100755
index 0000000..7863d36
--- /dev/null
+++ b/Resources/Images/sliderInst1.png
Binary files differ
diff --git a/Resources/Images/sliderInst2.png b/Resources/Images/sliderInst2.png
new file mode 100755
index 0000000..8743753
--- /dev/null
+++ b/Resources/Images/sliderInst2.png
Binary files differ
diff --git a/Resources/Images/sliderInst3.png b/Resources/Images/sliderInst3.png
new file mode 100755
index 0000000..0d7d6cd
--- /dev/null
+++ b/Resources/Images/sliderInst3.png
Binary files differ
diff --git a/Resources/Images/sliderInst4.png b/Resources/Images/sliderInst4.png
new file mode 100755
index 0000000..a3fd20e
--- /dev/null
+++ b/Resources/Images/sliderInst4.png
Binary files differ
diff --git a/TamTam.py b/TamTam.py
index 36edd43..d442c30 100755
--- a/TamTam.py
+++ b/TamTam.py
@@ -9,7 +9,7 @@ import Config
import Util.CSoundClient as CSoundClient
from Util.Profiler import TP
from Player.StandalonePlayer import StandAlonePlayer
-#from Edit.Core.MainWindow import MainWindow
+from Edit.MainWindow import MainWindow
#csnd = CSoundClient.CSoundClientSocket( Config.SERVER_ADDRESS, Config.SERVER_PORT, os.getpid() )
diff --git a/Util/NoteLooper.py b/Util/NoteLooper.py
index d355303..5f1f94f 100644
--- a/Util/NoteLooper.py
+++ b/Util/NoteLooper.py
@@ -7,10 +7,9 @@ pygtk.require( '2.0' )
import gtk
import gobject
-from Framework.Constants import Constants
-from Framework.CSound.CSoundConstants import CSoundConstants
-from Framework.Generation.GenerationConstants import GenerationConstants
-from Framework.Core.Profiler import TP
+import Config
+from Generation.GenerationConstants import GenerationConstants
+from Util.Profiler import TP
#------------------------------------------------------------------------------
# A base class used to play a collection of Events at their respective onsets
@@ -101,24 +100,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,
@@ -126,7 +125,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 4344591..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
@@ -94,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