Control: tags 759058 + patch

Dear maintainer,

The attached patch contains fixes for soundgrain for wxPython 3.0.

I've done some simple testing with one of the sample files from the
package, and everything seems to work well.  Without the patch it
crashes on startup with a segmentation fault.

Happy to NMU if you prefer - just let me know.

Cheers,
    Olly
diff -Nru soundgrain-4.1.1/debian/changelog soundgrain-4.1.1/debian/changelog
--- soundgrain-4.1.1/debian/changelog	2012-08-15 09:45:58.000000000 -0300
+++ soundgrain-4.1.1/debian/changelog	2014-09-09 18:09:52.000000000 -0300
@@ -1,3 +1,11 @@
+soundgrain (4.1.1-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Update for wxPython 3.0 (Closes: #759058):
+    - New patch: wxpython3.0.patch
+
+ -- Olly Betts <o...@survex.com>  Tue, 09 Sep 2014 21:09:48 +0000
+
 soundgrain (4.1.1-2) unstable; urgency=low
 
   * Changes arch to all and build-depends on python-all (>= 2.6.6-3~);
diff -Nru soundgrain-4.1.1/debian/control soundgrain-4.1.1/debian/control
--- soundgrain-4.1.1/debian/control	2012-08-15 09:45:58.000000000 -0300
+++ soundgrain-4.1.1/debian/control	2014-09-07 13:03:06.000000000 -0300
@@ -13,7 +13,7 @@
 
 Package: soundgrain
 Architecture: all
-Depends: python (>= 2.6), python-wxgtk2.8, python-pyo, ${misc:Depends}
+Depends: python (>= 2.6), python-wxgtk3.0, python-pyo, ${misc:Depends}
 Description: Graphical interface to control granular sound synthesis modules
  Soundgrain is a graphical interface where users can draw and edit trajectories
  to control granular sound synthesis. It is written in Python and WxPython and
diff -Nru soundgrain-4.1.1/debian/patches/series soundgrain-4.1.1/debian/patches/series
--- soundgrain-4.1.1/debian/patches/series	2012-08-15 09:45:58.000000000 -0300
+++ soundgrain-4.1.1/debian/patches/series	2014-09-07 13:04:47.000000000 -0300
@@ -1 +1,2 @@
 use-distutils.patch
+wxpython3.0.patch
diff -Nru soundgrain-4.1.1/debian/patches/wxpython3.0.patch soundgrain-4.1.1/debian/patches/wxpython3.0.patch
--- soundgrain-4.1.1/debian/patches/wxpython3.0.patch	1969-12-31 21:00:00.000000000 -0300
+++ soundgrain-4.1.1/debian/patches/wxpython3.0.patch	2014-09-09 18:09:44.000000000 -0300
@@ -0,0 +1,154 @@
+Description: Update for wxPython 3.0
+ These changes should remain compatible with wxPython 2.8.
+Bug-Debian: https://bugs.debian.org/759058
+Forwarded: no
+Last-Update: 2014-09-07
+
+Index: soundgrain-4.1.1/Resources/FxBall.py
+===================================================================
+--- soundgrain-4.1.1.orig/Resources/FxBall.py
++++ soundgrain-4.1.1/Resources/FxBall.py
+@@ -152,8 +152,8 @@ def getColors(col, gradient):
+     return firstColor, secondColor
+ 
+ def GetRoundMaskBitmap(w, h, radius):
+-    maskColor = wx.Color(30,30,30)
+-    shownColor = wx.Color(29,29,29)
++    maskColor = wx.Colour(30,30,30)
++    shownColor = wx.Colour(29,29,29)
+     b = wx.EmptyBitmap(w,h)
+     dc = wx.MemoryDC(b)
+     dc.SetPen(wx.Pen(maskColor, 1))
+@@ -168,7 +168,7 @@ def GetRoundMaskBitmap(w, h, radius):
+ 
+ def GetRoundBitmap(w, h, mask, col, gradient):
+     firstColor, secondColor = getColors(col, gradient)
+-    maskColor = wx.Color(30,30,30)
++    maskColor = wx.Colour(30,30,30)
+     b = wx.EmptyBitmap(w,h)
+     dc = wx.MemoryDC(b)
+     dc.SetPen(wx.Pen(maskColor, 1))
+Index: soundgrain-4.1.1/Resources/splash.py
+===================================================================
+--- soundgrain-4.1.1.orig/Resources/splash.py
++++ soundgrain-4.1.1/Resources/splash.py
+@@ -63,12 +63,7 @@ class SoundGrainSplashScreen(wx.Frame):
+         dc.DrawRectangle(0,0,w,h)
+         dc.DrawBitmap(self.bmp, 0,0,True)
+         dc.SetTextForeground("#FFFFFF")
+-        font = dc.GetFont()
+-        if PLATFORM == "win32":
+-            pass
+-        else:
+-            font.SetFaceName("Monaco")
+-            font.SetPixelSize((15,15))
++        font = wx.FFontFromPixelSize(pixelSize=(15,15), family=wx.FONTFAMILY_DEFAULT, face="Monaco")
+         dc.SetFont(font)
+         dc.DrawLabel(u"Olivier Bélanger", wx.Rect(0, 320, 400, 15), wx.ALIGN_CENTER)
+         dc.DrawLabel("iACT, %s" % SG_YEAR, wx.Rect(0, 335, 400, 15), wx.ALIGN_CENTER)
+@@ -80,6 +75,11 @@ class SoundGrainSplashScreen(wx.Frame):
+         self.Destroy()
+ 
+ if __name__ == '__main__':
+-    app = wx.PySimpleApp()
++    class MySimpleApp(wx.App):
++        def OnInit(self):
++            # Suppress WXDEBUG assertions, as happens by default with wx2.8.
++            #self.SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS)
++            return True
++    app = MySimpleApp()
+     frame = SoundGrainSplashScreen(None, img="SoundGrainSplash.png")
+     app.MainLoop()
+Index: soundgrain-4.1.1/SoundGrain.py
+===================================================================
+--- soundgrain-4.1.1.orig/SoundGrain.py
++++ soundgrain-4.1.1/SoundGrain.py
+@@ -286,12 +286,12 @@ class DrawingSurface(wx.Panel):
+         return self.oscilScaling
+ 
+     def SetColors(self, outline, bg, fill, rect, losa, wave):
+-        self.outlinecolor = wx.Color(*outline)
+-        self.backgroundcolor = wx.Color(*bg)
+-        self.fillcolor = wx.Color(*fill)
+-        self.rectcolor = wx.Color(*rect)
+-        self.losacolor = wx.Color(*losa)
+-        self.wavecolor = wx.Color(*wave)
++        self.outlinecolor = wx.Colour(*outline)
++        self.backgroundcolor = wx.Colour(*bg)
++        self.fillcolor = wx.Colour(*fill)
++        self.rectcolor = wx.Colour(*rect)
++        self.losacolor = wx.Colour(*losa)
++        self.wavecolor = wx.Colour(*wave)
+         self.losaBrush = wx.Brush(self.losacolor, wx.SOLID)
+         self.losaPen = wx.Pen(self.losacolor, width=1, style=wx.SOLID)
+ 
+@@ -1310,7 +1310,7 @@ class ControlPanel(scrolled.ScrolledPane
+                             defaultFile="",
+                             wildcard="AIFF file |*.aif;*.aiff;*.aifc;*.AIF;*.AIFF;*.Aif;*.Aiff|" \
+                                      "Wave file |*.wav;*.wave;*.WAV;*.WAVE;*.Wav;*.Wave",
+-                            style=wx.OPEN)
++                            style=wx.FD_OPEN)
+         if dlg.ShowModal() == wx.ID_OK:
+             sndPath = dlg.GetPath()
+             self.loadSound(ensureNFD(sndPath))
+@@ -1322,7 +1322,7 @@ class ControlPanel(scrolled.ScrolledPane
+                             defaultFile="",
+                             wildcard="AIFF file |*.aif;*.aiff;*.aifc;*.AIF;*.AIFF;*.Aif;*.Aiff|" \
+                                      "Wave file |*.wav;*.wave;*.WAV;*.WAVE;*.Wav;*.Wave",
+-                            style=wx.OPEN)
++                            style=wx.FD_OPEN)
+         if dlg.ShowModal() == wx.ID_OK:
+             ok = True
+             sndPath = dlg.GetPath()
+@@ -2053,7 +2053,7 @@ class MainFrame(wx.Frame):
+         dlg = wx.FileDialog(self, message="Open SoundGrain file...",
+                             defaultFile="",
+                             wildcard="SoundGrain file (*.sg)|*.sg",
+-                            style=wx.OPEN)
++                            style=wx.FD_OPEN)
+         if dlg.ShowModal() == wx.ID_OK:
+             path = dlg.GetPath()
+             self.loadFile(ensureNFD(path))
+@@ -2077,7 +2077,7 @@ class MainFrame(wx.Frame):
+     def handleSaveAs(self, evt):
+         dlg = wx.FileDialog(self, message="Save file as ...",
+                             defaultFile="Granulator.sg",
+-                            style=wx.SAVE)
++                            style=wx.FD_SAVE)
+         if dlg.ShowModal() == wx.ID_OK:
+             path = dlg.GetPath()
+             if os.path.isfile(path):
+@@ -2323,7 +2323,7 @@ class MainFrame(wx.Frame):
+                 wildcard = "AIFF file|*.aiff;*.aif|" \
+                            "Wave file|*.wave;*.wav"
+                 dlg2 = wx.FileDialog(self, message="Choose a filename...", defaultDir=os.getcwd(),
+-                    defaultFile="mixedtable.wav", wildcard=wildcard, style=wx.SAVE | wx.CHANGE_DIR)
++                    defaultFile="mixedtable.wav", wildcard=wildcard, style=wx.FD_SAVE | wx.FD_CHANGE_DIR)
+                 if dlg2.ShowModal() == wx.ID_OK:
+                     path = dlg2.GetPath()
+                     if path != "":
+@@ -2461,10 +2461,10 @@ class MainFrame(wx.Frame):
+         info.Copyright = u'(C) %s Olivier Bélanger' % SG_YEAR
+         wx.AboutBox(info)
+ 
+-class SoundGrainApp(wx.PySimpleApp):
++class SoundGrainApp(wx.App):
+     def __init__(self, *args, **kwargs):
+         global SCREEN_SIZE
+-        wx.PySimpleApp.__init__(self, *args, **kwargs)
++        wx.App.__init__(self, *args, **kwargs)
+         X,Y = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_X), wx.SystemSettings.GetMetric(wx.SYS_SCREEN_Y)
+         SCREEN_SIZE = (X, Y)
+         if X < 900: sizex = X - 40
+@@ -2476,6 +2476,11 @@ class SoundGrainApp(wx.PySimpleApp):
+         self.frame = MainFrame(None, -1, pos=(20,20), size=(sizex,sizey))
+         self.loadFile = self.frame.loadFile
+ 
++    def OnInit(self):
++        # Suppress WXDEBUG assertions, as happens by default with wx2.8.
++        #self.SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS)
++        return True
++
+     def MacOpenFile(self, filename):
+         self.loadFile(ensureNFD(filename))
+ 
_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to