mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-26 15:20:21 +01:00
Norm C's patch to put the full name of the track in the waveform. Defaulted to 'off' but selectable in prefs->Interface->Show track name in waveform display.
Thanks Norm!
This commit is contained in:
@@ -321,6 +321,10 @@ void TrackArtist::DrawTracks(TrackList * tracks,
|
||||
dc.DrawRectangle(clip);
|
||||
#endif
|
||||
|
||||
wxFont labelFont(8, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
dc.SetFont(labelFont);
|
||||
gPrefs->Read(wxT("/GUI/ShowTrackNameInWaveform"), &mbShowTrackNameInWaveform, false);
|
||||
|
||||
t = iter.StartWith(start);
|
||||
while (t) {
|
||||
trackRect.y = t->GetY() - viewInfo->vpos;
|
||||
@@ -399,6 +403,8 @@ void TrackArtist::DrawTrack(const Track * t,
|
||||
case WaveTrack::WaveformDisplay:
|
||||
DrawWaveform(wt, dc, r, viewInfo,
|
||||
drawEnvelope, drawSamples, drawSliders, false, muted);
|
||||
if (mbShowTrackNameInWaveform && wt->GetChannel() != Track::RightChannel) // so left or mono only
|
||||
dc.DrawText (wt->GetName(), r.x+10, r.y); // move right 10 pixels to avoid overwriting <- symbol
|
||||
break;
|
||||
case WaveTrack::WaveformDBDisplay:
|
||||
DrawWaveform(wt, dc, r, viewInfo,
|
||||
@@ -611,7 +617,7 @@ void TrackArtist::UpdateVRuler(Track *t, wxRect & r)
|
||||
|
||||
float min, max;
|
||||
wt->GetDisplayBounds(&min, &max);
|
||||
|
||||
// This assumes that wt->GetDisplayBounds(&min, &max); is in dB, and it isn't, it's linear
|
||||
if (max > 0) {
|
||||
int top = 0;
|
||||
float topval = 0;
|
||||
@@ -1809,7 +1815,6 @@ void TrackArtist::DrawClipSpectrum(WaveTrack *track,
|
||||
|
||||
int minSamples = int ((double)minFreq * (double)windowSize / rate + 0.5); // units are fft bins
|
||||
int maxSamples = int ((double)maxFreq * (double)windowSize / rate + 0.5);
|
||||
int temp = sizeof(int);
|
||||
float binPerPx = float(maxSamples - minSamples) / float(mid.height);
|
||||
|
||||
int x = 0;
|
||||
|
||||
@@ -179,6 +179,7 @@ class AUDACITY_DLL_API TrackArtist {
|
||||
int mMinFreq; // "/Spectrum/MinFreq"
|
||||
int mWindowSize; // "/Spectrum/FFTSize"
|
||||
bool mIsGrayscale; // "/Spectrum/Grayscale"
|
||||
bool mbShowTrackNameInWaveform; // "/GUI/ShowTrackNameInWaveform"
|
||||
|
||||
#ifdef EXPERIMENTAL_FFT_SKIP_POINTS
|
||||
int mFftSkipPoints; // "/Spectrum/FFTSkipPoints"
|
||||
|
||||
@@ -125,6 +125,9 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
S.TieCheckBox(_("&Beep on completion of longer activities"),
|
||||
wxT("/GUI/BeepOnCompletion"),
|
||||
false);
|
||||
S.TieCheckBox(_("&Show track name in waveform display"),
|
||||
wxT("/GUI/ShowTrackNameInWaveform"),
|
||||
false);
|
||||
}
|
||||
S.EndStatic();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user