Free ControlToolBar from cycles. That's all the toolbars now!
This commit is contained in:
parent
acfd2b7010
commit
500ccb60b3
|
@ -45,7 +45,7 @@
|
|||
#include "ViewInfo.h"
|
||||
#include "prefs/TracksBehaviorsPrefs.h"
|
||||
#include "prefs/TracksPrefs.h"
|
||||
#include "toolbars/ControlToolBar.h"
|
||||
#include "toolbars/ToolBar.h"
|
||||
#include "tracks/ui/Scrubbing.h"
|
||||
#include "tracks/ui/TrackView.h"
|
||||
#include "widgets/AButton.h"
|
||||
|
@ -572,7 +572,7 @@ public:
|
|||
static std::shared_ptr<PlayheadHandle>
|
||||
HitTest( const AudacityProject *pProject, wxCoord xx )
|
||||
{
|
||||
if( ControlToolBar::Get( *pProject )
|
||||
if( Scrubber::Get( *pProject )
|
||||
.IsTransportingPinned() &&
|
||||
ProjectAudioIO::Get( *pProject ).IsAudioActive() )
|
||||
{
|
||||
|
@ -2068,7 +2068,7 @@ void AdornedRulerPanel::DoDrawIndicator
|
|||
dc->DrawPolygon( 3, tri );
|
||||
}
|
||||
else {
|
||||
bool pinned = ControlToolBar::Get( *mProject ).IsTransportingPinned();
|
||||
bool pinned = Scrubber::Get( *mProject ).IsTransportingPinned();
|
||||
wxBitmap & bmp = theTheme.Bitmap( pinned ?
|
||||
(playing ? bmpPlayPointerPinned : bmpRecordPointerPinned) :
|
||||
(playing ? bmpPlayPointer : bmpRecordPointer)
|
||||
|
|
|
@ -74,7 +74,6 @@
|
|||
#include "../FileNames.h"
|
||||
|
||||
#include "../tracks/ui/Scrubbing.h"
|
||||
#include "../prefs/TracksPrefs.h"
|
||||
#include "../toolbars/ToolManager.h"
|
||||
|
||||
IMPLEMENT_CLASS(ControlToolBar, ToolBar);
|
||||
|
@ -745,20 +744,9 @@ void ControlToolBar::UpdateStatusBar()
|
|||
);
|
||||
}
|
||||
|
||||
bool ControlToolBar::IsTransportingPinned() const
|
||||
{
|
||||
if (!TracksPrefs::GetPinnedHeadPreference())
|
||||
return false;
|
||||
const auto &scrubber = Scrubber::Get( mProject );
|
||||
return
|
||||
!(scrubber.HasMark() &&
|
||||
!scrubber.WasSpeedPlaying() &&
|
||||
!Scrubber::ShouldScrubPinned());
|
||||
}
|
||||
|
||||
void ControlToolBar::StartScrollingIfPreferred()
|
||||
{
|
||||
if ( IsTransportingPinned() )
|
||||
if ( Scrubber::Get( mProject ).IsTransportingPinned() )
|
||||
StartScrolling();
|
||||
#ifdef __WXMAC__
|
||||
else if (Scrubber::Get( mProject ).HasMark()) {
|
||||
|
|
|
@ -36,8 +36,6 @@ class ControlToolBar final : public ToolBar {
|
|||
ControlToolBar( AudacityProject &project );
|
||||
virtual ~ControlToolBar();
|
||||
|
||||
bool IsTransportingPinned() const;
|
||||
|
||||
static ControlToolBar *Find( AudacityProject &project );
|
||||
static ControlToolBar &Get( AudacityProject &project );
|
||||
static const ControlToolBar &Get( const AudacityProject &project );
|
||||
|
|
|
@ -687,6 +687,16 @@ void Scrubber::ContinueScrubbingUI()
|
|||
}
|
||||
}
|
||||
|
||||
bool Scrubber::IsTransportingPinned() const
|
||||
{
|
||||
if (!TracksPrefs::GetPinnedHeadPreference())
|
||||
return false;
|
||||
return
|
||||
!(HasMark() &&
|
||||
!WasSpeedPlaying() &&
|
||||
!ShouldScrubPinned());
|
||||
}
|
||||
|
||||
void Scrubber::StartPolling()
|
||||
{
|
||||
mPaused = false;
|
||||
|
|
|
@ -127,6 +127,8 @@ public:
|
|||
bool IsPaused() const;
|
||||
void CheckMenuItems();
|
||||
|
||||
bool IsTransportingPinned() const;
|
||||
|
||||
private:
|
||||
void StartPolling();
|
||||
void StopPolling();
|
||||
|
|
Loading…
Reference in New Issue