expand on Norm's new track name in display

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: expand on Norm's new track name in display

Post by steve » Sun Jan 22, 2012 11:21 pm

I applied only the patch in your last post.
I'm not seeing the colour in Preferences (though setting the colour manually in audacity.cfg produces the expected colour in the audio track text.
[Update] I've just realised, the colour IS shown in Preferences, but in the wrong place. It's too high and too far to the left as shown here
colour.png
colour.png (28.71 KiB) Viewed 2077 times
The font size works well - nice touch :)

The font choices seem a bit Mac-centric. Modern and Teletype produce one font, Roman produces a serif font and all of the other options produce the default font. Is there any way to get the font options from the fonts actually installed? If not would generic font families (as used in HTML) work? (for example: serif/sans-serif/cursive/monospace)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: expand on Norm's new track name in display

Post by Edgar » Mon Jan 23, 2012 12:49 am

steve wrote: the colour IS shown in Preferences, but in the wrong place.
I will need a capture of the entire dialog so I may measure the offsets in Linux (and I am guessing those offsets might be different on different Linux installs). If you send me one I will tailor the code with a Windows/Linux fork--very easy to do. For now just look at GUIPrefs.cpp lines 158 & 159:

Code: Select all

         fontSizeCtrlLocation.x = 320+89;
         fontSizeCtrlLocation.y += 200+64;
and make those added additions then fudge them as needed for your display.
steve wrote: The font choices seem a bit Mac-centric. Modern and Teletype produce one font, Roman produces a serif font and all of the other options produce the default font. Is there any way to get the font options from the fonts actually installed? If not would generic font families (as used in HTML) work? (for example: serif/sans-serif/cursive/monospace)
These are the wxWidgets 2.8 built-in offerings over which I have no control; each are different (except default is Swiss) on Windows; until we drag Bill into the compiling age we will not know about Mac. I could use a wxFontDialog which would give access to all installed fonts (or some approximation thereof??) but since there is no ShuttleGUI version I would have the same problems as I did with the color picker (setting location & transferring/storing data). My drive was plowed this afternoon so I am no longer snowbound but if I get really enthusiastic I might add a font dialog and see what happens.
-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: expand on Norm's new track name in display

Post by steve » Mon Jan 23, 2012 12:57 am

interface.png
interface.png (65.45 KiB) Viewed 2076 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: expand on Norm's new track name in display

Post by steve » Mon Jan 23, 2012 1:05 am

I've changed GUIPrefs.cpp lines 158 & 159:

Code: Select all

         fontSizeCtrlLocation.x = 425;
         fontSizeCtrlLocation.y += 260;
interface2.png
interface2.png (65.2 KiB) Viewed 2075 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: expand on Norm's new track name in display

Post by Edgar » Mon Jan 23, 2012 5:17 am

Change those two lines so they become:

Code: Select all

#ifdef __WXMSW__ 
         fontSizeCtrlLocation.x = 320;
         fontSizeCtrlLocation.y += 200;
#endif
#ifdef __WXGTK__
         fontSizeCtrlLocation.x = 425;
         fontSizeCtrlLocation.y += 260;
#endif
#ifdef __WXMAC__
         //don't really know what the correct values are
         fontSizeCtrlLocation.x = 320;
         fontSizeCtrlLocation.y += 200;
#endif
and note that the MAC stuff is still undetermined.

Oh, and, something like:
sfd.png
sfd.png (80.31 KiB) Viewed 2070 times
-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: expand on Norm's new track name in display

Post by Edgar » Mon Jan 23, 2012 6:10 am

OK, here is what it looks like:
plf.png
plf.png (12.81 KiB) Viewed 2068 times
bff.png
bff.png (14.87 KiB) Viewed 2068 times
The current stumbling block is that I have not figured out how to store a system font in Prefs--mañana. The following patch has all the old patch stuff commented out. Doing it this way is far less code and removes the problem of the color picker's location; the font dialog is launched via a button for which we have ShuttleGUI access.

Code: Select all

Index: src/AudacityApp.h
===================================================================
--- src/AudacityApp.h	(revision 11419)
+++ src/AudacityApp.h	(working copy)
@@ -24,6 +24,7 @@
 #include <wx/snglinst.h>
 #include <wx/log.h>
 #include <wx/timer.h>
+#include <wx/font.h>
 
 #include "widgets/FileHistory.h"
 #include "ondemand/ODTaskThread.h"
@@ -193,6 +194,8 @@
    Importer *mImporter;
 
    wxLogWindow *mLogger;
+   wxFont mWaveformFont;
+   wxColor mWaveformFontColor;
 
 #if defined(__WXGTK__)
    /** brief This flag is set true when in a keyboard event handler.
Index: src/prefs/GUIPrefs.cpp
===================================================================
--- src/prefs/GUIPrefs.cpp	(revision 11419)
+++ src/prefs/GUIPrefs.cpp	(working copy)
@@ -20,6 +20,10 @@
 #include "../Audacity.h"
 
 #include <wx/defs.h>
+#include <wx/clrpicker.h>
+#include <wx/textctrl.h>
+#include <wx/msgdlg.h>
+#include <wx/fontdlg.h>
 
 #include "../AudacityApp.h"
 #include "../Languages.h"
@@ -28,9 +32,16 @@
 
 #include "GUIPrefs.h"
 
+#define ID_FONTDIALOG_BUTTON 7777
+
+BEGIN_EVENT_TABLE(GUIPrefs, PrefsPanel)
+   EVT_BUTTON(ID_FONTDIALOG_BUTTON, GUIPrefs::OnFontDialogButton)
+END_EVENT_TABLE()
+
 GUIPrefs::GUIPrefs(wxWindow * parent)
 :  PrefsPanel(parent, _("Interface"))
 {
+   //mFontColorPickerCtrl = NULL;
    Populate();
 }
 
@@ -63,6 +74,22 @@
    mRangeChoices.Add(_("-120 dB (approximate limit of human hearing)"));
    mRangeChoices.Add(_("-145 dB (PCM range of 24 bit samples)"));
 
+   //mFontFamilyCodes.Add(wxT("wxFONTFAMILY_DEFAULT"));
+   //mFontFamilyCodes.Add(wxT("wxFONTFAMILY_DECORATIVE"));
+   //mFontFamilyCodes.Add(wxT("wxFONTFAMILY_ROMAN"));
+   //mFontFamilyCodes.Add(wxT("wxFONTFAMILY_SCRIPT"));
+   //mFontFamilyCodes.Add(wxT("wxFONTFAMILY_SWISS"));
+   //mFontFamilyCodes.Add(wxT("wxFONTFAMILY_MODERN"));
+   //mFontFamilyCodes.Add(wxT("wxFONTFAMILY_TELETYPE"));
+
+   //mFontFamilyChoices.Add(_("Default"));
+   //mFontFamilyChoices.Add(_("Decorative"));
+   //mFontFamilyChoices.Add(_("Roman"));
+   //mFontFamilyChoices.Add(_("Script"));
+   //mFontFamilyChoices.Add(_("Swiss"));
+   //mFontFamilyChoices.Add(_("Modern"));
+   //mFontFamilyChoices.Add(_("Teletype"));
+
 #if 0
    // only for testing...
    mLangCodes.Add("kg");   mLangNames.Add("Klingon");
@@ -78,6 +105,15 @@
    // ----------------------- End of main section --------------
 }
 
+void GUIPrefs::OnFontDialogButton(wxCommandEvent & e)
+{
+   wxFontDialog fontDialog = new wxFontDialog((wxWindow *)this);
+   fontDialog.ShowModal();
+   wxFontData fontData = fontDialog.GetFontData();
+   wxGetApp().mWaveformFont = fontData.GetChosenFont();
+   wxGetApp().mWaveformFontColor = fontData.GetColour();
+}
+
 void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
 {
    S.SetBorder(2);
@@ -128,6 +164,68 @@
       S.TieCheckBox(_("&Show track name in waveform display"),
                     wxT("/GUI/ShowTrackNameInWaveform"),
                     false);
+//      S.StartThreeColumn();
+//      {
+//         int fontSize = gPrefs->Read(wxT("/GUI/FontSizeForNameInWaveform"), (int)8);
+//         mFontSizeCtrl = S.TieNumericTextBox(_("Font size for track name in waveform display"), wxT("/GUI/FontSizeForNameInWaveform"), fontSize, 4);
+//         mFontSizeCtrl->SetSizeHints(wxSize(50,20));
+//         S.AddUnits(_(" Color: "));
+//         wxPoint fontSizeCtrlLocation = mFontSizeCtrl->GetPosition();
+//#ifdef __WXMSW__ 
+//         fontSizeCtrlLocation.x = 320;
+//         fontSizeCtrlLocation.y += 200;
+//#endif
+//#ifdef __WXGTK__
+//         fontSizeCtrlLocation.x = 425;
+//         fontSizeCtrlLocation.y += 260;
+//#endif
+//#ifdef __WXMAC__
+//         //don't really know what the correct values are
+//         fontSizeCtrlLocation.x = 320;
+//         fontSizeCtrlLocation.y += 200;
+//#endif
+//         wxString red;
+//         long redValue = 0;
+//         if (gPrefs->Read(wxT("/GUI/FontColorRedForNameInWaveform"), &red))
+//            red.ToLong(&redValue);
+//
+//         wxString green;
+//         long greenValue = 0;
+//         if (gPrefs->Read(wxT("/GUI/FontColorGreenForNameInWaveform"), &green))
+//            green.ToLong(&greenValue);
+//
+//         wxString blue;
+//         long blueValue = 0;
+//         if (gPrefs->Read(wxT("/GUI/FontColorBlueForNameInWaveform"), &blue))
+//            blue.ToLong(&blueValue);
+//
+//         wxColour fontColor(redValue, greenValue, blueValue);
+//         if (!mFontColorPickerCtrl)
+//            mFontColorPickerCtrl = new wxColourPickerCtrl((wxWindow *)this, wxID_ANY, fontColor, fontSizeCtrlLocation);
+//         else {
+//            wxColour fontColor = mFontColorPickerCtrl->GetColour();
+//            unsigned char red = fontColor.Red();
+//            unsigned char green = fontColor.Green();
+//            unsigned char blue = fontColor.Blue();
+//            gPrefs->Write(wxT("/GUI/FontColorRedForNameInWaveform"), red);
+//            gPrefs->Write(wxT("/GUI/FontColorGreenForNameInWaveform"), green);
+//            gPrefs->Write(wxT("/GUI/FontColorBlueForNameInWaveform"), blue);
+//         }
+//      }
+//      S.EndMultiColumn();
+//
+//      S.StartMultiColumn(2);
+//      {
+//         S.TieChoice(_("Font family for track name in waveform display"),
+//                     wxT("/GUI/FontFamilyForNameInWaveform"),
+//                     wxT("Swiss"),
+//                     mFontFamilyChoices,
+//                     mFontFamilyCodes);
+//         S.SetSizeHints(mFontFamilyChoices);
+//      }
+//      S.EndMultiColumn();
+
+      S.Id(ID_FONTDIALOG_BUTTON).AddButton(_("System Font Dialog for waveform text..."), wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
    }
    S.EndStatic();
 
@@ -152,6 +250,19 @@
    ShuttleGui S(this, eIsSavingToPrefs);
    PopulateOrExchange(S);
 
+   //validate user's choice of font size
+   //if (mFontSizeCtrl) {
+   //   long fontSize = 8;
+   //   mFontSizeCtrl->GetValue().ToLong(&fontSize);
+   //   if (fontSize < 8) {
+   //      fontSize = 8;
+   //      gPrefs->Write(wxT("/GUI/FontSizeForNameInWaveform"), (int)8);
+   //      wxMessageBox(_("Font size must be no smaller than 8; setting to 8."));
+   //   }
+   //   //else if (fontSize > TOO_BIG) {//how big is too big?
+   //}
+   //if (mFontColorPickerCtrl) delete mFontColorPickerCtrl;
+
    // If language has changed, we want to change it now, not on the next reboot.
    wxString lang = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
    if (lang == wxT(""))
Index: src/prefs/GUIPrefs.h
===================================================================
--- src/prefs/GUIPrefs.h	(revision 11419)
+++ src/prefs/GUIPrefs.h	(working copy)
@@ -17,6 +17,10 @@
 
 #include <wx/arrstr.h>
 #include <wx/window.h>
+#include <wx/clrpicker.h>
+#include <wx/textctrl.h>
+#include <wx/msgdlg.h>
+#include <wx/fontdlg.h>
 
 #include "../ShuttleGui.h"
 
@@ -41,6 +45,15 @@
 
    wxArrayString mRangeCodes;
    wxArrayString mRangeChoices;
+
+   //wxArrayString mFontFamilyCodes;
+   //wxArrayString mFontFamilyChoices;
+   //wxTextCtrl * mFontSizeCtrl;
+   //wxColourPickerCtrl * mFontColorPickerCtrl;
+
+   void OnFontDialogButton(wxCommandEvent & e);
+
+   DECLARE_EVENT_TABLE();
 };
 
 #endif
Index: src/TrackArtist.cpp
===================================================================
--- src/TrackArtist.cpp	(revision 11419)
+++ src/TrackArtist.cpp	(working copy)
@@ -321,8 +321,30 @@
    dc.DrawRectangle(clip);
 #endif
 
-   wxFont labelFont(8, wxSWISS, wxNORMAL, wxNORMAL);
-   dc.SetFont(labelFont);
+   
+   //int fontSize = gPrefs->Read(wxT("/GUI/FontSizeForNameInWaveform"), (int)8);
+   //wxString fontFamilyStr = gPrefs->Read(wxT("/GUI/FontFamilyForNameInWaveform"), wxT("wxFONTFAMILY_SWISS"));
+   //int fontFamily = wxFONTFAMILY_SWISS;
+   //if (fontFamilyStr.IsSameAs(wxT("wxFONTFAMILY_DEFAULT")))
+   //      fontFamily = wxFONTFAMILY_DEFAULT;
+   //else if (fontFamilyStr.IsSameAs(wxT("wxFONTFAMILY_DECORATIVE")))
+   //      fontFamily = wxFONTFAMILY_DECORATIVE;
+   //else if (fontFamilyStr.IsSameAs(wxT("wxFONTFAMILY_ROMAN")))
+   //      fontFamily = wxFONTFAMILY_ROMAN;
+   //else if (fontFamilyStr.IsSameAs(wxT("wxFONTFAMILY_SCRIPT")))
+   //      fontFamily = wxFONTFAMILY_SCRIPT;
+   //else if (fontFamilyStr.IsSameAs(wxT("wxFONTFAMILY_SWISS")))
+   //      fontFamily = wxFONTFAMILY_SWISS;
+   //else if (fontFamilyStr.IsSameAs(wxT("wxFONTFAMILY_MODERN")))
+   //      fontFamily = wxFONTFAMILY_MODERN;
+   //else if (fontFamilyStr.IsSameAs(wxT("wxFONTFAMILY_TELETYPE")))
+   //      fontFamily = wxFONTFAMILY_TELETYPE;
+   //else
+   //      fontFamily = wxFONTFAMILY_SWISS;
+
+   //wxFont labelFont(fontSize, fontFamily, wxNORMAL, wxNORMAL);
+   //dc.SetFont(labelFont);
+   dc.SetFont(wxGetApp().mWaveformFont);
    gPrefs->Read(wxT("/GUI/ShowTrackNameInWaveform"), &mbShowTrackNameInWaveform, false);
 
    t = iter.StartWith(start);
@@ -403,8 +425,30 @@
       case WaveTrack::WaveformDisplay:
          DrawWaveform(wt, dc, r, viewInfo,
                       drawEnvelope, drawSamples, drawSliders, false, muted);
-         if (mbShowTrackNameInWaveform && wt->GetChannel() != Track::RightChannel)    // so left or mono only
+
+         if (mbShowTrackNameInWaveform && wt->GetChannel() != Track::RightChannel) {    // so left or mono only
+            const wxColour& originalForegroundTextColor = dc.GetTextForeground();
+            //wxString red;
+            //long redValue = 0;
+            //if (gPrefs->Read(wxT("/GUI/FontColorRedForNameInWaveform"), &red))
+            //   red.ToLong(&redValue);
+
+            //wxString green;
+            //long greenValue = 0;
+            //if (gPrefs->Read(wxT("/GUI/FontColorGreenForNameInWaveform"), &green))
+            //   green.ToLong(&greenValue);
+
+            //wxString blue;
+            //long blueValue = 0;
+            //if (gPrefs->Read(wxT("/GUI/FontColorBlueForNameInWaveform"), &blue))
+            //   blue.ToLong(&blueValue);
+
+            //wxColour newForegroundColor(redValue, greenValue, blueValue);
+            //dc.SetTextForeground(newForegroundColor);
+            dc.SetTextForeground(wxGetApp().mWaveformFontColor);
             dc.DrawText (wt->GetName(), r.x+10, r.y);  // move right 10 pixels to avoid overwriting <- symbol
+            dc.SetTextForeground(originalForegroundTextColor);
+         }
          break;
       case WaveTrack::WaveformDBDisplay:
          DrawWaveform(wt, dc, r, viewInfo,
-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: expand on Norm's new track name in display

Post by Edgar » Mon Jan 23, 2012 7:26 pm

OK Steve, you wanted native fonts so here it is with the choice preserved in Pref's config file. If you ran previous patches there will be some extraneous data in config but it is harmless. The color stuff remains the same and there is a new string which IDs the native font details. Only tested on Win7.

This is a very small patch which I think is ready for QA and an FR proposal. On such a proposal, I might argue for adding my original "size" field back in so that one could only change the size of the default wxFONTFAMILY_SWISS--if no font descriptor was found in Pref's config file Audacity would use the selected (and stored) size with the default font.

Code: Select all

Index: src/prefs/GUIPrefs.cpp
===================================================================
--- src/prefs/GUIPrefs.cpp	(revision 11430)
+++ src/prefs/GUIPrefs.cpp	(working copy)
@@ -20,6 +20,7 @@
 #include "../Audacity.h"
 
 #include <wx/defs.h>
+#include <wx/fontdlg.h>
 
 #include "../AudacityApp.h"
 #include "../Languages.h"
@@ -28,6 +29,12 @@
 
 #include "GUIPrefs.h"
 
+#define ID_FONTDIALOG_BUTTON 7777
+
+BEGIN_EVENT_TABLE(GUIPrefs, PrefsPanel)
+   EVT_BUTTON(ID_FONTDIALOG_BUTTON, GUIPrefs::OnFontDialogButton)
+END_EVENT_TABLE()
+
 GUIPrefs::GUIPrefs(wxWindow * parent)
 :  PrefsPanel(parent, _("Interface"))
 {
@@ -78,6 +85,21 @@
    // ----------------------- End of main section --------------
 }
 
+void GUIPrefs::OnFontDialogButton(wxCommandEvent & e)
+{
+   wxFontDialog fontDialog = new wxFontDialog((wxWindow *)this);
+   fontDialog.ShowModal();
+   wxFontData fontData = fontDialog.GetFontData();
+   gPrefs->Write(wxT("/GUI/NativeFontForNameInWaveform"), fontData.GetChosenFont().GetNativeFontInfoDesc());
+   const wxColor fontColor = fontData.GetColour();
+   unsigned char red = fontColor.Red();
+   unsigned char green = fontColor.Green();
+   unsigned char blue = fontColor.Blue();
+   gPrefs->Write(wxT("/GUI/FontColorRedForNameInWaveform"), red);
+   gPrefs->Write(wxT("/GUI/FontColorGreenForNameInWaveform"), green);
+   gPrefs->Write(wxT("/GUI/FontColorBlueForNameInWaveform"), blue);
+}
+
 void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
 {
    S.SetBorder(2);
@@ -128,6 +150,8 @@
       S.TieCheckBox(_("&Show track name in waveform display"),
                     wxT("/GUI/ShowTrackNameInWaveform"),
                     false);
+      S.Id(ID_FONTDIALOG_BUTTON).AddButton(_("System Font Dialog for waveform text..."), 
+                                           wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
    }
    S.EndStatic();
 
Index: src/prefs/GUIPrefs.h
===================================================================
--- src/prefs/GUIPrefs.h	(revision 11430)
+++ src/prefs/GUIPrefs.h	(working copy)
@@ -17,6 +17,8 @@
 
 #include <wx/arrstr.h>
 #include <wx/window.h>
+#include <wx/clrpicker.h>
+#include <wx/textctrl.h>
 
 #include "../ShuttleGui.h"
 
@@ -41,6 +43,10 @@
 
    wxArrayString mRangeCodes;
    wxArrayString mRangeChoices;
+
+   void OnFontDialogButton(wxCommandEvent & e);
+
+   DECLARE_EVENT_TABLE();
 };
 
 #endif
Index: src/TrackArtist.cpp
===================================================================
--- src/TrackArtist.cpp	(revision 11430)
+++ src/TrackArtist.cpp	(working copy)
@@ -160,6 +160,7 @@
 #include <wx/pen.h>
 #include <wx/log.h>
 #include <wx/datetime.h>
+//#include <wx/string.h>
 
 #ifdef USE_MIDI
 #include "NoteTrack.h"
@@ -321,7 +322,10 @@
    dc.DrawRectangle(clip);
 #endif
 
-   wxFont labelFont(8, wxSWISS, wxNORMAL, wxNORMAL);
+   wxFont labelFont(8, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL);
+   wxString fontDescription = gPrefs->Read(wxT("/GUI/NativeFontForNameInWaveform"), wxEmptyString);
+   if (!fontDescription.IsEmpty())
+      labelFont.SetNativeFontInfo(fontDescription);
    dc.SetFont(labelFont);
    gPrefs->Read(wxT("/GUI/ShowTrackNameInWaveform"), &mbShowTrackNameInWaveform, false);
 
@@ -403,8 +407,29 @@
       case WaveTrack::WaveformDisplay:
          DrawWaveform(wt, dc, r, viewInfo,
                       drawEnvelope, drawSamples, drawSliders, false, muted);
-         if (mbShowTrackNameInWaveform && wt->GetChannel() != Track::RightChannel)    // so left or mono only
+
+         if (mbShowTrackNameInWaveform && wt->GetChannel() != Track::RightChannel) {    // so left or mono only
+            const wxColour& originalForegroundTextColor = dc.GetTextForeground();
+            wxString red;
+            long redValue = 0;
+            if (gPrefs->Read(wxT("/GUI/FontColorRedForNameInWaveform"), &red))
+               red.ToLong(&redValue);
+
+            wxString green;
+            long greenValue = 0;
+            if (gPrefs->Read(wxT("/GUI/FontColorGreenForNameInWaveform"), &green))
+               green.ToLong(&greenValue);
+
+            wxString blue;
+            long blueValue = 0;
+            if (gPrefs->Read(wxT("/GUI/FontColorBlueForNameInWaveform"), &blue))
+               blue.ToLong(&blueValue);
+
+            wxColour newForegroundColor(redValue, greenValue, blueValue);
+            dc.SetTextForeground(newForegroundColor);
             dc.DrawText (wt->GetName(), r.x+10, r.y);  // move right 10 pixels to avoid overwriting <- symbol
+            dc.SetTextForeground(originalForegroundTextColor);
+         }
          break;
       case WaveTrack::WaveformDBDisplay:
          DrawWaveform(wt, dc, r, viewInfo,

-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: expand on Norm's new track name in display

Post by steve » Mon Jan 23, 2012 9:42 pm

I tried applying your latest patch to a brand new svn checkout. Unfortunately I'm getting an error during "make":

Code: Select all

/usr/include/wx-2.8/wx/fontdlg.h: In copy constructor ‘wxFontDialog::wxFontDialog(const wxFontDialog&)’:
/usr/include/wx-2.8/wx/fontdlg.h:61: error: ‘wxFontDialogBase::wxFontDialogBase(const wxFontDialogBase&)’ is private
/usr/include/wx-2.8/wx/gtk/fontdlg.h:19: error: within this context
prefs/GUIPrefs.cpp: In member function ‘void GUIPrefs::OnFontDialogButton(wxCommandEvent&)’:
prefs/GUIPrefs.cpp:90: note: synthesized method ‘wxFontDialog::wxFontDialog(const wxFontDialog&)’ first required here 
make[1]: *** [prefs/GUIPrefs.o] Error 1
make[1]: Leaving directory `/home/steve/sourcecode/audacity/src'
make: *** [audacity] Error 2

I did notice a warning when applying the patch:

Code: Select all

patching file src/TrackArtist.cpp
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 407 with fuzz 1.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: expand on Norm's new track name in display

Post by Edgar » Mon Jan 23, 2012 10:00 pm

steve wrote:I tried applying your latest patch to a brand new svn checkout. Unfortunately I'm getting an error during "make"

I did notice a warning when applying the patch
Let me send you a patch via e-mail since we may not attach .patch files here.

You will need to delete the three files (trackartist.cpp, guiprefs.h & guiprefs.cpp) from your ccurrent SVN and do an Update before running the patch.

I got some help on this from the wxWidgets Forum and just now got a suggestion for simplifying the color storage stuff so will test and implement that for the new patch.
-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: expand on Norm's new track name in display

Post by steve » Mon Jan 23, 2012 10:12 pm

Edgar wrote:Let me send you a patch via e-mail since we may not attach .patch files here.
You can attach patch files that have the file extension .patch
(we added that a while back, I think in response to your previous complaint :) )
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply