Posted by John Thu 7th Dec 2006 21:17 - Syntax is Python - 31 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
-
def OnAcceptEditBPM(self, widget=None):
-
if self.bpmeditPacked:
-
self.bpmframe.remove(self.bpmedit)
-
#FIXME: find a better way to do project.PrepareClick() it doesn't take a really long time with large bpm
-
oldbpm = self.bpmedit.get_text()
-
-
if oldbpm:
-
newbpm = float(oldbpm)
-
if newbpm > 400:
-
newbpm = 400.0
-
-
self.project.transport.SetBPM(newbpm)
-
self.project.PrepareClick()
-
-
tempstring = _("Enter a correct tempo value")
-
self.mainview.SetStatusBar(tempstring)
-
-
gobject.timeout_add(100, self.mainview.ClearStatusBar, tempstring)
-
-
self.bpmframe.add(self.bpmeventbox)
-
self.bpmedit.destroy()
-
self.bpmframe.show_all()
-
self.bpmeditPacked = False
-
-
#Do this outside the if statement so that it gets updated if someone else changes the bpm
-
self.bpmlabel.set_use_markup(True)
-
self.bpmlabel.set_markup("%d"%self.project.transport.bpm)
-
-
self.projectview.UpdateSize()
PermaLink to this entry https://pastebin.co.uk/7161
Posted by John Thu 7th Dec 2006 21:17 - Syntax is Python - 31 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers