mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-11-04 16:14:00 +01:00 
			
		
		
		
	Start of module prefs. (work in progress). Linux will need the makefile updating.
This commit is contained in:
		
							
								
								
									
										89
									
								
								src/prefs/ModulePrefs.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								src/prefs/ModulePrefs.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,89 @@
 | 
			
		||||
/**********************************************************************
 | 
			
		||||
 | 
			
		||||
  Audacity: A Digital Audio Editor
 | 
			
		||||
 | 
			
		||||
  ModulePrefs.cpp
 | 
			
		||||
 | 
			
		||||
  Brian Gunlogson
 | 
			
		||||
  Joshua Haberman
 | 
			
		||||
  Dominic Mazzoni
 | 
			
		||||
  James Crook
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
*******************************************************************//**
 | 
			
		||||
 | 
			
		||||
\class ModulePrefs
 | 
			
		||||
\brief A PrefsPanel to enable/disable certain modules.
 | 
			
		||||
 | 
			
		||||
*//*******************************************************************/
 | 
			
		||||
 | 
			
		||||
#include "../Audacity.h"
 | 
			
		||||
 | 
			
		||||
#include <wx/defs.h>
 | 
			
		||||
 | 
			
		||||
#include "../ShuttleGui.h"
 | 
			
		||||
 | 
			
		||||
#include "ModulePrefs.h"
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
ModulePrefs::ModulePrefs(wxWindow * parent)
 | 
			
		||||
:  PrefsPanel(parent, _("Modules"))
 | 
			
		||||
{
 | 
			
		||||
   Populate();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ModulePrefs::~ModulePrefs()
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ModulePrefs::Populate()
 | 
			
		||||
{
 | 
			
		||||
   //------------------------- Main section --------------------
 | 
			
		||||
   // Now construct the GUI itself.
 | 
			
		||||
   // Use 'eIsCreatingFromPrefs' so that the GUI is 
 | 
			
		||||
   // initialised with values from gPrefs.
 | 
			
		||||
   ShuttleGui S(this, eIsCreatingFromPrefs);
 | 
			
		||||
   PopulateOrExchange(S);
 | 
			
		||||
   // ----------------------- End of main section --------------
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ModulePrefs::PopulateOrExchange(ShuttleGui & S)
 | 
			
		||||
{
 | 
			
		||||
   S.SetBorder(2);
 | 
			
		||||
 | 
			
		||||
   S.StartStatic(_("Enable these Modules (if present)"));
 | 
			
		||||
   {
 | 
			
		||||
      S.AddFixedText(_("These are experimental.  Only enable them if you've read the manual\nand know what you are doing") );
 | 
			
		||||
      S.TieCheckBox(_("mod-script-pipe"),
 | 
			
		||||
                    wxT("/Module/mod-script-pipe"),
 | 
			
		||||
                    false);
 | 
			
		||||
      S.TieCheckBox(_("mod-nyq-bench"),    
 | 
			
		||||
                    wxT("/Module/mod-nyq-bench"),
 | 
			
		||||
                    false);
 | 
			
		||||
      S.TieCheckBox(_("mod-track-panel"),
 | 
			
		||||
                    wxT("/Module/mod-track-panel"),
 | 
			
		||||
                    false);
 | 
			
		||||
   }
 | 
			
		||||
   S.EndStatic();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool ModulePrefs::Apply()
 | 
			
		||||
{
 | 
			
		||||
   ShuttleGui S(this, eIsSavingToPrefs);
 | 
			
		||||
   PopulateOrExchange(S);
 | 
			
		||||
 | 
			
		||||
   return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
 | 
			
		||||
// 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
 | 
			
		||||
// arch-tag: 7e997d04-6b94-4abb-b3d6-748400f86598
 | 
			
		||||
							
								
								
									
										47
									
								
								src/prefs/ModulePrefs.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/prefs/ModulePrefs.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
/**********************************************************************
 | 
			
		||||
 | 
			
		||||
  Audacity: A Digital Audio Editor
 | 
			
		||||
 | 
			
		||||
  ModulePrefs.h
 | 
			
		||||
 | 
			
		||||
  Brian Gunlogson
 | 
			
		||||
  Joshua Haberman
 | 
			
		||||
  James Crook
 | 
			
		||||
 | 
			
		||||
**********************************************************************/
 | 
			
		||||
 | 
			
		||||
#ifndef __AUDACITY_MODULE_PREFS__
 | 
			
		||||
#define __AUDACITY_MODULE_PREFS__
 | 
			
		||||
 | 
			
		||||
#include <wx/defs.h>
 | 
			
		||||
 | 
			
		||||
#include <wx/window.h>
 | 
			
		||||
 | 
			
		||||
#include "../ShuttleGui.h"
 | 
			
		||||
 | 
			
		||||
#include "PrefsPanel.h"
 | 
			
		||||
 | 
			
		||||
class ModulePrefs:public PrefsPanel
 | 
			
		||||
{
 | 
			
		||||
 public:
 | 
			
		||||
   ModulePrefs(wxWindow * parent);
 | 
			
		||||
   ~ModulePrefs();
 | 
			
		||||
   virtual bool Apply();
 | 
			
		||||
 | 
			
		||||
 private:
 | 
			
		||||
   void Populate();
 | 
			
		||||
   void PopulateOrExchange(ShuttleGui & S);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
 | 
			
		||||
// 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
 | 
			
		||||
// arch-tag: 57018e2b-d264-4f93-bfa7-06752ebf631e
 | 
			
		||||
@@ -51,6 +51,7 @@
 | 
			
		||||
#include "KeyConfigPrefs.h"
 | 
			
		||||
#include "LibraryPrefs.h"
 | 
			
		||||
#include "MousePrefs.h"
 | 
			
		||||
#include "ModulePrefs.h"
 | 
			
		||||
#include "PlaybackPrefs.h"
 | 
			
		||||
#include "ProjectsPrefs.h"
 | 
			
		||||
#include "QualityPrefs.h"
 | 
			
		||||
@@ -146,6 +147,7 @@ PrefsDialog::PrefsDialog(wxWindow * parent)
 | 
			
		||||
//       w = new BatchPrefs(mCategories);       mCategories->AddPage(w, w->GetName(), false, 0);
 | 
			
		||||
         w = new KeyConfigPrefs(mCategories);   mCategories->AddPage(w, w->GetName(), false, 0);
 | 
			
		||||
         w = new MousePrefs(mCategories);       mCategories->AddPage(w, w->GetName(), false, 0);
 | 
			
		||||
         w = new ModulePrefs(mCategories);      mCategories->AddPage(w, w->GetName(), false, 0);
 | 
			
		||||
      }
 | 
			
		||||
      S.EndHorizontalLay();
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user