changeset 18:cf93a76eda92

The laser cutter software barfs on these lines and stops processing the PDF (but doesn't emit any errors!) so just if them out for now.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 20 Apr 2016 08:38:38 +0930
parents c50427f1da2d
children ffaf97818ce3
files musiccutter.py
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/musiccutter.py	Wed Apr 20 08:35:44 2016 +0930
+++ b/musiccutter.py	Wed Apr 20 08:38:38 2016 +0930
@@ -97,6 +97,27 @@
             pdf.saveState() # Not really necessary since this is last thing we do
             pdf.setLineWidth(0)
 
+            # Draw time marks
+            if False:
+                tstart = 0
+                tend = (self.pagewidth - self.lmargin) / self.timescale
+                if pindx > 0:
+                    tsize = self.pagewidth / self.timescale
+                    tstart = tend + tsize * pindx
+                    tend = tend + tsize * (pindx + 1)
+                for s in range(tstart, tend, 5):
+                    x = float(s * self.timescale + self.lmargin) % self.pagewidth
+                    pdf.line(x * mm, self.offset, x * mm, self.pageheight * mm)
+                    Midi2PDF.textHelper(pdf, x * mm, 1 * mm, ENGRAVE_COLOUR, False, self.fontname, self.fontsize, str(s) + 's')
+
+            # Draw rectangle around page
+            if False:
+                pdf.rect(0, 0, self.pagewidth * mm, self.pageheight * mm, fill = False, stroke = True)
+                pdf.line(0, 0, 0, self.pagewidth * mm)
+                pdf.line(0, self.pagewidth * mm, self.pagewidth * mm, self.pageheight * mm)
+                pdf.line(self.pagewidth * mm, self.pageheight * mm, 0, self.pageheight * mm)
+                pdf.line(0, self.pageheight * mm, 0, 0)
+
             # Draw lines per note
             for slot in sorted(self.slot2note.keys()):
                 ofs = (self.offset + slot * self.pitch) * mm