Currently Audacity will not build with any wxWidgets release beyond the 2.8 series; wx29 has many bug fixes which might benefit Audacity but the Audacity code needs some massaging to make it wx29+ compliant. The included patch is stale and will need to be applied manually, it was current as of when I created it but changes will have been made since then! I can only test this on Windows 7 so other OSes will have minor differences which are not explored here.
On Windows one must change all the solutions (there are 25 of them currently–Audacity, help, libflac, tolame etc.) and each solution’s configuration (currently 4, but the non-Unicode ones may not exist for long–Release, Debug, Unicode Release & Unicode Debug) so that they use the wx29 libraries. To do this open each solution’s property page’s Linker’s Input panel’s Additional Dependencies dialog:
wxbase28ud.lib will change to wxbase29ud.lib etc. (or maybe even wxbase30ud.lib depending on the version of wxWidgets you are targeting). Many of the solutions may not link with the wxWidgets libraries–if one of any solution’s configuration does not then none of its configurations do; only a few will need to be changed.
Don’t forget to change your WXWIN environmental variable to point to your wx29 folder; this will need to be done before opening VC++ and may even require a reboot to take full effect.
Index: lib-src/ffmpeg/libavutil/common.h
===================================================================
--- lib-src/ffmpeg/libavutil/common.h (revision 11306)
+++ lib-src/ffmpeg/libavutil/common.h (working copy)
@@ -36,6 +36,8 @@
#include <string.h>
#include "attributes.h"
+#include "../win32/stdint.h"
+
//rounded division & shift
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
/* assume b>0 */
Index: lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c
===================================================================
--- lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c (revision 11306)
+++ lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c (working copy)
@@ -102,7 +102,8 @@
#include "pa_win_ds.h"
#include "pa_win_ds_dynlink.h"
#include "pa_win_waveformat.h"
-#include "pa_win_wdmks_utils.h"
+//#include "pa_win_wdmks_utils.h"
+#include "../../os/win/pa_win_wdmks_utils.h"
#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */
Index: lib-src/twolame/libtwolame/common.h
===================================================================
--- lib-src/twolame/libtwolame/common.h (revision 11306)
+++ lib-src/twolame/libtwolame/common.h (working copy)
@@ -27,12 +27,12 @@
#define _COMMON_H
#ifdef _WIN32
-# include "../win32/configwin.h"
+#include "configwin.h"
/*
* When building as a Win32 DLL, some functions are not allowed to be inlined,
* otherwise the Microsoft Visual Studio 2005 linker will complain
*/
-# define NO_DLL_INLINE
+#define NO_DLL_INLINE
#else
# include "config.h"
/*
Index: src/AudacityApp.cpp
===================================================================
--- src/AudacityApp.cpp (revision 11306)
+++ src/AudacityApp.cpp (working copy)
@@ -603,7 +603,7 @@
if (!cmd.IsEmpty()) {
wxCommandEvent e(EVT_OPEN_AUDIO_FILE);
e.SetString(data);
- project->AddPendingEvent(e);
+ project->GetEventHandler()->AddPendingEvent(e);
}
return true;
@@ -651,7 +651,7 @@
wxCommandEvent e(EVT_OPEN_AUDIO_FILE);
e.SetString(fileName);
- AddPendingEvent(e);
+ GetEventHandler()->AddPendingEvent(e);
}
// in response of a print-document apple event
@@ -663,7 +663,7 @@
wxCommandEvent e(EVT_OPEN_AUDIO_FILE);
e.SetString(fileName);
- AddPendingEvent(e);
+ GetEventHandler()->AddPendingEvent(e);
}
// in response of a open-application apple event
Index: src/AudioIO.cpp
===================================================================
--- src/AudioIO.cpp (revision 11306)
+++ src/AudioIO.cpp (working copy)
@@ -550,7 +550,7 @@
wxString errStr = _("Could not find any audio devices.n");
errStr += _("You will not be able to play or record audio.nn");
wxString paErrStr = LAT1CTOWX(Pa_GetErrorText(err));
- if (paErrStr)
+ if (paErrStr != wxEmptyString)
errStr += _("Error: ")+paErrStr;
// XXX: we are in libaudacity, popping up dialogs not allowed! A
// long-term solution will probably involve exceptions
Index: src/commands/ScriptCommandRelay.cpp
===================================================================
--- src/commands/ScriptCommandRelay.cpp (revision 11306)
+++ src/commands/ScriptCommandRelay.cpp (working copy)
@@ -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
Index: src/effects/Compressor.cpp
===================================================================
--- src/effects/Compressor.cpp (revision 11306)
+++ src/effects/Compressor.cpp (working copy)
@@ -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"
Index: src/effects/VST/VSTEffect.cpp
===================================================================
--- src/effects/VST/VSTEffect.cpp (revision 11306)
+++ src/effects/VST/VSTEffect.cpp (working copy)
@@ -32,6 +32,7 @@
#include <wx/stattext.h>
#include <wx/stopwatch.h>
#include <wx/utils.h>
+#include <wx/textctrl.h>
#if defined(__WXMAC__)
#include <dlfcn.h>
@@ -41,6 +42,10 @@
#endif
#if defined(__WXMSW__)
+ #include <wx/msw/wrapwin.h>
+ #include <WinBase.h>
+ #include <WinDef.h>
+ #include <WinNT.h>
#include <wx/msw/seh.h>
#include <windows.h>
#include <shlwapi.h>
Index: src/import/ImportRaw.cpp
===================================================================
--- src/import/ImportRaw.cpp (revision 11306)
+++ src/import/ImportRaw.cpp (working copy)
@@ -323,7 +323,7 @@
if (sf_format_check(&info)) {
mEncodingSubtype[mNumEncodings] = subtype;
- encodings.Add(LAT1CTOWX(sf_encoding_index_name(i)));
+ encodings.Add(wxString (sf_encoding_index_name(i).wc_str(), wxConvISO8859_1));
if ((mEncoding & SF_FORMAT_SUBMASK) == subtype)
selection = mNumEncodings;
Index: src/Internat.h
===================================================================
--- src/Internat.h (revision 11306)
+++ src/Internat.h (working copy)
@@ -12,6 +12,7 @@
#ifndef __AUDACITY_INTERNAT__
#define __AUDACITY_INTERNAT__
+#include <wx/thread.h>
#include <wx/arrstr.h>
#include <wx/string.h>
#include <wx/longlong.h>
Index: src/ondemand/ODManager.cpp
===================================================================
--- src/ondemand/ODManager.cpp (revision 11306)
+++ src/ondemand/ODManager.cpp (working copy)
@@ -311,7 +311,7 @@
AudacityProject::AllProjectsDeleteLock();
AudacityProject* proj = GetActiveProject();
if(proj)
- proj->AddPendingEvent( event );
+ proj->GetEventHandler()->AddPendingEvent( event );
AudacityProject::AllProjectsDeleteUnlock();
}
mTerminateMutex.Lock();
Index: src/ondemand/ODTask.cpp
===================================================================
--- src/ondemand/ODTask.cpp (revision 11306)
+++ src/ondemand/ODTask.cpp (working copy)
@@ -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;
Index: src/PitchName.cpp
===================================================================
--- src/PitchName.cpp (revision 11306)
+++ src/PitchName.cpp (working copy)
@@ -16,7 +16,7 @@
*//*******************************************************************/
-
+#include <wx/string.h>
#include <math.h>
#include <stdio.h>
Index: src/prefs/KeyConfigPrefs.cpp
===================================================================
--- src/prefs/KeyConfigPrefs.cpp (revision 11306)
+++ src/prefs/KeyConfigPrefs.cpp (working copy)
@@ -122,6 +122,7 @@
@@ -350,7 +352,7 @@
nevent.SetDirection(!e.ShiftDown());
nevent.SetEventObject(t);
nevent.SetCurrentFocus(t);
- t->GetParent()->ProcessEvent(nevent);
+ t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
return;
}
Index: src/Project.cpp
===================================================================
--- src/Project.cpp (revision 11306)
+++ src/Project.cpp (working copy)
@@ -1657,7 +1703,7 @@
wxCommandEvent e(EVT_CAPTURE_KEY);
e.SetEventObject(&event);
- if (w->ProcessEvent(e)) {
+ if (w->GetEventHandler()->ProcessEvent(e)) {
return false;
}
}
Index: src/Tags.cpp
===================================================================
--- src/Tags.cpp (revision 11306)
+++ src/Tags.cpp (working copy)
@@ -482,7 +482,8 @@
while (*attrs) {
wxString attr = *attrs++;
- if (!*attr)
+ if (attr == wxEmptyString)
break;
wxString value = *attrs++;
Index: src/toolbars/ControlToolBar.cpp
===================================================================
--- src/toolbars/ControlToolBar.cpp (revision 11306)
+++ src/toolbars/ControlToolBar.cpp (working copy)
@@ -586,10 +586,10 @@
}
else {
// msmeyer: Show error message if stream could not be opened
- wxMessageBox(_(
- "Error while opening sound device. "
- wxT("Please check the output device settings and the project sample rate.")),
- _("Error"), wxOK | wxICON_EXCLAMATION, this);
+ wxString messageA(_("Error while opening sound device. "));
+ wxString messageB(wxT("Please check the output device settings and the project sample rate."));
+ messageA.Append(messageB);
+ wxMessageBox(messageA, _("Error"), wxOK | wxICON_EXCLAMATION, this);
}
}
@@ -928,9 +928,10 @@
}
// msmeyer: Show error message if stream could not be opened
- wxMessageBox(_("Error while opening sound device. "
- wxT("Please check the input device settings and the project sample rate.")),
- _("Error"), wxOK | wxICON_EXCLAMATION, this);
+ wxString messageA(_("Error while opening sound device. "));
+ wxString messageB(wxT("Please check the input device settings and the project sample rate."));
+ messageA.Append(messageB);
+ wxMessageBox(messageA, _("Error"), wxOK | wxICON_EXCLAMATION, this);
SetPlay(false);
SetStop(false);
Index: src/toolbars/DeviceToolBar.cpp
===================================================================
--- src/toolbars/DeviceToolBar.cpp (revision 11306)
+++ src/toolbars/DeviceToolBar.cpp (working copy)
@@ -72,8 +72,8 @@
ToolBar::Create(parent);
// Simulate a size event to set initial meter placement/size
- wxSizeEvent dummy;
- OnSize(dummy);
+ //wxSizeEvent dummy;//efm5 debug figure this out
+ //OnSize(dummy);//wx's V says Layout() or just nothing
}
void DeviceToolBar::RecreateTipWindows()
Index: src/toolbars/ToolDock.h
===================================================================
--- src/toolbars/ToolDock.h (revision 11306)
+++ src/toolbars/ToolDock.h (working copy)
@@ -40,8 +40,8 @@
enum
{
NoDockID = 0,
- TopDockID,
- BotDockID,
+ TopDockID = 2,
+ BotDockID = 3,
DockCount = 2
};
Index: src/toolbars/ToolManager.cpp
===================================================================
--- src/toolbars/ToolManager.cpp (revision 11306)
+++ src/toolbars/ToolManager.cpp (working copy)
@@ -740,12 +740,24 @@
gPrefs->SetPath( bar->GetSection() );
// Search both docks for toolbar order
- int to = mTopDock->GetOrder( bar );
- int bo = mBotDock->GetOrder( bar );
+ int top = mTopDock->GetOrder( bar );
+ int bottom = mBotDock->GetOrder( bar );
// Save
- gPrefs->Write( wxT("Dock"), to ? TopDockID : bo ? BotDockID : NoDockID );
- gPrefs->Write( wxT("Order"), to + bo );
+ wxString dock;
+ if (top) {
+ dock.Printf(wxT("%d"), TopDockID);
+ gPrefs->Write( wxT("Dock"), dock );
+ }
+ else if (bottom) {
+ dock.Printf(wxT("%d"), BotDockID);
+ gPrefs->Write( wxT("Dock"), dock );
+ }
+ else {
+ dock.Printf(wxT("%d"), NoDockID);
+ gPrefs->Write( wxT("Dock"), dock );
+ }
+ gPrefs->Write( wxT("Order"), (top + bottom) );
gPrefs->Write( wxT("Show"), IsVisible( ndx ) );
wxPoint pos( -1, -1 );
Index: src/toolbars/ToolsToolBar.cpp
===================================================================
--- src/toolbars/ToolsToolBar.cpp (revision 11306)
+++ src/toolbars/ToolsToolBar.cpp (working copy)
@@ -59,18 +59,18 @@
// Strings to convert a tool number into a status message
// These MUST be in the same order as the ids above.
-const wxChar * 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"),
+const wxChar * MessageOfTool[numTools] = { _("Click and drag to select audio"),
+ _("Click and drag to edit the amplitude envelope"),
+ _("Click and drag to edit the samples"),
#if defined( __WXMAC__ )
- wxTRANSLATE("Click to Zoom In, Shift-Click to Zoom Out"),
+ _("Click to Zoom In, Shift-Click to Zoom Out"),
#elif defined( __WXMSW__ )
- wxTRANSLATE("Drag to Zoom Into Region, Right-Click to Zoom Out"),
+ _("Drag to Zoom Into Region, Right-Click to Zoom Out"),
#elif defined( __WXGTK__ )
- wxTRANSLATE("Left=Zoom In, Right=Zoom Out, Middle=Normal"),
+ _("Left=Zoom In, Right=Zoom Out, Middle=Normal"),
#endif
- wxTRANSLATE("Click and drag to move a track in time"),
- wxT("") // multi-mode tool
+ _("Click and drag to move a track in time"),
+ wxString(wxEmptyString) // multi-mode tool
};
////////////////////////////////////////////////////////////
Index: src/TrackPanel.cpp
===================================================================
--- src/TrackPanel.cpp (revision 11306)
+++ src/TrackPanel.cpp (working copy)
@@ -4768,7 +4763,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...
@@ -5199,28 +5203,42 @@
int trackKind = pTrack->GetKind();
currentTool = selectTool; // the default.
- if( event.ButtonIsDown(3) || event.RightUp()){
+ if( event.RightIsDown() || event.RightUp())
+ {
currentTool = zoomTool;
- } else if( trackKind == Track::Time ){
+ }
+ else if( trackKind == Track::Time )
+ {
currentTool = envelopeTool;
- } else if( trackKind == Track::Label ){
+ }
+ else if( trackKind == Track::Label )
+ {
currentTool = selectTool;
- } else if( trackKind != Track::Wave) {
+ }
+ else if( trackKind != Track::Wave)
+ {
currentTool = selectTool;
// So we are in a wave track.
//FIX-ME: Not necessarily. Haven't checked Track::Note (#if defined(USE_MIDI)).
// From here on the order in which we hit test determines
// which tool takes priority in the rare cases where it
// could be more than one.
- } else if (event.CmdDown()){
+ }
+ else if (event.CmdDown())
+ {
// msmeyer: If control is down, slide single clip
// msmeyer: If control and shift are down, slide all clips
currentTool = slideTool;
- } else if( HitTestEnvelope( pTrack, r, event ) ){
+ }
+ else if( HitTestEnvelope( pTrack, r, event ) )
+ {
currentTool = envelopeTool;
- } else if( HitTestSlide( pTrack, r, event )){
+ }
+ else if( HitTestSlide( pTrack, r, event ))
+ {
currentTool = slideTool;
- } else if( HitTestSamples( pTrack, r, event )){
+ }
+ else if( HitTestSamples( pTrack, r, event )){
currentTool = drawTool;
}
@@ -7712,28 +7737,27 @@
TrackInfo::TrackInfo(wxWindow * pParentIn)
{
-
+ mpFont = NULL;
pParent = pParentIn;
// Populate sliders array
+
for (unsigned int i = 0; i < kInitialSliders; ++i) {
MakeMoreSliders();
}
mSliderOffset = 0;
- int fontSize = 10;
- mFont.Create(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
-
int allowableWidth = GetTrackInfoWidth() - 2; // 2 to allow for left/right borders
int textWidth, textHeight;
+ int fontSize = 10;
+ mpFont = new wxFont(fontSize, wxFONTFAMILY_SWISS,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL);//no mem alloc testing
do {
- mFont.SetPointSize(fontSize);
+ mpFont->SetPointSize(fontSize);
pParent->GetTextExtent(_("Stereo, 999999Hz"),
- &textWidth,
- &textHeight,
- NULL,
- NULL,
- &mFont);
+ &textWidth, &textHeight,
+ NULL, NULL, mpFont);
fontSize--;
} while (textWidth >= allowableWidth);
}
@@ -7745,6 +7769,7 @@
delete mGains[i];
for(i=0; i<mPans.Count(); i++)
delete mPans[i];
+ if (mpFont) delete mpFont;
}
static const int kTrackInfoWidth = 100;
@@ -7826,7 +7851,7 @@
/// todo Probably should move to 'Utils.cpp'.
void TrackInfo::SetTrackInfoFont(wxDC * dc)
{
- dc->SetFont(mFont);
+ dc->SetFont(*mpFont);
}
void TrackInfo::DrawBordersWithin(wxDC* dc, const wxRect r, bool bHasMuteSolo)
Index: src/TrackPanel.h
===================================================================
--- src/TrackPanel.h (revision 11306)
+++ src/TrackPanel.h (working copy)
@@ -143,7 +143,7 @@
LWSlider * PanSlider(int trackIndex);
wxWindow * pParent;
- wxFont mFont;
+ wxFont * mpFont;
friend class TrackPanel;
};
Index: src/UploadDialog.cpp
===================================================================
--- src/UploadDialog.cpp (revision 11306)
+++ src/UploadDialog.cpp (working copy)
@@ -123,12 +123,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);
Index: src/widgets/ASlider.cpp
===================================================================
--- src/widgets/ASlider.cpp (revision 11306)
+++ src/widgets/ASlider.cpp (working copy)
@@ -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)
Index: src/widgets/Grabber.cpp
===================================================================
--- src/widgets/Grabber.cpp (revision 11306)
+++ src/widgets/Grabber.cpp (working copy)
@@ -83,7 +83,7 @@
e.SetEventObject(parent);
// Queue the event
- parent->AddPendingEvent(e);
+ parent->GetEventHandler()->AddPendingEvent(e);
}
//
Index: src/widgets/Grid.cpp
===================================================================
--- src/widgets/Grid.cpp (revision 11306)
+++ src/widgets/Grid.cpp (working copy)
@@ -28,7 +28,7 @@
TimeEditor::TimeEditor()
{
- TimeEditor(wxT("seconds"), 44100);
+ TimeEditor(wxT("seconds"), 44100.0);
}
TimeEditor::TimeEditor(const wxString &format, double rate)
@@ -303,8 +303,7 @@
Choice()->SetFocus();
}
-bool ChoiceEditor::EndEdit(int row, int col,
- wxGrid* grid)
+bool ChoiceEditor::EndEdit(int row, int col, wxGrid * grid)
{
wxString val = mChoices[Choice()->GetSelection()];
@@ -492,7 +491,7 @@
if (def && def->IsEnabled()) {
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
def->GetId());
- GetParent()->ProcessEvent(cevent);
+ GetParent()->GetEventHandler()->ProcessEvent(cevent);
}
}
else {
Index: src/widgets/Grid.h
===================================================================
--- src/widgets/Grid.h (revision 11306)
+++ src/widgets/Grid.h (working copy)
@@ -53,6 +53,8 @@
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();
@@ -125,6 +127,9 @@
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();
Index: src/widgets/ImageRoll.cpp
===================================================================
--- src/widgets/ImageRoll.cpp (revision 11306)
+++ src/widgets/ImageRoll.cpp (working copy)
@@ -100,6 +100,8 @@
#include <wx/bitmap.h>
#include <wx/dcmemory.h>
#include <wx/image.h>
+#include <wx/defs.h>
+#include <wx/dcclient.h>
WX_DEFINE_OBJARRAY(BitmapArray);
WX_DEFINE_OBJARRAY(ImageArray);
@@ -299,19 +301,19 @@
}
void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
- int x, int y, int logicalFunc)
+ int x, int y, wxRasterOperationMode logicalFunction)
{
- if (logicalFunc == wxCOPY)
+ if (logicalFunction == wxCOPY)
dc.DrawBitmap(bitmap, x, y);
else {
wxMemoryDC memDC;
memDC.SelectObject(bitmap);
dc.Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(),
- &memDC, 0, 0, logicalFunc);
+ &memDC, 0, 0, logicalFunction);
}
}
-void ImageRoll::Draw(wxDC &dc, wxRect rect, int logicalFunc)
+void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode logicalFunction)
{
int width = rect.width;
int height = rect.height;
@@ -434,9 +436,9 @@
mImageRoll.GetMaxSize());
}
-void ImageRollPanel::SetLogicalFunction(int func)
+void ImageRollPanel::SetLogicalFunction(wxRasterOperationMode logicalFunction)
{
- mLogicalFunction = func;
+ mLogicalFunction = logicalFunction;
}
void ImageRollPanel::OnPaint(wxPaintEvent &evt)
Index: src/widgets/ImageRoll.h
===================================================================
--- src/widgets/ImageRoll.h (revision 11306)
+++ src/widgets/ImageRoll.h (working copy)
@@ -15,6 +15,7 @@
#include <wx/defs.h>
#include <wx/dynarray.h>
#include <wx/panel.h>
+#include <wx/dc.h>
WX_DECLARE_OBJARRAY(wxBitmap, BitmapArray);
WX_DECLARE_OBJARRAY(wxImage, ImageArray);
@@ -40,7 +41,7 @@
wxSize GetMaxSize() const { return mMaxSize; }
void Draw(wxDC &dc, wxRect rect,
- int logicalFunc = wxCOPY);
+ wxRasterOperationMode logicalFunction = wxCOPY);
static ImageArray SplitH(const wxImage &src, wxColour magicColor);
static ImageArray SplitV(const wxImage &src, wxColour magicColor);
@@ -48,7 +49,7 @@
protected:
void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
- int x, int y, int logicalFunc = wxCOPY);
+ int x, int y, wxRasterOperationMode logicalFunction = wxCOPY);
void Init(RollType type, const wxImage &src, wxColour magicColor);
@@ -72,7 +73,7 @@
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL);
- void SetLogicalFunction(int func);
+ void SetLogicalFunction(wxRasterOperationMode logicalFunction);
void OnPaint(wxPaintEvent &evt);
void OnSize(wxSizeEvent &evt);
@@ -80,7 +81,7 @@
protected:
ImageRoll mImageRoll;
- int mLogicalFunction;
+ wxRasterOperationMode mLogicalFunction;
DECLARE_EVENT_TABLE();
Index: src/widgets/TimeTextCtrl.cpp
===================================================================
--- src/widgets/TimeTextCtrl.cpp (revision 11306)
+++ src/widgets/TimeTextCtrl.cpp (working copy)
@@ -176,6 +176,7 @@
#include <wx/stattext.h>
#include <wx/tooltip.h>
#include <wx/toplevel.h>
+#include <wx/dcclient.h>
#ifdef _DEBUG
#ifdef _MSC_VER
@@ -1152,7 +1153,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) {
@@ -1161,7 +1162,7 @@
if (def && def->IsEnabled()) {
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
def->GetId());
- GetParent()->ProcessEvent(cevent);
+ GetParent()->GetEventHandler()->ProcessEvent(cevent);
}
}
Index: src/xml/XMLWriter.cpp
===================================================================
--- src/xml/XMLWriter.cpp (revision 11306)
+++ src/xml/XMLWriter.cpp (working copy)
@@ -246,7 +246,7 @@
mHasKids[0] = true;
}
- Write(value.c_str());
+ Write(value);
}
void XMLWriter::WriteSubTree(const wxChar *value)
Some of the above changes may already have been made, others might be needed! There are a few included changes which only affect readability of the code but I made them to help diagnosing the build errors and left them in as they improve things for everyone (I think !).
I would suggest following this procedure:
- download & compile current wxWidgets stable post-2.8 version
- set WXWIN environmental variable
- reboot
- checkout a clean Audacity SVN HEAD
- open the audacity.sln in VC++ and make all the needed Linker library changes
- search all Audacity source code for every instance of “AddPendingEvent” it will find a bunch of lines like:
AddPendingEvent(e);
change them to:
GetEventHandler()->AddPendingEvent(e);
(remember the (e) might really be (event) then use “GetEventHandler()->AddPendingEvent(event);” etc. - use Batch Build to compile everything (this will get the entire Audacity solution including help and locale plus all the external libraries). You will get a lot of errors!
- I found it easiest to start with the external libraries–fewer changes–so open the Solution Explorer window and start at the bottom “twolame”–right-click to get a context menu, choose Project Only > Build only twolame, fix errors until it builds then move up to “soundtouch” and continue.
When you hit an error search through the above patch to find the solution (or a similar solution) and apply the fix manually. If you get stuck, post here and I will try to help.