Audacity  3.0.3
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TrackPanel Class Referencefinal

The TrackPanel class coordinates updates and operations on the main part of the screen which contains multiple tracks. More...

#include <TrackPanel.h>

Inheritance diagram for TrackPanel:
[legend]
Collaboration diagram for TrackPanel:
[legend]

Classes

class  AudacityTimer
 Timer class dedicated to informing the TrackPanel that it is time to refresh some aspect of the screen. More...
 

Public Member Functions

 TrackPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const std::shared_ptr< TrackList > &tracks, ViewInfo *viewInfo, AudacityProject *project, AdornedRulerPanel *ruler)
 
virtual ~ TrackPanel ()
 
void UpdatePrefs () override
 
void OnAudioIO (wxCommandEvent &evt)
 
void OnPaint (wxPaintEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void OnKeyDown (wxKeyEvent &event)
 
void OnTrackListResizing (TrackListEvent &event)
 
void OnTrackListDeletion (wxEvent &event)
 
void OnEnsureVisible (TrackListEvent &event)
 
void UpdateViewIfNoTracks ()
 
double GetMostRecentXPos ()
 
void OnSize (wxSizeEvent &)
 
void OnIdle (wxIdleEvent &event)
 
void OnTimer (wxTimerEvent &event)
 AS: This gets called on our wx timer events. More...
 
void OnProjectSettingsChange (wxCommandEvent &event)
 
void OnTrackFocusChange (wxCommandEvent &event)
 
void OnUndoReset (wxCommandEvent &event)
 
void Refresh (bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
 
void RefreshTrack (Track *trk, bool refreshbacking=true)
 
void HandlePageUpKey ()
 
void HandlePageDownKey ()
 
AudacityProjectGetProject () const override
 
void OnTrackMenu (Track *t=NULL)
 
void VerticalScroll (float fracPosition)
 
TrackPanelCellGetFocusedCell () override
 
void SetFocusedCell () override
 
void UpdateVRulers ()
 
void UpdateVRuler (Track *t)
 
void UpdateTrackVRuler (Track *t)
 
void UpdateVRulerSize ()
 
size_t GetSelectedTrackCount () const
 
void MakeParentRedrawScrollbars ()
 
wxRect FindTrackRect (const Track *target)
 
wxRect FindFocusedTrackRect (const Track *target)
 
std::vector< wxRect > FindRulerRects (const Track *target)
 
const TrackListGetTracks () const
 
TrackListGetTracks ()
 
ViewInfoGetViewInfo ()
 
TrackPanelListenerGetListener ()
 
AdornedRulerPanelGetRuler ()
 
void SetBackgroundCell (const std::shared_ptr< CommonTrackPanelCell > &pCell)
 
std::shared_ptr< CommonTrackPanelCellGetBackgroundCell ()
 
- Public Member Functions inherited from CellularPanel
 CellularPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, ViewInfo *viewInfo, long style=wxTAB_TRAVERSAL|wxNO_BORDER)
 
 ~CellularPanel () override
 
void Visit (Visitor &visitor)
 
void VisitCells (const SimpleCellVisitor &visitor)
 
void VisitPreorder (const SimpleNodeVisitor &visitor)
 
void VisitPostorder (const SimpleNodeVisitor &visitor)
 
FoundCell FindCell (int mouseX, int mouseY)
 
wxRect FindRect (const TrackPanelCell &cell)
 
wxRect FindRect (const std::function< bool(TrackPanelNode &) > &pred)
 
UIHandlePtr Target ()
 
std::shared_ptr< TrackPanelCellLastCell () const
 
bool IsMouseCaptured ()
 Determines if a modal tool is active. More...
 
wxCoord MostRecentXCoord () const
 
void HandleCursorForPresentMouseState (bool doHit=true)
 
void Draw (TrackPanelDrawingContext &context, unsigned nPasses)
 
- Public Member Functions inherited from OverlayPanel
 OverlayPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style=wxTAB_TRAVERSAL|wxNO_BORDER)
 
void AddOverlay (const std::weak_ptr< Overlay > &pOverlay)
 
void ClearOverlays ()
 
void DrawOverlays (bool repaint_all, wxDC *pDC=nullptr)
 
- Public Member Functions inherited from BackedPanel
 BackedPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style)
 
 ~BackedPanel ()
 
wxDC & GetBackingDC ()
 
wxDC & GetBackingDCForRepaint ()
 
void ResizeBacking ()
 
void RepairBitmap (wxDC &dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height)
 
void DisplayBitmap (wxDC &dc)
 
void OnSize (wxSizeEvent &event)
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 
- Public Member Functions inherited from NonKeystrokeInterceptingWindow
virtual ~NonKeystrokeInterceptingWindow ()
 

Static Public Member Functions

static TrackPanelGet (AudacityProject &project)
 
static const TrackPanelGet (const AudacityProject &project)
 
static void Destroy (AudacityProject &project)
 

Protected Member Functions

bool IsAudioActive ()
 
void UpdateSelectionDisplay ()
 
std::shared_ptr< TrackPanelNodeRoot () override
 
void DrawTracks (wxDC *dc)
 
void ProcessUIHandleResult (TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell, unsigned refreshResult) override
 
void UpdateStatusMessage (const TranslatableString &status) override
 
- Protected Member Functions inherited from CellularPanel
bool HasEscape ()
 
bool CancelDragging (bool escaping)
 
void DoContextMenu (TrackPanelCell *pCell=nullptr)
 
void ClearTargets ()
 

Protected Attributes

TrackPanelListenermListener
 
std::shared_ptr< TrackListmTracks
 
AdornedRulerPanelmRuler
 
std::unique_ptr< TrackArtistmTrackArtist
 
TrackPanel::AudacityTimer mTimer
 
int mTimeCount
 
bool mRefreshBacking
 
SelectedRegion mLastDrawnSelectedRegion {}
 
std::shared_ptr< CommonTrackPanelCellmpBackground
 
- Protected Attributes inherited from CellularPanel
ViewInfomViewInfo
 
wxMouseState mLastMouseState
 

Additional Inherited Members

- Public Types inherited from CellularPanel
using SimpleCellVisitor = std::function< void(const wxRect &rect, TrackPanelCell &cell) >
 
using SimpleNodeVisitor = std::function< void(const wxRect &rect, TrackPanelNode &node) >
 
- Private Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdateSelectedPrefs (int id)
 
- Static Private Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 

Detailed Description

The TrackPanel class coordinates updates and operations on the main part of the screen which contains multiple tracks.

It uses many other classes, but in particular it uses the TrackInfo class to draw the controls area on the left of a track, and the TrackArtist class to draw the actual waveforms.

Note that in some of the older code here, "Label" means the TrackInfo plus the vertical ruler. Confusing relative to LabelTrack labels.

The TrackPanel manages multiple tracks and their TrackInfos.

Note that with stereo tracks there will be one TrackInfo being used by two wavetracks.

This is a diagram of TrackPanel's division of one (non-stereo) track rectangle. Total height equals TrackView::GetHeight()'s value. Total width is the wxWindow's width. Each character that is not . represents one pixel.

Inset space of this track, and top inset of the next track, are used to draw the focus highlight.

Top inset of the right channel of a stereo track, and bottom shadow line of the left channel, are used for the channel separator.

"Margin" is a term used for inset plus border (top and left) or inset plus shadow plus border (right and bottom).

GetVRulerOffset() counts columns from the left edge up to and including controls, and is a constant.

GetVRulerWidth() is variable – all tracks have the same ruler width at any time, but that width may be adjusted when tracks change their vertical scales.

GetLeftOffset() counts columns up to and including the VRuler and one more, the "one pixel" column.

Cell for label has a rectangle that OMITS left, top, and bottom margins

Cell for vruler has a rectangle right of the label, up to and including the One Pixel column, and OMITS top and bottom margins

Cell() for track returns a rectangle with x == GetLeftOffset(), and OMITS right, top, and bottom margins

+------------— ... ---— ... ------------------— ... ... ----------—+

Top Inset
+---------— ... ---— ... ------------------— ... ... -------—+

| L|+-Border-— ... ---— ... ------------------— ... ... -Border-+ |R | | e||+-------— ... -++— ... -+++--------------— ... ... ----—+| |i | | f|B| || ||| |BS|g | | t|o| Controls || V |O| The good stuff |oh|h | | |r| || R |n| |ra|t | | I|d| || u |e| |dd| | | n|e| || l | | |eo|I | | s|r| || e |P| |rw|n | | e||| || r |i| ||||s | | t||| || |x| ||||e | | ||| || |e| ||||t | | ||| || |l| |||| | | ||| || ||| |||| |

. ... .. ... .... . . ... .. ... .... . . ... .. ... .... .

| ||| || ||| |||| | | ||+-------— -++– ... -+++--------------— ... ... ----—+||| | | |+-Border-— ... --— ... ------------------— ... ... -Border-+|| | | | Shadow-— ... --— ... ------------------— ... ... –Shadow-+| |

Definition at line 62 of file TrackPanel.h.

Constructor & Destructor Documentation

◆ TrackPanel()

TrackPanel::TrackPanel ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos,
const wxSize &  size,
const std::shared_ptr< TrackList > &  tracks,
ViewInfo viewInfo,
AudacityProject project,
AdornedRulerPanel ruler 
)

Definition at line 250 of file TrackPanel.cpp.

257  : CellularPanel(parent, id, pos, size, viewInfo,
258  wxWANTS_CHARS | wxNO_BORDER),
259  mListener( &ProjectWindow::Get( *project ) ),
260  mTracks(tracks),
261  mRuler(ruler),
262  mTrackArtist(nullptr),
263  mRefreshBacking(false)
264 #ifndef __WXGTK__ //Get rid if this pragma for gtk
265 #pragma warning( default: 4355 )
266 #endif
267 {
268  SetLayoutDirection(wxLayout_LeftToRight);
269  SetLabel(XO("Track Panel"));
270  SetName(XO("Track Panel"));
271  SetBackgroundStyle(wxBG_STYLE_PAINT);
272 
273  {
274  auto pAx = std::make_unique <TrackPanelAx>( *project );
275  pAx->SetWindow( this );
276  wxWeakRef< TrackPanel > weakThis{ this };
277  pAx->SetFinder(
278  [weakThis]( const Track &track ) -> wxRect {
279  if (weakThis)
280  return weakThis->FindTrackRect( &track );
281  return {};
282  }
283  );
284  TrackFocus::Get( *GetProject() ).SetAccessible(
285  *this, std::move( pAx ) );
286  }
287 
288  mTrackArtist = std::make_unique<TrackArtist>( this );
289 
290  mTimeCount = 0;
291  mTimer.parent = this;
292  // Timer is started after the window is visible
293  ProjectWindow::Get( *GetProject() ).Bind(wxEVT_IDLE,
294  &TrackPanel::OnIdle, this);
295 
296  // Register for tracklist updates
297  mTracks->Bind(EVT_TRACKLIST_RESIZING,
299  this);
300  mTracks->Bind(EVT_TRACKLIST_ADDITION,
302  this);
303  mTracks->Bind(EVT_TRACKLIST_DELETION,
305  this);
306  mTracks->Bind(EVT_TRACKLIST_TRACK_REQUEST_VISIBLE,
308  this);
309 
310  auto theProject = GetProject();
311  theProject->Bind(
312  EVT_PROJECT_SETTINGS_CHANGE, &TrackPanel::OnProjectSettingsChange, this);
313  theProject->Bind(
314  EVT_TRACK_FOCUS_CHANGE, &TrackPanel::OnTrackFocusChange, this );
315 
316  theProject->Bind(EVT_UNDO_RESET, &TrackPanel::OnUndoReset, this);
317 
318  wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
320  this);
321  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
323  this);
324  UpdatePrefs();
325 }

References TrackFocus::Get(), ProjectWindow::Get(), GetProject(), mTimeCount, mTimer, mTrackArtist, mTracks, OnAudioIO(), OnEnsureVisible(), OnIdle(), OnProjectSettingsChange(), OnTrackFocusChange(), OnTrackListDeletion(), OnTrackListResizing(), OnUndoReset(), TrackPanel::AudacityTimer::parent, wxPanelWrapper::SetLabel(), wxPanelWrapper::SetName(), UpdatePrefs(), and XO.

Here is the call graph for this function:

◆ ~ TrackPanel()

virtual TrackPanel::~ TrackPanel ( )
virtual

Member Function Documentation

◆ Destroy()

void TrackPanel::Destroy ( AudacityProject project)
static

Definition at line 237 of file TrackPanel.cpp.

238 {
239  auto *pPanel = GetAttachedWindows(project).Find<TrackPanel>( sKey );
240  if (pPanel) {
241  pPanel->wxWindow::Destroy();
242  GetAttachedWindows(project).Assign(sKey, nullptr);
243  }
244 }

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Assign(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Find(), GetAttachedWindows(), and sKey.

Referenced by ProjectManager::OnCloseWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawTracks()

void TrackPanel::DrawTracks ( wxDC *  dc)
protected

Draw the actual track areas. We only draw the borders and the little buttons and menues and whatnot here, the actual contents of each track are drawn by the TrackArtist.

Definition at line 826 of file TrackPanel.cpp.

827 {
828  wxRegion region = GetUpdateRegion();
829 
830  const wxRect clip = GetRect();
831 
833  mTrackArtist->pSelectedRegion = &sr;
834  mTrackArtist->pZoomInfo = mViewInfo;
835  TrackPanelDrawingContext context {
836  *dc, Target(), mLastMouseState, mTrackArtist.get()
837  };
838 
839  // Don't draw a bottom margin here.
840 
841  const auto &settings = ProjectSettings::Get( *GetProject() );
842  bool bMultiToolDown =
843  (ToolCodes::multiTool == settings.GetTool());
844  bool envelopeFlag =
845  bMultiToolDown || (ToolCodes::envelopeTool == settings.GetTool());
846  bool bigPointsFlag =
847  bMultiToolDown || (ToolCodes::drawTool == settings.GetTool());
848  bool sliderFlag = bMultiToolDown;
849  bool brushFlag = false;
850 #ifdef EXPERIMENTAL_BRUSH_TOOL
851  brushFlag = (ToolCodes::brushTool == settings.GetTool());
852 #endif
853 
854  const bool hasSolo = GetTracks()->Any< PlayableTrack >()
855  .any_of( []( const PlayableTrack *pt ) {
856  pt = static_cast< const PlayableTrack * >(
857  pt->SubstitutePendingChangedTrack().get() );
858  return (pt && pt->GetSolo());
859  } );
860 
861  mTrackArtist->drawEnvelope = envelopeFlag;
862  mTrackArtist->bigPoints = bigPointsFlag;
863  mTrackArtist->drawSliders = sliderFlag;
864  mTrackArtist->onBrushTool = brushFlag;
865  mTrackArtist->hasSolo = hasSolo;
866 
867  this->CellularPanel::Draw( context, TrackArtist::NPasses );
868 }

References TrackList::Any(), CellularPanel::Draw(), ToolCodes::drawTool, ToolCodes::envelopeTool, ProjectSettings::Get(), GetProject(), PlayableTrack::GetSolo(), GetTracks(), CellularPanel::mLastMouseState, mTrackArtist, ToolCodes::multiTool, CellularPanel::mViewInfo, TrackArtist::NPasses, ViewInfo::selectedRegion, settings(), Track::SubstitutePendingChangedTrack(), and CellularPanel::Target().

Referenced by OnPaint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindFocusedTrackRect()

wxRect TrackPanel::FindFocusedTrackRect ( const Track target)
Returns
includes what's in FindTrackRect(target) and the focus ring area around it. If target is nullptr, returns empty rectangle.

Definition at line 1675 of file TrackPanel.cpp.

1676 {
1677  auto rect = FindTrackRect(target);
1678  if (rect != wxRect{}) {
1679  // Enlarge horizontally.
1680  // PRL: perhaps it's one pixel too much each side, including some gray
1681  // beyond the yellow?
1682  rect.x = 0;
1683  GetClientSize(&rect.width, nullptr);
1684 
1685  // Enlarge vertically, enough to enclose the yellow focus border pixels
1686  // The the outermost ring of gray pixels is included on three sides
1687  // but not the top (should that be fixed?)
1688 
1689  // (Note that TrackPanel paints its focus over the "top margin" of the
1690  // rectangle allotted to the track, according to TrackView::GetY() and
1691  // TrackView::GetHeight(), but also over the margin of the next track.)
1692 
1693  rect.height += kBottomMargin;
1694  int dy = kTopMargin - 1;
1695  rect.Inflate( 0, dy );
1696 
1697  // Note that this rectangle does not coincide with any one of
1698  // the nodes in the subdivision.
1699  }
1700  return rect;
1701 }

References FindTrackRect(), kBottomMargin, and kTopMargin.

Referenced by ScreenshotCommand::GetTrackRect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindRulerRects()

std::vector< wxRect > TrackPanel::FindRulerRects ( const Track target)
Returns
extents of the vertical rulers of one channel, top to bottom. (There may be multiple sub-views, each with a ruler.) If target is nullptr, returns an empty vector.

Definition at line 1703 of file TrackPanel.cpp.

1704 {
1705  std::vector<wxRect> results;
1706  if (target)
1707  VisitCells( [&]( const wxRect &rect, TrackPanelCell &visited ) {
1708  if (auto pRuler = dynamic_cast<const TrackVRulerControls*>(&visited);
1709  pRuler && pRuler->FindTrack().get() == target)
1710  results.push_back(rect);
1711  } );
1712  return results;
1713 }

References CommonTrackPanelCell::FindTrack(), and CellularPanel::VisitCells().

Here is the call graph for this function:

◆ FindTrackRect()

wxRect TrackPanel::FindTrackRect ( const Track target)
Returns
includes track control panel, and the vertical ruler, and the proper track area of all channels, and the separators between them. If target is nullptr, returns empty rectangle.

Definition at line 1661 of file TrackPanel.cpp.

1662 {
1663  auto leader = *GetTracks()->FindLeader( target );
1664  if (!leader) {
1665  return {};
1666  }
1667 
1668  return CellularPanel::FindRect( [&] ( TrackPanelNode &node ) {
1669  if (auto pGroup = dynamic_cast<const LabeledChannelGroup*>( &node ))
1670  return pGroup->mpTrack.get() == leader;
1671  return false;
1672  } );
1673 }

References TrackList::FindLeader(), CellularPanel::FindRect(), and GetTracks().

Referenced by FindFocusedTrackRect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [1/2]

TrackPanel & TrackPanel::Get ( AudacityProject project)
static

Definition at line 227 of file TrackPanel.cpp.

228 {
229  return GetAttachedWindows(project).Get< TrackPanel >( sKey );
230 }

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), GetAttachedWindows(), and sKey.

Referenced by ScreenshotCommand::Apply(), SelectTimeCommand::Apply(), SetTrackVisualsCommand::ApplyInner(), ProjectSelectionManager::AS_ModifySelection(), ProjectSelectionManager::AS_SetSelectionFormat(), BrushHandle::Click(), SelectHandle::Click(), WaveformPrefs::Commit(), MenuButtonHandle::CommitChanges(), LabelTrackView::DialogForLabelName(), anonymous_namespace{LabelMenus.cpp}::DoAddLabel(), EffectUI::DoEffect(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), TrackUtilities::DoRemoveTracks(), BrushHandle::Drag(), EditCursorOverlay::Draw(), DeviceToolBar::EnableDisableButtons(), GetInfoCommand::ExploreTrackPanel(), Get(), MixerTrackCluster::HandleSliderGain(), MixerTrackCluster::HandleSliderPan(), GainSliderHandle::HitTest(), PanSliderHandle::HitTest(), InitProjectWindow(), anonymous_namespace{SelectMenus.cpp}::MoveWhenAudioInactive(), ProjectManager::New(), anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame(), MixerTrackCluster::OnButton_Mute(), EditActions::Handler::OnCopy(), EditActions::Handler::OnCut(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::Handler::OnEditClipName(), ToolActions::Handler::OnNextTool(), LabelEditActions::Handler::OnPasteNewLabel(), TransportActions::Handler::OnPlayOneSecond(), TransportActions::Handler::OnPlayToSelection(), ToolActions::Handler::OnPrevTool(), FileActions::Handler::OnPrint(), EditActions::Handler::OnRedo(), ViewActions::Handler::OnShowClipping(), ViewActions::Handler::OnShowNameOverlay(), TrackActions::Handler::OnSyncLock(), SelectHandle::TimerHandler::OnTimer(), TrackActions::Handler::OnTrackClose(), TrackActions::Handler::OnTrackGain(), TrackActions::Handler::OnTrackGainDec(), TrackActions::Handler::OnTrackGainInc(), TrackActions::Handler::OnTrackMenu(), TrackActions::Handler::OnTrackMoveBottom(), TrackActions::Handler::OnTrackMoveDown(), TrackActions::Handler::OnTrackMoveTop(), TrackActions::Handler::OnTrackMoveUp(), TrackActions::Handler::OnTrackPan(), TrackActions::Handler::OnTrackPanLeft(), TrackActions::Handler::OnTrackPanRight(), EditActions::Handler::OnUndo(), ViewActions::Handler::OnZoomIn(), ViewActions::Handler::OnZoomNormal(), ViewActions::Handler::OnZoomToggle(), ProjectFileManager::OpenProjectFile(), SpectrumPrefs::Preview(), SpectrumPrefs::Rollback(), SelectUtilities::SelectNone(), anonymous_namespace{ToolsToolBar.cpp}::SetTool(), anonymous_namespace{TrackMenus.cpp}::SetTrackGain(), anonymous_namespace{TrackMenus.cpp}::SetTrackPan(), and ProjectSelectionManager::SSBL_ModifySpectralSelection().

Here is the call graph for this function:

◆ Get() [2/2]

const TrackPanel & TrackPanel::Get ( const AudacityProject project)
static

Definition at line 232 of file TrackPanel.cpp.

233 {
234  return Get( const_cast< AudacityProject & >( project ) );
235 }

References Get().

Here is the call graph for this function:

◆ GetBackgroundCell()

std::shared_ptr< CommonTrackPanelCell > TrackPanel::GetBackgroundCell ( )

Definition at line 876 of file TrackPanel.cpp.

877 {
878  return mpBackground;
879 }

References mpBackground.

Referenced by GetFocusedCell().

Here is the caller graph for this function:

◆ GetFocusedCell()

TrackPanelCell * TrackPanel::GetFocusedCell ( )
overridevirtual

Implements CellularPanel.

Definition at line 1715 of file TrackPanel.cpp.

1716 {
1717  auto pTrack = TrackFocus::Get( *GetProject() ).Get();
1718  return pTrack ? &TrackView::Get( *pTrack ) : GetBackgroundCell().get();
1719 }

References TrackFocus::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), TrackView::Get(), GetBackgroundCell(), and GetProject().

Referenced by OnTrackFocusChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetListener()

TrackPanelListener* TrackPanel::GetListener ( )
inline

Definition at line 172 of file TrackPanel.h.

172 { return mListener;}

◆ GetMostRecentXPos()

double TrackPanel::GetMostRecentXPos ( )

Definition at line 749 of file TrackPanel.cpp.

750 {
751  return mViewInfo->PositionToTime(
753 }

References ZoomInfo::GetLeftOffset(), CellularPanel::MostRecentXCoord(), CellularPanel::mViewInfo, and ZoomInfo::PositionToTime().

Here is the call graph for this function:

◆ GetProject()

AudacityProject * TrackPanel::GetProject ( ) const
overridevirtual

Gets the pointer to the AudacityProject that goes with this track panel.

Implements CellularPanel.

Definition at line 349 of file TrackPanel.cpp.

350 {
351  //JKC casting away constness here.
352  //Do it in two stages in case 'this' is not a wxWindow.
353  //when the compiler will flag the error.
354  wxWindow const * const pConstWind = this;
355  wxWindow * pWind=(wxWindow*)pConstWind;
356 #ifdef EXPERIMENTAL_NOTEBOOK
357  pWind = pWind->GetParent(); //Page
358  wxASSERT( pWind );
359  pWind = pWind->GetParent(); //Notebook
360  wxASSERT( pWind );
361 #endif
362  pWind = pWind->GetParent(); //MainPanel
363  wxASSERT( pWind );
364  pWind = pWind->GetParent(); //ProjectWindow
365  wxASSERT( pWind );
366  return &static_cast<ProjectWindow*>( pWind )->GetProject();
367 }

Referenced by DrawTracks(), GetFocusedCell(), IsAudioActive(), OnEnsureVisible(), OnIdle(), OnMouseEvent(), OnTimer(), OnTrackListDeletion(), OnUndoReset(), ProcessUIHandleResult(), SetFocusedCell(), TrackPanel(), UpdateStatusMessage(), and UpdateViewIfNoTracks().

Here is the caller graph for this function:

◆ GetRuler()

AdornedRulerPanel* TrackPanel::GetRuler ( )
inline

Definition at line 173 of file TrackPanel.h.

173 { return mRuler;}

Referenced by ScreenshotCommand::Apply(), and ScreenshotCommand::GetPanelRect().

Here is the caller graph for this function:

◆ GetSelectedTrackCount()

size_t TrackPanel::GetSelectedTrackCount ( ) const

Definition at line 640 of file TrackPanel.cpp.

641 {
642  return GetTracks()->SelectedLeaders().size();
643 }

References GetTracks(), and TrackList::SelectedLeaders().

Here is the call graph for this function:

◆ GetTracks() [1/2]

TrackList* TrackPanel::GetTracks ( )
inline

Definition at line 170 of file TrackPanel.h.

170 { return mTracks.get(); }

◆ GetTracks() [2/2]

const TrackList* TrackPanel::GetTracks ( ) const
inline

Definition at line 169 of file TrackPanel.h.

169 { return mTracks.get(); }

Referenced by DrawTracks(), FindTrackRect(), GetSelectedTrackCount(), OnEnsureVisible(), ProcessUIHandleResult(), RefreshTrack(), UpdateVRulers(), UpdateVRulerSize(), and VerticalScroll().

Here is the caller graph for this function:

◆ GetViewInfo()

ViewInfo* TrackPanel::GetViewInfo ( )
inline

Definition at line 171 of file TrackPanel.h.

171 { return mViewInfo;}

References CellularPanel::mViewInfo.

◆ HandlePageDownKey()

void TrackPanel::HandlePageDownKey ( )

Definition at line 609 of file TrackPanel.cpp.

References ZoomInfo::GetScreenEndTime(), mListener, CellularPanel::mViewInfo, and TrackPanelListener::TP_ScrollWindow().

Referenced by OnKeyDown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandlePageUpKey()

void TrackPanel::HandlePageUpKey ( )

Definition at line 604 of file TrackPanel.cpp.

605 {
607 }

References ZoomInfo::GetScreenEndTime(), ZoomInfo::h, mListener, CellularPanel::mViewInfo, and TrackPanelListener::TP_ScrollWindow().

Referenced by OnKeyDown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAudioActive()

bool TrackPanel::IsAudioActive ( )
protected

Definition at line 614 of file TrackPanel.cpp.

615 {
617  return ProjectAudioIO::Get( *p ).IsAudioActive();
618 }

References ProjectAudioIO::Get(), GetProject(), and ProjectAudioIO::IsAudioActive().

Referenced by OnTimer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeParentRedrawScrollbars()

void TrackPanel::MakeParentRedrawScrollbars ( )

Definition at line 524 of file TrackPanel.cpp.

525 {
527 }

References mListener, and TrackPanelListener::TP_RedrawScrollbars().

Here is the call graph for this function:

◆ OnAudioIO()

void TrackPanel::OnAudioIO ( wxCommandEvent &  evt)

Definition at line 814 of file TrackPanel.cpp.

815 {
816  evt.Skip();
817  // Some hit tests want to change their cursor to and from the ban symbol
819 }

References BasicUI::CallAfter(), and CellularPanel::HandleCursorForPresentMouseState().

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnEnsureVisible()

void TrackPanel::OnEnsureVisible ( TrackListEvent event)

Definition at line 1008 of file TrackPanel.cpp.

1009 {
1010  e.Skip();
1011  bool modifyState = e.GetInt();
1012 
1013  auto pTrack = e.mpTrack.lock();
1014  auto t = pTrack.get();
1015 
1016  int trackTop = 0;
1017  int trackHeight =0;
1018 
1019  for (auto it : GetTracks()->Leaders()) {
1020  trackTop += trackHeight;
1021 
1022  auto channels = TrackList::Channels(it);
1023  trackHeight = channels.sum( TrackView::GetTrackHeight );
1024 
1025  //We have found the track we want to ensure is visible.
1026  if (channels.contains(t)) {
1027 
1028  //Get the size of the trackpanel.
1029  int width, height;
1030  GetSize(&width, &height);
1031 
1032  if (trackTop < mViewInfo->vpos) {
1033  height = mViewInfo->vpos - trackTop + mViewInfo->scrollStep;
1034  height /= mViewInfo->scrollStep;
1035  mListener->TP_ScrollUpDown(-height);
1036  }
1037  else if (trackTop + trackHeight > mViewInfo->vpos + height) {
1038  height = (trackTop + trackHeight) - (mViewInfo->vpos + height);
1039  height = (height + mViewInfo->scrollStep + 1) / mViewInfo->scrollStep;
1040  mListener->TP_ScrollUpDown(height);
1041  }
1042 
1043  break;
1044  }
1045  }
1046  Refresh(false);
1047 
1048  if ( modifyState )
1050 }

References TrackList::Channels(), ProjectHistory::Get(), GetProject(), TrackView::GetTrackHeight(), GetTracks(), mListener, ProjectHistory::ModifyState(), TrackListEvent::mpTrack, CellularPanel::mViewInfo, Refresh(), ViewInfo::scrollStep, TrackPanelListener::TP_ScrollUpDown(), and ZoomInfo::vpos.

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnIdle()

void TrackPanel::OnIdle ( wxIdleEvent &  event)

Definition at line 377 of file TrackPanel.cpp.

378 {
379  event.Skip();
380  // The window must be ready when the timer fires (#1401)
381  if (IsShownOnScreen())
382  {
383  mTimer.Start(kTimerInterval, FALSE);
384 
385  // Timer is started, we don't need the event anymore
386  GetProjectFrame( *GetProject() ).Unbind(wxEVT_IDLE,
387  &TrackPanel::OnIdle, this);
388  }
389  else
390  {
391  // Get another idle event, wx only guarantees we get one
392  // event after "some other normal events occur"
393  event.RequestMore();
394  }
395 }

References GetProject(), GetProjectFrame(), kTimerInterval, and mTimer.

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnKeyDown()

void TrackPanel::OnKeyDown ( wxKeyEvent &  event)

Definition at line 700 of file TrackPanel.cpp.

701 {
702  switch (event.GetKeyCode())
703  {
704  // Allow PageUp and PageDown keys to
705  //scroll the Track Panel left and right
706  case WXK_PAGEUP:
707  HandlePageUpKey();
708  return;
709 
710  case WXK_PAGEDOWN:
712  return;
713 
714  default:
715  // fall through to base class handler
716  event.Skip();
717  }
718 }

References HandlePageDownKey(), and HandlePageUpKey().

Here is the call graph for this function:

◆ OnMouseEvent()

void TrackPanel::OnMouseEvent ( wxMouseEvent &  event)

Definition at line 720 of file TrackPanel.cpp.

721 {
722  if (event.LeftDown()) {
723  // wxTimers seem to be a little unreliable, so this
724  // "primes" it to make sure it keeps going for a while...
725 
726  // When this timer fires, we call TrackPanel::OnTimer and
727  // possibly update the screen for offscreen scrolling.
728  mTimer.Stop();
729  mTimer.Start(kTimerInterval, FALSE);
730  }
731 
732 
733  if (event.ButtonUp()) {
734  //EnsureVisible should be called after processing the up-click.
735  this->CallAfter( [this, event]{
736  const auto foundCell = FindCell(event.m_x, event.m_y);
737  const auto t = FindTrack( foundCell.pCell.get() );
738  if ( t ) {
739  TrackFocus::Get(*GetProject()).Set(t.get());
740  t->EnsureVisible();
741  }
742  } );
743  }
744 
745  // Must also fall through to base class handler
746  event.Skip();
747 }

References BasicUI::CallAfter(), Track::EnsureVisible(), CellularPanel::FindCell(), anonymous_namespace{TrackPanel.cpp}::FindTrack(), TrackFocus::Get(), GetProject(), kTimerInterval, and mTimer.

Here is the call graph for this function:

◆ OnPaint()

void TrackPanel::OnPaint ( wxPaintEvent &  event)

AS: OnPaint( ) is called during the normal course of completing a repaint operation.

Definition at line 474 of file TrackPanel.cpp.

475 {
477 
478 #if DEBUG_DRAW_TIMING
479  wxStopWatch sw;
480 #endif
481 
482  {
483  wxPaintDC dc(this);
484 
485  // Retrieve the damage rectangle
486  wxRect box = GetUpdateRegion().GetBox();
487 
488  // Recreate the backing bitmap if we have a full refresh
489  // (See TrackPanel::Refresh())
490  if (mRefreshBacking || (box == GetRect()))
491  {
492  // Reset (should a mutex be used???)
493  mRefreshBacking = false;
494 
495  // Redraw the backing bitmap
497 
498  // Copy it to the display
499  DisplayBitmap(dc);
500  }
501  else
502  {
503  // Copy full, possibly clipped, damage rectangle
504  RepairBitmap(dc, box.x, box.y, box.width, box.height);
505  }
506 
507  // Done with the clipped DC
508 
509  // Drawing now goes directly to the client area.
510  // DrawOverlays() may need to draw outside the clipped region.
511  // (Used to make a NEW, separate wxClientDC, but that risks flashing
512  // problems on Mac.)
513  dc.DestroyClippingRegion();
514  DrawOverlays(true, &dc);
515  }
516 
517 #if DEBUG_DRAW_TIMING
518  sw.Pause();
519  wxLogDebug(wxT("Total: %ld milliseconds"), sw.Time());
520  wxPrintf(wxT("Total: %ld milliseconds\n"), sw.Time());
521 #endif
522 }

References BackedPanel::DisplayBitmap(), OverlayPanel::DrawOverlays(), DrawTracks(), BackedPanel::GetBackingDCForRepaint(), mLastDrawnSelectedRegion, mRefreshBacking, CellularPanel::mViewInfo, BackedPanel::RepairBitmap(), and ViewInfo::selectedRegion.

Here is the call graph for this function:

◆ OnProjectSettingsChange()

void TrackPanel::OnProjectSettingsChange ( wxCommandEvent &  event)

Definition at line 453 of file TrackPanel.cpp.

454 {
455  event.Skip();
456  switch ( static_cast<ProjectSettings::EventCode>( event.GetInt() ) ) {
458  Refresh(false);
459  break;
460  default:
461  break;
462  }
463 }

References ProjectSettings::ChangedSyncLock, and Refresh().

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSize()

void TrackPanel::OnSize ( wxSizeEvent &  evt)

Definition at line 369 of file TrackPanel.cpp.

370 {
371  evt.Skip();
372  const auto &size = evt.GetSize();
373  mViewInfo->SetWidth( size.GetWidth() );
374  mViewInfo->SetHeight( size.GetHeight() );
375 }

References CellularPanel::mViewInfo, ViewInfo::SetHeight(), ZoomInfo::SetWidth(), and size.

Here is the call graph for this function:

◆ OnTimer()

void TrackPanel::OnTimer ( wxTimerEvent &  event)

AS: This gets called on our wx timer events.

Definition at line 398 of file TrackPanel.cpp.

399 {
400  mTimeCount++;
401 
402  AudacityProject *const p = GetProject();
403  auto &window = ProjectWindow::Get( *p );
404 
405  auto &projectAudioIO = ProjectAudioIO::Get( *p );
406  auto gAudioIO = AudioIO::Get();
407 
408  // Check whether we were playing or recording, but the stream has stopped.
409  if (projectAudioIO.GetAudioIOToken()>0 && !IsAudioActive())
410  {
411  //the stream may have been started up after this one finished (by some other project)
412  //in that case reset the buttons don't stop the stream
413  auto &projectAudioManager = ProjectAudioManager::Get( *p );
414  projectAudioManager.Stop(!gAudioIO->IsStreamActive());
415  }
416 
417  // Next, check to see if we were playing or recording
418  // audio, but now Audio I/O is completely finished.
419  if (projectAudioIO.GetAudioIOToken()>0 &&
420  !gAudioIO->IsAudioTokenActive(projectAudioIO.GetAudioIOToken()))
421  {
422  projectAudioIO.SetAudioIOToken(0);
423  window.RedrawProject();
424  }
427  }
428 
429  // Notify listeners for timer ticks
430  {
431  wxCommandEvent e(EVT_TRACK_PANEL_TIMER);
432  p->ProcessEvent(e);
433  }
434 
435  DrawOverlays(false);
436  mRuler->DrawOverlays(false);
437 
438  if(IsAudioActive() && gAudioIO->GetNumCaptureChannels()) {
439 
440  // Periodically update the display while recording
441 
442  if ((mTimeCount % 5) == 0) {
443  // Must tell OnPaint() to recreate the backing bitmap
444  // since we've not done a full refresh.
445  mRefreshBacking = true;
446  Refresh( false );
447  }
448  }
449  if(mTimeCount > 1000)
450  mTimeCount = 0;
451 }

References OverlayPanel::DrawOverlays(), AudioIO::Get(), ProjectAudioIO::Get(), ProjectAudioManager::Get(), ProjectWindow::Get(), GetProject(), IsAudioActive(), mLastDrawnSelectedRegion, mRefreshBacking, mRuler, mTimeCount, CellularPanel::mViewInfo, Refresh(), ViewInfo::selectedRegion, and UpdateSelectionDisplay().

Here is the call graph for this function:

◆ OnTrackFocusChange()

void TrackPanel::OnTrackFocusChange ( wxCommandEvent &  event)

Definition at line 1729 of file TrackPanel.cpp.

1730 {
1731  event.Skip();
1732  auto cell = GetFocusedCell();
1733 
1734  if (cell) {
1735  Refresh( false );
1736  }
1737 }

References GetFocusedCell(), and Refresh().

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnTrackListDeletion()

void TrackPanel::OnTrackListDeletion ( wxEvent &  event)

Definition at line 683 of file TrackPanel.cpp.

684 {
685  // copy shared_ptr for safety, as in HandleClick
686  auto handle = Target();
687  if (handle) {
688  handle->OnProjectChange(GetProject());
689  }
690 
691  // If the focused track disappeared but there are still other tracks,
692  // this reassigns focus.
693  TrackFocus( *GetProject() ).Get();
694 
696 
697  e.Skip();
698 }

References TrackFocus::Get(), GetProject(), CellularPanel::Target(), and UpdateVRulerSize().

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnTrackListResizing()

void TrackPanel::OnTrackListResizing ( TrackListEvent event)

Definition at line 669 of file TrackPanel.cpp.

670 {
671  auto t = e.mpTrack.lock();
672  // A deleted track can trigger the event. In which case do nothing here.
673  // A deleted track can have a valid pointer but no owner, bug 2060
674  if( t && t->HasOwner() )
675  UpdateVRuler(t.get());
676  e.Skip();
677 
678  // fix for bug 2477
680 }

References mListener, TrackListEvent::mpTrack, TrackPanelListener::TP_RedrawScrollbars(), and UpdateVRuler().

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnTrackMenu()

void TrackPanel::OnTrackMenu ( Track t = NULL)

Definition at line 1002 of file TrackPanel.cpp.

1003 {
1004  CellularPanel::DoContextMenu( t ? &TrackView::Get( *t ) : nullptr );
1005 }

References CellularPanel::DoContextMenu(), and TrackView::Get().

Here is the call graph for this function:

◆ OnUndoReset()

void TrackPanel::OnUndoReset ( wxCommandEvent &  event)

Definition at line 465 of file TrackPanel.cpp.

466 {
467  event.Skip();
468  TrackFocus::Get( *GetProject() ).Set( nullptr );
469  Refresh( false );
470 }

References TrackFocus::Get(), GetProject(), and Refresh().

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessUIHandleResult()

void TrackPanel::ProcessUIHandleResult ( TrackPanelCell pClickedTrack,
TrackPanelCell pLatestCell,
unsigned  refreshResult 
)
overrideprotectedvirtual

Implements CellularPanel.

Definition at line 538 of file TrackPanel.cpp.

541 {
542  const auto panel = this;
543  auto pLatestTrack = FindTrack( pLatestCell ).get();
544 
545  // This precaution checks that the track is not only nonnull, but also
546  // really owned by the track list
547  auto pClickedTrack = GetTracks()->Lock(
548  std::weak_ptr<Track>{ FindTrack( pClickedCell ) }
549  ).get();
550 
551  // TODO: make a finer distinction between refreshing the track control area,
552  // and the waveform area. As it is, redraw both whenever you must redraw either.
553 
554  // Copy data from the underlying tracks to the pending tracks that are
555  // really displayed
556  TrackList::Get( *panel->GetProject() ).UpdatePendingTracks();
557 
558  using namespace RefreshCode;
559 
560  if (refreshResult & DestroyedCell) {
561  panel->UpdateViewIfNoTracks();
562  // Beware stale pointer!
563  if (pLatestTrack == pClickedTrack)
564  pLatestTrack = NULL;
565  pClickedTrack = NULL;
566  }
567 
568  if (pClickedTrack && (refreshResult & RefreshCode::UpdateVRuler))
569  panel->UpdateVRuler(pClickedTrack);
570 
571  if (refreshResult & RefreshCode::DrawOverlays) {
572  panel->DrawOverlays(false);
573  mRuler->DrawOverlays(false);
574  }
575 
576  // Refresh all if told to do so, or if told to refresh a track that
577  // is not known.
578  const bool refreshAll =
579  ( (refreshResult & RefreshAll)
580  || ((refreshResult & RefreshCell) && !pClickedTrack)
581  || ((refreshResult & RefreshLatestCell) && !pLatestTrack));
582 
583  if (refreshAll)
584  panel->Refresh(false);
585  else {
586  if (refreshResult & RefreshCell)
587  panel->RefreshTrack(pClickedTrack);
588  if (refreshResult & RefreshLatestCell)
589  panel->RefreshTrack(pLatestTrack);
590  }
591 
592  if (refreshResult & FixScrollbars)
593  panel->MakeParentRedrawScrollbars();
594 
595  if (refreshResult & Resize)
596  panel->GetListener()->TP_HandleResize();
597 
598  if ((refreshResult & RefreshCode::EnsureVisible) && pClickedTrack) {
599  TrackFocus::Get(*GetProject()).Set(pClickedTrack);
600  pClickedTrack->EnsureVisible();
601  }
602 }

References RefreshCode::DestroyedCell, RefreshCode::DrawOverlays, OverlayPanel::DrawOverlays(), RefreshCode::EnsureVisible, Track::EnsureVisible(), anonymous_namespace{TrackPanel.cpp}::FindTrack(), RefreshCode::FixScrollbars, TrackFocus::Get(), TrackList::Get(), GetProject(), GetTracks(), TrackList::Lock(), mRuler, RefreshCode::RefreshAll, RefreshCode::RefreshCell, RefreshCode::RefreshLatestCell, RefreshCode::Resize, TrackList::UpdatePendingTracks(), and RefreshCode::UpdateVRuler.

Here is the call graph for this function:

◆ Refresh()

void TrackPanel::Refresh ( bool  eraseBackground = true,
const wxRect *  rect = (const wxRect *) NULL 
)
override

This method overrides Refresh() of wxWindow so that the boolean play indicator can be set to false, so that an old play indicator that is no longer there won't get XORed (to erase it), thus redrawing it on the TrackPanel

Definition at line 793 of file TrackPanel.cpp.

795 {
796  // Tell OnPaint() to refresh the backing bitmap.
797  //
798  // Originally I had the check within the OnPaint() routine and it
799  // was working fine. That was until I found that, even though a full
800  // refresh was requested, Windows only set the onscreen portion of a
801  // window as damaged.
802  //
803  // So, if any part of the trackpanel was off the screen, full refreshes
804  // didn't work and the display got corrupted.
805  if( !rect || ( *rect == GetRect() ) )
806  {
807  mRefreshBacking = true;
808  }
809  wxWindow::Refresh(eraseBackground, rect);
810 
812 }

References BasicUI::CallAfter(), CellularPanel::HandleCursorForPresentMouseState(), and mRefreshBacking.

Referenced by ProjectSelectionManager::AS_SetSelectionFormat(), OnEnsureVisible(), OnProjectSettingsChange(), SelectHandle::TimerHandler::OnTimer(), OnTimer(), OnTrackFocusChange(), OnUndoReset(), RefreshTrack(), anonymous_namespace{ToolsToolBar.cpp}::SetTool(), UpdatePrefs(), UpdateSelectionDisplay(), UpdateVRulerSize(), and VerticalScroll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshTrack()

void TrackPanel::RefreshTrack ( Track trk,
bool  refreshbacking = true 
)

Definition at line 755 of file TrackPanel.cpp.

756 {
757  if (!trk)
758  return;
759 
760  // Always move to the first channel of the group, and use only
761  // the sum of channel heights, not the height of any channel alone!
762  trk = *GetTracks()->FindLeader(trk);
763  auto &view = TrackView::Get( *trk );
764  auto height =
766 
767  // Set rectangle top according to the scrolling position, `vpos`
768  // Subtract the inset (above) and shadow (below) from the height of the
769  // rectangle, but not the border
770  // This matters because some separators do paint over the border
771  const auto top =
772  -mViewInfo->vpos + view.GetCumulativeHeightBefore() + kTopInset;
773  height -= (kTopInset + kShadowThickness);
774 
775  // Width also subtracts insets (left and right) plus shadow (right)
776  const auto left = kLeftInset;
777  const auto width = GetRect().GetWidth()
779 
780  wxRect rect(left, top, width, height);
781 
782  if( refreshbacking )
783  mRefreshBacking = true;
784 
785  Refresh( false, &rect );
786 }

References TrackList::Channels(), TrackList::FindLeader(), TrackView::Get(), TrackView::GetTrackHeight(), GetTracks(), kLeftInset, kRightInset, kShadowThickness, kTopInset, mRefreshBacking, CellularPanel::mViewInfo, Refresh(), and ZoomInfo::vpos.

Referenced by MixerTrackCluster::HandleSliderGain(), MixerTrackCluster::HandleSliderPan(), MixerTrackCluster::OnButton_Mute(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::Handler::OnEditClipName(), anonymous_namespace{TrackMenus.cpp}::SetTrackGain(), and anonymous_namespace{TrackMenus.cpp}::SetTrackPan().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Root()

std::shared_ptr< TrackPanelNode > TrackPanel::Root ( )
overrideprotectedvirtual

Implements CellularPanel.

Definition at line 1649 of file TrackPanel.cpp.

1650 {
1651  // Root and other subgroup objects are throwaways.
1652  // They might instead be cached to avoid repeated allocation.
1653  // That cache would need invalidation when there is addition, deletion, or
1654  // permutation of tracks, or change of width of the vertical rulers.
1655  return std::make_shared< MainGroup >( *this );
1656 }

◆ SetBackgroundCell()

void TrackPanel::SetBackgroundCell ( const std::shared_ptr< CommonTrackPanelCell > &  pCell)

Definition at line 870 of file TrackPanel.cpp.

872 {
873  mpBackground = pCell;
874 }

References mpBackground.

◆ SetFocusedCell()

void TrackPanel::SetFocusedCell ( )
overridevirtual

Implements CellularPanel.

Definition at line 1721 of file TrackPanel.cpp.

1722 {
1723  // This may have a side-effect of assigning a focus if there was none
1724  auto& trackFocus = TrackFocus::Get(*GetProject());
1725  trackFocus.Set(trackFocus.Get());
1727 }

References KeyboardCapture::Capture(), TrackFocus::Get(), and GetProject().

Here is the call graph for this function:

◆ UpdatePrefs()

void TrackPanel::UpdatePrefs ( )
overridevirtual

Implements PrefsListener.

Definition at line 338 of file TrackPanel.cpp.

339 {
340  // All vertical rulers must be recalculated since the minimum and maximum
341  // frequencies may have been changed.
342  UpdateVRulers();
343 
344  Refresh();
345 }

References Refresh(), and UpdateVRulers().

Referenced by TrackPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSelectionDisplay()

void TrackPanel::UpdateSelectionDisplay ( )
protected

Definition at line 629 of file TrackPanel.cpp.

630 {
631  // Full refresh since the label area may need to indicate
632  // newly selected tracks.
633  Refresh(false);
634 
635  // Make sure the ruler follows suit.
637 }

References AdornedRulerPanel::DrawSelection(), mRuler, and Refresh().

Referenced by OnTimer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateStatusMessage()

void TrackPanel::UpdateStatusMessage ( const TranslatableString status)
overrideprotectedvirtual

Implements CellularPanel.

Definition at line 620 of file TrackPanel.cpp.

621 {
622  auto status = st;
623  if (HasEscape())
624  /* i18n-hint Esc is a key on the keyboard */
625  status.Join( XO("(Esc to cancel)"), " " );
626  ProjectStatus::Get( *GetProject() ).Set( status );
627 }

References ProjectStatus::Get(), GetProject(), CellularPanel::HasEscape(), TranslatableString::Join(), ProjectStatus::Set(), and XO.

Here is the call graph for this function:

◆ UpdateTrackVRuler()

void TrackPanel::UpdateTrackVRuler ( Track t)

Definition at line 943 of file TrackPanel.cpp.

944 {
945  wxASSERT(t);
946  if (!t)
947  return;
948 
949  auto heights = FindAdjustedChannelHeights(*t);
950 
951  wxRect rect(mViewInfo->GetVRulerOffset(),
952  0,
954  0);
955 
956  auto pHeight = heights.begin();
957  for (auto channel : TrackList::Channels(t)) {
958  auto &view = TrackView::Get( *channel );
959  const auto height = *pHeight++;
960  rect.SetHeight( height );
961  const auto subViews = view.GetSubViews( rect );
962  if (subViews.empty())
963  continue;
964 
965  auto iter = subViews.begin(), end = subViews.end(), next = iter;
966  auto yy = iter->first;
967  wxSize vRulerSize{ 0, 0 };
968  for ( ; iter != end; iter = next ) {
969  ++next;
970  auto nextY = ( next == end )
971  ? height
972  : next->first;
973  rect.SetHeight( nextY - yy );
974  // This causes ruler size in the track to be reassigned:
975  TrackVRulerControls::Get( *iter->second ).UpdateRuler( rect );
976  // But we want to know the maximum width and height over all sub-views:
977  vRulerSize.IncTo( t->vrulerSize );
978  yy = nextY;
979  }
980  t->vrulerSize = vRulerSize;
981  }
982 }

References TrackList::Channels(), anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights(), TrackView::Get(), TrackVRulerControls::Get(), ZoomInfo::GetVRulerOffset(), ZoomInfo::GetVRulerWidth(), CellularPanel::mViewInfo, TrackVRulerControls::UpdateRuler(), and Track::vrulerSize.

Referenced by UpdateVRuler(), and UpdateVRulers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateViewIfNoTracks()

void TrackPanel::UpdateViewIfNoTracks ( )

Definition at line 645 of file TrackPanel.cpp.

646 {
647  if (mTracks->empty())
648  {
649  // BG: There are no more tracks on screen
650  //BG: Set zoom to normal
652 
653  //STM: Set selection to 0,0
654  //PRL: and default the rest of the selection information
656 
657  // PRL: Following causes the time ruler to align 0 with left edge.
658  // Bug 972
659  mViewInfo->h = 0;
660 
662  //STM: Clear message if all tracks are removed
664  }
665 }

References ProjectStatus::Get(), ZoomInfo::GetDefaultZoom(), GetProject(), ZoomInfo::h, mListener, mTracks, CellularPanel::mViewInfo, ViewInfo::selectedRegion, ProjectStatus::Set(), ZoomInfo::SetZoom(), and TrackPanelListener::TP_HandleResize().

Here is the call graph for this function:

◆ UpdateVRuler()

void TrackPanel::UpdateVRuler ( Track t)

Definition at line 935 of file TrackPanel.cpp.

936 {
937  if (t)
939 
941 }

References UpdateTrackVRuler(), and UpdateVRulerSize().

Referenced by OnTrackListResizing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateVRulers()

void TrackPanel::UpdateVRulers ( )

Definition at line 927 of file TrackPanel.cpp.

928 {
929  for (auto t : GetTracks()->Any< WaveTrack >())
931 
933 }

References GetTracks(), UpdateTrackVRuler(), and UpdateVRulerSize().

Referenced by UpdatePrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateVRulerSize()

void TrackPanel::UpdateVRulerSize ( )

Definition at line 984 of file TrackPanel.cpp.

985 {
986  auto trackRange = GetTracks()->Any();
987  if (trackRange) {
988  wxSize s { 0, 0 };
989  for (auto t : trackRange)
990  s.IncTo(t->vrulerSize);
991 
992  if (mViewInfo->GetVRulerWidth() != s.GetWidth()) {
993  mViewInfo->SetVRulerWidth( s.GetWidth() );
995  mViewInfo->GetLeftOffset()); // bevel on AdornedRuler
996  mRuler->Refresh();
997  }
998  }
999  Refresh(false);
1000 }

References TrackList::Any(), ZoomInfo::GetLeftOffset(), GetTracks(), ZoomInfo::GetVRulerWidth(), mRuler, CellularPanel::mViewInfo, AdornedRulerPanel::Refresh(), Refresh(), AdornedRulerPanel::SetLeftOffset(), and ZoomInfo::SetVRulerWidth().

Referenced by OnTrackListDeletion(), UpdateVRuler(), and UpdateVRulers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VerticalScroll()

void TrackPanel::VerticalScroll ( float  fracPosition)

Definition at line 1054 of file TrackPanel.cpp.

1054  {
1055 
1056  int trackTop = 0;
1057  int trackHeight = 0;
1058 
1059  auto tracks = GetTracks();
1060 
1061  auto range = tracks->Leaders();
1062  if (!range.empty()) {
1063  trackHeight = TrackView::GetChannelGroupHeight( *range.rbegin() );
1064  --range.second;
1065  }
1066  trackTop = range.sum( TrackView::GetChannelGroupHeight );
1067 
1068  int delta;
1069 
1070  //Get the size of the trackpanel.
1071  int width, height;
1072  GetSize(&width, &height);
1073 
1074  delta = (fracPosition * (trackTop + trackHeight - height)) - mViewInfo->vpos + mViewInfo->scrollStep;
1075  //wxLogDebug( "Scroll down by %i pixels", delta );
1076  delta /= mViewInfo->scrollStep;
1077  mListener->TP_ScrollUpDown(delta);
1078  Refresh(false);
1079 }

References TrackView::GetChannelGroupHeight(), GetTracks(), mListener, CellularPanel::mViewInfo, Refresh(), ViewInfo::scrollStep, TrackPanelListener::TP_ScrollUpDown(), and ZoomInfo::vpos.

Here is the call graph for this function:

Member Data Documentation

◆ mLastDrawnSelectedRegion

SelectedRegion TrackPanel::mLastDrawnSelectedRegion {}
protected

Definition at line 219 of file TrackPanel.h.

Referenced by OnPaint(), and OnTimer().

◆ mListener

TrackPanelListener* TrackPanel::mListener
protected

◆ mpBackground

std::shared_ptr<CommonTrackPanelCell> TrackPanel::mpBackground
protected

Definition at line 223 of file TrackPanel.h.

Referenced by GetBackgroundCell(), and SetBackgroundCell().

◆ mRefreshBacking

bool TrackPanel::mRefreshBacking
protected

Definition at line 214 of file TrackPanel.h.

Referenced by OnPaint(), OnTimer(), Refresh(), and RefreshTrack().

◆ mRuler

AdornedRulerPanel* TrackPanel::mRuler
protected

◆ mTimeCount

int TrackPanel::mTimeCount
protected

Definition at line 212 of file TrackPanel.h.

Referenced by OnTimer(), and TrackPanel().

◆ mTimer

TrackPanel::AudacityTimer TrackPanel::mTimer
protected

Referenced by OnIdle(), OnMouseEvent(), and TrackPanel().

◆ mTrackArtist

std::unique_ptr<TrackArtist> TrackPanel::mTrackArtist
protected

Definition at line 194 of file TrackPanel.h.

Referenced by DrawTracks(), and TrackPanel().

◆ mTracks

std::shared_ptr<TrackList> TrackPanel::mTracks
protected

Definition at line 190 of file TrackPanel.h.

Referenced by TrackPanel(), and UpdateViewIfNoTracks().


The documentation for this class was generated from the following files:
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
ZoomInfo::vpos
int vpos
Definition: ZoomInfo.h:58
TrackPanel::OnTrackListResizing
void OnTrackListResizing(TrackListEvent &event)
Definition: TrackPanel.cpp:669
ProjectHistory::ModifyState
void ModifyState(bool bWantsAutoSave)
Definition: ProjectHistory.cpp:124
kLeftInset
@ kLeftInset
Definition: ZoomInfo.h:31
RefreshCode::DrawOverlays
@ DrawOverlays
Definition: RefreshCode.h:32
RefreshCode::FixScrollbars
@ FixScrollbars
Definition: RefreshCode.h:27
TrackPanel::GetTracks
const TrackList * GetTracks() const
Definition: TrackPanel.h:169
TrackPanel::UpdateVRulerSize
void UpdateVRulerSize()
Definition: TrackPanel.cpp:984
AdornedRulerPanel::Refresh
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: AdornedRulerPanel.cpp:990
TrackPanel::DrawTracks
void DrawTracks(wxDC *dc)
Definition: TrackPanel.cpp:826
CellularPanel::HandleCursorForPresentMouseState
void HandleCursorForPresentMouseState(bool doHit=true)
Definition: CellularPanel.cpp:231
PlayableTrack::GetSolo
bool GetSolo() const
Definition: Track.h:861
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:55
TrackPanelListener::TP_RedrawScrollbars
virtual void TP_RedrawScrollbars()=0
ToolCodes::drawTool
@ drawTool
Definition: ProjectSettings.h:42
RefreshCode::RefreshAll
@ RefreshAll
Definition: RefreshCode.h:26
ZoomInfo::GetVRulerOffset
int GetVRulerOffset() const
Definition: ZoomInfo.h:100
TrackArtist::NPasses
@ NPasses
Definition: TrackArtist.h:90
TrackView::Get
static TrackView & Get(Track &)
Definition: TrackView.cpp:63
TrackPanel::UpdateVRuler
void UpdateVRuler(Track *t)
Definition: TrackPanel.cpp:935
BackedPanel::DisplayBitmap
void DisplayBitmap(wxDC &dc)
Definition: BackedPanel.cpp:65
BackedPanel::RepairBitmap
void RepairBitmap(wxDC &dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height)
Definition: BackedPanel.cpp:60
ClientData::Site::Find
Subclass * Find(const RegisteredFactory &key)
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand...
Definition: ClientData.h:333
TrackFocus
Definition: TrackPanelAx.h:161
TrackList::Lock
std::shared_ptr< Subclass > Lock(const std::weak_ptr< Subclass > &wTrack)
Definition: Track.h:1542
ZoomInfo::GetDefaultZoom
static double GetDefaultZoom()
Definition: ZoomInfo.h:123
TrackPanel::OnIdle
void OnIdle(wxIdleEvent &event)
Definition: TrackPanel.cpp:377
Track::EnsureVisible
void EnsureVisible(bool modifyState=false)
Definition: Track.cpp:100
wxPanelWrapper::SetLabel
void SetLabel(const TranslatableString &label)
Definition: wxPanelWrapper.cpp:46
TrackPanelListener::TP_ScrollWindow
virtual void TP_ScrollWindow(double scrollto)=0
CellularPanel::mViewInfo
ViewInfo * mViewInfo
Definition: CellularPanel.h:161
ClientData::Site::Get
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:309
CommonTrackPanelCell::FindTrack
std::shared_ptr< Track > FindTrack()
Definition: CommonTrackPanelCell.h:46
TrackPanelDrawingContext
Definition: TrackPanelDrawingContext.h:22
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1484
kShadowThickness
@ kShadowThickness
Definition: ZoomInfo.h:29
TrackPanel::Get
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:227
TrackView::GetTrackHeight
static int GetTrackHeight(const Track *pTrack)
Definition: TrackView.cpp:29
XO
#define XO(s)
Definition: Internat.h:31
ProjectSettings::Get
static ProjectSettings & Get(AudacityProject &project)
Definition: ProjectSettings.cpp:44
TrackPanel::FindTrackRect
wxRect FindTrackRect(const Track *target)
Definition: TrackPanel.cpp:1661
TrackPanel::AudacityTimer::parent
TrackPanel * parent
Definition: TrackPanel.h:209
ZoomInfo::SetVRulerWidth
void SetVRulerWidth(int width)
Definition: ZoomInfo.h:99
kRightInset
@ kRightInset
Definition: ZoomInfo.h:32
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:535
ZoomInfo::GetVRulerWidth
int GetVRulerWidth() const
Definition: ZoomInfo.h:98
CellularPanel::FindRect
wxRect FindRect(const TrackPanelCell &cell)
Definition: CellularPanel.cpp:1141
BasicUI::CallAfter
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:38
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler
Ruler & ruler()
Definition: TimeTrackVRulerControls.cpp:34
TrackPanel
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:66
kBottomMargin
@ kBottomMargin
Definition: TrackPanelConstants.h:22
TrackList::SelectedLeaders
auto SelectedLeaders() -> TrackIterRange< TrackType >
Definition: Track.h:1422
RefreshCode::EnsureVisible
@ EnsureVisible
Definition: RefreshCode.h:31
ProjectAudioIO::IsAudioActive
bool IsAudioActive() const
Definition: ProjectAudioIO.cpp:51
sKey
static const AudacityProject::AttachedObjects::RegisteredFactory sKey
Definition: ProjectRate.cpp:35
TrackPanelListener::TP_ScrollUpDown
virtual bool TP_ScrollUpDown(int delta)=0
CellularPanel::CellularPanel
CellularPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, ViewInfo *viewInfo, long style=wxTAB_TRAVERSAL|wxNO_BORDER)
Definition: CellularPanel.cpp:108
TrackPanel::GetProject
AudacityProject * GetProject() const override
Definition: TrackPanel.cpp:349
ZoomInfo::GetLeftOffset
int GetLeftOffset() const
Definition: ZoomInfo.h:103
TrackPanel::UpdatePrefs
void UpdatePrefs() override
Definition: TrackPanel.cpp:338
anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights
std::vector< int > FindAdjustedChannelHeights(Track &t)
Definition: TrackPanel.cpp:882
ViewInfo::scrollStep
int scrollStep
Definition: ViewInfo.h:247
TrackPanel::UpdateSelectionDisplay
void UpdateSelectionDisplay()
Definition: TrackPanel.cpp:629
ClientData::Site::Assign
void Assign(const RegisteredFactory &key, ReplacementPointer &&replacement)
Reassign Site's pointer to ClientData.
Definition: ClientData.h:355
TrackPanel::OnTrackListDeletion
void OnTrackListDeletion(wxEvent &event)
Definition: TrackPanel.cpp:683
TrackVRulerControls
Definition: TrackVRulerControls.h:25
ProjectSettings::EventCode
EventCode
Definition: ProjectSettings.h:66
TrackPanel::GetFocusedCell
TrackPanelCell * GetFocusedCell() override
Definition: TrackPanel.cpp:1715
BackedPanel::GetBackingDCForRepaint
wxDC & GetBackingDCForRepaint()
Definition: BackedPanel.cpp:35
ProjectSettings::ChangedSyncLock
@ ChangedSyncLock
Definition: ProjectSettings.h:67
TrackPanelNode
The TrackPanel is built up of nodes, subtrees of the CellularPanel's area Common base class for Track...
Definition: TrackPanelCell.h:39
TrackList::FindLeader
TrackIter< Track > FindLeader(Track *pTrack)
Definition: Track.cpp:659
ProjectStatus::Set
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
Definition: ProjectStatus.cpp:77
Track::SubstitutePendingChangedTrack
std::shared_ptr< Track > SubstitutePendingChangedTrack()
Definition: Track.cpp:1198
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:229
CellularPanel::MostRecentXCoord
wxCoord MostRecentXCoord() const
Definition: CellularPanel.cpp:1179
TrackFocus::Get
static TrackFocus & Get(AudacityProject &project)
Definition: TrackPanelAx.cpp:736
TrackPanel::OnProjectSettingsChange
void OnProjectSettingsChange(wxCommandEvent &event)
Definition: TrackPanel.cpp:453
ToolCodes::multiTool
@ multiTool
Definition: ProjectSettings.h:44
CellularPanel::HasEscape
bool HasEscape()
Definition: CellularPanel.cpp:422
ZoomInfo::SetZoom
void SetZoom(double pixelsPerSecond)
Definition: ZoomInfo.cpp:84
TrackPanel::mLastDrawnSelectedRegion
SelectedRegion mLastDrawnSelectedRegion
Definition: TrackPanel.h:219
TrackPanelListener::TP_HandleResize
virtual void TP_HandleResize()=0
ProjectWindow
A top-level window associated with a project, and handling scrollbars and zooming.
Definition: ProjectWindow.h:32
GetAttachedWindows
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Definition: ProjectWindows.cpp:114
AdornedRulerPanel::DrawSelection
void DrawSelection()
Definition: AdornedRulerPanel.cpp:2066
kTopMargin
@ kTopMargin
Definition: TrackPanelConstants.h:21
KeyboardCapture::Capture
void Capture(wxWindow *handler)
Definition: KeyboardCapture.cpp:70
TrackVRulerControls::Get
static TrackVRulerControls & Get(TrackView &)
Definition: TrackVRulerControls.cpp:36
RefreshCode::Resize
@ Resize
Definition: RefreshCode.h:28
TrackPanelCell
Definition: TrackPanelCell.h:74
@0::kTimerInterval
@ kTimerInterval
ZoomInfo::GetScreenEndTime
double GetScreenEndTime() const
Definition: ZoomInfo.h:114
AdornedRulerPanel::SetLeftOffset
void SetLeftOffset(int offset)
Definition: AdornedRulerPanel.cpp:2133
CellularPanel::Target
UIHandlePtr Target()
Definition: CellularPanel.cpp:1170
TrackFocus::Get
Track * Get()
Definition: TrackPanelAx.cpp:755
RefreshCode::UpdateVRuler
@ UpdateVRuler
Definition: RefreshCode.h:30
TrackPanel::mTimer
TrackPanel::AudacityTimer mTimer
TrackPanel::GetBackgroundCell
std::shared_ptr< CommonTrackPanelCell > GetBackgroundCell()
Definition: TrackPanel.cpp:876
RefreshCode::RefreshCell
@ RefreshCell
Definition: RefreshCode.h:24
TrackPanel::mRuler
AdornedRulerPanel * mRuler
Definition: TrackPanel.h:192
anonymous_namespace{TrackPanel.cpp}::FindTrack
std::shared_ptr< Track > FindTrack(TrackPanelCell *pCell)
Definition: TrackPanel.cpp:530
TrackVRulerControls::UpdateRuler
virtual void UpdateRuler(const wxRect &rect)=0
PlayableTrack
AudioTrack subclass that can also be audibly replayed by the program.
Definition: Track.h:854
RefreshCode::RefreshLatestCell
@ RefreshLatestCell
Definition: RefreshCode.h:25
TrackPanel::HandlePageUpKey
void HandlePageUpKey()
Definition: TrackPanel.cpp:604
TrackList::UpdatePendingTracks
void UpdatePendingTracks()
Definition: Track.cpp:1072
CellularPanel::Draw
void Draw(TrackPanelDrawingContext &context, unsigned nPasses)
Definition: CellularPanel.cpp:1202
RefreshCode::DestroyedCell
@ DestroyedCell
Definition: RefreshCode.h:34
TrackPanel::mListener
TrackPanelListener * mListener
Definition: TrackPanel.h:188
TrackPanel::UpdateVRulers
void UpdateVRulers()
Definition: TrackPanel.cpp:927
wxPanelWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:61
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
ToolCodes::envelopeTool
@ envelopeTool
Definition: ProjectSettings.h:41
ProjectStatus::Get
static ProjectStatus & Get(AudacityProject &project)
Definition: ProjectStatus.cpp:35
kTopInset
@ kTopInset
Definition: TrackPanelConstants.h:20
TrackPanel::Refresh
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: TrackPanel.cpp:793
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
TrackPanel::mRefreshBacking
bool mRefreshBacking
Definition: TrackPanel.h:214
TrackPanel::mTrackArtist
std::unique_ptr< TrackArtist > mTrackArtist
Definition: TrackPanel.h:194
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: ProjectWindows.cpp:72
CellularPanel::mLastMouseState
wxMouseState mLastMouseState
Definition: CellularPanel.h:164
CellularPanel::VisitCells
void VisitCells(const SimpleCellVisitor &visitor)
Definition: CellularPanel.cpp:1031
ViewInfo::SetHeight
void SetHeight(int height)
Definition: ViewInfo.h:212
TrackPanel::OnAudioIO
void OnAudioIO(wxCommandEvent &evt)
Definition: TrackPanel.cpp:814
TrackPanel::OnEnsureVisible
void OnEnsureVisible(TrackListEvent &event)
Definition: TrackPanel.cpp:1008
OverlayPanel::DrawOverlays
void DrawOverlays(bool repaint_all, wxDC *pDC=nullptr)
Definition: OverlayPanel.cpp:43
TrackPanel::OnTrackFocusChange
void OnTrackFocusChange(wxCommandEvent &event)
Definition: TrackPanel.cpp:1729
CellularPanel::DoContextMenu
void DoContextMenu(TrackPanelCell *pCell=nullptr)
Definition: CellularPanel.cpp:942
TrackView::GetChannelGroupHeight
static int GetChannelGroupHeight(const Track *pTrack)
Definition: TrackView.cpp:34
TrackPanel::mTracks
std::shared_ptr< TrackList > mTracks
Definition: TrackPanel.h:190
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1371
TranslatableString::Join
TranslatableString & Join(TranslatableString arg, const wxString &separator={}) &
Append another translatable string.
Definition: TranslatableString.cpp:124
TrackPanel::OnUndoReset
void OnUndoReset(wxCommandEvent &event)
Definition: TrackPanel.cpp:465
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:141
settings
static Settings & settings()
Definition: TrackInfo.cpp:86
RefreshCode
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16
TrackPanel::HandlePageDownKey
void HandlePageDownKey()
Definition: TrackPanel.cpp:609
CellularPanel::FindCell
FoundCell FindCell(int mouseX, int mouseY)
Definition: CellularPanel.cpp:1102
TrackPanel::mTimeCount
int mTimeCount
Definition: TrackPanel.h:212
ProjectHistory::Get
static ProjectHistory & Get(AudacityProject &project)
Definition: ProjectHistory.cpp:26
ZoomInfo::h
double h
Definition: ZoomInfo.h:60
TrackPanel::IsAudioActive
bool IsAudioActive()
Definition: TrackPanel.cpp:614
ZoomInfo::PositionToTime
double PositionToTime(wxInt64 position, wxInt64 origin=0, bool ignoreFisheye=false) const
Definition: ZoomInfo.cpp:39
TrackPanel::UpdateTrackVRuler
void UpdateTrackVRuler(Track *t)
Definition: TrackPanel.cpp:943
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:35
ZoomInfo::SetWidth
void SetWidth(int width)
Definition: ZoomInfo.h:96
TrackPanel::mpBackground
std::shared_ptr< CommonTrackPanelCell > mpBackground
Definition: TrackPanel.h:223
Track::vrulerSize
wxSize vrulerSize
Definition: Track.h:354