mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-17 17:17:40 +02:00
Preference dialog pages are registered, not exhaustively listed
This commit is contained in:
commit
76041f0b8e
@ -95,9 +95,14 @@ BatchPrefs::~BatchPrefs()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
#if 0
|
||||||
BatchPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
namespace{
|
||||||
{
|
PrefsPanel::Registration sAttachment{ 190,
|
||||||
wxASSERT(parent); // to justify safenew
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
return safenew BatchPrefs(parent, winid);
|
{
|
||||||
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew BatchPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -38,7 +38,4 @@ private:
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one BatchPrefs panel.
|
|
||||||
extern PrefsPanel::Factory BatchPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -422,10 +422,12 @@ bool DevicePrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
DevicePrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 10,
|
||||||
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
{
|
{
|
||||||
wxASSERT(parent); // to justify safenew
|
wxASSERT(parent); // to justify safenew
|
||||||
return safenew DevicePrefs(parent, winid);
|
return safenew DevicePrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -57,7 +57,4 @@ class DevicePrefs final : public PrefsPanel
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one DevicePrefs panel.
|
|
||||||
extern PrefsPanel::Factory DevicePrefsFactory;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -298,3 +298,9 @@ DirectoriesPrefsFactory() {
|
|||||||
return safenew DirectoriesPrefs(parent, winid);
|
return safenew DirectoriesPrefs(parent, winid);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace{
|
||||||
|
PrefsPanel::Registration sAttachment{ 150,
|
||||||
|
DirectoriesPrefsFactory() };
|
||||||
|
};
|
||||||
|
|
||||||
|
@ -250,9 +250,12 @@ bool EffectsPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
EffectsPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 170,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew EffectsPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew EffectsPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -38,9 +38,5 @@ class EffectsPrefs final : public PrefsPanel
|
|||||||
void Populate();
|
void Populate();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one EffectsPrefs panel.
|
|
||||||
extern PrefsPanel::Factory EffectsPrefsFactory;
|
|
||||||
|
|
||||||
extern ChoiceSetting EffectsGroupBy;
|
extern ChoiceSetting EffectsGroupBy;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -826,9 +826,12 @@ void ExtImportPrefsDropTarget::OnLeave()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
ExtImportPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 120,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew ExtImportPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew ExtImportPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -113,7 +113,4 @@ class ExtImportPrefs final : public PrefsPanel
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one ExtImportPrefs panel.
|
|
||||||
extern PrefsPanel::Factory ExtImportPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -377,9 +377,12 @@ int ShowClippingPrefsID()
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
GUIPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 60,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew GUIPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew GUIPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -64,9 +64,6 @@ class GUIPrefs final : public PrefsPanel
|
|||||||
int mDefaultRangeIndex;
|
int mDefaultRangeIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one GUIPrefs panel.
|
|
||||||
extern PrefsPanel::Factory GUIPrefsFactory;
|
|
||||||
|
|
||||||
int ShowClippingPrefsID();
|
int ShowClippingPrefsID();
|
||||||
|
|
||||||
extern ChoiceSetting
|
extern ChoiceSetting
|
||||||
|
@ -149,9 +149,13 @@ bool ImportExportPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
ImportExportPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 110,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew ImportExportPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew ImportExportPrefs(parent, winid);
|
||||||
|
},
|
||||||
|
1
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -42,7 +42,4 @@ class ImportExportPrefs final : public PrefsPanel
|
|||||||
void Populate();
|
void Populate();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one ImportExportPrefs panel.
|
|
||||||
extern PrefsPanel::Factory ImportExportPrefsFactory;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -722,3 +722,8 @@ KeyConfigPrefsFactory( const CommandID &name )
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
namespace{
|
||||||
|
PrefsPanel::Registration sAttachment{ 200,
|
||||||
|
KeyConfigPrefsFactory()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -261,9 +261,14 @@ bool LibraryPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || !defined(DISABLE_DYNAMIC_LOADING_LAME)
|
||||||
LibraryPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
namespace{
|
||||||
{
|
PrefsPanel::Registration sAttachment{ 140,
|
||||||
wxASSERT(parent); // to justify safenew
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
return safenew LibraryPrefs(parent, winid);
|
{
|
||||||
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew LibraryPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -50,6 +50,4 @@ class LibraryPrefs final : public PrefsPanel
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one LibraryPrefs panel.
|
|
||||||
extern PrefsPanel::Factory LibraryPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -301,11 +301,16 @@ bool MidiIOPrefs::Validate()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
MidiIOPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
namespace{
|
||||||
{
|
PrefsPanel::Registration sAttachment{ 40,
|
||||||
wxASSERT(parent); // to justify safenew
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
return safenew MidiIOPrefs(parent, winid);
|
{
|
||||||
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew MidiIOPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,8 +68,6 @@ class MidiIOPrefs final : public PrefsPanel
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one MidiIOPrefs panel.
|
|
||||||
extern PrefsPanel::Factory MidiIOPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,6 +18,8 @@ with names like mnod-script-pipe that add NEW features.
|
|||||||
#include "../Audacity.h"
|
#include "../Audacity.h"
|
||||||
#include "ModulePrefs.h"
|
#include "ModulePrefs.h"
|
||||||
|
|
||||||
|
#include "Experimental.h"
|
||||||
|
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
|
|
||||||
@ -187,9 +189,14 @@ void ModulePrefs::SetModuleStatus(const FilePath &fname, int iStatus){
|
|||||||
gPrefs->Flush();
|
gPrefs->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
#ifdef EXPERIMENTAL_MODULE_PREFS
|
||||||
ModulePrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
namespace{
|
||||||
{
|
PrefsPanel::Registration sAttachment{ 220,
|
||||||
wxASSERT(parent); // to justify safenew
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
return safenew ModulePrefs(parent, winid);
|
{
|
||||||
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew ModulePrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -55,6 +55,4 @@ class ModulePrefs final : public PrefsPanel
|
|||||||
FilePaths mPaths;
|
FilePaths mPaths;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one ModulePrefs panel.
|
|
||||||
extern PrefsPanel::Factory ModulePrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -222,9 +222,12 @@ bool MousePrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
MousePrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 210,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew MousePrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew MousePrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -42,6 +42,4 @@ class MousePrefs final : public PrefsPanel
|
|||||||
wxListCtrl * mList;
|
wxListCtrl * mList;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one MousePrefs panel.
|
|
||||||
extern PrefsPanel::Factory MousePrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -182,10 +182,12 @@ bool PlaybackPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
PlaybackPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 20,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew PlaybackPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew PlaybackPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -38,8 +38,4 @@ class PlaybackPrefs final : public PrefsPanel
|
|||||||
void Populate();
|
void Populate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one PlaybackPrefs panel.
|
|
||||||
extern PrefsPanel::Factory PlaybackPrefsFactory;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
#include "../Audacity.h" // for USE_* macros
|
#include "../Audacity.h" // for USE_* macros
|
||||||
#include "PrefsDialog.h"
|
#include "PrefsDialog.h"
|
||||||
|
|
||||||
#include "../Experimental.h"
|
|
||||||
|
|
||||||
#include <wx/app.h>
|
#include <wx/app.h>
|
||||||
#include <wx/setup.h> // for wxUSE_* macros
|
#include <wx/setup.h> // for wxUSE_* macros
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
@ -40,33 +38,7 @@
|
|||||||
#include "../Prefs.h"
|
#include "../Prefs.h"
|
||||||
#include "../ShuttleGui.h"
|
#include "../ShuttleGui.h"
|
||||||
|
|
||||||
#include "BatchPrefs.h"
|
#include "PrefsPanel.h"
|
||||||
#include "DevicePrefs.h"
|
|
||||||
#include "DirectoriesPrefs.h"
|
|
||||||
#include "EffectsPrefs.h"
|
|
||||||
#include "GUIPrefs.h"
|
|
||||||
#include "ImportExportPrefs.h"
|
|
||||||
#include "KeyConfigPrefs.h"
|
|
||||||
#include "LibraryPrefs.h"
|
|
||||||
#include "MousePrefs.h"
|
|
||||||
#ifdef EXPERIMENTAL_MODULE_PREFS
|
|
||||||
#include "ModulePrefs.h"
|
|
||||||
#endif
|
|
||||||
#include "PlaybackPrefs.h"
|
|
||||||
#include "ProjectsPrefs.h"
|
|
||||||
#include "QualityPrefs.h"
|
|
||||||
#include "RecordingPrefs.h"
|
|
||||||
#include "SpectrumPrefs.h"
|
|
||||||
#include "ThemePrefs.h"
|
|
||||||
#include "TracksPrefs.h"
|
|
||||||
#include "TracksBehaviorsPrefs.h"
|
|
||||||
#include "WarningsPrefs.h"
|
|
||||||
// #include "WaveformPrefs.h"
|
|
||||||
#include "ExtImportPrefs.h"
|
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
|
||||||
#include "MidiIOPrefs.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../widgets/HelpSystem.h"
|
#include "../widgets/HelpSystem.h"
|
||||||
|
|
||||||
@ -477,56 +449,48 @@ int wxTreebookExt::SetSelection(size_t n)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
struct Entry{
|
||||||
|
unsigned sequenceNumber;
|
||||||
|
PrefsDialog::PrefsNode node;
|
||||||
|
|
||||||
|
bool operator < ( const Entry &other ) const
|
||||||
|
{ return sequenceNumber < other.sequenceNumber; }
|
||||||
|
};
|
||||||
|
using Entries = std::vector< Entry >;
|
||||||
|
Entries &Registry()
|
||||||
|
{
|
||||||
|
static Entries result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PrefsPanel::Registration::Registration( unsigned sequenceNumber,
|
||||||
|
const Factory &factory,
|
||||||
|
unsigned nChildren,
|
||||||
|
bool expanded )
|
||||||
|
{
|
||||||
|
auto ®istry = Registry();
|
||||||
|
Entry entry{ sequenceNumber, { factory, nChildren, expanded } };
|
||||||
|
const auto end = registry.end();
|
||||||
|
// Find insertion point:
|
||||||
|
auto iter = std::lower_bound( registry.begin(), end, entry );
|
||||||
|
// There should not be duplicate sequence numbers:
|
||||||
|
wxASSERT( iter == end || entry < *iter );
|
||||||
|
registry.insert( iter, entry );
|
||||||
|
}
|
||||||
|
|
||||||
PrefsDialog::Factories
|
PrefsDialog::Factories
|
||||||
&PrefsDialog::DefaultFactories()
|
&PrefsDialog::DefaultFactories()
|
||||||
{
|
{
|
||||||
// To do, perhaps: create this table by registration, without including each PrefsPanel
|
static Factories factories;
|
||||||
// class... and thus allowing a plug-in protocol
|
static std::once_flag flag;
|
||||||
|
|
||||||
static PrefsNode nodes[] = {
|
std::call_once( flag, []{
|
||||||
DevicePrefsFactory,
|
for ( const auto &entry : Registry() ) {
|
||||||
PlaybackPrefsFactory,
|
factories.push_back( entry.node );
|
||||||
RecordingPrefsFactory,
|
}
|
||||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
} );
|
||||||
MidiIOPrefsFactory,
|
|
||||||
#endif
|
|
||||||
QualityPrefsFactory,
|
|
||||||
GUIPrefsFactory,
|
|
||||||
|
|
||||||
// Group other page(s)
|
|
||||||
PrefsNode(TracksPrefsFactory, 2),
|
|
||||||
// WaveformPrefsFactory(),
|
|
||||||
TracksBehaviorsPrefsFactory,
|
|
||||||
SpectrumPrefsFactory(),
|
|
||||||
|
|
||||||
// Group one other page
|
|
||||||
PrefsNode(ImportExportPrefsFactory, 1),
|
|
||||||
ExtImportPrefsFactory,
|
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_OD_DATA
|
|
||||||
ProjectsPrefsFactory,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || !defined(DISABLE_DYNAMIC_LOADING_LAME)
|
|
||||||
LibraryPrefsFactory,
|
|
||||||
#endif
|
|
||||||
DirectoriesPrefsFactory(),
|
|
||||||
WarningsPrefsFactory,
|
|
||||||
EffectsPrefsFactory,
|
|
||||||
#ifdef EXPERIMENTAL_THEME_PREFS
|
|
||||||
ThemePrefsFactory,
|
|
||||||
#endif
|
|
||||||
// &batchPrefsFactory,
|
|
||||||
KeyConfigPrefsFactory(),
|
|
||||||
MousePrefsFactory,
|
|
||||||
#ifdef EXPERIMENTAL_MODULE_PREFS
|
|
||||||
ModulePrefsFactory,
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
static Factories factories(nodes, nodes + sizeof(nodes) / sizeof(nodes[0]));
|
|
||||||
return factories;
|
return factories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ class PrefsDialog /* not final */ : public wxDialogWrapper
|
|||||||
std::function< PrefsPanel * (
|
std::function< PrefsPanel * (
|
||||||
wxWindow *parent, wxWindowID winid, AudacityProject *) >;
|
wxWindow *parent, wxWindowID winid, AudacityProject *) >;
|
||||||
Factory factory;
|
Factory factory;
|
||||||
CONST int nChildren;
|
unsigned nChildren;
|
||||||
bool expanded;
|
bool expanded;
|
||||||
|
|
||||||
PrefsNode(const Factory &factory_,
|
PrefsNode(const Factory &factory_,
|
||||||
int nChildren_ = 0,
|
unsigned nChildren_ = 0,
|
||||||
bool expanded_ = true)
|
bool expanded_ = true)
|
||||||
: factory(factory_), nChildren(nChildren_), expanded(expanded_)
|
: factory(factory_), nChildren(nChildren_), expanded(expanded_)
|
||||||
{}
|
{}
|
||||||
|
@ -49,7 +49,7 @@ class PrefsPanel /* not final */ : public wxPanelWrapper, ComponentInterface
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// \brief Type alias for factories such as GUIPrefsFactory that produce a
|
// \brief Type alias for factories such as GUIPrefsFactory that produce a
|
||||||
// PrefsPanel.
|
// PrefsPanel, used by the Preferences dialog in a treebook.
|
||||||
// The project pointer may be null. Usually it's not needed because
|
// The project pointer may be null. Usually it's not needed because
|
||||||
// preferences are global. But sometimes you need a project, such as to
|
// preferences are global. But sometimes you need a project, such as to
|
||||||
// preview the preference changes for spectrograms.
|
// preview the preference changes for spectrograms.
|
||||||
@ -57,8 +57,18 @@ class PrefsPanel /* not final */ : public wxPanelWrapper, ComponentInterface
|
|||||||
std::function< PrefsPanel * (
|
std::function< PrefsPanel * (
|
||||||
wxWindow *parent, wxWindowID winid, AudacityProject *) >;
|
wxWindow *parent, wxWindowID winid, AudacityProject *) >;
|
||||||
|
|
||||||
PrefsPanel(
|
// Typically you make a static object of this type in the .cpp file that
|
||||||
wxWindow * parent, wxWindowID winid, const TranslatableString &title)
|
// also implements the PrefsPanel subclass.
|
||||||
|
struct Registration final
|
||||||
|
{
|
||||||
|
Registration( unsigned sequenceNumber,
|
||||||
|
const Factory &factory,
|
||||||
|
unsigned nChildren = 0,
|
||||||
|
bool expanded = true );
|
||||||
|
};
|
||||||
|
|
||||||
|
PrefsPanel(wxWindow * parent,
|
||||||
|
wxWindowID winid, const TranslatableString &title)
|
||||||
: wxPanelWrapper(parent, winid)
|
: wxPanelWrapper(parent, winid)
|
||||||
{
|
{
|
||||||
SetLabel(title); // Provide visual label
|
SetLabel(title); // Provide visual label
|
||||||
|
@ -19,6 +19,8 @@ handling.
|
|||||||
#include "../Audacity.h"
|
#include "../Audacity.h"
|
||||||
#include "ProjectsPrefs.h"
|
#include "ProjectsPrefs.h"
|
||||||
|
|
||||||
|
#include "../Experimental.h"
|
||||||
|
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
|
|
||||||
@ -95,9 +97,14 @@ bool ProjectsPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
#ifdef EXPERIMENTAL_OD_DATA
|
||||||
ProjectsPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
namespace{
|
||||||
{
|
PrefsPanel::Registration sAttachment{ 130,
|
||||||
wxASSERT(parent); // to justify safenew
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
return safenew ProjectsPrefs(parent, winid);
|
{
|
||||||
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew ProjectsPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -37,6 +37,4 @@ class ProjectsPrefs final : public PrefsPanel
|
|||||||
void Populate();
|
void Populate();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one ProjectPrefs panel.
|
|
||||||
extern PrefsPanel::Factory ProjectsPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -233,12 +233,15 @@ bool QualityPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
QualityPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 50,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew QualityPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew QualityPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
sampleFormat QualityPrefs::SampleFormatChoice()
|
sampleFormat QualityPrefs::SampleFormatChoice()
|
||||||
{
|
{
|
||||||
|
@ -56,6 +56,4 @@ class QualityPrefs final : public PrefsPanel
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one QualityPrefs panel.
|
|
||||||
extern PrefsPanel::Factory QualityPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -304,9 +304,12 @@ void RecordingPrefs::OnToggleCustomName(wxCommandEvent & /* Evt */)
|
|||||||
mToggleCustomName->Enable(mUseCustomTrackName);
|
mToggleCustomName->Enable(mUseCustomTrackName);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
RecordingPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 30,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew RecordingPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew RecordingPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -63,6 +63,4 @@ class RecordingPrefs final : public PrefsPanel
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one RecordingPrefs panel.
|
|
||||||
extern PrefsPanel::Factory RecordingPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -600,3 +600,10 @@ SpectrumPrefsFactory( WaveTrack *wt )
|
|||||||
return safenew SpectrumPrefs(parent, winid, pProject, wt);
|
return safenew SpectrumPrefs(parent, winid, pProject, wt);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace{
|
||||||
|
PrefsPanel::Registration sAttachment{ 100,
|
||||||
|
SpectrumPrefsFactory( nullptr ),
|
||||||
|
false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -31,6 +31,8 @@ Provides:
|
|||||||
#include "../Audacity.h"
|
#include "../Audacity.h"
|
||||||
#include "ThemePrefs.h"
|
#include "ThemePrefs.h"
|
||||||
|
|
||||||
|
#include "../Experimental.h"
|
||||||
|
|
||||||
#include <wx/app.h>
|
#include <wx/app.h>
|
||||||
#include <wx/wxprec.h>
|
#include <wx/wxprec.h>
|
||||||
#include "../Prefs.h"
|
#include "../Prefs.h"
|
||||||
@ -229,9 +231,14 @@ bool ThemePrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
#ifdef EXPERIMENTAL_THEME_PREFS
|
||||||
ThemePrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
namespace{
|
||||||
{
|
PrefsPanel::Registration sAttachment{ 180,
|
||||||
wxASSERT(parent); // to justify safenew
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
return safenew ThemePrefs(parent, winid);
|
{
|
||||||
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew ThemePrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -53,6 +53,4 @@ class ThemePrefs final : public PrefsPanel
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one ThemePrefs panel.
|
|
||||||
extern PrefsPanel::Factory ThemePrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -131,9 +131,12 @@ bool TracksBehaviorsPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
TracksBehaviorsPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 90,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew TracksBehaviorsPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew TracksBehaviorsPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -41,9 +41,5 @@ class TracksBehaviorsPrefs final : public PrefsPanel
|
|||||||
void PopulateOrExchange(ShuttleGui & S) override;
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one TracksBehaviorsPrefs panel.
|
|
||||||
extern PrefsPanel::Factory TracksBehaviorsPrefsFactory;
|
|
||||||
|
|
||||||
extern ChoiceSetting TracksBehaviorsSolo;
|
extern ChoiceSetting TracksBehaviorsSolo;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -447,9 +447,13 @@ bool TracksPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
TracksPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 70,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew TracksPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew TracksPrefs(parent, winid);
|
||||||
|
},
|
||||||
|
2
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -56,6 +56,4 @@ class TracksPrefs final : public PrefsPanel
|
|||||||
static int iPreferencePinned;
|
static int iPreferencePinned;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one TracksPrefs panel.
|
|
||||||
extern PrefsPanel::Factory TracksPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -106,9 +106,12 @@ bool WarningsPrefs::Commit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrefsPanel::Factory
|
namespace{
|
||||||
WarningsPrefsFactory = [](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
PrefsPanel::Registration sAttachment{ 160,
|
||||||
{
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
||||||
wxASSERT(parent); // to justify safenew
|
{
|
||||||
return safenew WarningsPrefs(parent, winid);
|
wxASSERT(parent); // to justify safenew
|
||||||
|
return safenew WarningsPrefs(parent, winid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
@ -37,6 +37,4 @@ class WarningsPrefs final : public PrefsPanel
|
|||||||
void PopulateOrExchange(ShuttleGui & S) override;
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A PrefsPanel::Factory that creates one WarningPrefs panel.
|
|
||||||
extern PrefsPanel::Factory WarningsPrefsFactory;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -263,3 +263,11 @@ WaveformPrefsFactory(WaveTrack *wt)
|
|||||||
return safenew WaveformPrefs(parent, winid, pProject, wt);
|
return safenew WaveformPrefs(parent, winid, pProject, wt);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
namespace{
|
||||||
|
PrefsPanel::Registration sAttachment{ 80,
|
||||||
|
WaveformPrefsFactory( nullptr ),
|
||||||
|
false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user