1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

More #ifdefs to allow joint Audacity/DarkAudacity use.

This commit is contained in:
James Crook 2017-02-13 21:57:30 +00:00
parent da1f860f2f
commit 49010dc7b0
12 changed files with 62 additions and 14 deletions

View File

@ -48,8 +48,7 @@
// feature to link audio tracks to a label track // feature to link audio tracks to a label track
#define EXPERIMENTAL_SYNC_LOCK #define EXPERIMENTAL_SYNC_LOCK
// enables dark theme and customisations. // enables dark audacity theme and customisations.
#define EXPERIMENTAL_DARK_AUDACITY
#define EXPERIMENTAL_DA #define EXPERIMENTAL_DA
// experimental theming // experimental theming

View File

@ -57,6 +57,12 @@ const wxString& GetCustomSubstitution(const wxString& str2)
str3.Replace( " an DarkAudacity", " a DarkAudacity" ); str3.Replace( " an DarkAudacity", " a DarkAudacity" );
return wxTranslations::GetUntranslatedString(str3); return wxTranslations::GetUntranslatedString(str3);
} }
#else
const wxString& GetCustomSubstitution(const wxString& str1)
{
return str1 ;
}
#endif
// In any translated string, we can replace the name 'Audacity' by 'DarkAudacity' // In any translated string, we can replace the name 'Audacity' by 'DarkAudacity'
// without requiring translators to see extra strings for the two versions. // without requiring translators to see extra strings for the two versions.
@ -65,7 +71,6 @@ const wxString& GetCustomTranslation(const wxString& str1)
const wxString& str2 = wxGetTranslation( str1 ); const wxString& str2 = wxGetTranslation( str1 );
return GetCustomSubstitution( str2 ); return GetCustomSubstitution( str2 );
} }
#endif
void Internat::Init() void Internat::Init()

View File

@ -325,7 +325,7 @@ void AudacityProject::CreateMenusAndCommands()
AudioIONotBusyFlag | UnsavedChangesFlag); AudioIONotBusyFlag | UnsavedChangesFlag);
c->AddItem(wxT("SaveAs"), _("Save Project &As..."), FN(OnSaveAs)); c->AddItem(wxT("SaveAs"), _("Save Project &As..."), FN(OnSaveAs));
c->BeginSubMenu( _("Save Other") ); c->BeginSubMenu( _("Save Other") );
#ifdef EXPERIMENTAL_DARK_AUDACITY #ifdef EXPERIMENTAL_DA
// Enable Export audio commands only when there are audio tracks. // Enable Export audio commands only when there are audio tracks.
c->AddItem(wxT("ExportMp3"), _("Export as MP&3"), FN(OnExportMp3), wxT(""), c->AddItem(wxT("ExportMp3"), _("Export as MP&3"), FN(OnExportMp3), wxT(""),
AudioIONotBusyFlag | WaveTracksExistFlag, AudioIONotBusyFlag | WaveTracksExistFlag,
@ -593,7 +593,11 @@ void AudacityProject::CreateMenusAndCommands()
TracksExistFlag, TracksExistFlag); TracksExistFlag, TracksExistFlag);
#ifdef EXPERIMENTAL_SYNC_LOCK #ifdef EXPERIMENTAL_SYNC_LOCK
#ifdef EXPERIMENTAL_DA
c->AddItem(wxT("SelSyncLockTracks"), _("In All Time-Locked Tracks"), c->AddItem(wxT("SelSyncLockTracks"), _("In All Time-Locked Tracks"),
#else
c->AddItem(wxT("SelSyncLockTracks"), _("In All Sync-Locked Tracks"),
#endif
FN(OnSelectSyncLockSel), wxT("Ctrl+Shift+Y"), FN(OnSelectSyncLockSel), wxT("Ctrl+Shift+Y"),
TracksSelectedFlag | IsSyncLockedFlag, TracksSelectedFlag | IsSyncLockedFlag,
TracksSelectedFlag | IsSyncLockedFlag); TracksSelectedFlag | IsSyncLockedFlag);

View File

@ -1256,7 +1256,11 @@ void AudacityProject::UpdatePrefsVariables()
gPrefs->Read(wxT("/AudioFiles/NormalizeOnLoad"),&mNormalizeOnLoad, false); gPrefs->Read(wxT("/AudioFiles/NormalizeOnLoad"),&mNormalizeOnLoad, false);
gPrefs->Read(wxT("/GUI/AutoScroll"), &mViewInfo.bUpdateTrackIndicator, true); gPrefs->Read(wxT("/GUI/AutoScroll"), &mViewInfo.bUpdateTrackIndicator, true);
gPrefs->Read(wxT("/GUI/EmptyCanBeDirty"), &mEmptyCanBeDirty, true ); gPrefs->Read(wxT("/GUI/EmptyCanBeDirty"), &mEmptyCanBeDirty, true );
#ifdef EXPERIMENTAL_DA
gPrefs->Read(wxT("/GUI/Help"), &mHelpPref, wxT("FromInternet") ); gPrefs->Read(wxT("/GUI/Help"), &mHelpPref, wxT("FromInternet") );
#else
gPrefs->Read(wxT("/GUI/Help"), &mHelpPref, wxT("Local") );
#endif
gPrefs->Read(wxT("/GUI/SelectAllOnNone"), &mSelectAllOnNone, true); gPrefs->Read(wxT("/GUI/SelectAllOnNone"), &mSelectAllOnNone, true);
mStopIfWasPaused = true; // not configurable for now, but could be later. mStopIfWasPaused = true; // not configurable for now, but could be later.
gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &mShowSplashScreen, true); gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &mShowSplashScreen, true);

View File

@ -522,7 +522,11 @@ int SourceOutputStream::OpenFile(const wxString & Filename)
bOk = File.Open( Filename, wxFile::write ); bOk = File.Open( Filename, wxFile::write );
if( bOk ) if( bOk )
{ {
#ifdef EXPERIMENTAL_DA
File.Write( wxT("// DarkThemeAsCeeCode.h\r\n") ); File.Write( wxT("// DarkThemeAsCeeCode.h\r\n") );
#else
File.Write( wxT("// ThemeAsCeeCode.h\r\n") );
#endif
File.Write( wxT("//\r\n") ); File.Write( wxT("//\r\n") );
File.Write( wxT("// This file was Auto-Generated.\r\n") ); File.Write( wxT("// This file was Auto-Generated.\r\n") );
File.Write( wxT("// It is included by Theme.cpp.\r\n") ); File.Write( wxT("// It is included by Theme.cpp.\r\n") );

View File

@ -392,7 +392,11 @@ wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
this track is shown with a sync-locked icon.*/ this track is shown with a sync-locked icon.*/
// The absence of a dash between Sync and Locked is deliberate - // The absence of a dash between Sync and Locked is deliberate -
// if present, Jaws reads it as "dash". // if present, Jaws reads it as "dash".
#ifdef EXPERIMENTAL_DA
name->Append( wxT(" ") + wxString(_( " Time Lock Selected" )) ); name->Append( wxT(" ") + wxString(_( " Time Lock Selected" )) );
#else
name->Append( wxT(" ") + wxString(_( " Sync Lock Selected" )) );
#endif
} }
} }
} }

View File

@ -14,6 +14,7 @@
*//*******************************************************************/ *//*******************************************************************/
#include "../Audacity.h" #include "../Audacity.h"
#include "../Experimental.h"
#include "DtmfGen.h" #include "DtmfGen.h"
#include <wx/intl.h> #include <wx/intl.h>
@ -33,12 +34,18 @@ enum
ID_DutyCycle, ID_DutyCycle,
}; };
#ifdef EXPERIMENTAL_DA
#define SHORT_APP_NAME "darkaudacity"
#else
#define SHORT_APP_NAME "audacity"
#endif
// Define keys, defaults, minimums, and maximums for the effect parameters // Define keys, defaults, minimums, and maximums for the effect parameters
// //
// Name Type Key Def Min Max Scale // Name Type Key Def Min Max Scale
Param( Sequence, wxString, XO("Sequence"), wxT("darkaudacity"), wxT(""), wxT(""), wxT("")); Param( Sequence, wxString, XO("Sequence"), wxT(SHORT_APP_NAME), wxT(""), wxT(""), wxT(""));
Param( DutyCycle, double, XO("Duty Cycle"), 55.0, 0.0, 100.0, 10.0 ); Param( DutyCycle, double, XO("Duty Cycle"), 55.0, 0.0, 100.0, 10.0 );
Param( Amplitude, double, XO("Amplitude"), 0.8, 0.001, 1.0, 1 ); Param( Amplitude, double, XO("Amplitude"), 0.8, 0.001, 1.0, 1 );
static const double kFadeInOut = 250.0; // used for fadein/out needed to remove clicking noise static const double kFadeInOut = 250.0; // used for fadein/out needed to remove clicking noise
@ -269,7 +276,7 @@ bool EffectDtmf::Startup()
// Load the old "current" settings // Load the old "current" settings
if (gPrefs->Exists(base)) if (gPrefs->Exists(base))
{ {
gPrefs->Read(base + wxT("String"), &dtmfSequence, wxT("darkaudacity")); gPrefs->Read(base + wxT("String"), &dtmfSequence, wxT(SHORT_APP_NAME));
gPrefs->Read(base + wxT("DutyCycle"), &dtmfDutyCycle, 550L); gPrefs->Read(base + wxT("DutyCycle"), &dtmfDutyCycle, 550L);
gPrefs->Read(base + wxT("Amplitude"), &dtmfAmplitude, 0.8f); gPrefs->Read(base + wxT("Amplitude"), &dtmfAmplitude, 0.8f);

View File

@ -16,6 +16,7 @@
*//*******************************************************************/ *//*******************************************************************/
#include "../Audacity.h" #include "../Audacity.h"
#include "../Experimental.h"
#include "TruncSilence.h" #include "TruncSilence.h"
#include <algorithm> #include <algorithm>
@ -283,7 +284,11 @@ bool EffectTruncSilence::ProcessIndependently()
if (track2->GetKind() == Track::Wave && if (track2->GetKind() == Track::Wave &&
!(track2 == track || track2 == link) && !(track2 == track || track2 == link) &&
track2->GetSelected()) { track2->GetSelected()) {
#ifdef EXPERIMENTAL_DA
::wxMessageBox(_("When truncating independently, there may only be one selected audio track in each Time-Locked Track Group.")); ::wxMessageBox(_("When truncating independently, there may only be one selected audio track in each Time-Locked Track Group."));
#else
::wxMessageBox(_("When truncating independently, there may only be one selected audio track in each Sync-Locked Track Group."));
#endif
return false; return false;
} }
} }

View File

@ -192,7 +192,11 @@ bool GUIPrefs::Apply()
gPrefs->Flush(); gPrefs->Flush();
} }
#ifdef EXPERIMENTAL_DA
wxString theme = gPrefs->Read(wxT("/GUI/Theme"), wxT("dark")); wxString theme = gPrefs->Read(wxT("/GUI/Theme"), wxT("dark"));
#else
wxString theme = gPrefs->Read(wxT("/GUI/Theme"), wxT("light"));
#endif
if( theme != "foo" ){ if( theme != "foo" ){
// gPrefs->Write(wxT("/GUI/Theme"), theme); // gPrefs->Write(wxT("/GUI/Theme"), theme);
// gPrefs->Flush(); // gPrefs->Flush();

View File

@ -148,10 +148,12 @@ void EditToolBar::Populate()
AddSeparator(); AddSeparator();
#ifdef EXPERIMENTAL_SYNC_LOCK #ifdef EXPERIMENTAL_SYNC_LOCK
// AddButton(bmpSyncLockTracksUp, bmpSyncLockTracksDown, bmpSyncLockTracksUp, ETBSyncLockID, #ifndef EXPERIMENTAL_DA
// _("Time-Lock Tracks"), true); AddButton(bmpSyncLockTracksUp, bmpSyncLockTracksDown, bmpSyncLockTracksUp, ETBSyncLockID,
_("Sync-Lock Tracks"), true);
// AddSeparator(); AddSeparator();
#endif
#endif #endif
AddButton(bmpZoomIn, bmpZoomIn, bmpZoomInDisabled, ETBZoomInID, AddButton(bmpZoomIn, bmpZoomIn, bmpZoomInDisabled, ETBZoomInID,
@ -212,7 +214,9 @@ void EditToolBar::RegenerateTooltips()
{ ETBRedoID, wxT("Redo"), XO("Redo") }, { ETBRedoID, wxT("Redo"), XO("Redo") },
#ifdef EXPERIMENTAL_SYNC_LOCK #ifdef EXPERIMENTAL_SYNC_LOCK
// { ETBSyncLockID, wxT("SyncLock"), XO("Time-Lock Tracks") }, #ifndef EXPERIMENTAL_DA
{ ETBSyncLockID, wxT("SyncLock"), XO("Sync-Lock Tracks") },
#endif
#endif #endif
{ ETBZoomInID, wxT("ZoomIn"), XO("Zoom In") }, { ETBZoomInID, wxT("ZoomIn"), XO("Zoom In") },

View File

@ -38,7 +38,9 @@ enum {
ETBRedoID, ETBRedoID,
#ifdef EXPERIMENTAL_SYNC_LOCK #ifdef EXPERIMENTAL_SYNC_LOCK
// ETBSyncLockID, #ifndef EXPERIMENTAL_DA
ETBSyncLockID,
#endif
#endif #endif
ETBZoomInID, ETBZoomInID,

View File

@ -296,9 +296,15 @@ void HelpSystem::ShowHelpDialog(wxWindow *parent,
} }
else if (releasePageName == wxT("Quick_Help")) else if (releasePageName == wxT("Quick_Help"))
{ {
#ifdef EXPERIMENTAL_DA
releasePageName = wxT("video") + HelpSystem::ReleaseSuffix + anchor; releasePageName = wxT("video") + HelpSystem::ReleaseSuffix + anchor;
localHelpPage = wxFileName(FileNames::HtmlHelpDir(), releasePageName).GetFullPath(); localHelpPage = wxFileName(FileNames::HtmlHelpDir(), releasePageName).GetFullPath();
webHelpPath = wxT("http://www.darkaudacity.com/"); webHelpPath = wxT("http://www.darkaudacity.com/");
#else
releasePageName = wxT("quick_help") + HelpSystem::ReleaseSuffix + anchor;
localHelpPage = wxFileName(FileNames::HtmlHelpDir(), releasePageName).GetFullPath();
webHelpPath = wxT("http://")+HelpSystem::HelpHostname+HelpSystem::HelpServerHomeDir;
#endif
} }
else else
{ {