From 954a9744225fbfc93587486f7612b78b06a6a25e Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 11 Sep 2017 00:08:31 -0400 Subject: [PATCH] Changed the conditional compilation for alpha/beta/release... ... In particular, don't put the extra information in MIDI device info for Beta But still link to the Alpha manual. --- src/Audacity.h | 36 +++++++++++++++++++++++++++--------- src/AudioIO.cpp | 1 + src/HelpText.cpp | 6 +++--- src/Menus.cpp | 4 ++-- src/widgets/HelpSystem.cpp | 4 ++-- 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/Audacity.h b/src/Audacity.h index e6c62546e..aa1039846 100644 --- a/src/Audacity.h +++ b/src/Audacity.h @@ -34,12 +34,30 @@ // We only do alpha builds, beta builds, and release versions. -// Most of the time we're in development, so IS_ALPHA should be defined -// to 1. -// Its value may be more than 1 for pre-release "Beta" builds that differ only in the -// welcome screen. -// Use "#if IS_ALPHA" not #ifdef -#define IS_ALPHA 2 +// Most of the time we're in development, so AUDACITY_BUILD_LEVEL should be +// defined to 0. +// Its value may be more than 0 for pre-release "Beta" builds that differ only +// in the welcome screen, and hiding of some development menu commands, but +// still link to the alpha manual online. +#define AUDACITY_BUILD_LEVEL 1 + +// used #ifdef not #if for IS_ALPHA, IS_BETA, IS_RELEASE, USE_ALPHA_MANUAL +#undef IS_ALPHA +#undef IS_BETA +#undef IS_RELEASE +#undef USE_ALPHA_MANUAL + +#if AUDACITY_BUILD_LEVEL == 0 + #define IS_ALPHA + #define USE_ALPHA_MANUAL +#elif AUDACITY_BUILD_LEVEL == 1 + #define IS_BETA + #define USE_ALPHA_MANUAL +#else + #define IS_RELEASE +#endif + + // Increment as appropriate every time we release a NEW version. #define AUDACITY_VERSION 2 @@ -47,9 +65,9 @@ #define AUDACITY_REVISION 0 #define AUDACITY_MODLEVEL 0 -#if IS_ALPHA > 1 +#if defined(IS_BETA) #define AUDACITY_SUFFIX wxT("-beta-") __TDATE__ -#elif IS_ALPHA +#elif defined(IS_ALPHA) #define AUDACITY_SUFFIX wxT("-alpha-") __TDATE__ #else #define AUDACITY_SUFFIX wxT("") // for a stable release @@ -147,7 +165,7 @@ void QuitAudacity(); // Put extra symbol information in the release build, for the purpose of gathering // profiling information (as from Windows Process Monitor), when there otherwise // isn't a need for AUDACITY_DLL_API. -#if IS_ALPHA +#ifdef IS_ALPHA #define PROFILE_DLL_API AUDACITY_DLL_API #else #define PROFILE_DLL_API diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index f4e7f7d26..c2c787d5e 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -3498,6 +3498,7 @@ wxString AudioIO::GetMidiDeviceInfo() s << wxT("No MIDI playback device found for '") << playDevice << wxT("'.") << e; } + // Mention our conditional compilation flags for Alpha only #ifdef IS_ALPHA s << wxT("==============================") << e; diff --git a/src/HelpText.cpp b/src/HelpText.cpp index afb258d57..eea664361 100644 --- a/src/HelpText.cpp +++ b/src/HelpText.cpp @@ -212,10 +212,10 @@ static wxString HelpTextBuiltIn( const wxString & Key ) /* i18n-hint: Preserve [[file:quick_help.html as it's the name of a file.*/ wxString result = wxString(wxT("")) + -#if IS_ALPHA +#if defined(IS_ALPHA) || defined(IS_BETA) wxT("

") + _("Get the Official Released Version of Audacity") + wxT("

") + VerCheckHtml() + -#if IS_ALPHA == 1 +#ifdef IS_ALPHA alphamsg #else betamsg @@ -246,7 +246,7 @@ static wxString HelpTextBuiltIn( const wxString & Key ) _("More: Visit our [[http://wiki.audacityteam.org/index.php|Wiki]] for tips, tricks, extra tutorials and effects plug-ins.") + wxT("

"); #endif -#if IS_ALPHA +#ifdef USE_ALPHA_MANUAL result.Replace( "//manual.audacityteam.org/quick_help.html","//alphamanual.audacityteam.org/man/Quick_Help" ); result.Replace( "//manual.audacityteam.org/","//alphamanual.audacityteam.org/man/" ); #endif diff --git a/src/Menus.cpp b/src/Menus.cpp index 9106b3395..549dd1883 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -1224,7 +1224,7 @@ void AudacityProject::CreateMenusAndCommands() // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic, // as they used to in 1.3.x -//#if IS_ALPHA +//#ifdef IS_ALPHA // TODO: What should we do here? Make benchmark a plug-in? // Easy enough to do. We'd call it mod-self-test. @@ -8285,7 +8285,7 @@ void AudacityProject::OnCheckForUpdates() // Only does the update checks if it's an ALPHA build and not disabled by preferences. void AudacityProject::MayCheckForUpdates() { -#if IS_ALPHA +#ifdef IS_ALPHA OnCheckForUpdates(); #endif } diff --git a/src/widgets/HelpSystem.cpp b/src/widgets/HelpSystem.cpp index 6e772e42b..ac811fcb3 100644 --- a/src/widgets/HelpSystem.cpp +++ b/src/widgets/HelpSystem.cpp @@ -36,7 +36,7 @@ #include "ErrorDialog.h" #include "HelpSystem.h" -#if IS_ALPHA +#ifdef USE_ALPHA_MANUAL const wxString HelpSystem::HelpHostname = wxT("alphamanual.audacityteam.org"); const wxString HelpSystem::HelpServerHomeDir = wxT("/man/"); const wxString HelpSystem::HelpServerManDir = wxT("/man/"); @@ -354,7 +354,7 @@ void HelpSystem::ShowHelp(wxWindow *parent, webHelpPath = wxT("https://")+HelpSystem::HelpHostname+HelpSystem::HelpServerManDir; } -#if IS_ALPHA +#ifdef USE_ALPHA_MANUAL webHelpPage = webHelpPath + PageName; #else webHelpPage = webHelpPath + releasePageName;