mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 14:18:53 +02:00
Merge branch 'master' into deletes
This commit is contained in:
commit
1d08c793ed
@ -1882,7 +1882,7 @@ void AudacityProject::ModifyToolbarMenus()
|
||||
mCommandManager.Check(wxT("AutomatedInputLevelAdjustmentOnOff"), active);
|
||||
#endif
|
||||
|
||||
active = PlaybackPrefs::GetPinnedHeadPreference();
|
||||
active = TracksPrefs::GetPinnedHeadPreference();
|
||||
mCommandManager.Check(wxT("PinnedHead"), active);
|
||||
|
||||
gPrefs->Read(wxT("/AudioIO/Duplex"),&active, true);
|
||||
@ -2411,8 +2411,8 @@ void AudacityProject::OnToggleSoundActivated()
|
||||
|
||||
void AudacityProject::OnTogglePinnedHead()
|
||||
{
|
||||
bool value = !PlaybackPrefs::GetPinnedHeadPreference();
|
||||
PlaybackPrefs::SetPinnedHeadPreference(value, true);
|
||||
bool value = !TracksPrefs::GetPinnedHeadPreference();
|
||||
TracksPrefs::SetPinnedHeadPreference(value, true);
|
||||
ModifyAllProjectToolbarMenus();
|
||||
|
||||
// Change what happens in case transport is in progress right now
|
||||
|
@ -1730,7 +1730,9 @@ void TrackPanel::HandleCursor(const wxMouseEvent & event)
|
||||
// practice (on a P500).
|
||||
int tool = DetermineToolToUse( ttb, event );
|
||||
|
||||
tip = ttb->GetMessageForTool(tool);
|
||||
tip = GetProject()->GetScrubber().StatusMessageForWave();
|
||||
if( tip.IsEmpty() )
|
||||
tip = ttb->GetMessageForTool(tool);
|
||||
|
||||
if( tool != selectTool )
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
|
||||
WX_DECLARE_OBJARRAY(EffectBassTrebleState, EffectBassTrebleStateArray);
|
||||
|
||||
class EffectBassTreble : public Effect
|
||||
class EffectBassTreble final : public Effect
|
||||
{
|
||||
public:
|
||||
EffectBassTreble();
|
||||
|
@ -154,9 +154,10 @@ void MousePrefs::CreateList()
|
||||
// AddItem(_("ESC"), _("Select"), _("Toggle center snapping in spectrogram"), _("same as select tool"));
|
||||
#endif
|
||||
|
||||
AddItem(_("Shift-Wheel-Rotate"),_("Any"), _("Scroll waveform"));
|
||||
AddItem(CTRL + _("-Wheel-Rotate"), _("Any"), _("Zoom waveform in or out"));
|
||||
AddItem(CTRL + _("-Shift-Wheel-Rotate"),_("Any"), _("Waveform (dB) range"));
|
||||
AddItem(_("Wheel-Rotate"), _("Any"), _("Scroll tracks up or down"));
|
||||
AddItem(_("Shift-Wheel-Rotate"), _("Any"), _("Scroll waveform"));
|
||||
AddItem(CTRL + _("-Wheel-Rotate"), _("Any"), _("Zoom waveform in or out"));
|
||||
AddItem(CTRL + _("-Shift-Wheel-Rotate"), _("Any"), _("Waveform (dB) range"));
|
||||
|
||||
mList->SetColumnWidth(BlankColumn, 0);
|
||||
mList->SetColumnWidth(ToolColumn, wxLIST_AUTOSIZE);
|
||||
|
@ -27,18 +27,6 @@
|
||||
#include "../ShuttleGui.h"
|
||||
#include "../Prefs.h"
|
||||
|
||||
namespace {
|
||||
const wxChar *PinnedHeadPreferenceKey()
|
||||
{
|
||||
return wxT("/AudioIO/PinnedHead");
|
||||
}
|
||||
|
||||
bool PinnedHeadPreferenceDefault()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PlaybackPrefs::PlaybackPrefs(wxWindow * parent)
|
||||
: PrefsPanel(parent, _("Playback"))
|
||||
{
|
||||
@ -125,11 +113,6 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndThreeColumn();
|
||||
}
|
||||
S.EndStatic();
|
||||
|
||||
// This affects recording too, though it is in playback preferences.
|
||||
S.TieCheckBox(_("Pinned playback/recording head"),
|
||||
PinnedHeadPreferenceKey(),
|
||||
PinnedHeadPreferenceDefault());
|
||||
}
|
||||
|
||||
bool PlaybackPrefs::Apply()
|
||||
@ -140,18 +123,6 @@ bool PlaybackPrefs::Apply()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PlaybackPrefs::GetPinnedHeadPreference()
|
||||
{
|
||||
return gPrefs->ReadBool(PinnedHeadPreferenceKey(), PinnedHeadPreferenceDefault());
|
||||
}
|
||||
|
||||
void PlaybackPrefs::SetPinnedHeadPreference(bool value, bool flush)
|
||||
{
|
||||
gPrefs->Write(PinnedHeadPreferenceKey(), value);
|
||||
if(flush)
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
PrefsPanel *PlaybackPrefsFactory::Create(wxWindow *parent)
|
||||
{
|
||||
wxASSERT(parent); // to justify safenew
|
||||
|
@ -27,9 +27,6 @@ class PlaybackPrefs final : public PrefsPanel
|
||||
virtual ~PlaybackPrefs();
|
||||
bool Apply() override;
|
||||
|
||||
static bool GetPinnedHeadPreference();
|
||||
static void SetPinnedHeadPreference(bool value, bool flush = false);
|
||||
|
||||
private:
|
||||
void Populate();
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
|
@ -30,6 +30,20 @@
|
||||
|
||||
#include "../Experimental.h"
|
||||
|
||||
|
||||
namespace {
|
||||
const wxChar *PinnedHeadPreferenceKey()
|
||||
{
|
||||
return wxT("/AudioIO/PinnedHead");
|
||||
}
|
||||
|
||||
bool PinnedHeadPreferenceDefault()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TracksPrefs::TracksPrefs(wxWindow * parent)
|
||||
: PrefsPanel(parent, _("Tracks"))
|
||||
{
|
||||
@ -89,9 +103,13 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
|
||||
S.StartStatic(_("Display"));
|
||||
{
|
||||
S.TieCheckBox(_("&Update display while playing"),
|
||||
S.TieCheckBox(_("&Update display while when Recording/Playback head unpinned"),
|
||||
wxT("/GUI/AutoScroll"),
|
||||
true);
|
||||
|
||||
S.TieCheckBox(_("Pinned Recording/Playback head"),
|
||||
PinnedHeadPreferenceKey(),
|
||||
PinnedHeadPreferenceDefault());
|
||||
S.TieCheckBox(_("Automatically &fit tracks vertically zoomed"),
|
||||
wxT("/GUI/TracksFitVerticallyZoomed"),
|
||||
false);
|
||||
@ -160,6 +178,19 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndStatic();
|
||||
}
|
||||
|
||||
bool TracksPrefs::GetPinnedHeadPreference()
|
||||
{
|
||||
return gPrefs->ReadBool(PinnedHeadPreferenceKey(), PinnedHeadPreferenceDefault());
|
||||
}
|
||||
|
||||
void TracksPrefs::SetPinnedHeadPreference(bool value, bool flush)
|
||||
{
|
||||
gPrefs->Write(PinnedHeadPreferenceKey(), value);
|
||||
if(flush)
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
|
||||
bool TracksPrefs::Apply()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
|
@ -29,6 +29,8 @@ class TracksPrefs final : public PrefsPanel
|
||||
~TracksPrefs();
|
||||
bool Apply() override;
|
||||
|
||||
static bool GetPinnedHeadPreference();
|
||||
static void SetPinnedHeadPreference(bool value, bool flush = false);
|
||||
static const wxChar *ScrollingPreferenceKey();
|
||||
static inline bool ScrollingPreferenceDefault() { return false; }
|
||||
|
||||
|
@ -68,7 +68,7 @@
|
||||
#include "../widgets/Meter.h"
|
||||
|
||||
#include "../tracks/ui/Scrubbing.h"
|
||||
#include "../prefs/PlaybackPrefs.h"
|
||||
#include "../prefs/TracksPrefs.h"
|
||||
#include "../toolbars/ToolManager.h"
|
||||
|
||||
IMPLEMENT_CLASS(ControlToolBar, ToolBar);
|
||||
@ -1260,7 +1260,7 @@ void ControlToolBar::UpdateStatusBar(AudacityProject *pProject)
|
||||
|
||||
void ControlToolBar::StartScrollingIfPreferred()
|
||||
{
|
||||
if (PlaybackPrefs::GetPinnedHeadPreference())
|
||||
if (TracksPrefs::GetPinnedHeadPreference())
|
||||
StartScrolling();
|
||||
#ifdef __WXMAC__
|
||||
else if (::GetActiveProject()->GetScrubber().HasStartedScrubbing()) {
|
||||
|
@ -250,4 +250,5 @@ void ScrubbingToolBar::EnableDisableButtons()
|
||||
barButton->PushDown();
|
||||
else
|
||||
barButton->PopUp();
|
||||
RegenerateTooltips();
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../TrackPanelCell.h"
|
||||
#include "../../TrackPanelCellIterator.h"
|
||||
#include "../../commands/CommandFunctors.h"
|
||||
#include "../../prefs/PlaybackPrefs.h"
|
||||
#include "../../prefs/TracksPrefs.h"
|
||||
#include "../../toolbars/ControlToolBar.h"
|
||||
#include "../../toolbars/ScrubbingToolBar.h"
|
||||
#include "../../toolbars/ToolManager.h"
|
||||
@ -282,9 +282,11 @@ void Scrubber::MarkScrubStart(
|
||||
|
||||
mSeeking = seek;
|
||||
|
||||
ctb->SetPlay(true, mSeeking
|
||||
? ControlToolBar::PlayAppearance::Seek
|
||||
: ControlToolBar::PlayAppearance::Scrub);
|
||||
ctb->SetPlay(true, ControlToolBar::PlayAppearance::Straight );
|
||||
// Commented out for Bug 1421
|
||||
// mSeeking
|
||||
// ? ControlToolBar::PlayAppearance::Seek
|
||||
// : ControlToolBar::PlayAppearance::Scrub);
|
||||
|
||||
mScrubStartPosition = xx;
|
||||
ctb->UpdateStatusBar(mProject);
|
||||
@ -375,9 +377,12 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
|
||||
#endif
|
||||
lrint(std::max(0.0, MinStutter) * options.rate);
|
||||
|
||||
ControlToolBar::PlayAppearance appearance = mSeeking
|
||||
? ControlToolBar::PlayAppearance::Seek
|
||||
: ControlToolBar::PlayAppearance::Scrub;
|
||||
ControlToolBar::PlayAppearance appearance =
|
||||
// commented out to fix Bug 1241
|
||||
// mSeeking
|
||||
// ? ControlToolBar::PlayAppearance::Seek
|
||||
// : ControlToolBar::PlayAppearance::Scrub;
|
||||
ControlToolBar::PlayAppearance::Straight;
|
||||
const bool cutPreview = false;
|
||||
const bool backwards = time1 < time0;
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
|
||||
@ -546,6 +551,7 @@ void Scrubber::StopScrubbing()
|
||||
}
|
||||
|
||||
mProject->GetRulerPanel()->HideQuickPlayIndicator();
|
||||
CheckMenuItems();
|
||||
}
|
||||
|
||||
bool Scrubber::ShowsBar() const
|
||||
@ -613,6 +619,8 @@ bool Scrubber::Seeks() const
|
||||
|
||||
bool Scrubber::Scrubs() const
|
||||
{
|
||||
if( Seeks() )
|
||||
return false;
|
||||
return (HasStartedScrubbing() || IsScrubbing()) && !ChoseSeeking();
|
||||
}
|
||||
|
||||
@ -852,7 +860,7 @@ Scrubber &ScrubbingOverlay::GetScrubber()
|
||||
void Scrubber::DoScrub(bool seek)
|
||||
{
|
||||
const bool wasScrubbing = HasStartedScrubbing() || IsScrubbing();
|
||||
const bool scroll = PlaybackPrefs::GetPinnedHeadPreference();
|
||||
const bool scroll = TracksPrefs::GetPinnedHeadPreference();
|
||||
if (!wasScrubbing) {
|
||||
auto tp = mProject->GetTrackPanel();
|
||||
wxCoord xx = tp->ScreenToClient(::wxGetMouseState().GetPosition()).x;
|
||||
@ -897,11 +905,13 @@ void Scrubber::OnScrubOrSeek(bool seek)
|
||||
void Scrubber::OnScrub(wxCommandEvent&)
|
||||
{
|
||||
OnScrubOrSeek(false);
|
||||
CheckMenuItems();
|
||||
}
|
||||
|
||||
void Scrubber::OnSeek(wxCommandEvent&)
|
||||
{
|
||||
OnScrubOrSeek(true);
|
||||
CheckMenuItems();
|
||||
}
|
||||
|
||||
void Scrubber::OnToggleScrubBar(wxCommandEvent&)
|
||||
@ -938,6 +948,20 @@ const wxString &Scrubber::GetUntranslatedStateString() const
|
||||
return empty;
|
||||
}
|
||||
|
||||
const wxString & Scrubber::StatusMessageForWave() const
|
||||
{
|
||||
static wxString result;
|
||||
result = "";
|
||||
|
||||
if( Seeks() )
|
||||
result = _("Move mouse pointer to Seek");
|
||||
else if( Scrubs() )
|
||||
result = _("Move mouse pointer to Scrub");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::vector<wxString> Scrubber::GetAllUntranslatedStatusStrings()
|
||||
{
|
||||
using namespace std;
|
||||
|
@ -129,6 +129,7 @@ public:
|
||||
// A string to put in the leftmost part of the status bar
|
||||
// when scrub or seek is in progress, or else empty.
|
||||
const wxString &GetUntranslatedStateString() const;
|
||||
const wxString &StatusMessageForWave() const;
|
||||
|
||||
// All possible status strings.
|
||||
static std::vector<wxString> GetAllUntranslatedStatusStrings();
|
||||
|
@ -2122,6 +2122,9 @@ namespace {
|
||||
else
|
||||
return _("Move to Scrub");
|
||||
#else
|
||||
wxMouseState State = wxGetMouseState();
|
||||
if( State.LeftIsDown() )
|
||||
return _("Release and move to Scrub. Drag to Seek.");
|
||||
return _("Move to Scrub, drag to Seek");
|
||||
#endif
|
||||
}
|
||||
@ -2429,7 +2432,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
else if (!HasCapture() && inScrubZone) {
|
||||
if (evt.LeftDown()) {
|
||||
scrubber.MarkScrubStart(evt.m_x,
|
||||
PlaybackPrefs::GetPinnedHeadPreference(), false);
|
||||
TracksPrefs::GetPinnedHeadPreference(), false);
|
||||
UpdateStatusBarAndTooltips(StatusChoice::EnteringScrubZone);
|
||||
}
|
||||
ShowQuickPlayIndicator();
|
||||
@ -2785,7 +2788,7 @@ void AdornedRulerPanel::UpdateButtonStates()
|
||||
};
|
||||
|
||||
{
|
||||
bool state = PlaybackPrefs::GetPinnedHeadPreference();
|
||||
bool state = TracksPrefs::GetPinnedHeadPreference();
|
||||
auto pinButton = static_cast<AButton*>(FindWindow(OnTogglePinnedStateID));
|
||||
pinButton->PopUp();
|
||||
pinButton->SetAlternateIdx(state ? 0 : 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user