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
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 » Wed Jan 25, 2012 6:26 pm

steve wrote:
Edgar wrote:Have a look at the headers listed at the top of GUIPrefs (.h & .cpp both) and add any of these which are not there now:
Tried that, but no difference, still the same error.
OK, I am doing a custom build today but when I get that out I will install Linux in a VM and see if I can figure it out. What Linux are you running currently?
-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: 81609
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 » Wed Jan 25, 2012 6:51 pm

Edgar wrote:What Linux are you running currently?
Debian Squeeze 32 bit (Linux kernel 2.6.32-39 686 with Gnome).

If you're going to install Debian, you'll probably find this sources list useful:

Code: Select all

deb http://ftp.uk.debian.org/debian/ squeeze contrib non-free main
deb-src http://ftp.uk.debian.org/debian/ squeeze contrib non-free main

deb http://security.debian.org/ squeeze/updates contrib non-free main
deb-src http://security.debian.org/ squeeze/updates contrib non-free main

# squeeze-updates, previously known as 'volatile'
deb http://ftp.uk.debian.org/debian/ squeeze-updates main
deb-src http://ftp.uk.debian.org/debian/ squeeze-updates main
deb http://www.debian-multimedia.org squeeze main non-free

# wxWidgets/wxPython repository at apt.wxwidgets.org
deb http://apt.wxwidgets.org/ squeeze-wx main
deb-src http://apt.wxwidgets.org/ squeeze-wx main  
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81609
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 » Wed Jan 25, 2012 6:56 pm

Installing Debian tends to be quite slow (for Linux) unless you already have a full set of CDs (loads of them).
Debian can be installed from just CD1, or a mini-download for a net install, but either way there's a lot of data downloading, so I hope you have fast broadband. If not, there's a Virtualbox image available here that may save some time and bandwidth, though there is still likely to be a lot of updates after installation: http://virtualboximages.com/VirtulBox+debian+VDIs
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 » Wed Jan 25, 2012 7:33 pm

My custom build ended up being swapping 2 lines of code--I bet I could have gotten a few hundred bucks for the "fix" <grin>! DLing the newest Oracle VirtualBox 4.1.8 right now...

I have a fast broadband so will grab Debian Squeeze 32 bit (although I generally use the 64-bit) as per your direction.
Last edited by Edgar on Wed Jan 25, 2012 8:08 pm, edited 1 time in total.
-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: 81609
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 » Wed Jan 25, 2012 8:01 pm

Edgar wrote:and DLed Packages.gz; hope that is right...
You're on your own with that :D I've no idea what is included in those packages.

I've only ever installed from an installation disk (or a disk image when installing as a VM)
I've used both the "netinst" using the "Small CD" from here: http://www.debian.org/distrib/netinst
and the "debian-6.0.3-i386-CD-1.iso" from here: http://www.debian.org/CD/torrent-cd/
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 » Thu Jan 26, 2012 4:29 am

I ended up re-installing squeeze as I had my wxWidgets horribly conflicted <grin>...
debian.png
debian.png (72.34 KiB) Viewed 2918 times
was this what you had in mind?
sizeColorFamilyViaFontDialog6.patch
(3.84 KiB) Downloaded 119 times
It was a really stupid programming error--why it worked on MSW is anybody's guess!
-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: 81609
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 » Thu Jan 26, 2012 5:25 pm

Hooray :D
Works a treat.
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 » Sat Jan 28, 2012 5:19 am

In my haste to get this out for beta testing <grin> I neglected two features and missed a bug.
The bug is that if you do not click OK in the font dialog it will reset your font to the default--fixed.
One feature (maybe a P5 bug) was that the dialog did not open with the previously preferred font already chosen--fixed.
Another feature (which some might not appreciate) implemented is to have the open font dialog button use the currently preferred font for its text label. This can have the side affect in Debug builds of Asserting if the preferred font is large.

Adding this on top of patch 6 is easily done manually, only one file (GUIPrefs.cpp) is affected; the attached patch is a full patch against SVN HEAD.

At line 24 add this include:

Code: Select all

#include <wx/button.h>
At what is now line 89 it is easiest to replace the entire function:

Code: Select all

void GUIPrefs::OnFontDialogButton(wxCommandEvent & e)
{
   wxFont font(8, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL);
   wxString fontDescription = gPrefs->Read(wxT("/GUI/NativeFontForNameInWaveform"), wxEmptyString);
   if (!fontDescription.IsEmpty())
      font.SetNativeFontInfo(fontDescription);
   wxFontData fontData;
   fontData.SetInitialFont(font);
   wxString fontColorAsString;
   if (gPrefs->Read(wxT("/GUI/FontColorForNameInWaveform"), &fontColorAsString)) {
      wxColour fontColor(fontColorAsString);
      fontData.SetColour(fontColor);
   }
   wxFontDialog fontDialog((wxWindow *)this, fontData);
   if (fontDialog.ShowModal() == wxID_OK) {
      wxFontData fontData = fontDialog.GetFontData();
      gPrefs->Write(wxT("/GUI/NativeFontForNameInWaveform"), fontData.GetChosenFont().GetNativeFontInfoDesc());
      const wxColor fontColor = fontData.GetColour();
      wxString fontColorAsString = fontColor.GetAsString(wxC2S_HTML_SYNTAX);
      gPrefs->Write(wxT("/GUI/FontColorForNameInWaveform"), fontColorAsString);
   }
}
At what is now line 154 it is easiest to replace the entire "Behaviors" section:

Code: Select all

   S.StartStatic(_("Behaviors"));
   {
      S.TieCheckBox(_("&Beep on completion of longer activities"),
                    wxT("/GUI/BeepOnCompletion"),
                    false);
      S.TieCheckBox(_("&Show track name in waveform display"),
                    wxT("/GUI/ShowTrackNameInWaveform"),
                    false);
      wxButton * getFont = S.Id(ID_FONTDIALOG_BUTTON).AddButton(_("System Font Dialog for waveform text..."), 
                                           wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
      wxFont font(8, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL);
      wxString fontDescription = gPrefs->Read(wxT("/GUI/NativeFontForNameInWaveform"), wxEmptyString);
      if (!fontDescription.IsEmpty())
         font.SetNativeFontInfo(fontDescription);
      wxColour fontColor;
      wxString fontColorAsString;
      if (gPrefs->Read(wxT("/GUI/FontColorForNameInWaveform"), &fontColorAsString))
         fontColor.Set(fontColorAsString);
      getFont->SetForegroundColour(fontColor);
      getFont->SetFont(font);
   }
   S.EndStatic();
Attachments
sizeColorFamilyViaFontDialog7.patch
(4.95 KiB) Downloaded 120 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

steve
Site Admin
Posts: 81609
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 » Sat Jan 28, 2012 10:14 pm

It builds OK and the font selection works fine, but looking at your patch, we appear to have some of the colour chooser code, but no colour options. Is this version supposed to include the color picker thing?
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 » Sun Jan 29, 2012 12:58 am

steve wrote:we appear to have some of the colour chooser code, but no colour options. Is this version supposed to include the color picker thing?
The color picker is build in to the font picker dialog but when you save a font in prefs it does not store the color so color storage/retrieval needs to be dealt with separately. Personally, I call that a bug/FR against wxWidgets.
-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

Post Reply