1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Zoom Toggle

Added preferences for Zoom-Toggle and put into menus.
New helper functions for determining zoom scaling.

Optional EXPERIMENTAL_ZOOM_TOGGLE_BUTTON added, and Light theme updated.
Not enabled for 2.2.2.
This commit is contained in:
James Crook
2018-01-04 15:56:15 +00:00
parent f57fdc99d7
commit 0cc9c6bc3b
13 changed files with 3680 additions and 3555 deletions

View File

@@ -80,12 +80,33 @@ void TracksPrefs::Populate()
// How samples are displayed when zoomed in:
mSampleDisplayChoice.Add(_("Connect dots"));
mSampleDisplayCodes.Add((int) WaveTrack::LinarInterpolate);
mSampleDisplayChoices.Add(_("Connect dots"));
mSampleDisplayCodes.Add((int) WaveTrack::LinearInterpolate);
mSampleDisplayChoice.Add(_("Stem plot"));
mSampleDisplayChoices.Add(_("Stem plot"));
mSampleDisplayCodes.Add((int) WaveTrack::StemPlot);
mZoomChoices.Add( _("Zoom to Fit") );
mZoomCodes.Add( WaveTrack::kZoomToFit );
mZoomChoices.Add( _("Zoom to Selection") );
mZoomCodes.Add( WaveTrack::kZoomToSelection );
mZoomChoices.Add( _("Zoom Default") );
mZoomCodes.Add( WaveTrack::kZoomDefault );
mZoomChoices.Add( _("Minutes") );
mZoomCodes.Add( WaveTrack::kZoomMinutes );
mZoomChoices.Add( _("Seconds") );
mZoomCodes.Add( WaveTrack::kZoomSeconds );
mZoomChoices.Add( _("MilliSeconds") );
mZoomCodes.Add( WaveTrack::kZoomMilliSeconds );
mZoomChoices.Add( _("Samples") );
mZoomCodes.Add( WaveTrack::kZoomSamples );
mZoomChoices.Add( _("4 Pixels per Sample") );
mZoomCodes.Add( WaveTrack::kZoom4To1 );
mZoomChoices.Add( _("Max Zoom") );
mZoomCodes.Add( WaveTrack::kMaxZoom );
//------------------------- Main section --------------------
// Now construct the GUI itself.
// Use 'eIsCreatingFromPrefs' so that the GUI is
@@ -125,9 +146,9 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
S.TieChoice(_("Display &samples:"),
wxT("/GUI/SampleView"),
1,
mSampleDisplayChoice,
mSampleDisplayChoices,
mSampleDisplayCodes);
S.SetSizeHints(mSampleDisplayChoice);
S.SetSizeHints(mSampleDisplayChoices);
S.TieTextBox(_("Default audio track &name:"),
wxT("/GUI/TrackNames/DefaultTrackName"),
@@ -141,6 +162,27 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
false);
}
S.EndStatic();
S.StartStatic(_("Zoom-Toggle"));
{
S.StartMultiColumn(4);
{
S.TieChoice(_("Preset 1:"),
wxT("/GUI/ZoomPreset1"),
WaveTrack::kZoomDefault,
mZoomChoices,
mZoomCodes);
S.SetSizeHints(mZoomChoices);
S.TieChoice(_("Preset 2:"),
wxT("/GUI/ZoomPreset2"),
WaveTrack::kZoom4To1,
mZoomChoices,
mZoomCodes);
S.SetSizeHints(mZoomChoices);
}
}
S.EndStatic();
}
bool TracksPrefs::GetPinnedHeadPreference()

View File

@@ -44,7 +44,9 @@ class TracksPrefs final : public PrefsPanel
wxArrayInt mViewCodes;
wxArrayString mViewChoices;
wxArrayInt mSampleDisplayCodes;
wxArrayString mSampleDisplayChoice;
wxArrayString mSampleDisplayChoices;
wxArrayInt mZoomCodes;
wxArrayString mZoomChoices;
};
class TracksPrefsFactory final : public PrefsPanelFactory