diff options
author | amartin <olpc@xo-00-CE-12.localdomain> | 2007-07-12 18:42:09 (GMT) |
---|---|---|
committer | amartin <olpc@xo-00-CE-12.localdomain> | 2007-07-12 18:42:09 (GMT) |
commit | 54fef9365ba5ceca37cdbee67c3a1d278e85aef3 (patch) | |
tree | 8c3a647c71f15428a2b6ea064114e8c1d7da1bf9 | |
parent | bed9f06b6ed68dff7cef1727fe59edb1eca98b80 (diff) |
page delete bug, page duplicate proper instruments
-rw-r--r-- | Edit/MainWindow.py | 9 | ||||
-rw-r--r-- | Edit/TuneInterface.py | 11 | ||||
-rw-r--r-- | Util/NoteDB.py | 2 |
3 files changed, 16 insertions, 6 deletions
diff --git a/Edit/MainWindow.py b/Edit/MainWindow.py index bae041b..2ab273d 100644 --- a/Edit/MainWindow.py +++ b/Edit/MainWindow.py @@ -753,8 +753,13 @@ class MainWindow( SubActivity ): if self.playScope == "All": return + + if self.displayedPage in selectedIds: + startPage = self.displayedPage + else: + startPage = selectedIds[0] - self._playPages( selectedIds, self.displayedPage, self.trackInterface.getPlayhead() ) + self._playPages( selectedIds, startPage, self.trackInterface.getPlayhead() ) def updatePagesPlaying( self ): if not self.playing: @@ -835,6 +840,7 @@ class MainWindow( SubActivity ): if (Config.DEBUG > 3): print 'rebuild note loop' print 'pages : ', self.pages_playing + x = 1/len(self.pages_playing) # make me crash if there are no pages print 'trackset : ', trackset print 'numticks : ', numticks print 'notes : ', len(notes), 'notes' @@ -1401,7 +1407,6 @@ class MainWindow( SubActivity ): page = self.noteDB.getPage(pageId) for i in range(Config.NUMBER_OF_TRACKS): - print self.trackInstrument[i].instrumentId if self.trackInstrument[i].instrumentId != page.instruments[i]: self.trackInstrument[i] = Config.INSTRUMENTSID[page.instruments[i]] if i == Config.NUMBER_OF_TRACKS-1: btn = self.GUI["2drumButton"] diff --git a/Edit/TuneInterface.py b/Edit/TuneInterface.py index 4dfbcbf..f9d686f 100644 --- a/Edit/TuneInterface.py +++ b/Edit/TuneInterface.py @@ -411,7 +411,7 @@ class TuneInterface( gtk.EventBox ): return True # page added to selection - def deselectPage( self, id, force = False, skip_redraw = False ): + def deselectPage( self, id, force = False, skip_redraw = False, noUpdate = False ): if not id in self.selectedIds: return False # page isn't selected if not force: @@ -427,7 +427,8 @@ class TuneInterface( gtk.EventBox ): ind = self.noteDB.getPageIndex( id ) self.invalidate_rect( self.pageOffset + ind*Config.PAGE_THUMBNAIL_WIDTH, 0, Config.PAGE_THUMBNAIL_WIDTH, self.height ) - self.owner.updatePageSelection( self.selectedIds ) + if not noUpdate: + self.owner.updatePageSelection( self.selectedIds ) return True # page removed from the selection @@ -471,9 +472,13 @@ class TuneInterface( gtk.EventBox ): self.updateSize() def notifyPageDelete( self, which, safe ): + if self.displayedPage in which: + noUpdate = True + else: + noUpdate = False for id in self.selectedIds: if id in which: - self.deselectPage( id, True, True ) + self.deselectPage( id, True, True, noUpdate ) for id in which: del self.thumbnail[id] del self.thumbnailDirtyRect[id] diff --git a/Util/NoteDB.py b/Util/NoteDB.py index c43f5e4..bc452da 100644 --- a/Util/NoteDB.py +++ b/Util/NoteDB.py @@ -177,7 +177,7 @@ class NoteDB: new = {} for cp in sorted: - id = self._newPage( -1, Page(self.pages[cp].beats,self.pages[cp].color) ) + id = self._newPage( -1, Page(self.pages[cp].beats,self.pages[cp].color,self.pages[cp].instruments) ) self._insertPage( id, after ) after = id new[cp] = id |