mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-28 14:18:41 +02:00
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 "ViewInfo.h"
|
||||||
#include "prefs/TracksBehaviorsPrefs.h"
|
#include "prefs/TracksBehaviorsPrefs.h"
|
||||||
#include "prefs/TracksPrefs.h"
|
#include "prefs/TracksPrefs.h"
|
||||||
#include "toolbars/ControlToolBar.h"
|
#include "toolbars/ToolBar.h"
|
||||||
#include "tracks/ui/Scrubbing.h"
|
#include "tracks/ui/Scrubbing.h"
|
||||||
#include "tracks/ui/TrackView.h"
|
#include "tracks/ui/TrackView.h"
|
||||||
#include "widgets/AButton.h"
|
#include "widgets/AButton.h"
|
||||||
@ -572,7 +572,7 @@ public:
|
|||||||
static std::shared_ptr<PlayheadHandle>
|
static std::shared_ptr<PlayheadHandle>
|
||||||
HitTest( const AudacityProject *pProject, wxCoord xx )
|
HitTest( const AudacityProject *pProject, wxCoord xx )
|
||||||
{
|
{
|
||||||
if( ControlToolBar::Get( *pProject )
|
if( Scrubber::Get( *pProject )
|
||||||
.IsTransportingPinned() &&
|
.IsTransportingPinned() &&
|
||||||
ProjectAudioIO::Get( *pProject ).IsAudioActive() )
|
ProjectAudioIO::Get( *pProject ).IsAudioActive() )
|
||||||
{
|
{
|
||||||
@ -2068,7 +2068,7 @@ void AdornedRulerPanel::DoDrawIndicator
|
|||||||
dc->DrawPolygon( 3, tri );
|
dc->DrawPolygon( 3, tri );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bool pinned = ControlToolBar::Get( *mProject ).IsTransportingPinned();
|
bool pinned = Scrubber::Get( *mProject ).IsTransportingPinned();
|
||||||
wxBitmap & bmp = theTheme.Bitmap( pinned ?
|
wxBitmap & bmp = theTheme.Bitmap( pinned ?
|
||||||
(playing ? bmpPlayPointerPinned : bmpRecordPointerPinned) :
|
(playing ? bmpPlayPointerPinned : bmpRecordPointerPinned) :
|
||||||
(playing ? bmpPlayPointer : bmpRecordPointer)
|
(playing ? bmpPlayPointer : bmpRecordPointer)
|
||||||
|
@ -74,7 +74,6 @@
|
|||||||
#include "../FileNames.h"
|
#include "../FileNames.h"
|
||||||
|
|
||||||
#include "../tracks/ui/Scrubbing.h"
|
#include "../tracks/ui/Scrubbing.h"
|
||||||
#include "../prefs/TracksPrefs.h"
|
|
||||||
#include "../toolbars/ToolManager.h"
|
#include "../toolbars/ToolManager.h"
|
||||||
|
|
||||||
IMPLEMENT_CLASS(ControlToolBar, ToolBar);
|
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()
|
void ControlToolBar::StartScrollingIfPreferred()
|
||||||
{
|
{
|
||||||
if ( IsTransportingPinned() )
|
if ( Scrubber::Get( mProject ).IsTransportingPinned() )
|
||||||
StartScrolling();
|
StartScrolling();
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
else if (Scrubber::Get( mProject ).HasMark()) {
|
else if (Scrubber::Get( mProject ).HasMark()) {
|
||||||
|
@ -36,8 +36,6 @@ class ControlToolBar final : public ToolBar {
|
|||||||
ControlToolBar( AudacityProject &project );
|
ControlToolBar( AudacityProject &project );
|
||||||
virtual ~ControlToolBar();
|
virtual ~ControlToolBar();
|
||||||
|
|
||||||
bool IsTransportingPinned() const;
|
|
||||||
|
|
||||||
static ControlToolBar *Find( AudacityProject &project );
|
static ControlToolBar *Find( AudacityProject &project );
|
||||||
static ControlToolBar &Get( AudacityProject &project );
|
static ControlToolBar &Get( AudacityProject &project );
|
||||||
static const ControlToolBar &Get( const 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()
|
void Scrubber::StartPolling()
|
||||||
{
|
{
|
||||||
mPaused = false;
|
mPaused = false;
|
||||||
|
@ -127,6 +127,8 @@ public:
|
|||||||
bool IsPaused() const;
|
bool IsPaused() const;
|
||||||
void CheckMenuItems();
|
void CheckMenuItems();
|
||||||
|
|
||||||
|
bool IsTransportingPinned() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void StartPolling();
|
void StartPolling();
|
||||||
void StopPolling();
|
void StopPolling();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user