Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
Settings Struct Reference
Inheritance diagram for Settings:
[legend]
Collaboration diagram for Settings:
[legend]

Public Member Functions

void UpdatePrefs () override
 
- Public Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdatePrefs ()=0
 

Public Attributes

wxString gSoloPref
 
wxFont gFont
 
bool mInitialized { false }
 

Additional Inherited Members

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

Detailed Description

Definition at line 48 of file TrackInfo.cpp.

Member Function Documentation

◆ UpdatePrefs()

void Settings::UpdatePrefs ( )
inlineoverridevirtual

Implements PrefsListener.

Definition at line 54 of file TrackInfo.cpp.

55 {
57
58 // Calculation of best font size depends on language, so it should be redone in case
59 // the language preference changed.
60
61 // wxWidgets seems to need a window to do this portably.
62 if ( !wxTheApp )
63 return;
64 auto window = wxTheApp->GetTopWindow();
65 if ( !window )
66 return;
67
68 int fontSize = 10;
69 gFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
70
71 int allowableWidth =
72 // PRL: was it correct to include the margin?
74 - 2; // 2 to allow for left/right borders
75 int textWidth;
76 do {
77 gFont.SetPointSize(fontSize);
78 window->GetTextExtent(_("Stereo, 999999Hz"),
79 &textWidth, nullptr, nullptr, nullptr, &gFont);
80 fontSize--;
81 } while (textWidth >= allowableWidth);
82
83 mInitialized = true;
84 }
#define _(s)
Definition: Internat.h:75
ChoiceSetting TracksBehaviorsSolo
@ kTrackInfoWidth
Definition: ZoomInfo.h:36
@ kLeftMargin
Definition: ZoomInfo.h:33
wxString Read() const
Definition: Prefs.cpp:354
wxString gSoloPref
Definition: TrackInfo.cpp:49
bool mInitialized
Definition: TrackInfo.cpp:52
wxFont gFont
Definition: TrackInfo.cpp:50

References _, gFont, gSoloPref, kLeftMargin, kTrackInfoWidth, mInitialized, ChoiceSetting::Read(), and TracksBehaviorsSolo.

Referenced by settings().

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

Member Data Documentation

◆ gFont

wxFont Settings::gFont

Definition at line 50 of file TrackInfo.cpp.

Referenced by UpdatePrefs().

◆ gSoloPref

wxString Settings::gSoloPref

Definition at line 49 of file TrackInfo.cpp.

Referenced by TrackInfo::HasSoloButton(), and UpdatePrefs().

◆ mInitialized

bool Settings::mInitialized { false }

Definition at line 52 of file TrackInfo.cpp.

Referenced by settings(), and UpdatePrefs().


The documentation for this struct was generated from the following file: