Posted by John Thu 7th Dec 2006 21:17 - Syntax is Python - 31 views
Download | New Post | Modify | Hide line numbers
  1. def OnAcceptEditBPM(self, widget=None):
  2.     if self.bpmeditPacked:
  3.         self.bpmframe.remove(self.bpmedit)
  4.         #FIXME: find a better way to do project.PrepareClick() it doesn't take a really long time with large bpm
  5.         oldbpm = self.bpmedit.get_text()
  6.            
  7.         if oldbpm:
  8.             newbpm = float(oldbpm)
  9.                 if newbpm > 400:
  10.                     newbpm = 400.0           
  11.            
  12.         self.project.transport.SetBPM(newbpm)
  13.         self.project.PrepareClick()
  14.            
  15.         tempstring = _("Enter a correct tempo value")
  16.         self.mainview.SetStatusBar(tempstring)
  17.  
  18.         gobject.timeout_add(100, self.mainview.ClearStatusBar, tempstring)
  19.            
  20.         self.bpmframe.add(self.bpmeventbox)
  21.         self.bpmedit.destroy()
  22.         self.bpmframe.show_all()
  23.         self.bpmeditPacked = False
  24.        
  25.         #Do this outside the if statement so that it gets updated if someone else changes the bpm
  26.         self.bpmlabel.set_use_markup(True)
  27.         self.bpmlabel.set_markup("%d"%self.project.transport.bpm)
  28.            
  29.         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