[xiph-commits] r7427 - trunk/xinloe

arc at motherfish-iii.xiph.org arc
Thu Aug 5 19:04:44 PDT 2004


Author: arc
Date: Thu Aug  5 19:04:44 2004
New Revision: 7427

Modified:
trunk/xinloe/sandbox.py
Log:
Will now only display a 'muxed' layer if the chain is actually muxed,
chains with just one codec will show that codec on the 'muxed' layer.

Also, will not show zero offsets, and the display of chain offsets
applies to single-codec chains as well.



Modified: trunk/xinloe/sandbox.py
===================================================================
--- trunk/xinloe/sandbox.py	2004-07-31 05:45:43 UTC (rev 7426)
+++ trunk/xinloe/sandbox.py	2004-07-31 08:11:05 UTC (rev 7427)
@@ -154,27 +154,16 @@
def __init__(self, parent):
self.parent = parent
grandparent = parent.parent
+      self.name = 'Chain %d (%s offset)' % (len(parent.chains),
+                                            timestr(parent.length))
+      self.desc = ''
self.icon = ''

-      chain = grandparent.tree.AppendItem(parent.branch, \
-       'Chain %d (%s offset)' % (len(parent.chains), timestr(parent.length)))
-      grandparent.tree.SetPyData(chain, self)
-      grandparent.tree.SetItemImage(chain, grandparent.muxpackidx,
-                                    which = wxTreeItemIcon_Normal)
-      grandparent.tree.SetItemImage(chain, grandparent.muxopenidx,
-                                    which = wxTreeItemIcon_Expanded)
self.serials = {}

bitstreams = self.GetNewStreams()
for handler in bitstreams:
self.serials[handler.serialno] = handler
-        stream = grandparent.tree.AppendItem(chain, handler.name)
-        grandparent.tree.SetPyData(stream, handler)
-        if not grandparent.codecidx.has_key(handler.icon) :
-          print 'Missing icon for %s' % handler.name
-          handler.icon = ''
-        grandparent.tree.SetItemImage(stream,
-          grandparent.codecidx[handler.icon], which = wxTreeItemIcon_Normal)

while parent.page and parent.page.pageno > 0:
self.serials[parent.page.serialno].PageIn(parent.page)
@@ -185,6 +174,30 @@
break  # End of file reached.
parent.page = parent.sy.pageout()

+      if parent.length > 0:
+        extra = ' (%s offset)' % timestr(parent.length)
+      else :
+        extra = ''
+      if len(bitstreams) == 1 :
+        chain = parent.branch
+      else :
+        chain = grandparent.tree.AppendItem(parent.branch, 'Muxed Stream'+extra)
+        grandparent.tree.SetPyData(chain, self)
+        grandparent.tree.SetItemImage(chain, grandparent.muxpackidx,
+                                      which = wxTreeItemIcon_Normal)
+        grandparent.tree.SetItemImage(chain, grandparent.muxopenidx,
+                                      which = wxTreeItemIcon_Expanded)
+        extra = ''
+      for handler in bitstreams:
+        stream = grandparent.tree.AppendItem(chain, handler.name+extra)
+        grandparent.tree.SetPyData(stream, handler)
+        if not grandparent.codecidx.has_key(handler.icon) :
+          print 'Missing icon for %s' % handler.name
+          handler.icon = ''
+        grandparent.tree.SetItemImage(stream,
+          grandparent.codecidx[handler.icon], which = wxTreeItemIcon_Normal)
+
+
self.bytes = 0
self.length = 0
for handler in bitstreams:



More information about the commits mailing list