Bug#749659: audacity + wxWidgets 3.0 — Proposing patch

Martin Steghöfer martin at steghoefer.eu
Sun Sep 21 16:08:08 UTC 2014


On 09/14/2014 10:14 PM, Reinhard Tartler wrote:
> Please remind me, what was the autoreconf problem, and how has it been 
> fixed upstream? I'm really not comfortable with uploading an about 
> 500kb diff.

I agree, having that patch in the actual package is not an option, it's 
huge, opaque and will break with a new upstream release (although the 
latter hopefully won't be an issue). The reason I posted that patch in 
the first place was so others could try and evaluate the other patch 
(wx30.patch), the one that was actually relevant. I was hoping that 
someone closer to the package would be able fix the dh_autoreconf issue 
(see my first post in this bug).

But since nobody spoke up, I've had a look myself. Turns out that 
autoreconf only recurses into subdirectories that are included via the 
AC_CONFIG_SUBDIRS macro using string literals (no variables) as 
argument. In audacity, however, AC_CONFIG_SUBDIRS is either called using 
variables as argument or not called at all (calling the configure script 
of the subdirectory explicitly instead).

With that knowledge I was able to find and backport two upstream commits 
that fix this. However, the fact that the autotools are now called on 
more subdirectories than before uncovered configuration script problems 
in those subdirectories. I fixed the errors and the most important 
warnings in an additional patch.

Please find attached a new debdiff including the mentioned changes.

Cheers,
Martin

-------------- next part --------------
diff -Nru audacity-2.0.5/debian/changelog audacity-2.0.5/debian/changelog
--- audacity-2.0.5/debian/changelog	2014-05-31 22:04:20.000000000 +0200
+++ audacity-2.0.5/debian/changelog	2014-09-20 23:06:56.000000000 +0200
@@ -1,3 +1,17 @@
+audacity (2.0.5-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Compile audacity against wxWidgets 3.0: (Closes: #749659)
+    - debian/patches/wx30.patch: Patch source for compatibility.
+    - debian/control: Upgrade build dependency to wxWidgets dev package.
+  * Fix dh-autoreconf by backporting patches from upstream:
+    - debian/patches/autoreconf-subdirectories.patch: r12761
+    - debian/patches/autoreconf-subdirectories-lib-widget-extra.patch: r12901
+    - debian/patches/autoreconf.patch: Fix problems in the autotools
+      configuration files of subdirectories.
+
+ -- Martin Steghöfer <martin at steghoefer.eu>  Sun, 21 Sep 2014 17:51:14 +0200
+
 audacity (2.0.5-2) unstable; urgency=medium
 
   * Add support for recent FFmpeg/libav versions. Thanks to Michael Niedermayer
diff -Nru audacity-2.0.5/debian/control audacity-2.0.5/debian/control
--- audacity-2.0.5/debian/control	2014-05-31 20:26:20.000000000 +0200
+++ audacity-2.0.5/debian/control	2014-09-20 23:06:14.000000000 +0200
@@ -30,7 +30,7 @@
                libsoxr-dev (>= 0.0.5),
                libtwolame-dev (>= 0.3.9),
                libvorbis-dev (>= 1.0.0-3),
-               libwxgtk2.8-dev,
+               libwxgtk3.0-dev,
                portaudio19-dev (>= 19+svn20101113-3~),
                vamp-plugin-sdk (>= 2.0)
 Build-Conflicts: libwxbase2.6-dev, wx2.6-headers
diff -Nru audacity-2.0.5/debian/patches/autoreconf.patch audacity-2.0.5/debian/patches/autoreconf.patch
--- audacity-2.0.5/debian/patches/autoreconf.patch	1970-01-01 01:00:00.000000000 +0100
+++ audacity-2.0.5/debian/patches/autoreconf.patch	2014-09-20 23:06:38.000000000 +0200
@@ -0,0 +1,45 @@
+Description: Fix autotools errors and warnings
+ The backporting of fixes to enable autoreconf in all subdirectories
+ uncovered (already existing, but untriggered) problems with autotools
+ project files:
+ * Unexpected parameter "enabled" was passed to AM_MAINTAINER_MODE
+   (instead of the correct parameter "enable").
+ * After dh_autoreconf_clean, the subsequent execution of
+   autoreconf failed to regenerate ltmain.sh, if "AUX_DIR"
+   is not set.
+ * Lots of warnings about source files in subdirectories without
+   the automake option "subdir-objects".
+Author: Martin Steghöfer <martin at steghoefer.eu>
+Bug-Debian: https://bugs.debian.org/749659
+
+--- a/lib-src/sbsms/configure.in
++++ b/lib-src/sbsms/configure.in
+@@ -5,6 +5,8 @@
+ dnl libtoolize --copy --force
+ AC_CONFIG_MACRO_DIR([m4])
+ 
++AC_CONFIG_AUX_DIR(autotools)
++
+ #------------------------------------------------------------------------------------
+ # Library's "official" release version:
+ 
+@@ -120,7 +122,7 @@
+ 
+ AM_INIT_AUTOMAKE([no-dependencies])
+ 
+-AM_MAINTAINER_MODE([enabled])
++AM_MAINTAINER_MODE([enable])
+ 
+ AC_CONFIG_FILES([Makefile src/Makefile libsbsms.spec sbsms.pc])
+ 
+--- a/lib-src/libnyquist/configure.ac
++++ b/lib-src/libnyquist/configure.ac
+@@ -25,7 +25,7 @@
+ # which also contains a subdir containing macros
+ AC_CONFIG_MACRO_DIR([autotools/m4])
+ dnl set up automake
+-AM_INIT_AUTOMAKE([-Wall foreign])
++AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+ dnl Audacity policy: don't enable automatic rebuild of configure et al if 
+ dnl sources change
+ AM_MAINTAINER_MODE([enable])
diff -Nru audacity-2.0.5/debian/patches/autoreconf-subdirectories-lib-widget-extra.patch audacity-2.0.5/debian/patches/autoreconf-subdirectories-lib-widget-extra.patch
--- audacity-2.0.5/debian/patches/autoreconf-subdirectories-lib-widget-extra.patch	1970-01-01 01:00:00.000000000 +0100
+++ audacity-2.0.5/debian/patches/autoreconf-subdirectories-lib-widget-extra.patch	2014-09-20 23:06:14.000000000 +0200
@@ -0,0 +1,307 @@
+Description: Use AC_CONFIG_SUBDIRS to configure "lib-widget-extra".
+ This allows dh_autoreconf to refresh configure scripts in the subdirectory
+ "lib-widget-extra", which in turn is needed because of a patched
+ configure.ac file.
+Origin: backport, https://code.google.com/p/audacity/source/detail?r=12901
+Bug-Debian: https://bugs.debian.org/749659
+
+--- a/m4/audacity_checklib_widgetextra.m4
++++ b/m4/audacity_checklib_widgetextra.m4
+@@ -1,37 +1,50 @@
+ dnl Add Audacity/WX license?
+ dnl Please increment the serial number below whenever you alter this macro
+ dnl for the benefit of automatic macro update systems
+-# audacity_checklib_widgetextra.m4 serial 1
++# audacity_checklib_widgetextra.m4 serial 2
+ 
+ dnl A function to check for the correct presence of lib-widget-extra in the 
+ dnl lib-src tree. Note that this is a mandatory library, and
+ dnl that because we maintain it, we don't support system copies.
+ 
+-dnl You would have thought you could use pkg-config for this. But the
+-dnl pkg-config file doesn't exist until configure has been run for
+-dnl lib-widget-extra. Using AC_CONFIG_SUBDIRS, that doesn't happen until
+-dnl after everything in the main configure script has happened, so
+-dnl we can't detect anything about the configured library, because it isn't
+-dnl configured when this runs.
+-dnl To get round this we have created our own subdirectory configuration
+-dnl function, AX_CONFIG_DIR based on a subset of the code that implements
+-dnl AC_CONFIG_SUBDIRS.
+-
+ AC_DEFUN([AUDACITY_CHECKLIB_WIDGETEXTRA], [
+-   dnl we always need to configure libwidgetextra, so just call the script
+-   dnl regardless.
+-   AX_CONFIG_DIR(["${srcdir}/lib-src/lib-widget-extra"])
+-   dnl having done that we get a pkg-config file we can use
+-   dnl add the directory with lib-widget-extra in to the pkg-config search path
+-   PKG_CONFIG_PATH="${srcdir}/lib-src/lib-widget-extra/:$PKG_CONFIG_PATH"
+-   export PKG_CONFIG_PATH
++   AC_ARG_WITH(widgetextra,
++               [AS_HELP_STRING([--with-widgetextra],
++                               [which libwidgetextra to use (required): [system,local]])],
++               WIDGETEXTRA_ARGUMENT=$withval,
++               WIDGETEXTRA_ARGUMENT="unspecified")
++
++   dnl see if libwidgetextra is installed on the system
++
+    PKG_CHECK_MODULES(WIDGETEXTRA, libwidgetextra,
+-                     widgetextra_available="yes",
+-                     widgetextra_available="no")
++                     WIDGETEXTRA_SYSTEM_AVAILABLE="yes",
++                     WIDGETEXTRA_SYSTEM_AVAILABLE="no")
++
++   if test "$WIDGETEXTRA_SYSTEM_AVAILABLE" = "yes"; then
++      WIDGETEXTRA_SYSTEM_LIBS=$WIDGETEXTRA_LIBS
++      WIDGETEXTRA_SYSTEM_CXXFLAGS=$WIDGETEXTRA_CFLAGS
++      AC_MSG_NOTICE([libwidgetextra library is available as system library.])
++   else
++      AC_MSG_NOTICE([libwidgetextra library is NOT available as system library.])
++   fi
++
++   dnl see if libwidgetextra is available locally
++
++   AC_CHECK_FILE(${srcdir}/lib-src/lib-widget-extra/NonGuiThread.h,
++                 WIDGETEXTRA_LOCAL_AVAILABLE="yes",
++                 WIDGETEXTRA_LOCAL_AVAILABLE="no")
++
++   if test "$WIDGETEXTRA_LOCAL_AVAILABLE" = "yes"; then
++      WIDGETEXTRA_LOCAL_LIBS="libwidgetextra.a"
++      WIDGETEXTRA_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/lib-widget-extra'
++      AC_MSG_NOTICE([libwidgetextra library is available in the local tree])
++   else
++      AC_MSG_NOTICE([libwidgetextra library is NOT available in the local tree])
++   fi
++])
+ 
+-   if test "x$widgetextra_available" != "xyes" ; then
+-      AC_MSG_ERROR([lib-widget-extra is required to build audacity. A copy is included in the audacity source distribution at lib-src/lib-widget-extra/.])
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_WIDGETEXTRA], [
++   if test "$WIDGETEXTRA_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/lib-widget-extra])
+    fi
+-   dnl otherwise good - got it. Flags will be available for use in
+-   dnl WIDGETEXTRA_LIBS and friends
+ ])
+--- a/lib-src/Makefile.in
++++ b/lib-src/Makefile.in
+@@ -21,6 +21,8 @@
+ # libwidgetextra
+ widgetextra:
+ 	$(MAKE) -C lib-widget-extra
++libwidgetextra.a: widgetextra
++	ln -sf lib-widget-extra/.libs/libwidgetextra.a libwidgetextra.a
+ 
+ # libogg
+ libogg-recursive:
+--- a/lib-src/lib-widget-extra/libwidgetextra-uninstalled.pc.in
++++ /dev/null
+@@ -1,17 +0,0 @@
+-# This pkg-config file lets you use the compiled lib without having to first
+-# install it anywhere. Simply put the directory the pkg-config file is in on the
+-# PKG_CONFIG_PATH and look for libwidgetextra as normal - the uninstalled file 
+-# is prefered to the installed one if both are found
+-libdir=@abs_builddir@
+-# The library always ends up in the build dir.
+-includedir=@abs_srcdir@
+-# The headers are always in the source dir
+-
+-Name: lib-widget-extra
+-Description: Extras for wxwidgets
+-Requires: 
+-Version: 1
+-
+-Libs: -L${libdir} -lwidgetextra
+-Libs.private: @LIBS@ 
+-Cflags: -I${includedir}
+--- a/lib-src/lib-widget-extra/configure.in
++++ b/lib-src/lib-widget-extra/configure.in
+@@ -7,21 +7,26 @@
+ dnl
+ 
+ dnl
+-dnl Instructions: to create "configure" from "configure.in", run:
++dnl Instructions: to create "configure" from "configure.in", run: autoreconf
+ dnl
+ 
+-dnl Process this file with autoconf to produce a configure script.
+-
+ dnl Require autoconf >= 2.60
+-AC_PREREQ(2.59)
++AC_PREREQ([2.60])
+ 
+ dnl Init autoconf
+-AC_INIT
++AC_INIT([libwidgetextra], [1.0])
+ dnl check we have some source (are in the right directory)
+ AC_CONFIG_SRCDIR([NonGuiThread.h])
++AC_CONFIG_AUX_DIR([autotools])
+ dnl we have some extra macros in m4/
+ AC_CONFIG_MACRO_DIR([m4])
+ 
++AM_INIT_AUTOMAKE([1.11 dist-xz foreign no-dist-gzip -Wall])
++AM_MAINTAINER_MODE([disable])
++
++AM_PROG_AR
++LT_INIT
++
+ dnl -------------------------------------------------------
+ dnl Checks for programs.
+ dnl -------------------------------------------------------
+@@ -38,22 +43,6 @@
+ CPPFLAGS="$cppflags_save"
+ CXXFLAGS="$cxxflags_save"
+ 
+-dnl we will need an "install" program to be available
+-AC_PROG_INSTALL
+-
+-dnl We have some extra variables which we need to subsitute into output files
+-AC_SUBST(INSTALL_PREFIX)
+-
+-dnl Make the install prefix available to the program so that the pkg-config file
+-dnl can be created correctly
+-AC_PREFIX_DEFAULT(/usr/local)
+-if [[ $prefix = "NONE" ]] ; then
+-  AC_DEFINE(INSTALL_PREFIX, "/usr/local",
+-      [define as prefix where Audacity is installed])
+-else
+-  AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix")
+-fi
+-
+ dnl Build Options
+ 
+ AC_ARG_ENABLE(wx-static,
+@@ -84,7 +73,7 @@
+ dnl If user asked for debug, put debug in compiler flags
+ dnl ----------------------------------------------------
+ 
+-if test x"$debug_preference" = "xyes" ; then
++if test "$debug_preference" = "yes"; then
+    dnl we want debuging on
+    AC_MSG_NOTICE([Adding -g for debugging to CFLAGS and CXXFLAGS ...])
+    CFLAGS="${CFLAGS} -g "
+@@ -158,28 +147,19 @@
+ 
+ dnl Gather wx arguments
+ 
+-LIBS="$LIBS `$WX_CONFIG $wx_configargs --libs`"
+-CPPFLAGS="$CPPFLAGS `$WX_CONFIG $wx_configargs --cxxflags`"
++WX_CXXFLAGS=$($WX_CONFIG $wx_configargs --cxxflags)
++WX_LIBS=$($WX_CONFIG $wx_configargs --libs)
++AC_SUBST([WX_CXXFLAGS])
++AC_SUBST([WX_LIBS])
+ 
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+ AC_TYPE_SIZE_T
+ 
+-AC_CONFIG_FILES([Makefile libwidgetextra.pc libwidgetextra-uninstalled.pc])
++AC_CONFIG_FILES([libwidgetextra.pc Makefile])
+ 
+ AC_OUTPUT
+ 
+ echo ""
+ echo "Run 'configure --help' for an explanation of the possible options,"
+ echo "otherwise run 'make' to build libwidgetextra."
+-
+-dnl Indentation settings for Vim and Emacs and unique identifier for Arch, a
+-dnl version control system. Please do not modify past this point.
+-
+-
+-# Local Variables:
+-# c-basic-offset: 3
+-# indent-tabs-mode: nil
+-# End:
+-#
+-# vim: et sts=3 sw=3
+--- a/lib-src/lib-widget-extra/libwidgetextra.pc.in
++++ b/lib-src/lib-widget-extra/libwidgetextra.pc.in
+@@ -1,11 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
+ libdir=@libdir@
+ includedir=@includedir@
+ 
+-Name: lib-widget-extra
++Name: @PACKAGE@
+ Description: Extras for wxwidgets
+-Requires: 
+-Version: 1
+-
+-Libs: -L${libdir} -lwidgetextra 
+-Libs.private: @LIBS@ 
+-Cflags: -I${includedir} 
++Version: @VERSION@
++Cflags: -I${includedir}
++Libs: -L${libdir} -lwidgetextra
+--- /dev/null
++++ b/lib-src/lib-widget-extra/Makefile.am
+@@ -0,0 +1,12 @@
++ACLOCAL_AMFLAGS = -I m4
++
++EXTRA_DIST = libwidgetextra.pc.in
++
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = libwidgetextra.pc
++
++lib_LTLIBRARIES = libwidgetextra.la
++
++libwidgetextra_la_CPPFLAGS = $(WX_CXXFLAGS)
++libwidgetextra_la_LIBADD = $(WX_LIBS)
++libwidgetextra_la_SOURCES = NonGuiThread.cpp NonGuiThread.h
+--- a/configure.in
++++ b/configure.in
+@@ -322,20 +322,11 @@
+ LOCAL_LIBS="$LOCAL_LIBS FileDialog.a"
+ CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/lib-src/FileDialog"
+ 
+-dnl Include lib-widget-extra (via pkg-config). Doing this gets it configured as
+-dnl well, because it has to be configured in order to be found
+-AUDACITY_CHECKLIB_WIDGETEXTRA
+-dnl pull in flags for the library
+-BUILD_LDFLAGS="$BUILD_LDFLAGS $WIDGETEXTRA_LIBS"
+-CXXFLAGS="$CXXFLAGS $WIDGETEXTRA_CFLAGS"
+-dnl Add the library to the list of libraries that need to be compiled
+-LIBSRC_BUILD="$LIBSRC_BUILD widgetextra"
+-
+ dnl-------------------------------------------------------------
+ dnl Optional library support. Lots of things we could use, but 
+ dnl can do without if they aren't available.
+ dnl-------------------------------------------------------------
+-LIBRARIES="LIBVORBIS LIBMAD LIBSNDFILE LIBFLAC LIBID3TAG LIBSOXR LIBRESAMPLE LIBSAMPLERATE LIBSBSMS LIBSOUNDTOUCH LIBNYQUIST LIBVAMP LIBEXPAT LIBTWOLAME FFMPEG PORTSMF PORTAUDIO LAME"
++LIBRARIES="LIBVORBIS LIBMAD LIBSNDFILE LIBFLAC LIBID3TAG LIBSOXR LIBRESAMPLE LIBSAMPLERATE LIBSBSMS LIBSOUNDTOUCH LIBNYQUIST LIBVAMP LIBEXPAT LIBTWOLAME FFMPEG PORTSMF PORTAUDIO LAME WIDGETEXTRA"
+ 
+ AC_MSG_NOTICE([Determining what libraries are available in this tree and on the system])
+ 
+@@ -357,6 +348,7 @@
+ AUDACITY_CHECKLIB_PORTSMF
+ AUDACITY_CHECKLIB_PORTAUDIO
+ AUDACITY_CHECKLIB_LAME
++AUDACITY_CHECKLIB_WIDGETEXTRA
+ 
+ dnl Decide what libraries to build with, and whether to use system or local libraries
+ dnl Set variables based on choices.
+@@ -409,11 +401,16 @@
+ done
+ 
+ # In some cases the choices made above might be inappropriate.
++#   * we need to have libwidgetextra one way or another
+ #   * we need to have libsndfile one way or another
+ #   * we need to have libexpat one way or another
+ #   * we need to have portaudio way or another
+ #   * we can only use one of libsoxr, libsamplerate and libresample
+ 
++if test "$WIDGETEXTRA_USE_LOCAL" != "yes" -a "$WIDGETEXTRA_USE_SYSTEM" != "yes"; then
++   AC_MSG_ERROR([Audacity requires libwidgetextra to be enabled.])
++fi
++
+ if test "$LIBSNDFILE_USE_LOCAL" != "yes" && test "$LIBSNDFILE_USE_SYSTEM" != "yes" ; then
+    AC_MSG_ERROR([Audacity requires libsndfile to be enabled])
+ fi
+@@ -524,6 +521,7 @@
+ AUDACITY_CONFIG_SUBDIRS_LIBVORBIS
+ AUDACITY_CONFIG_SUBDIRS_PORTAUDIO
+ AUDACITY_CONFIG_SUBDIRS_PORTSMF
++AUDACITY_CONFIG_SUBDIRS_WIDGETEXTRA
+ 
+ dnl " This is included purely to close an otherwise endless string in vim
+ 
diff -Nru audacity-2.0.5/debian/patches/autoreconf-subdirectories.patch audacity-2.0.5/debian/patches/autoreconf-subdirectories.patch
--- audacity-2.0.5/debian/patches/autoreconf-subdirectories.patch	1970-01-01 01:00:00.000000000 +0100
+++ audacity-2.0.5/debian/patches/autoreconf-subdirectories.patch	2014-09-20 23:06:14.000000000 +0200
@@ -0,0 +1,448 @@
+Description: Make configure subdirectories in AC_CONFIG_SUBDIRS literal.
+ This allows dh_autoreconf to refresh configure scripts in subdirectories,
+ which in turn is needed because of patched configure.ac files.
+Origin: backport, https://code.google.com/p/audacity/source/detail?r=12761
+Bug-Debian: https://bugs.debian.org/749659
+
+--- a/m4/audacity_checklib_libvamp.m4
++++ b/m4/audacity_checklib_libvamp.m4
+@@ -53,8 +53,6 @@
+ 	  dnl define a pre-processor symbol to tell other code that the vamp host
+ 	  dnl SDK is available
+       LIBVAMP_LOCAL_CPPSYMBOLS="USE_VAMP"
+-	  dnl schedule the directory to be configured
+-      LIBVAMP_LOCAL_CONFIG_SUBDIRS="lib-src/libvamp"
+ 	  dnl do not build programs we don't need
+ 	   LIBVAMP_LOCAL_CONFIGURE_ARGS="--disable-programs"
+ 
+@@ -65,3 +63,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBVAMP], [
++   if test "$LIBVAMP_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libvamp])
++   fi
++])
+--- a/m4/audacity_checklib_libvorbis.m4
++++ b/m4/audacity_checklib_libvorbis.m4
+@@ -59,7 +59,6 @@
+ 
+       LIBVORBIS_LOCAL_CPPSYMBOLS="USE_LIBVORBIS"
+ 
+-      LIBVORBIS_LOCAL_CONFIG_SUBDIRS="lib-src/libogg lib-src/libvorbis"
+       AC_MSG_NOTICE([Vorbis libraries are available in this source tree])
+    else
+       AC_MSG_NOTICE([Vorbis libraries are NOT available in this source tree])
+@@ -67,3 +66,8 @@
+    LIBVORBIS_MIMETYPES="application/ogg;audio/x-vorbis+ogg;"
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBVORBIS], [
++   if test "$LIBVORBIS_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libogg lib-src/libvorbis])
++   fi
++])
+--- a/m4/audacity_checklib_libtwolame.m4
++++ b/m4/audacity_checklib_libtwolame.m4
+@@ -45,8 +45,6 @@
+       LIBTWOLAME_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/twolame/libtwolame'
+       LIBTWOLAME_LOCAL_CPPSYMBOLS="USE_LIBTWOLAME"
+ 	
+-	  dnl request library is configured
+-      LIBTWOLAME_LOCAL_CONFIG_SUBDIRS="lib-src/twolame"
+ 	  dnl disable programs we don't need to build
+ 	   LIBTWOLAME_LOCAL_CONFIGURE_ARGS="--disable-programs"
+ 
+@@ -57,3 +55,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBTWOLAME], [
++   if test "$LIBTWOLAME_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/twolame])
++   fi
++])
+--- a/m4/audacity_checklib_libid3tag.m4
++++ b/m4/audacity_checklib_libid3tag.m4
+@@ -49,7 +49,6 @@
+       LIBID3TAG_LOCAL_LIBS="libid3tag.a"
+       LIBID3TAG_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/libid3tag'
+       LIBID3TAG_LOCAL_CPPSYMBOLS="USE_LIBID3TAG"
+-      LIBID3TAG_LOCAL_CONFIG_SUBDIRS="lib-src/libid3tag"
+       AC_MSG_NOTICE([libid3tag libraries are available in the local tree])
+    else
+       LIBID3TAG_LOCAL_AVAILABLE="no"
+@@ -57,3 +56,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBID3TAG], [
++   if test "$LIBID3TAG_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libid3tag])
++   fi
++])
+--- a/m4/audacity_checklib_libnyquist.m4
++++ b/m4/audacity_checklib_libnyquist.m4
+@@ -34,8 +34,6 @@
+       LIBNYQUIST_LOCAL_OPTOBJS="effects/nyquist/Nyquist.o"
+       LIBNYQUIST_LOCAL_OPTOBJS="$LIBNYQUIST_LOCAL_OPTOBJS effects/nyquist/LoadNyquist.o"
+ 
+-      LIBNYQUIST_LOCAL_CONFIG_SUBDIRS="lib-src/libnyquist"
+-
+       AC_MSG_NOTICE([nyquist libraries are available in the local tree])
+    else
+       LIBNYQUIST_LOCAL_AVAILABLE="no"
+@@ -43,3 +41,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBNYQUIST], [
++   if test "$LIBNYQUIST_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libnyquist])
++   fi
++])
+--- a/m4/audacity_checklib_portaudio.m4
++++ b/m4/audacity_checklib_portaudio.m4
+@@ -44,7 +44,6 @@
+       PORTAUDIO_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/portaudio-v19/include'
+ 
+       dnl set up configuring portaudio
+-      PORTAUDIO_LOCAL_CONFIG_SUBDIRS="lib-src/portaudio-v19"
+       PORTAUDIO_LOCAL_CONFIGURE_ARGS="--with-pa-include=../portaudio-v19/include"
+ 
+       AC_MSG_NOTICE([portaudio19 library is available in the local tree])
+@@ -54,3 +53,9 @@
+    fi
+ 
+ ])
++
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_PORTAUDIO], [
++   if test "$PORTAUDIO_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/portaudio-v19])
++   fi
++])
+--- a/m4/audacity_checklib_liblrdf.m4
++++ b/m4/audacity_checklib_liblrdf.m4
+@@ -46,9 +46,6 @@
+       LIBLRDF_LOCAL_LIBS="liblrdf.a"
+       LIBLRDF_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/liblrdf'
+       LIBLRDF_LOCAL_CPPSYMBOLS="USE_LIBLRDF"
+-      if test ! -f lib-src/liblrdf/Makefile ; then
+-         LIBLRDF_LOCAL_CONFIG_SUBDIRS="lib-src/liblrdf"
+-      fi
+       AC_MSG_NOTICE([liblrdf is available in the local tree])
+    else
+       LIBLRDF_LOCAL_AVAILABLE="no"
+@@ -56,3 +53,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBLRDF], [
++   if test "$LIBLRDF_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/liblrdf])
++   fi
++])
+--- a/m4/audacity_checklib_libsoxr.m4
++++ b/m4/audacity_checklib_libsoxr.m4
+@@ -48,13 +48,9 @@
+       LIBSOXR_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/libsoxr/src'
+       LIBSOXR_LOCAL_CPPSYMBOLS="USE_LIBSOXR"
+ 
+-      if test ! -f lib-src/libsoxr/Makefile ; then
+-         LIBSOXR_LOCAL_CONFIG_SUBDIRS="lib-src/libsoxr"
+-
+-         # Breaks other other libraries in Audacity tree; but why is ./configure
+-         # passing options specific to this library to other libraries?
+-         #LIBSOXR_LOCAL_CONFIGURE_ARGS="\"-DBUILD_SHARED_LIBS=OFF -DWITH_OPENMP=OFF\""
+-      fi
++      # Breaks other other libraries in Audacity tree; but why is ./configure
++      # passing options specific to this library to other libraries?
++      #LIBSOXR_LOCAL_CONFIGURE_ARGS="\"-DBUILD_SHARED_LIBS=OFF -DWITH_OPENMP=OFF\""
+       AC_MSG_NOTICE([libsoxr libraries are available in the local tree])
+    else
+       LIBSOXR_LOCAL_AVAILABLE="no"
+@@ -62,3 +58,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBSOXR], [
++   if test "$LIBSOXR_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libsoxr])
++   fi
++])
+--- a/m4/audacity_checklib_libsamplerate.m4
++++ b/m4/audacity_checklib_libsamplerate.m4
+@@ -44,10 +44,6 @@
+       LIBSAMPLERATE_LOCAL_LIBS="libsamplerate.a"
+       LIBSAMPLERATE_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/libsamplerate/src'
+       LIBSAMPLERATE_LOCAL_CPPSYMBOLS="USE_LIBSAMPLERATE"
+-
+-      if test ! -f lib-src/libsamplerate/Makefile ; then
+-         LIBSAMPLERATE_LOCAL_CONFIG_SUBDIRS="lib-src/libsamplerate"
+-      fi
+       AC_MSG_NOTICE([libsamplerate libraries are available in the local tree])
+    else
+       LIBSAMPLERATE_LOCAL_AVAILABLE="no"
+@@ -55,3 +51,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBSAMPLERATE], [
++   if test "$LIBSAMPLERATE_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libsamplerate])
++   fi
++])
+--- a/m4/audacity_checklib_slv2.m4
++++ b/m4/audacity_checklib_slv2.m4
+@@ -44,9 +44,6 @@
+       SLV2_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/slv2'
+       SLV2_LOCAL_CPPSYMBOLS="USE_SLV2"
+       SLV2_LOCAL_OPTOBJS="effects/lv2/LoadLV2.o effects/lv2/LV2Effect.o effects/lv2/LV2PortGroup.o"
+-      if test ! -f lib-src/slv2/Makefile ; then
+-         SLV2_LOCAL_CONFIG_SUBDIRS="lib-src/slv2"
+-      fi
+       AC_MSG_NOTICE([SLV2 is available in the local tree])
+    else
+       SLV2_LOCAL_AVAILABLE="no"
+@@ -54,3 +51,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_SLV2], [
++   if test "$SLV2_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/slv2])
++   fi
++])
+--- a/m4/audacity_checklib_portsmf.m4
++++ b/m4/audacity_checklib_portsmf.m4
+@@ -45,10 +45,15 @@
+       PORTSMF_LOCAL_LIBS="libportSMF.a"
+       PORTSMF_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/portsmf'
+       PORTSMF_LOCAL_CPPSYMBOLS="USE_MIDI"
+-      PORTSMF_LOCAL_CONFIG_SUBDIRS="lib-src/portsmf"
+       dnl extra objects we can now compile
+       PORTSMF_LOCAL_OPTOBJS="NoteTrack.o import/ImportMIDI.o"
+    else
+       PORTSMF_LOCAL_AVAILABLE="no"
+    fi
+ ])
++
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_PORTSMF], [
++   if test "$PORTSMF_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/portsmf])
++   fi
++])
+--- a/m4/audacity_checklib_libflac.m4
++++ b/m4/audacity_checklib_libflac.m4
+@@ -62,7 +62,6 @@
+       LIBFLAC_LOCAL_CPPSYMBOLS="USE_LIBFLAC"
+       # this file shouldn't be built at if no libflac is available
+       LIBFLAC_LOCAL_OPTOBJS="ondemand/ODDecodeFlacTask.o"
+-      LIBFLAC_LOCAL_CONFIG_SUBDIRS="lib-src/libflac"
+ 	
+       AC_MSG_NOTICE([FLAC libraries are available in this source tree])
+    else
+@@ -72,3 +71,8 @@
+    LIBFLAC_MIMETYPES="audio/flac;audio/x-flac;"
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBFLAC], [
++   if test "$LIBFLAC_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libflac])
++   fi
++])
+--- a/m4/audacity_checklib_libraptor.m4
++++ b/m4/audacity_checklib_libraptor.m4
+@@ -36,9 +36,6 @@
+       LIBRAPTOR_LOCAL_AVAILABLE="yes"
+       LIBRAPTOR_LOCAL_LIBS="libraptor.a"
+       LIBRAPTOR_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/libraptor/src'
+-      if test ! -f lib-src/libraptor/Makefile ; then
+-         LIBRAPTOR_LOCAL_CONFIG_SUBDIRS="lib-src/libraptor"
+-      fi
+       AC_MSG_NOTICE([libraptor is available in the local tree])
+       if test "x$LIBEXPAT_SYSTEM_AVAILABLE" = "xno" ; then
+          LIBRAPTOR_LOCAL_CONFIGURE_ARGS="\"--with-expat-source=${srcdir}/src/include\""
+@@ -50,3 +47,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBRAPTOR], [
++   if test "$LIBRAPTOR_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libraptor])
++   fi
++])
+--- a/m4/audacity_checklib_libresample.m4
++++ b/m4/audacity_checklib_libresample.m4
+@@ -33,7 +33,6 @@
+       LIBRESAMPLE_LOCAL_LIBS="libresample.a"
+       LIBRESAMPLE_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/libresample/include'
+       LIBRESAMPLE_LOCAL_CPPSYMBOLS="USE_LIBRESAMPLE"
+-      LIBRESAMPLE_LOCAL_CONFIG_SUBDIRS="lib-src/libresample"
+       
+       AC_MSG_NOTICE([libresample libraries are available in the local tree])
+    else
+@@ -42,3 +41,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBRESAMPLE], [
++   if test "$LIBRESAMPLE_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libresample])
++   fi
++])
+--- a/m4/audacity_checklib_taglib.m4
++++ b/m4/audacity_checklib_taglib.m4
+@@ -43,9 +43,6 @@
+       TAGLIB_LOCAL_LIBS="taglib.a"
+       TAGLIB_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/taglib/taglib'
+       TAGLIB_LOCAL_CPPSYMBOLS="USE_TAGLIB"
+-	
+-      dnl request library is configured
+-      TAGLIB_LOCAL_CONFIG_SUBDIRS="lib-src/taglib"
+ 
+       AC_MSG_NOTICE([TagLib library is available in the local tree])
+    else
+@@ -54,3 +51,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_TAGLIB], [
++   if test "$TAGLIB_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/taglib])
++   fi
++])
+--- a/m4/audacity_checklib_redland.m4
++++ b/m4/audacity_checklib_redland.m4
+@@ -34,9 +34,6 @@
+       REDLAND_LOCAL_AVAILABLE="yes"
+       REDLAND_LOCAL_LIBS="librdf.a libraptor.a librasqal.a"
+       REDLAND_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/redland/librdf -I$(top_srcdir)/lib-src/redland/raptor/src -I$(top_srcdir)/lib-src/redland/rasqal/src'
+-      if test ! -f lib-src/redland/Makefile ; then
+-         REDLAND_LOCAL_CONFIG_SUBDIRS="lib-src/redland"
+-      fi
+       if test "x$LIBEXPAT_SYSTEM_AVAILABLE" = "xno" ; then
+          # This is a horrible hack to keep from having to modify the raptor/configure.ac.  It makes
+          # the raptor configure think there's a full expat source tree.  But, all we have is expat.h
+@@ -51,3 +48,8 @@
+    fi
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_REDLAND], [
++   if test "$REDLAND_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/redland])
++   fi
++])
+--- a/m4/audacity_checklib_libsndfile.m4
++++ b/m4/audacity_checklib_libsndfile.m4
+@@ -37,7 +37,6 @@
+       LIBSNDFILE_LOCAL_AVAILABLE="yes"
+       LIBSNDFILE_LOCAL_LIBS="libsndfile.a"
+       LIBSNDFILE_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/libsndfile/src'
+-      LIBSNDFILE_LOCAL_CONFIG_SUBDIRS="lib-src/libsndfile"
+       AC_MSG_NOTICE([libsndfile libraries are available in this source tree])
+ 
+       dnl These must be visible so libvamp and sbsms can find us
+@@ -53,3 +52,8 @@
+    LIBSNDFILE_MIMETYPES="audio/basic;audio/x-aiff;audio/x-wav;"
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBSNDFILE], [
++   if test "$LIBSNDFILE_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libsndfile])
++   fi
++])
+--- a/m4/audacity_checklib_libsbsms.m4
++++ b/m4/audacity_checklib_libsbsms.m4
+@@ -45,8 +45,6 @@
+       LIBSBSMS_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/sbsms/include'
+       LIBSBSMS_LOCAL_CPPSYMBOLS="USE_SBSMS"
+ 
+-	  dnl set up configuring sbsms
+-      LIBSBSMS_LOCAL_CONFIG_SUBDIRS="lib-src/sbsms"
+ 	  dnl do not build programs we don't need
+ 	   LIBSBSMS_LOCAL_CONFIGURE_ARGS="--disable-programs"
+ 
+@@ -58,3 +56,8 @@
+ 
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBSBSMS], [
++   if test "$LIBSBSMS_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/sbsms])
++   fi
++])
+--- a/m4/audacity_checklib_libsoundtouch.m4
++++ b/m4/audacity_checklib_libsoundtouch.m4
+@@ -59,7 +59,6 @@
+       LIBSOUNDTOUCH_LOCAL_LIBS="libSoundTouch.a"
+       LIBSOUNDTOUCH_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/soundtouch/include'
+       LIBSOUNDTOUCH_LOCAL_CPPSYMBOLS="USE_SOUNDTOUCH"
+-      LIBSOUNDTOUCH_LOCAL_CONFIG_SUBDIRS="lib-src/soundtouch"
+       AC_MSG_NOTICE([libsoundtouch libraries are available in the local tree])
+    else
+       LIBSOUNDTOUCH_LOCAL_AVAILABLE="no"
+@@ -68,3 +67,8 @@
+ 
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBSOUNDTOUCH], [
++   if test "$LIBSOUNDTOUCH_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/soundtouch])
++   fi
++])
+--- a/m4/audacity_checklib_libmad.m4
++++ b/m4/audacity_checklib_libmad.m4
+@@ -53,7 +53,6 @@
+       LIBMAD_LOCAL_LIBS="libmad.a"
+       LIBMAD_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/libmad'
+       LIBMAD_LOCAL_CPPSYMBOLS="USE_LIBMAD"
+-      LIBMAD_LOCAL_CONFIG_SUBDIRS="lib-src/libmad"
+       AC_MSG_NOTICE([libmad libraries are available in the local tree])
+    else
+       LIBMAD_LOCAL_AVAILABLE="no"
+@@ -62,3 +61,8 @@
+    LIBMAD_MIMETYPES="audio/mpeg;"
+ ])
+ 
++AC_DEFUN([AUDACITY_CONFIG_SUBDIRS_LIBMAD], [
++   if test "$LIBMAD_USE_LOCAL" = yes; then
++      AC_CONFIG_SUBDIRS([lib-src/libmad])
++   fi
++])
+--- a/configure.in
++++ b/configure.in
+@@ -490,9 +490,7 @@
+       eval BUILD_LDFLAGS=\"\$BUILD_LDFLAGS \$${lib}_LOCAL_LDFLAGS\"
+       eval OPTOBJS=\"$OPTOBJS \$${lib}_LOCAL_OPTOBJS\"
+       eval CXXFLAGS=\"\$CXXFLAGS \$${lib}_LOCAL_CXXFLAGS\"
+-      eval CONFIG_SUBDIRS=\"\$${lib}_LOCAL_CONFIG_SUBDIRS\"
+       eval ac_configure_args=\"\$ac_configure_args \$${lib}_LOCAL_CONFIGURE_ARGS\"
+-      AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
+ 
+       eval CPPSYMBOLS=\"\$${lib}_LOCAL_CPPSYMBOLS\"
+       for symbol in $CPPSYMBOLS ; do
+@@ -511,6 +509,22 @@
+    fi
+ done
+ 
++AUDACITY_CONFIG_SUBDIRS_LIBFLAC
++AUDACITY_CONFIG_SUBDIRS_LIBID3TAG
++AUDACITY_CONFIG_SUBDIRS_LIBMAD
++AUDACITY_CONFIG_SUBDIRS_LIBNYQUIST
++AUDACITY_CONFIG_SUBDIRS_LIBRESAMPLE
++AUDACITY_CONFIG_SUBDIRS_LIBSAMPLERATE
++AUDACITY_CONFIG_SUBDIRS_LIBSBSMS
++AUDACITY_CONFIG_SUBDIRS_LIBSNDFILE
++AUDACITY_CONFIG_SUBDIRS_LIBSOUNDTOUCH
++AUDACITY_CONFIG_SUBDIRS_LIBSOXR
++AUDACITY_CONFIG_SUBDIRS_LIBTWOLAME
++AUDACITY_CONFIG_SUBDIRS_LIBVAMP
++AUDACITY_CONFIG_SUBDIRS_LIBVORBIS
++AUDACITY_CONFIG_SUBDIRS_PORTAUDIO
++AUDACITY_CONFIG_SUBDIRS_PORTSMF
++
+ dnl " This is included purely to close an otherwise endless string in vim
+ 
+ 
diff -Nru audacity-2.0.5/debian/patches/series audacity-2.0.5/debian/patches/series
--- audacity-2.0.5/debian/patches/series	2014-05-31 21:54:16.000000000 +0200
+++ audacity-2.0.5/debian/patches/series	2014-09-20 23:06:26.000000000 +0200
@@ -3,3 +3,7 @@
 ffmpeg.patch
 remove-strict-prototype-warnings.patch
 fix-ladspa-search-path.patch
+wx30.patch
+autoreconf-subdirectories.patch
+autoreconf-subdirectories-lib-widget-extra.patch
+autoreconf.patch
diff -Nru audacity-2.0.5/debian/patches/wx30.patch audacity-2.0.5/debian/patches/wx30.patch
--- audacity-2.0.5/debian/patches/wx30.patch	1970-01-01 01:00:00.000000000 +0100
+++ audacity-2.0.5/debian/patches/wx30.patch	2014-09-20 23:06:14.000000000 +0200
@@ -0,0 +1,1444 @@
+Description: Compile audacity against wxWidgets 3.0
+ Solved compilation issues:
+ (1.) Allow wxWidgets 3.0 in various configure scripts.
+ (2.) The file dialog was derived from an internal wx class that
+ disappeared in wx3.0 (discussed in further detail below).
+ (3.) In several places the types in interfaces changed between
+ wxChar* and wxString. I've tried to modify the code so it works with
+ both interfaces (thanks to implicit conversion; may look a bit weird
+ in some places).
+ (4.) Calls to "wxTheApp->SuspendIdleCallback()" are no longer
+ supported. They were part of a workaround for a clipboard problem,
+ which fortunately doesn't seem to be there any longer in wx3.0, so I
+ deactivated it for wx3.0.
+ (5.) AddPendingEvent() and ProcessEvent() now have the visibility
+ "protected" in wxWindow. It has always been a bad idea to call them
+ directly on a wxWindow object, but now it's explicitly forbidden.
+ Instead, those functions should be called on the object returned by
+ GetEventHandler().
+ (6.) The class wxStandardPaths is now a singleton and has to be
+ treated as such (no more explicit constructor calls).
+ (7.) "wxLogWarning" is a macro now, so the "::" prefix doesn't work
+ on it anymore.
+ (8.) Several int types (which were actually used as enums) are now
+ real enum types (e.g. wxRasterOperationMode, wxMouseButton) and have
+ to be used as such.
+ (9.) Apart from the FD constants (which have been fixed in Olly's
+ patch already) there are some other constants which have received a
+ prefix (e.g. wx* -> wxFONTFAMILY_*, wx* -> wxFONTSTYLE_*, wx* ->
+ wxFONTWEIGHT_*).
+ (10.) Signature changes in constructors of wxFlexGridSizer and wxIcon
+ and wxSizeEvent
+ (11.) Missing includes (missing header files were probably included
+ indirectly in wx2.8 by chance)
+ (12.) When deriving from the abstract class wxGridTableBase,
+ different methods have to be implemented with wx3.0 (EndEdit with new
+ signature and ApplyEdit) than before with wx2.8 (only EndEdit with
+ old signature). Now both versions are implemented in parallel in the
+ classes TimeEditor and ChoiceEditor (one version essentially being a
+ wrapper of the other one).
+ Solved runtime issues:
+ (1.) Segmentation fault: The LadspaEffectDialog receives EVT_TEXT
+ events before it's properly initialized. To prevent this, a
+ workaround was already in place, but was only active on Windows. It
+ looks like this happens now on more platforms (including GTK). As the
+ workaround doesn't do any harm, even if activated unnecessarily, I've
+ simply activated it for all environments.
+ (2.) GTK critical warning "IA__gtk_range_set_range: assertion
+ 'min < max' failed" because of negative numbers as result of window
+ size checking. Added a sanity check that straightens up the numbers
+ in edge cases.
+ (3.) GTK critical warning "IA__gdk_window_get_origin: assertion
+ 'GDK_IS_WINDOW (window)' failed": Received events of type wxSizeEvent
+ on the main project window cause calls to "ClientToScreen" - which is
+ not available until the window is first shown. So the class has to
+ keep track of wxShowEvent events and inhibit those actions until the
+ window is first shown.
+ (4.) The functions wxString::Format and wxString::Printf have become
+ stricter about parameter types that don't match (format string vs.
+ function parameters). So the bugs (that were already present in
+ audacity before) become visible in wx3.0 as error messages. I've
+ fixed all the ones that popped up during my testing, but there might
+ be more of them that I just didn't happen to hit. At some point, all
+ the calls to wxString::Format and wxString::Printf have to be checked
+ systematically.
+Author: Martin Steghöfer <martin at steghoefer.eu>
+Bug-Debian: https://bugs.debian.org/749659
+
+--- a/configure.in
++++ b/configure.in
+@@ -152,11 +152,11 @@
+ ### Build Options ###
+ #####################
+ 
+-AC_ARG_ENABLE(static,
+-            [AS_HELP_STRING([--enable-static],
++AC_ARG_ENABLE(wx-static,
++            [AS_HELP_STRING([--enable-wx-static],
+                             [link wx statically [default=no]])],
+-            static_preference="--static=$enableval",
+-            static_preference="")
++            wx_static_preference="--static=$enableval",
++            wx_static_preference="")
+ 
+ AC_ARG_ENABLE(unicode,
+             [AS_HELP_STRING([--enable-unicode],
+@@ -186,13 +186,11 @@
+             [dynamic_loading="$enableval"],
+             [dynamic_loading="yes"])
+ 
+-dnl AC_ARG_WITH(wx-version,
+-dnl            [AS_HELP_STRING([--with-wx-version],
+-dnl                            [select wxWidgets version (if both installed) [2.8,]])],
+-dnl            wx_preference="--version=$withval",
+-dnl            wx_preference="")
+-dnl At the moment we only support wx2.8. If we start supporting 3.0 when it
+-dnl comes out, we'll want it back again.
++AC_ARG_WITH(wx-version,
++           [AS_HELP_STRING([--with-wx-version],
++                           [select wxWidgets version (if both installed) [2.8, 3.0]])],
++           wx_preference="--version=$withval",
++           wx_preference="")
+ 
+ dnl ----------------------------------------------------
+ dnl If user asked for debug, put debug in compiler flags
+@@ -281,29 +279,31 @@
+ 
+ if test "x$debug_preference" = "xyes"; then
+    dnl want debug wx as well
+-   wxconfigargs="--debug=yes"
++   wx_configargs="--debug=yes"
+ else
+    dnl normal wx
+-   wxconfigargs=""
++   wx_configargs=""
+ fi
+ 
+ dnl more things we always pass to wx-config
+-wxconfigargs="$static_preference $unicode_preference  $wxconfigargs $wx_preference"
+-wx_version=`${WX_CONFIG} $wxconfigargs --version`
++wx_configargs="$wx_static_preference $unicode_preference $wx_configargs $wx_preference"
++wx_version=`${WX_CONFIG} $wx_configargs --version`
+ 
+-AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
++AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x or 3.0.x])
+ 
+ case "${wx_version}" in
+   2.8.*)
+     echo "Great, you're using wxWidgets ${wx_version}!"
+     ;;
++  3.0.*)
++    echo "Great, you're using wxWidgets ${wx_version}!"
++    ;;
+   *)
+   wx_list=`${WX_CONFIG} --list`
+-  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
+-The currently available configurations are listed below.  If necessary, either
+-install the package for your distribution or download the latest version of
+-wxWidgets
+-from http://wxwidgets.org.
++  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x
++or v3.0.x. The currently available configurations are listed below. If
++necessary, either install the package for your distribution or download a
++suitable version of wxWidgets from http://wxwidgets.org.
+ ${wx_list}])
+ esac
+ 
+@@ -311,8 +311,8 @@
+ ac_configure_args="$ac_configure_args --with-wx-config=\"$WX_CONFIG\""
+ 
+ dnl Gather wx arguments
+-LIBS="$LIBS `$WX_CONFIG $wxconfigargs --libs`"
+-CXXFLAGS="$CXXFLAGS `$WX_CONFIG $wxconfigargs --cxxflags`"
++LIBS="$LIBS `$WX_CONFIG $wx_configargs --libs`"
++CXXFLAGS="$CXXFLAGS `$WX_CONFIG $wx_configargs --cxxflags`"
+ 
+ dnl-----------------------------------------------------------------
+ dnl Pull in library Cflags and so on for the non-optional libraries
+--- a/lib-src/lib-widget-extra/configure.in
++++ b/lib-src/lib-widget-extra/configure.in
+@@ -56,11 +56,11 @@
+ 
+ dnl Build Options
+ 
+-AC_ARG_ENABLE(static,
+-            [AS_HELP_STRING([--enable-static],
++AC_ARG_ENABLE(wx-static,
++            [AS_HELP_STRING([--enable-wx-static],
+                             [link wx statically [default=no]])],
+-            static_preference="--static=$enableval",
+-            static_preference="")
++            wx_static_preference="--static=$enableval",
++            wx_static_preference="")
+ 
+ AC_ARG_ENABLE(unicode,
+             [AS_HELP_STRING([--enable-unicode],
+@@ -74,12 +74,11 @@
+             debug_preference="$enableval",
+             debug_preference="no")
+ 
+-dnl AC_ARG_WITH(wx-version,
+-dnl             [AS_HELP_STRING([--with-wx-version],
+-dnl                            [select wxWidgets version (if both installed) [2.8,]])],
+-dnl            wx_preference="--version=$withval",
+-dnl            wx_preference="")
+-dnl Right now only support wx 2.8
++AC_ARG_WITH(wx-version,
++           [AS_HELP_STRING([--with-wx-version],
++                           [select wxWidgets version (if both installed) [2.8, 3.0]])],
++           wx_preference="--version=$withval",
++           wx_preference="")
+ 
+ dnl ----------------------------------------------------
+ dnl If user asked for debug, put debug in compiler flags
+@@ -128,37 +127,39 @@
+ 
+ if test "x$debug_preference" = "xyes"; then
+    dnl want debug wx as well
+-   wxconfigargs="--debug=yes"
++   wx_configargs="--debug=yes"
+ else
+    dnl normal wx
+-   wxconfigargs=""
++   wx_configargs=""
+ fi
+ 
+ dnl more things we always pass to wx-config
+-wxconfigargs="$static_preference $unicode_preference  $wxconfigargs $wx_preference"
++wx_configargs="$wx_static_preference $unicode_preference $wx_configargs $wx_preference"
+ 
+-wx_version=`${WX_CONFIG} $wxconfigargs --version`
++wx_version=`${WX_CONFIG} $wx_configargs --version`
+ 
+-AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
++AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x or 3.0.x])
+ 
+ case "${wx_version}" in
+   2.8.*)
+     echo "Great, you're using wxWidgets ${wx_version}!"
+     ;;
++  3.0.*)
++    echo "Great, you're using wxWidgets ${wx_version}!"
++    ;;
+   *)
+   wx_list=`${WX_CONFIG} --list`
+-  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
+-The currently available configurations are listed below.  If necessary, either
+-install the package for your distribution or download the latest version of
+-wxWidgets
+-from http://wxwidgets.org.
++  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x
++or v3.0.x. The currently available configurations are listed below. If
++necessary, either install the package for your distribution or download a
++suitable version of wxWidgets from http://wxwidgets.org.
+ ${wx_list}])
+ esac
+ 
+ dnl Gather wx arguments
+ 
+-LIBS="$LIBS `$WX_CONFIG $wxconfigargs --libs`"
+-CPPFLAGS="$CPPFLAGS `$WX_CONFIG $wxconfigargs --cxxflags`"
++LIBS="$LIBS `$WX_CONFIG $wx_configargs --libs`"
++CPPFLAGS="$CPPFLAGS `$WX_CONFIG $wx_configargs --cxxflags`"
+ 
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+--- a/lib-src/FileDialog/configure.ac
++++ b/lib-src/FileDialog/configure.ac
+@@ -26,11 +26,11 @@
+ #
+ # Check for debug
+ #
+-AC_ARG_ENABLE(static,
+-            [AC_HELP_STRING([--enable-static],
++AC_ARG_ENABLE(wx-static,
++            [AC_HELP_STRING([--enable-wx-static],
+                             [link wx statically (default=no)])],
+-            static_preference="--static=$enableval",
+-            static_preference="")
++            wx_static_preference="--static=$enableval",
++            wx_static_preference="")
+ 
+ 
+ AC_ARG_ENABLE(unicode,
+@@ -47,7 +47,7 @@
+ 
+ AC_ARG_WITH(wx-version,
+             [AC_HELP_STRING([--with-wx-version],
+-                            [override default wxWidgets version [2.6,2.8]])],
++                            [override default wxWidgets version [2.8, 3.0]])],
+             wx_preference="--version=$withval",
+             wx_preference="")
+ 
+@@ -64,45 +64,66 @@
+ fi
+ 
+ dnl Gather wx arguments
++wx_configargs="$wx_static_preference $unicode_preference $debug_preference $wx_preference"
+ 
+-CPPFLAGS="$CPPFLAGS `$WX_CONFIG $static_preference $unicode_preference $debug_preference $wx_preference --cxxflags`"
++dnl Get wx version
++wx_version=`${WX_CONFIG} $wx_configargs --version`
+ 
+-dnl OS-specific configuration
++dnl Get wx flags
++CXXFLAGS="$CXXFLAGS `$WX_CONFIG $wx_configargs --cxxflags`"
++
++dnl OS- and wx-version-specific configuration
+ 
+ AC_CANONICAL_HOST
+ 
+-case "${host_os}" in
+-   darwin*)
+-      dnl Mac OS X configuration
+-      EXTRADEPS="mac/FileDialogPrivate.h"
+-      EXTRAOBJS="mac/FileDialogPrivate.o"
+-   ;;      
+-
+-   cygwin*)
+-      dnl Windows/CygWin configuration
+-      EXTRADEPS="win/FileDialogPrivate.h"
+-      EXTRAOBJS="win/FileDialogPrivate.o"
+-   ;;
+-
+-   *)
+-      dnl Unix configuration
+-      AM_PATH_GTK_2_0(2.4.0,
+-            have_gtk="yes",
+-            have_gtk="no")
+-      if [[ "$have_gtk" = "yes" ]]
+-      then
+-         CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
+-         EXTRADEPS="gtk/FileDialogPrivate.h gtk/private.h"
+-         EXTRAOBJS="gtk/FileDialogPrivate.o"
+-         HAVE_GTK=1
+-      else
+-         EXTRADEPS="generic/FileDialogPrivate.h"
+-         EXTRAOBJS="generic/FileDialogPrivate.o"
+-         HAVE_GTK=0
+-      fi
+-   ;;
++case "${wx_version}" in
++  2.8.*)
++    case "${host_os}" in
++       darwin*)
++          dnl Mac OS X configuration
++          EXTRADEPS="mac/FileDialogPrivate.h"
++          EXTRAOBJS="mac/FileDialogPrivate.o"
++       ;;
++       cygwin*)
++          dnl Windows/CygWin configuration
++          EXTRADEPS="win/FileDialogPrivate.h"
++          EXTRAOBJS="win/FileDialogPrivate.o"
++       ;;
++       *)
++          dnl Unix configuration
++          AM_PATH_GTK_2_0(2.4.0,
++                have_gtk="yes",
++                have_gtk="no")
++          if [[ "$have_gtk" = "yes" ]]
++          then
++             CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
++             EXTRADEPS="gtk/FileDialogPrivate.h gtk/private.h"
++             EXTRAOBJS="gtk/FileDialogPrivate.o"
++             HAVE_GTK=1
++          else
++             EXTRADEPS="generic/FileDialogPrivate.h"
++             EXTRAOBJS="generic/FileDialogPrivate.o"
++             HAVE_GTK=0
++          fi
++       ;;
++    esac
++    ;;
++  3.0.*)
++    dnl for wxWidgets >= 3.0 we can compile a generic implementation of our FileDialog
++    EXTRADEPS="wx30/FileDialogPrivate.h"
++    EXTRAOBJS="wx30/FileDialogPrivate.o"
++    HAVE_GTK=0 dnl no need for extra GTK flags, we don't use it directly, we use wx interfaces
++    ;;
++  *)
++  wx_list=`${WX_CONFIG} --list`
++  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x
++or v3.0.x. The currently available configurations are listed below. If
++necessary, either install the package for your distribution or download a
++suitable version of wxWidgets from http://wxwidgets.org.
++${wx_list}])
+ esac
+ 
++
+ #
+ # Write it all out
+ #
+--- a/lib-src/FileDialog/FileDialog.h
++++ b/lib-src/FileDialog/FileDialog.h
+@@ -26,14 +26,18 @@
+ 
+ typedef void (*fdCallback)(void *, int);
+ 
+-#if defined(__WXMAC__)
+-#include "mac/FileDialogPrivate.h"
+-#elif defined(__WXMSW__)
+-#include "win/FileDialogPrivate.h"
+-#elif defined(__WXGTK__) && defined(HAVE_GTK)
+-#include "gtk/FileDialogPrivate.h"
+-#else
+-#include "generic/FileDialogPrivate.h"
++#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION == 8 // wx2.8
++#  if defined(__WXMAC__)
++#    include "mac/FileDialogPrivate.h"
++#  elif defined(__WXMSW__)
++#    include "win/FileDialogPrivate.h"
++#  elif defined(__WXGTK__) && defined(HAVE_GTK)
++#    include "gtk/FileDialogPrivate.h"
++#  else
++#    include "generic/FileDialogPrivate.h"
++#  endif
++#else // wx3.0
++#  include "wx30/FileDialogPrivate.h"
+ #endif
+ 
+ /////////////////////////////////////////////////////////////////////////////
+@@ -55,11 +59,11 @@
+ //----------------------------------------------------------------------------
+ 
+ wxString 
+-FileSelector(const wxChar *message = wxFileSelectorPromptStr,
++FileSelector(const wxChar *message = wxString(wxFileSelectorPromptStr, wxConvUTF8).wc_str(),
+              const wxChar *default_path = NULL,
+              const wxChar *default_filename = NULL,
+              const wxChar *default_extension = NULL,
+-             const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
++             const wxChar *wildcard = wxString(wxFileSelectorDefaultWildcardStr, wxConvUTF8).wc_str(),
+              int flags = 0,
+              wxWindow *parent = NULL,
+              wxString label = wxEmptyString,
+--- /dev/null
++++ b/lib-src/FileDialog/wx30/FileDialogPrivate.cpp
+@@ -0,0 +1,61 @@
++#include <wx/wxprec.h>
++#ifndef WX_PRECOMP
++#  include <wx/wx.h>
++#endif
++
++#include "../FileDialog.h"
++
++#include <cassert>
++
++#include "wx/event.h"
++#include "wx/filedlg.h"
++#include "wx/window.h"
++
++
++FileDialog::FileDialog(wxWindow *parent,
++        const wxString& message,
++        const wxString& defaultDir,
++        const wxString& defaultFile,
++        const wxString& wildCard,
++        long style,
++        const wxPoint& pos,
++        const wxSize& sz,
++        const wxString& name)
++: wxFileDialog(parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name)
++{
++}
++
++
++FileDialog::~FileDialog()
++{
++    // intentionally left blank; it's just there to make sure
++    // we have a virtual destructor (in case of subclassing)
++}
++
++
++int FileDialog::ShowModal()
++{
++    assert (SupportsExtraControl());
++    
++    if (!m_buttonlabel.IsEmpty()) {
++        SetExtraControlCreator(&FileDialog::CreateButton);
++    }
++    
++    return wxFileDialog::ShowModal();
++}
++
++
++wxWindow * FileDialog::CreateButton(wxWindow *fileDialogGeneric)
++{
++    FileDialog *fileDialog = (FileDialog *) fileDialogGeneric;
++    wxButton *button = new wxButton(fileDialog, wxID_ANY, fileDialog->m_buttonlabel);
++    fileDialog->Bind(wxEVT_BUTTON, &FileDialog::OnButton, fileDialog, button->GetId());
++    return button;
++}
++
++void FileDialog::OnButton(wxCommandEvent& WXUNUSED(event))
++{
++    ClickButton(GetFilterIndex());
++}
++
++
+--- /dev/null
++++ b/lib-src/FileDialog/wx30/FileDialogPrivate.h
+@@ -0,0 +1,47 @@
++#ifndef __FILEDIALOGWX30H__
++#define __FILEDIALOGWX30H__
++
++
++#include "wx/filedlg.h"
++
++
++class FileDialog : public wxFileDialog
++{
++public: // constructors/destructors
++    FileDialog() { }
++    
++    FileDialog(wxWindow *parent,
++               const wxString& message = wxFileSelectorPromptStr,
++               const wxString& defaultDir = wxEmptyString,
++               const wxString& defaultFile = wxEmptyString,
++               const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
++               long style = wxFD_DEFAULT_STYLE,
++               const wxPoint& pos = wxDefaultPosition,
++               const wxSize& sz = wxDefaultSize,
++               const wxString& name = wxFileDialogNameStr);
++    
++    virtual ~FileDialog();
++    
++public: // public methods
++    virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
++    
++    virtual void ClickButton(int index);
++    
++    virtual int ShowModal();
++    
++    void OnButton(wxCommandEvent& event);
++    
++private: // private methods
++    static wxWindow * CreateButton(wxWindow *fileDialog);
++    
++private: // attributes
++    wxString m_buttonlabel;
++    
++    fdCallback m_callback;
++    
++    void *m_cbdata;
++};
++
++
++#endif
++
+--- a/src/AudacityApp.cpp
++++ b/src/AudacityApp.cpp
+@@ -1324,7 +1324,7 @@
+          }
+ 
+          if (option < argc - 1 &&
+-             argv[option + 1] &&
++             !wxString(argv[option + 1]).IsEmpty() && // *argv is of type wxChar* in wx28 and wxString in wx30
+              !wxString(wxT("-blocksize")).CmpNoCase(argv[option])) {
+             long theBlockSize;
+             if (wxString(argv[option + 1]).ToLong(&theBlockSize)) {
+--- a/src/AudioIO.cpp
++++ b/src/AudioIO.cpp
+@@ -561,7 +561,7 @@
+       wxString errStr = _("Could not find any audio devices.\n");
+       errStr += _("You will not be able to play or record audio.\n\n");
+       wxString paErrStr = LAT1CTOWX(Pa_GetErrorText(err));
+-      if (paErrStr)
++      if (!paErrStr.IsEmpty())
+          errStr += _("Error: ")+paErrStr;
+       // XXX: we are in libaudacity, popping up dialogs not allowed!  A
+       // long-term solution will probably involve exceptions
+--- a/src/CaptureEvents.cpp
++++ b/src/CaptureEvents.cpp
+@@ -17,7 +17,7 @@
+ #include "Audacity.h"
+ #include "CaptureEvents.h"
+ 
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+ // As of wxGTK 2.8.9, there is a problem in the wxClipboard class that
+ // allows recursive event processing.  This problem has been corrected
+ // by wxWidgets 2.9+.  However, this han't made it into a release yet,
+--- a/src/LyricsWindow.cpp
++++ b/src/LyricsWindow.cpp
+@@ -68,9 +68,9 @@
+    // loads either the XPM or the windows resource, depending on the platform
+    #if !defined(__WXMAC__) && !defined(__WXX11__)
+       #ifdef __WXMSW__
+-         wxIcon ic(wxICON(AudacityLogo));
++         wxIcon ic = wxICON(AudacityLogo);
+       #else
+-         wxIcon ic(wxICON(AudacityLogo48x48));
++         wxIcon ic = wxICON(AudacityLogo48x48);
+       #endif
+       SetIcon(ic);
+    #endif
+--- a/src/Menus.cpp
++++ b/src/Menus.cpp
+@@ -2403,7 +2403,7 @@
+    //       The workaround is to queue a context menu event, allowing the key press
+    //       event to complete.
+    wxContextMenuEvent e(wxEVT_CONTEXT_MENU, GetId());
+-   mTrackPanel->AddPendingEvent(e);
++   mTrackPanel->GetEventHandler()->AddPendingEvent(e);
+ }
+ 
+ void AudacityProject::OnTrackMute()
+@@ -5872,7 +5872,7 @@
+       wxArrayString rates;
+       wxComboBox *cb;
+ 
+-      rate.Printf(wxT("%d"), lrint(mRate));
++      rate.Printf(wxT("%ld"), lrint(mRate));
+ 
+       rates.Add(wxT("8000"));
+       rates.Add(wxT("11025"));
+--- a/src/MixerBoard.cpp
++++ b/src/MixerBoard.cpp
+@@ -1723,9 +1723,9 @@
+    // loads either the XPM or the windows resource, depending on the platform
+    #if !defined(__WXMAC__) && !defined(__WXX11__)
+       #ifdef __WXMSW__
+-         wxIcon ic(wxICON(AudacityLogo));
++         wxIcon ic = wxICON(AudacityLogo);
+       #else
+-         wxIcon ic(wxICON(AudacityLogo48x48));
++         wxIcon ic = wxICON(AudacityLogo48x48);
+       #endif
+       SetIcon(ic);
+    #endif
+--- a/src/PitchName.cpp
++++ b/src/PitchName.cpp
+@@ -20,6 +20,10 @@
+ #include <math.h>
+ #include <stdio.h>
+ 
++#ifndef WX_PRECOMP
++#  include "wx/wx.h"
++#endif
++
+ #include "PitchName.h"
+ 
+ 
+--- a/src/PlatformCompatibility.cpp
++++ b/src/PlatformCompatibility.cpp
+@@ -20,6 +20,7 @@
+ #include <wx/filename.h>
+ #include <wx/stdpaths.h>
+ #include <wx/app.h>
++#include <wx/version.h>
+ 
+ #include "AudacityApp.h"
+ #include "PlatformCompatibility.h"
+@@ -37,7 +38,11 @@
+    static wxString path;
+ 
+    if (!found) {
++#if wxMAJOR_VERSION < 3
+       wxStandardPaths std;
++#else
++      wxStandardPaths std(wxStandardPaths::Get());
++#endif
+ 
+       path = std.GetExecutablePath();
+ 
+@@ -65,4 +70,4 @@
+ #else
+    return filePath;
+ #endif
+-}
+\ No newline at end of file
++}
+--- a/src/Profiler.cpp
++++ b/src/Profiler.cpp
+@@ -22,6 +22,9 @@
+ 
+ #include "Profiler.h"
+ 
++#include <cstdio>
++#include <cstring>
++
+ ///write to a profile at the end of the test.
+ Profiler::~Profiler()
+ {
+@@ -165,4 +168,3 @@
+    else
+       return 0.0;
+ }
+-    
+\ No newline at end of file
+--- a/src/Project.cpp
++++ b/src/Project.cpp
+@@ -79,7 +79,6 @@
+ #include <wx/string.h>
+ #include <wx/textfile.h>
+ #include <wx/timer.h>
+-#include <wx/generic/filedlgg.h>
+ #include <wx/display.h>
+ 
+ #include <wx/arrimpl.cpp>       // this allows for creation of wxObjArray
+@@ -702,6 +701,7 @@
+    EVT_MOUSE_EVENTS(AudacityProject::OnMouseEvent)
+    EVT_CLOSE(AudacityProject::OnCloseWindow)
+    EVT_SIZE(AudacityProject::OnSize)
++   EVT_SHOW(AudacityProject::OnShow)
+    EVT_MOVE(AudacityProject::OnMove)
+    EVT_ACTIVATE(AudacityProject::OnActivate)
+    EVT_COMMAND_SCROLL_LINEUP(HSBarID, AudacityProject::OnScrollLeftButton)
+@@ -758,7 +758,8 @@
+      mLastEffect(NULL),
+      mLastEffectType(0),
+      mTimerRecordCanceled(false),
+-     mMenuClose(false)
++     mMenuClose(false),
++     mShownOnce(false)
+ {
+    int widths[] = {-2, -1};
+    mStatusBar = CreateStatusBar(2);
+@@ -981,9 +982,9 @@
+    // loads either the XPM or the windows resource, depending on the platform
+ #if !defined(__WXMAC__) && !defined(__WXX11__)
+    #if defined(__WXMSW__)
+-      wxIcon ic(wxICON(AudacityLogo));
++      wxIcon ic = wxICON(AudacityLogo);
+    #elif defined(__WXGTK__)
+-      wxIcon ic(wxICON(AudacityLogoAlpha));
++      wxIcon ic = wxICON(AudacityLogoAlpha);
+    #else
+       wxIcon ic;
+       ic.CopyFromBitmap(theTheme.Bitmap(bmpAudacityLogo48x48));
+@@ -1350,6 +1351,12 @@
+ 
+    int panelWidth, panelHeight;
+    mTrackPanel->GetTracksUsableArea(&panelWidth, &panelHeight);
++   if (panelWidth < 0) {
++      panelWidth = 0;
++   }
++   if (panelHeight < 0) {
++      panelHeight = 0;
++   }
+ 
+    // Add 1/4 of a screen of blank space to the end of the longest track
+    mViewInfo.screen = ((double) panelWidth) / mViewInfo.zoom;
+@@ -1561,9 +1568,26 @@
+ 
+ void AudacityProject::OnSize(wxSizeEvent & event)
+ {
+-   HandleResize();
+-   if (!this->IsMaximized() && !this->IsIconized())
+-      SetNormalizedWindowState(this->GetRect());
++   if (mShownOnce) {
++      HandleResize();
++      if (!this->IsMaximized() && !this->IsIconized())
++         SetNormalizedWindowState(this->GetRect());
++   }
++   event.Skip();
++}
++
++void AudacityProject::OnShow(wxShowEvent & event)
++{
++   // Remember that the window has been shown at least once
++   mShownOnce = true;
++   
++   // Call "OnSize" again (the previous calls to "OnSize" might not
++   // have succeeded because some methods are not available before
++   // the actual creation/showing of the window)
++   wxSizeEvent sizeEvent(GetSize());
++   OnSize(sizeEvent);
++   
++   // Further processing by default handlers
+    event.Skip();
+ }
+ 
+@@ -1675,7 +1699,7 @@
+       wxCommandEvent e(EVT_CAPTURE_KEY);
+       e.SetEventObject(&event);
+    
+-      if (w->ProcessEvent(e)) {
++      if (w->GetEventHandler()->ProcessEvent(e)) {
+          return false;
+       }
+    }
+--- a/src/Sequence.cpp
++++ b/src/Sequence.cpp
+@@ -1035,7 +1035,7 @@
+                Internat::ToString(((wxLongLong)(bb->f->GetLength())).ToDouble(), 0).c_str(), 
+                Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
+          ::wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
+-         ::wxLogWarning(sMsg);
++         wxLogWarning(sMsg);
+          bb->f->SetLength(mMaxSamples);
+       }
+ 
+--- a/src/Tags.cpp
++++ b/src/Tags.cpp
+@@ -482,7 +482,7 @@
+ 
+       while (*attrs) {
+          wxString attr = *attrs++;
+-         if (!*attr)
++         if (attr.IsEmpty())
+             break;
+          wxString value = *attrs++;
+ 
+--- a/src/TrackPanel.cpp
++++ b/src/TrackPanel.cpp
+@@ -5097,7 +5097,7 @@
+       // The activate event is used to make the 
+       // parent window 'come alive' if it didn't have focus.
+       wxActivateEvent e;
+-      GetParent()->ProcessEvent(e);
++      GetParent()->GetEventHandler()->ProcessEvent(e);
+ 
+       // wxTimers seem to be a little unreliable, so this
+       // "primes" it to make sure it keeps going for a while...
+@@ -5534,7 +5534,7 @@
+    int trackKind = pTrack->GetKind();
+    currentTool = selectTool; // the default.
+ 
+-   if( event.ButtonIsDown(3) || event.RightUp()){
++   if( event.ButtonIsDown(wxMOUSE_BTN_RIGHT) || event.RightUp()){
+       currentTool = zoomTool;
+    } else if( trackKind == Track::Time ){
+       currentTool = envelopeTool;
+@@ -8251,7 +8251,7 @@
+    mSliderOffset = 0;
+ 
+    int fontSize = 10;
+-   mFont.Create(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
++   mFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
+ 
+    int allowableWidth = GetTrackInfoWidth() - 2; // 2 to allow for left/right borders
+    int textWidth, textHeight;
+--- a/src/CaptureEvents.h
++++ b/src/CaptureEvents.h
+@@ -17,7 +17,7 @@
+ #ifndef _AUDACITY_CAPTURE_EVENTS_
+ #define _AUDACITY_CAPTURE_EVENTS_
+ 
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+ // As of wxGTK 2.8.9, there is a problem in the wxClipboard class that
+ // allows recursive event processing.  This problem has been corrected
+ // by wxWidgets 2.9+.  However, this han't made it into a release yet,
+--- a/src/LabelTrack.cpp
++++ b/src/LabelTrack.cpp
+@@ -957,7 +957,7 @@
+    
+    // copy data onto clipboard
+    if (wxTheClipboard->Open()) {
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+       CaptureEvents capture;
+ #endif
+       wxTheClipboard->SetData(new wxTextDataObject(data));
+@@ -992,7 +992,7 @@
+ 
+    // copy the data on clipboard
+    if (wxTheClipboard->Open()) {
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+       CaptureEvents capture;
+ #endif
+       wxTheClipboard->SetData(new wxTextDataObject(data));
+@@ -1017,7 +1017,7 @@
+    // if text data is available
+    if (IsTextClipSupported()) {
+       if (wxTheClipboard->Open()) {
+-#if defined(__WXGTK__) && HAVE_GTK
++#if defined(__WXGTK__) && HAVE_GTK && wxMAJOR_VERSION < 3
+          CaptureEvents capture;
+ #endif
+          wxTextDataObject data;
+@@ -1074,7 +1074,7 @@
+ /// @return true if the text data is available in the clipboard, false otherwise
+ bool LabelTrack::IsTextClipSupported()
+ {
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+    CaptureEvents capture;
+ #endif
+ 
+--- a/src/UploadDialog.cpp
++++ b/src/UploadDialog.cpp
+@@ -113,12 +113,12 @@
+     icons->Add(*mp3Icon);
+     icons->Add(*upIcon);
+     
+-    wxFlexGridSizer *topSizer = new wxFlexGridSizer(2, 1);  
++    wxFlexGridSizer *topSizer = new wxFlexGridSizer(2, 1, 0);  
+     wxStaticBoxSizer *connectionBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("FTP Connection"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);   
+     wxStaticBoxSizer *fileBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("File Manager"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
+     wxStaticBoxSizer *siteBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("Site Manager"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
+ 
+-    wxFlexGridSizer *connectionSizer = new wxFlexGridSizer(2, 4);
++    wxFlexGridSizer *connectionSizer = new wxFlexGridSizer(2, 4, 0);
+     wxBoxSizer *leftSizer = new wxBoxSizer(wxVERTICAL);
+     wxBoxSizer *rightSizer = new wxBoxSizer(wxVERTICAL);
+     wxBoxSizer *fileButtonSizer = new wxBoxSizer(wxHORIZONTAL);
+--- a/src/commands/ScriptCommandRelay.cpp
++++ b/src/commands/ScriptCommandRelay.cpp
+@@ -57,7 +57,7 @@
+    wxASSERT(cmd != NULL);
+    AppCommandEvent ev;
+    ev.SetCommand(cmd);
+-   project->AddPendingEvent(ev);
++   project->GetEventHandler()->AddPendingEvent(ev);
+ }
+ 
+ /// This is the function which actually obeys one command.  Rather than applying
+--- a/src/effects/BassTreble.cpp
++++ b/src/effects/BassTreble.cpp
+@@ -35,6 +35,7 @@
+ #include <wx/checkbox.h>
+ #include <wx/slider.h>
+ #include <wx/sizer.h>
++#include <wx/textctrl.h>
+ 
+ // Used to communicate the type of the filter.
+ static const int bassType = 0; //Low Shelf
+--- a/src/effects/Compressor.cpp
++++ b/src/effects/Compressor.cpp
+@@ -38,6 +38,7 @@
+ #include <wx/textdlg.h>
+ #include <wx/brush.h>
+ #include <wx/image.h>
++#include <wx/dcclient.h>
+ #include <wx/dcmemory.h>
+ 
+ #include "Compressor.h"
+--- a/src/effects/nyquist/Nyquist.cpp
++++ b/src/effects/nyquist/Nyquist.cpp
+@@ -701,7 +701,7 @@
+          // See also http://bugzilla.audacityteam.org/show_bug.cgi?id=642#c9 
+          // for further info about this thread safety question.
+          wxString prevlocale = wxSetlocale(LC_NUMERIC, NULL);
+-         wxSetlocale(LC_NUMERIC, wxT("C"));
++         wxSetlocale(LC_NUMERIC, wxString(wxT("C")));
+ 
+          nyx_init();
+          nyx_set_os_callback(StaticOSCallback, (void *)this);
+--- a/src/import/ImportRaw.cpp
++++ b/src/import/ImportRaw.cpp
+@@ -324,7 +324,7 @@
+ 
+       if (sf_format_check(&info)) {
+          mEncodingSubtype[mNumEncodings] = subtype;
+-         encodings.Add(LAT1CTOWX(sf_encoding_index_name(i)));
++         encodings.Add(sf_encoding_index_name(i));
+ 
+          if ((mEncoding & SF_FORMAT_SUBMASK) == subtype)
+             selection = mNumEncodings;
+--- a/src/ondemand/ODManager.cpp
++++ b/src/ondemand/ODManager.cpp
+@@ -311,7 +311,7 @@
+          AudacityProject::AllProjectsDeleteLock();
+          AudacityProject* proj = GetActiveProject();
+          if(proj)
+-            proj->AddPendingEvent( event );
++            proj->GetEventHandler()->AddPendingEvent( event );
+          AudacityProject::AllProjectsDeleteUnlock();
+       }
+       mTerminateMutex.Lock();
+--- a/src/ondemand/ODTask.cpp
++++ b/src/ondemand/ODTask.cpp
+@@ -158,7 +158,7 @@
+          if(IsTaskAssociatedWithProject(gAudacityProjects[i]))
+          {
+             //this assumes tasks are only associated with one project.  
+-            gAudacityProjects[i]->AddPendingEvent( event );
++            gAudacityProjects[i]->GetEventHandler()->AddPendingEvent( event );
+             //mark the changes so that the project can be resaved.
+             gAudacityProjects[i]->GetUndoManager()->SetODChangesFlag();
+             break;
+--- a/src/prefs/KeyConfigPrefs.cpp
++++ b/src/prefs/KeyConfigPrefs.cpp
+@@ -992,7 +992,7 @@
+       nevent.SetDirection(!e.ShiftDown());
+       nevent.SetEventObject(t);
+       nevent.SetCurrentFocus(t);
+-      t->GetParent()->ProcessEvent(nevent);
++      t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
+ 
+       return;
+    }
+--- a/src/toolbars/DeviceToolBar.cpp
++++ b/src/toolbars/DeviceToolBar.cpp
+@@ -71,9 +71,7 @@
+ {
+    ToolBar::Create(parent);
+ 
+-   // Simulate a size event to set initial meter placement/size
+-   wxSizeEvent dummy;
+-   OnSize(dummy);
++   Layout();
+ }
+ 
+ void DeviceToolBar::RecreateTipWindows()
+@@ -618,7 +616,7 @@
+                name = _("2 (Stereo) Input Channels");
+             }
+             else {
+-               name = wxString::Format(wxT("%d"), j + 1);
++               name = wxString::Format(wxT("%lld"), (long long) (j + 1));
+             }
+             mInputChannels->Append(name);
+          }
+--- a/src/toolbars/ToolsToolBar.cpp
++++ b/src/toolbars/ToolsToolBar.cpp
+@@ -59,7 +59,7 @@
+ 
+ // Strings to convert a tool number into a status message
+ // These MUST be in the same order as the ids above.
+-static const wxChar * MessageOfTool[numTools] = {
++static const wxString MessageOfTool[numTools] = {
+    wxTRANSLATE("Click and drag to select audio"),
+    wxTRANSLATE("Click and drag to edit the amplitude envelope"),
+    wxTRANSLATE("Click and drag to edit the samples"),
+--- a/src/widgets/ASlider.cpp
++++ b/src/widgets/ASlider.cpp
+@@ -1191,7 +1191,7 @@
+                nevent.SetDirection( !event.ShiftDown() );
+                nevent.SetEventObject( mParent );
+                nevent.SetCurrentFocus( mParent );
+-               mParent->GetParent()->ProcessEvent( nevent );
++               mParent->GetParent()->GetEventHandler()->ProcessEvent( nevent );
+             }
+             break;
+ 
+@@ -1203,7 +1203,7 @@
+                if (def && def->IsEnabled()) {
+                   wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
+                         def->GetId());
+-                  mParent->ProcessEvent(cevent);
++                  mParent->GetEventHandler()->ProcessEvent(cevent);
+                }
+             }
+ 
+@@ -1228,7 +1228,7 @@
+    int intValue = (int)( ( mCurrentValue - mMinValue ) * 1000.0f /
+                          ( mMaxValue - mMinValue ) );
+    e.SetInt( intValue );
+-   mParent->ProcessEvent( e );
++   mParent->GetEventHandler()->ProcessEvent( e );
+ }
+ 
+ int LWSlider::ValueToPosition(float val)
+--- a/src/widgets/ExpandingToolBar.cpp
++++ b/src/widgets/ExpandingToolBar.cpp
+@@ -72,6 +72,7 @@
+ #include <wx/window.h>
+ #endif
+ 
++#include <wx/dcclient.h>
+ #include <wx/dcmemory.h>
+ #include <wx/log.h>
+ #include <wx/dragimag.h>
+--- a/src/widgets/Grabber.cpp
++++ b/src/widgets/Grabber.cpp
+@@ -89,7 +89,7 @@
+    e.SetEventObject(parent);
+ 
+    // Queue the event
+-   parent->AddPendingEvent(e);
++   parent->GetEventHandler()->AddPendingEvent(e);
+ }
+ 
+ //
+--- a/src/widgets/Grid.cpp
++++ b/src/widgets/Grid.cpp
+@@ -77,7 +77,8 @@
+ {
+    wxGridTableBase *table = grid->GetTable();
+ 
+-   table->GetValue(row, col).ToDouble(&mOld);
++   mOldString = table->GetValue(row, col);
++   mOldString.ToDouble(&mOld);
+ 
+    GetTimeCtrl()->SetTimeValue(mOld);
+    GetTimeCtrl()->EnableMenu();
+@@ -87,16 +88,32 @@
+ 
+ bool TimeEditor::EndEdit(int row, int col, wxGrid *grid)
+ {
++    wxString newvalue;
++    bool changed = EndEdit(row, col, grid, mOldString, &newvalue);
++    if (changed) {
++        ApplyEdit(row, col, grid);
++    }
++    return changed;
++}
++
++bool TimeEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval)
++{
+    double newtime = GetTimeCtrl()->GetTimeValue();
+    bool changed = newtime != mOld;
+ 
+    if (changed) {
+-      grid->GetTable()->SetValue(row, col, wxString::Format(wxT("%g"), newtime));
++      mValueAsString = wxString::Format(wxT("%g"), newtime);
++      *newval = mValueAsString;
+    }
+ 
+    return changed;
+ }
+ 
++void TimeEditor::ApplyEdit(int row, int col, wxGrid *grid)
++{
++   grid->GetTable()->SetValue(row, col, mValueAsString);
++}
++
+ void TimeEditor::Reset()
+ {
+    GetTimeCtrl()->SetTimeValue(mOld);
+@@ -303,8 +320,19 @@
+    Choice()->SetFocus();
+ }
+ 
++bool ChoiceEditor::EndEdit(int row, int col, wxGrid *grid)
++{
++    wxString newvalue;
++    bool changed = EndEdit(row, col, grid, mOld, &newvalue);
++    if (changed) {
++        ApplyEdit(row, col, grid);
++    }
++    return changed;
++}
++
+ bool ChoiceEditor::EndEdit(int row, int col,
+-                           wxGrid* grid)
++                           const wxGrid* grid,
++                           const wxString &oldval, wxString *newval)
+ {
+    int sel = Choice()->GetSelection();
+ 
+@@ -315,12 +343,20 @@
+    }
+ 
+    wxString val = mChoices[sel];
+-   if (val == mOld)
+-      return false;
++   bool changed = val != mOld;
++
++   if (changed)
++   {
++      mValueAsString = val;
++      *newval = val;
++   }
+ 
+-   grid->GetTable()->SetValue(row, col, val);
++   return changed;
++}
+ 
+-   return true;
++void ChoiceEditor::ApplyEdit(int row, int col, wxGrid *grid)
++{
++   grid->GetTable()->SetValue(row, col, mValueAsString);
+ }
+ 
+ void ChoiceEditor::Reset()
+@@ -499,7 +535,7 @@
+             if (def && def->IsEnabled()) {
+                wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
+                                      def->GetId());
+-               GetParent()->ProcessEvent(cevent);
++               GetParent()->GetEventHandler()->ProcessEvent(cevent);
+             }
+          }
+          else {
+--- a/src/widgets/Grid.h
++++ b/src/widgets/Grid.h
+@@ -52,8 +52,13 @@
+    void SetSize(const wxRect &rect);
+ 
+    void BeginEdit(int row, int col, wxGrid *grid);
++
+    bool EndEdit(int row, int col, wxGrid *grid);
+ 
++   bool EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval);
++
++   void ApplyEdit(int row, int col, wxGrid *grid);
++
+    void Reset();
+ 
+    wxString GetFormat();
+@@ -65,12 +70,14 @@
+    wxString GetValue() const;
+ 
+    TimeTextCtrl *GetTimeCtrl() const { return (TimeTextCtrl *)m_control; };
+-
++   
+  private:
+ 
+    wxString mFormat;
+    double mRate;
+    double mOld;
++   wxString mOldString;
++   wxString mValueAsString;
+ };
+ 
+ // ----------------------------------------------------------------------------
+@@ -124,8 +131,13 @@
+    void SetSize(const wxRect &rect);
+ 
+    void BeginEdit(int row, int col, wxGrid *grid);
++
+    bool EndEdit(int row, int col, wxGrid *grid);
+ 
++   bool EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval);
++
++   void ApplyEdit(int row, int col, wxGrid *grid);
++
+    void Reset();
+ 
+    wxGridCellEditor *Clone() const;
+@@ -159,6 +171,7 @@
+ 
+    wxArrayString mChoices;
+    wxString mOld;
++   wxString mValueAsString;
+ };
+ 
+ // ----------------------------------------------------------------------------
+--- a/src/widgets/ImageRoll.cpp
++++ b/src/widgets/ImageRoll.cpp
+@@ -299,7 +299,7 @@
+ }
+ 
+ void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
+-                           int x, int y, int logicalFunc)
++                           int x, int y, wxRasterOperationMode logicalFunc)
+ {
+    if (logicalFunc == wxCOPY)
+       dc.DrawBitmap(bitmap, x, y);
+@@ -311,7 +311,7 @@
+    }
+ }
+ 
+-void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
++void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logicalFunc))
+ {
+    int width = rect.width;
+    int height = rect.height;
+@@ -434,7 +434,7 @@
+                 mImageRoll.GetMaxSize());
+ }
+ 
+-void ImageRollPanel::SetLogicalFunction(int func)
++void ImageRollPanel::SetLogicalFunction(wxRasterOperationMode func)
+ {
+    mLogicalFunction = func;
+ }
+--- a/src/widgets/ImageRoll.h
++++ b/src/widgets/ImageRoll.h
+@@ -12,9 +12,18 @@
+ #ifndef __AUDACITY_IMAGE_ROLL__
+ #define __AUDACITY_IMAGE_ROLL__
+ 
++#include <wx/dc.h>
++#include <wx/dcclient.h>
+ #include <wx/defs.h>
+ #include <wx/dynarray.h>
+ #include <wx/panel.h>
++#include <wx/version.h>
++
++
++#if wxMAJOR_VERSION < 3
++#  define wxRasterOperationMode int
++#endif
++
+ 
+ WX_DECLARE_OBJARRAY(wxBitmap, BitmapArray);
+ WX_DECLARE_OBJARRAY(wxImage, ImageArray);
+@@ -40,7 +49,7 @@
+    wxSize GetMaxSize() const { return mMaxSize; }
+    
+    void Draw(wxDC &dc, wxRect rect,
+-             int logicalFunc = wxCOPY);
++             wxRasterOperationMode logicalFunc = wxCOPY);
+ 
+    static ImageArray SplitH(const wxImage &src, wxColour magicColor);
+    static ImageArray SplitV(const wxImage &src, wxColour magicColor);
+@@ -48,7 +57,7 @@
+  protected:
+ 
+    void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
+-                   int x, int y, int logicalFunc = wxCOPY);
++                   int x, int y, wxRasterOperationMode logicalFunc = wxCOPY);
+ 
+    void Init(RollType type, const wxImage &src, wxColour magicColor);
+ 
+@@ -72,7 +81,7 @@
+                   const wxSize& size = wxDefaultSize,
+                   long style = wxTAB_TRAVERSAL);
+    
+-   void SetLogicalFunction(int func);
++   void SetLogicalFunction(wxRasterOperationMode func);
+ 
+    void OnPaint(wxPaintEvent &evt);
+    void OnSize(wxSizeEvent &evt);
+@@ -80,7 +89,7 @@
+  protected:
+    ImageRoll mImageRoll;
+ 
+-   int mLogicalFunction;
++   wxRasterOperationMode mLogicalFunction;
+    
+    DECLARE_EVENT_TABLE();
+ 
+--- a/src/widgets/TimeTextCtrl.cpp
++++ b/src/widgets/TimeTextCtrl.cpp
+@@ -168,6 +168,7 @@
+ 
+ #include <math.h>
+ 
++#include <wx/dcclient.h>
+ #include <wx/dcmemory.h>
+ #include <wx/font.h>
+ #include <wx/intl.h>
+@@ -1160,7 +1161,7 @@
+       nevent.SetDirection(!event.ShiftDown());
+       nevent.SetEventObject(parent);
+       nevent.SetCurrentFocus(parent);
+-      GetParent()->ProcessEvent(nevent);
++      GetParent()->GetEventHandler()->ProcessEvent(nevent);
+    } 
+ 
+    else if (keyCode == WXK_RETURN || keyCode == WXK_NUMPAD_ENTER) {
+@@ -1169,7 +1170,7 @@
+       if (def && def->IsEnabled()) {
+          wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
+                                def->GetId());
+-         GetParent()->ProcessEvent(cevent);
++         GetParent()->GetEventHandler()->ProcessEvent(cevent);
+       }
+    }
+ 
+--- a/src/xml/XMLWriter.cpp
++++ b/src/xml/XMLWriter.cpp
+@@ -246,7 +246,7 @@
+       mHasKids[0] = true;
+    }
+ 
+-   Write(value.c_str());
++   Write(value);
+ }
+ 
+ void XMLWriter::WriteSubTree(const wxChar *value)
+--- a/src/widgets/FileHistory.cpp
++++ b/src/widgets/FileHistory.cpp
+@@ -142,7 +142,7 @@
+    // Stored in reverse order
+    int n = mHistory.GetCount() - 1;
+    for (size_t i = 1; i <= mHistory.GetCount(); i++) {
+-      config.Write(wxString::Format(wxT("file%02d"), i), mHistory[n--]);
++      config.Write(wxString::Format(wxT("file%02d"), (int) i), mHistory[n--]);
+    }
+ 
+    config.SetPath(wxT(".."));
+--- a/src/effects/ladspa/LoadLadspa.cpp
++++ b/src/effects/ladspa/LoadLadspa.cpp
+@@ -147,7 +147,7 @@
+       data = mainFn(index);
+       while(data) {
+ 
+-         wxString uniqid = wxString::Format(wxT("%08x-%s"), data->UniqueID, LAT1CTOWX(data->Label).c_str());
++         wxString uniqid = wxString::Format(wxT("%08x-%s"), (unsigned int) data->UniqueID, LAT1CTOWX(data->Label).c_str());
+          if (uniq.Index(uniqid) == wxNOT_FOUND) {
+             uniq.Add(uniqid);
+             std::set<wxString> categories;
+--- a/src/import/Import.cpp
++++ b/src/import/Import.cpp
+@@ -279,7 +279,7 @@
+                val.Append (wxT(":"));
+          }
+       }
+-      name.Printf (wxT("/ExtImportItems/Item%d"), i);
++      name.Printf (wxT("/ExtImportItems/Item%lld"), (long long) i);
+       gPrefs->Write (name, val);
+       gPrefs->Flush();
+    }
+@@ -288,7 +288,7 @@
+    more to delete.*/
+    i = this->mExtImportItems->Count();
+    do {
+-     name.Printf (wxT("/ExtImportItems/Item%d"), i);
++     name.Printf (wxT("/ExtImportItems/Item%lld"), (long long) i);
+      // No item to delete?  Then it's time to finish.
+      if (!gPrefs->Read(name, &val))
+         break;
+--- a/src/effects/ladspa/LadspaEffect.cpp
++++ b/src/effects/ladspa/LadspaEffect.cpp
+@@ -518,16 +518,14 @@
+    this->mData = data;
+    this->inputControls = inputControls;
+    this->sampleRate = sampleRate;
+-   #ifdef __WXMSW__
+-      // On Windows, for some reason, wxWidgets calls OnTextCtrl during creation
+-      // of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText,
+-      // which assumes all the fields have been initialized.
+-      // This can give us a bad pointer crash, so manipulate inSlider to
+-      // no-op HandleText during creation.
+-      inSlider = true;
+-   #else
+-      inSlider = false;
+-   #endif
++
++   // wxWidgets calls OnTextCtrl during creation
++   // of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText,
++   // which assumes all the fields have been initialized.
++   // This can give us a bad pointer crash, so manipulate inSlider to
++   // no-op HandleText during creation.
++   inSlider = true;
++   
+    inText = false;
+ 
+    toggles = new wxCheckBox*[mData->PortCount];
+--- a/src/prefs/PrefsDialog.cpp
++++ b/src/prefs/PrefsDialog.cpp
+@@ -185,8 +185,6 @@
+    Fit();
+    wxSize sz = GetSize();
+ 
+-   wxASSERT_MSG(sz.x <= 800 && sz.y <= 600, wxT("Preferences dialog exceeds max size"));
+-
+    if (sz.x > 800) {
+       sz.x = 800;
+    }
+--- a/src/prefs/QualityPrefs.cpp
++++ b/src/prefs/QualityPrefs.cpp
+@@ -162,13 +162,13 @@
+    {
+       S.StartMultiColumn(2, wxEXPAND);
+       {
+-         S.SetStretchyCol(2);
++         S.SetStretchyCol(1); // 2nd column (= index 1) is stretchy
+ 
+          S.TieChoice(_("Sample Rate Con&verter:"),
+                      Resample::GetFastMethodKey(),
+                      Resample::GetFastMethodDefault(),
+                      mConverterNames,
+-                     mConverterLabels),
++                     mConverterLabels);
+          S.SetSizeHints(mConverterNames);
+ 
+          S.TieChoice(_("&Dither:"),
+--- a/src/Project.h
++++ b/src/Project.h
+@@ -253,6 +253,7 @@
+    void OnMouseEvent(wxMouseEvent & event);
+    void OnIconize(wxIconizeEvent &event);
+    void OnSize(wxSizeEvent & event);
++   void OnShow(wxShowEvent & event);
+    void OnMove(wxMoveEvent & event);
+    void OnScroll(wxScrollEvent & event);
+    void OnCloseWindow(wxCloseEvent & event);
+@@ -487,6 +488,8 @@
+    // dialog for missing alias warnings
+    wxDialog            *mAliasMissingWarningDialog;
+ 
++   bool mShownOnce;
++
+  public:
+    ToolManager *mToolManager;
+    bool mShowSplashScreen;


More information about the pkg-multimedia-maintainers mailing list