Audacity 3.2.0
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ProjectSettings Class Referencefinal

Holds various per-project settings values, and sends events to the project when certain values change. More...

#include <ProjectSettings.h>

Inheritance diagram for ProjectSettings:
[legend]
Collaboration diagram for ProjectSettings:
[legend]

Public Types

enum  EventCode : int { ChangedTool }
 

Public Member Functions

 ProjectSettings (AudacityProject &project)
 
 ProjectSettings (const ProjectSettings &)=delete
 
ProjectSettingsoperator= (const ProjectSettings &)=delete
 
bool GetTracksFitVerticallyZoomed () const
 
void SetTracksFitVerticallyZoomed (bool flag)
 
void SetTool (int tool)
 
int GetTool () const
 
void SetBrushRadius (int brushRadius)
 
int GetBrushRadius () const
 
void SetSmartSelection (bool isSelected)
 
bool IsSmartSelection () const
 
void SetOvertones (bool isSelected)
 
bool IsOvertones () const
 
bool EmptyCanBeDirty () const
 
bool GetShowSplashScreen () const
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Static Public Member Functions

static ProjectSettingsGet (AudacityProject &project)
 
static const ProjectSettingsGet (const AudacityProject &project)
 

Private Member Functions

void UpdatePrefs () override
 
- Private Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdatePrefs ()=0
 
virtual void UpdateSelectedPrefs (int id)
 

Private Attributes

AudacityProjectmProject
 
int mCurrentTool
 
int mCurrentBrushRadius
 
int mCurrentBrushHop
 
bool mbSmartSelection { false }
 
bool mbOvertones { false }
 
bool mTracksFitVerticallyZoomed { false }
 
bool mEmptyCanBeDirty
 
bool mShowSplashScreen
 

Additional Inherited Members

- Static Private Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 

Detailed Description

Holds various per-project settings values, and sends events to the project when certain values change.

Definition at line 49 of file ProjectSettings.h.

Member Enumeration Documentation

◆ EventCode

Enumerator
ChangedTool 

Definition at line 58 of file ProjectSettings.h.

58 : int {
60 };

Constructor & Destructor Documentation

◆ ProjectSettings() [1/2]

ProjectSettings::ProjectSettings ( AudacityProject project)
explicit

Definition at line 53 of file ProjectSettings.cpp.

54 : mProject{ project }
56{
57 bool multiToolActive = false;
58 gPrefs->Read(wxT("/GUI/ToolBars/Tools/MultiToolActive"), &multiToolActive);
59
60 if (multiToolActive)
62 else
64
66}
wxT("CloseDown"))
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
const auto project
AudacityProject & mProject
void UpdatePrefs() override
virtual bool Read(const wxString &key, bool *value) const =0

References gPrefs, mCurrentTool, ToolCodes::multiTool, audacity::BasicSettings::Read(), ToolCodes::selectTool, UpdatePrefs(), and wxT().

Here is the call graph for this function:

◆ ProjectSettings() [2/2]

ProjectSettings::ProjectSettings ( const ProjectSettings )
delete

Member Function Documentation

◆ EmptyCanBeDirty()

bool ProjectSettings::EmptyCanBeDirty ( ) const
inline

Definition at line 85 of file ProjectSettings.h.

85{ return mEmptyCanBeDirty; }

◆ Get() [1/2]

ProjectSettings & ProjectSettings::Get ( AudacityProject project)
static

◆ Get() [2/2]

const ProjectSettings & ProjectSettings::Get ( const AudacityProject project)
static

Definition at line 48 of file ProjectSettings.cpp.

49{
50 return Get( const_cast< AudacityProject & >( project ) );
51}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static ProjectSettings & Get(AudacityProject &project)

References Get(), and project.

Here is the call graph for this function:

◆ GetBrushRadius()

int ProjectSettings::GetBrushRadius ( ) const
inline

Definition at line 77 of file ProjectSettings.h.

77{ return mCurrentBrushRadius; }

Referenced by BrushHandle::BrushHandle().

Here is the caller graph for this function:

◆ GetShowSplashScreen()

bool ProjectSettings::GetShowSplashScreen ( ) const
inline

Definition at line 87 of file ProjectSettings.h.

87{ return mShowSplashScreen; }

Referenced by AudacityApp::InitPart2().

Here is the caller graph for this function:

◆ GetTool()

int ProjectSettings::GetTool ( ) const
inline

Definition at line 73 of file ProjectSettings.h.

73{ return mCurrentTool; }

Referenced by TimeShiftHandle::Click(), and SelectHandle::Preview().

Here is the caller graph for this function:

◆ GetTracksFitVerticallyZoomed()

bool ProjectSettings::GetTracksFitVerticallyZoomed ( ) const
inline

Definition at line 67 of file ProjectSettings.h.

67{ return mTracksFitVerticallyZoomed; } //lda
bool mTracksFitVerticallyZoomed

Referenced by ProjectAudioManager::DoRecord().

Here is the caller graph for this function:

◆ IsOvertones()

bool ProjectSettings::IsOvertones ( ) const
inline

Definition at line 83 of file ProjectSettings.h.

83{ return mbOvertones; }

Referenced by BrushHandle::BrushHandle().

Here is the caller graph for this function:

◆ IsSmartSelection()

bool ProjectSettings::IsSmartSelection ( ) const
inline

Definition at line 80 of file ProjectSettings.h.

80{ return mbSmartSelection; }

Referenced by BrushHandle::BrushHandle().

Here is the caller graph for this function:

◆ operator=()

ProjectSettings & ProjectSettings::operator= ( const ProjectSettings )
delete

◆ SetBrushRadius()

void ProjectSettings::SetBrushRadius ( int  brushRadius)
inline

Definition at line 76 of file ProjectSettings.h.

76{ mCurrentBrushRadius = brushRadius; }

◆ SetOvertones()

void ProjectSettings::SetOvertones ( bool  isSelected)
inline

Definition at line 82 of file ProjectSettings.h.

82{ mbOvertones = isSelected; }

◆ SetSmartSelection()

void ProjectSettings::SetSmartSelection ( bool  isSelected)
inline

Definition at line 79 of file ProjectSettings.h.

79{ mbSmartSelection = isSelected; }

◆ SetTool()

void ProjectSettings::SetTool ( int  tool)

Definition at line 92 of file ProjectSettings.cpp.

92 {
93 if (auto oldValue = mCurrentTool; oldValue != tool) {
94 mCurrentTool = tool;
95 Notify( mProject, ChangedTool, oldValue );
96 }
97}
void Notify(AudacityProject &project, ProjectSettings::EventCode code, long previousValue)

References ChangedTool, mCurrentTool, mProject, and anonymous_namespace{ProjectSettings.cpp}::Notify().

Referenced by ToolsToolBar::OnTool(), and anonymous_namespace{ToolsToolBar.cpp}::SetTool().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetTracksFitVerticallyZoomed()

void ProjectSettings::SetTracksFitVerticallyZoomed ( bool  flag)
inline

Definition at line 68 of file ProjectSettings.h.

static std::once_flag flag

References flag.

◆ UpdatePrefs()

void ProjectSettings::UpdatePrefs ( )
overrideprivatevirtual

Implements PrefsListener.

Definition at line 68 of file ProjectSettings.cpp.

69{
70 gPrefs->Read(wxT("/GUI/EmptyCanBeDirty"), &mEmptyCanBeDirty, true);
71 gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &mShowSplashScreen, true);
72 gPrefs->Read(wxT("/GUI/TracksFitVerticallyZoomed"),
74 // gPrefs->Read(wxT("/GUI/UpdateSpectrogram"),
75 // &mViewInfo.bUpdateSpectrogram, true);
76
77 // This code to change an empty projects rate is currently disabled, after
78 // discussion. The rule 'Default sample rate' only affects newly created
79 // projects was felt to be simpler and better.
80#if 0
81 // The DefaultProjectSample rate is the rate for new projects.
82 // Do not change this project's rate, unless there are no tracks.
83 if( TrackList::Get( *this ).size() == 0){
84 mRate = QualityDefaultSampleRate.Read();
85 // If necessary, we change this rate in the selection toolbar too.
86 auto bar = SelectionBar::Get( *this );
87 bar.SetRate( mRate );
88 }
89#endif
90}
static SelectionBar & Get(AudacityProject &project)
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:354

References TrackList::Get(), SelectionBar::Get(), gPrefs, mEmptyCanBeDirty, mShowSplashScreen, mTracksFitVerticallyZoomed, audacity::BasicSettings::Read(), and wxT().

Referenced by ProjectSettings().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mbOvertones

bool ProjectSettings::mbOvertones { false }
private

Definition at line 98 of file ProjectSettings.h.

◆ mbSmartSelection

bool ProjectSettings::mbSmartSelection { false }
private

Definition at line 97 of file ProjectSettings.h.

◆ mCurrentBrushHop

int ProjectSettings::mCurrentBrushHop
private

Definition at line 96 of file ProjectSettings.h.

◆ mCurrentBrushRadius

int ProjectSettings::mCurrentBrushRadius
private

Definition at line 95 of file ProjectSettings.h.

◆ mCurrentTool

int ProjectSettings::mCurrentTool
private

Definition at line 94 of file ProjectSettings.h.

Referenced by ProjectSettings(), and SetTool().

◆ mEmptyCanBeDirty

bool ProjectSettings::mEmptyCanBeDirty
private

Definition at line 101 of file ProjectSettings.h.

Referenced by UpdatePrefs().

◆ mProject

AudacityProject& ProjectSettings::mProject
private

Definition at line 92 of file ProjectSettings.h.

Referenced by SetTool().

◆ mShowSplashScreen

bool ProjectSettings::mShowSplashScreen
private

Definition at line 102 of file ProjectSettings.h.

Referenced by UpdatePrefs().

◆ mTracksFitVerticallyZoomed

bool ProjectSettings::mTracksFitVerticallyZoomed { false }
private

Definition at line 100 of file ProjectSettings.h.

Referenced by UpdatePrefs().


The documentation for this class was generated from the following files: