@ -118,7 +118,7 @@ class ClientCallbacks(Callbacks): #inherits from the templates api callbacks
if session . data . currentMetronomeTrack is track :
setMetronome ( track . asMetronomeData , label = track . name ) #template api
def _updateTrack ( self , trId ) :
def _updateTrack ( self , trId ) :
""" The most important function. Create a static representation of the music data which
can be used by a GUI to draw notes .
track . staticRepresentation also creates the internal midi representation for cbox . """
@ -843,7 +843,7 @@ def appendBlock(trackid = None):
else :
session . history . register ( lambda blId = id ( block ) : deleteBlock ( blId ) , descriptionString = " append block " )
callbacks . _updateTrack ( id ( tr ) )
callbacks . _setCursor ( )
#callbacks._setCursor() #this will make the GUI jump around because it centers on the cursor
def splitBlock ( ) :
tr = session . data . currentTrack ( )
@ -880,7 +880,7 @@ def joinBlock():
rearrangeBlocksInMultipleTracks ( dictOfTrackIdsWithListOfBlockIds ) #handles undo and callbacks for redrawing
session . data . goTo ( * where ) #just for the user experience.
callbacks . _setCursor ( )
#callbacks._setCursor() #this will make the GUI jump around because it centers on the cursor
def deleteBlock ( blockId ) :
track , block = session . data . blockById ( blockId )
@ -891,7 +891,7 @@ def deleteBlock(blockId):
#Blocks are never truly deleted but a stored in the Block.allBlocks dict. This keeps the reference to this deleted block alive and it can be added through rearrange, which gets its blocks from this dict.
session . history . register ( lambda i = id ( track ) , l = oldBlockArrangement : rearrangeBlocks ( i , l ) , descriptionString = " delete block " )
callbacks . _updateTrack ( id ( track ) )
callbacks . _setCursor ( )
#callbacks._setCursor() #this will make the GUI jump around because it centers on the cursor
return True
else :
return False
@ -922,7 +922,7 @@ def duplicateBlock(blockId, times = 1):
for i in range ( times ) :
track . duplicateBlock ( block )
callbacks . _updateTrack ( id ( track ) )
callbacks . _setCursor ( )
#callbacks._setCursor( )
def duplicateContentLinkBlock ( blockId , times = 1 ) :
track , block = session . data . blockById ( blockId )
@ -930,7 +930,7 @@ def duplicateContentLinkBlock(blockId, times = 1):
for i in range ( times ) :
track . duplicateContentLinkBlock ( block )
callbacks . _updateTrack ( id ( track ) )
callbacks . _setCursor ( )
#callbacks._setCursor() #this will make the GUI jump around because it centers on the cursor
def moveBlockToOtherTrack ( blockId , newTrackId , listOfBlockIdsForNewTrack ) :
""" First move the block to the new track and then
@ -957,7 +957,7 @@ def moveBlockToOtherTrack(blockId, newTrackId, listOfBlockIdsForNewTrack):
callbacks . _updateTrack ( id ( oldTrack ) )
callbacks . _updateTrack ( newTrackId )
callbacks . _setCursor ( )
#callbacks._setCursor() #this will make the GUI jump around because it centers on the cursor
def rearrangeBlocks ( trackid , listOfBlockIds ) :
track = session . data . trackById ( trackid )
@ -973,6 +973,7 @@ def rearrangeBlocks(trackid, listOfBlockIds):
def rearrangeBlocksInMultipleTracks ( dictOfTrackIdsWithListOfBlockIds ) :
""" dictOfTrackIdsWithListOfBlockIds is [trackId] = [listOfBlockIds] """
print ( " multitrack " )
forUndo = { }
for trackId , listOfBlockIds in dictOfTrackIdsWithListOfBlockIds . items ( ) :
track = session . data . trackById ( trackId )
@ -988,7 +989,7 @@ def rearrangeBlocksInMultipleTracks(dictOfTrackIdsWithListOfBlockIds):
for trackId in dictOfTrackIdsWithListOfBlockIds . keys ( ) :
callbacks . _updateTrack ( trackId )
callbacks . _setCursor ( )
#callbacks._setCursor() no. this makes the GUI jump around.
def changeBlock ( blockId , newParametersDict ) :
""" for example " name " or " minimumInTicks " """