Audacity  3.0.3
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 ()
 

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 47 of file TrackInfo.cpp.

Member Function Documentation

◆ UpdatePrefs()

void Settings::UpdatePrefs ( )
inlineoverridevirtual

Implements PrefsListener.

Definition at line 53 of file TrackInfo.cpp.

54  {
56 
57  // Calculation of best font size depends on language, so it should be redone in case
58  // the language preference changed.
59 
60  // wxWidgets seems to need a window to do this portably.
61  if ( !wxTheApp )
62  return;
63  auto window = wxTheApp->GetTopWindow();
64  if ( !window )
65  return;
66 
67  int fontSize = 10;
68  gFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
69 
70  int allowableWidth =
71  // PRL: was it correct to include the margin?
73  - 2; // 2 to allow for left/right borders
74  int textWidth;
75  do {
76  gFont.SetPointSize(fontSize);
77  window->GetTextExtent(_("Stereo, 999999Hz"),
78  &textWidth, nullptr, nullptr, nullptr, &gFont);
79  fontSize--;
80  } while (textWidth >= allowableWidth);
81 
82  mInitialized = true;
83  }

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 49 of file TrackInfo.cpp.

Referenced by UpdatePrefs().

◆ gSoloPref

wxString Settings::gSoloPref

Definition at line 48 of file TrackInfo.cpp.

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

◆ mInitialized

bool Settings::mInitialized { false }

Definition at line 51 of file TrackInfo.cpp.

Referenced by settings(), and UpdatePrefs().


The documentation for this struct was generated from the following file:
TracksBehaviorsSolo
ChoiceSetting TracksBehaviorsSolo
Definition: TracksBehaviorsPrefs.cpp:64
Settings::gFont
wxFont gFont
Definition: TrackInfo.cpp:49
Settings::mInitialized
bool mInitialized
Definition: TrackInfo.cpp:51
Settings::gSoloPref
wxString gSoloPref
Definition: TrackInfo.cpp:48
ChoiceSetting::Read
wxString Read() const
Definition: Prefs.cpp:276
_
#define _(s)
Definition: Internat.h:75
kTrackInfoWidth
@ kTrackInfoWidth
Definition: ZoomInfo.h:36
kLeftMargin
@ kLeftMargin
Definition: ZoomInfo.h:33