Browse Source

*** empty log message ***

Mark Mine 25 years ago
parent
commit
c969edc88d
2 changed files with 14 additions and 11 deletions
  1. 1 1
      direct/src/directdevices/DirectDeviceManager.py
  2. 13 10
      direct/src/interval/Interval.py

+ 1 - 1
direct/src/directdevices/DirectDeviceManager.py

@@ -208,7 +208,7 @@ class DirectTimecodeReader(AnalogNode, PandaObject):
                         (((timeBits & 0xF000) >> 12) * 10))
                         (((timeBits & 0xF000) >> 12) * 10))
         self.minutes = (((timeBits & 0x0F0000) >> 16) +
         self.minutes = (((timeBits & 0x0F0000) >> 16) +
                         (((timeBits & 0xF00000) >> 20) * 10))
                         (((timeBits & 0xF00000) >> 20) * 10))
-        self.hours = (((timeBits & 0xF0000000) >> 24) +
+        self.hours = (((timeBits & 0xF000000) >> 24) +
                       (((timeBits & 0xF0000000) >> 28) * 10))
                       (((timeBits & 0xF0000000) >> 28) * 10))
         self.totalSeconds = ((self.hours * 3600) +
         self.totalSeconds = ((self.hours * 3600) +
                              (self.minutes * 60) +
                              (self.minutes * 60) +

+ 13 - 10
direct/src/interval/Interval.py

@@ -133,7 +133,7 @@ class Interval(DirectObject):
 	    space = space + ' '
 	    space = space + ' '
 	return (space + self.name + ' dur: %.2f' % self.duration)
 	return (space + self.name + ' dur: %.2f' % self.duration)
 
 
-    def popupControls(self):
+    def popupControls(self, tl = None):
         """ popupControls()
         """ popupControls()
             Popup control panel for interval.
             Popup control panel for interval.
         """
         """
@@ -143,10 +143,12 @@ class Interval(DirectObject):
         from Tkinter import *
         from Tkinter import *
         import Pmw
         import Pmw
         import EntryScale
         import EntryScale
-        tl = Toplevel()
-        tl.title(self.getName() + ' Interval Controls')
+        if tl == None:
+            tl = Toplevel()
+            tl.title(self.getName() + ' Interval Controls')
+        outerFrame = Frame(tl)
         self.es = es = EntryScale.EntryScale(
         self.es = es = EntryScale.EntryScale(
-            tl, text = 'Time',
+            outerFrame, text = 'Time',
             min = 0, max = string.atof(fpformat.fix(self.duration, 2)),
             min = 0, max = string.atof(fpformat.fix(self.duration, 2)),
             command = lambda t, s = self: s.setT(t))
             command = lambda t, s = self: s.setT(t))
         # So when you drag scale with mouse its like you started a playback
         # So when you drag scale with mouse its like you started a playback
@@ -162,7 +164,7 @@ class Interval(DirectObject):
         es.onReturnRelease = lambda s=self, es = es: s.setT(es.get(),
         es.onReturnRelease = lambda s=self, es = es: s.setT(es.get(),
                                                             event = IVAL_INIT)
                                                             event = IVAL_INIT)
         es.pack(expand = 1, fill = X)
         es.pack(expand = 1, fill = X)
-        f = Frame(tl)
+        bf = Frame(outerFrame)
         # Jump to start and end
         # Jump to start and end
         def toStart(s=self, es=es):
         def toStart(s=self, es=es):
             s.stop()
             s.stop()
@@ -170,19 +172,20 @@ class Interval(DirectObject):
         def toEnd(s=self):
         def toEnd(s=self):
             s.stop()
             s.stop()
             s.setT(s.getDuration(), event = IVAL_INIT)
             s.setT(s.getDuration(), event = IVAL_INIT)
-        jumpToStart = Button(tl, text = '<<', command = toStart)
+        jumpToStart = Button(bf, text = '<<', command = toStart)
         # Stop/play buttons
         # Stop/play buttons
-        stop = Button(tl, text = 'Stop',
+        stop = Button(bf, text = 'Stop',
                       command = lambda s=self: s.stop())
                       command = lambda s=self: s.stop())
         play = Button(
         play = Button(
-            tl, text = 'Play',
+            bf, text = 'Play',
             command = lambda s=self, es=es: s.play(es.get()))
             command = lambda s=self, es=es: s.play(es.get()))
-        jumpToEnd = Button(tl, text = '>>', command = toEnd)
+        jumpToEnd = Button(bf, text = '>>', command = toEnd)
         jumpToStart.pack(side = LEFT, expand = 1, fill = X)
         jumpToStart.pack(side = LEFT, expand = 1, fill = X)
         play.pack(side = LEFT, expand = 1, fill = X)
         play.pack(side = LEFT, expand = 1, fill = X)
         stop.pack(side = LEFT, expand = 1, fill = X)
         stop.pack(side = LEFT, expand = 1, fill = X)
         jumpToEnd.pack(side = LEFT, expand = 1, fill = X)
         jumpToEnd.pack(side = LEFT, expand = 1, fill = X)
-        f.pack(expand = 1, fill = X)
+        bf.pack(expand = 1, fill = X)
+        outerFrame.pack(expand = 1, fill = X)
         # Add function to update slider during setT calls
         # Add function to update slider during setT calls
         def update(t,es=es):
         def update(t,es=es):
             es.set(t, fCommand = 0)
             es.set(t, fCommand = 0)