Audacity  3.0.3
TrackPanel.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  TrackPanel.cpp
6 
7  Dominic Mazzoni
8  and lots of other contributors
9 
10  Implements TrackPanel.
11 
12 ********************************************************************//***************************************************************//*****************************************************************//*****************************************************************/
45 
46 
47 #include "TrackPanel.h"
48 
49 
50 
51 #include <wx/setup.h> // for wxUSE_* macros
52 
53 #include "AdornedRulerPanel.h"
54 #include "KeyboardCapture.h"
55 #include "Project.h"
56 #include "ProjectAudioIO.h"
57 #include "ProjectAudioManager.h"
58 #include "ProjectHistory.h"
59 #include "ProjectSettings.h"
60 #include "ProjectStatus.h"
61 #include "ProjectWindow.h"
62 #include "Theme.h"
63 #include "TrackPanelMouseEvent.h"
64 #include "TrackPanelResizeHandle.h"
65 //#define DEBUG_DRAW_TIMING 1
66 
67 #include "UndoManager.h"
68 
69 #include "AColor.h"
70 #include "AllThemeResources.h"
71 #include "AudioIO.h"
72 #include "float_cast.h"
73 
74 #include "Prefs.h"
75 #include "RefreshCode.h"
76 #include "TrackArtist.h"
77 #include "TrackPanelAx.h"
78 #include "TrackPanelResizerCell.h"
79 #include "WaveTrack.h"
80 
82 #include "tracks/ui/TrackView.h"
84 
85 //This loads the appropriate set of cursors, depending on platform.
86 #include "../images/Cursors.h"
87 
88 #include <algorithm>
89 
90 #include <wx/dc.h>
91 #include <wx/dcclient.h>
92 #include <wx/graphics.h>
93 
157 // Is the distance between A and B less than D?
158 template < class A, class B, class DIST > bool within(A a, B b, DIST d)
159 {
160  return (a > b - d) && (a < b + d);
161 }
162 
163 BEGIN_EVENT_TABLE(TrackPanel, CellularPanel)
164  EVT_MOUSE_EVENTS(TrackPanel::OnMouseEvent)
165  EVT_KEY_DOWN(TrackPanel::OnKeyDown)
166 
167  EVT_PAINT(TrackPanel::OnPaint)
168 
169  EVT_TIMER(wxID_ANY, TrackPanel::OnTimer)
170 
171  EVT_SIZE(TrackPanel::OnSize)
172 
174 
175 std::unique_ptr<wxCursor> MakeCursor( int WXUNUSED(CursorId), const char * const pXpm[36], int HotX, int HotY )
178 {
179 #define CURSORS_SIZE32
180 #ifdef CURSORS_SIZE32
181  const int HotAdjust =0;
182 #else
183  const int HotAdjust =8;
184 #endif
185 
186  wxImage Image = wxImage(wxBitmap(pXpm).ConvertToImage());
187  Image.SetMaskColour(255,0,0);
188  Image.SetMask();// Enable mask.
189 
190  Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, HotX-HotAdjust );
191  Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, HotY-HotAdjust );
192  return std::make_unique<wxCursor>( Image );
193 }
194 
195 
196 namespace{
197 
199  []( AudacityProject &project ) -> wxWeakRef< wxWindow > {
200  auto &ruler = AdornedRulerPanel::Get( project );
201  auto &viewInfo = ViewInfo::Get( project );
202  auto &window = ProjectWindow::Get( project );
203  auto mainPage = window.GetMainPage();
204  wxASSERT( mainPage ); // to justify safenew
205 
206  auto &tracks = TrackList::Get( project );
207  auto result = safenew TrackPanel(mainPage,
208  window.NextWindowID(),
209  wxDefaultPosition,
210  wxDefaultSize,
211  tracks.shared_from_this(),
212  &viewInfo,
213  &project,
214  &ruler);
215  project.SetPanel( result );
216  return result;
217  }
218 };
219 
220 }
221 
223 {
224  return project.AttachedWindows::Get< TrackPanel >( sKey );
225 }
226 
228 {
229  return Get( const_cast< AudacityProject & >( project ) );
230 }
231 
233 {
234  auto *pPanel = project.AttachedWindows::Find( sKey );
235  if (pPanel) {
236  pPanel->wxWindow::Destroy();
237  project.AttachedWindows::Assign( sKey, nullptr );
238  }
239 }
240 
241 // Don't warn us about using 'this' in the base member initializer list.
242 #ifndef __WXGTK__ //Get rid if this pragma for gtk
243 #pragma warning( disable: 4355 )
244 #endif
245 TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
246  const wxPoint & pos,
247  const wxSize & size,
248  const std::shared_ptr<TrackList> &tracks,
249  ViewInfo * viewInfo,
250  AudacityProject * project,
252  : CellularPanel(parent, id, pos, size, viewInfo,
253  wxWANTS_CHARS | wxNO_BORDER),
254  mListener( &ProjectWindow::Get( *project ) ),
255  mTracks(tracks),
256  mRuler(ruler),
257  mTrackArtist(nullptr),
258  mRefreshBacking(false)
259 #ifndef __WXGTK__ //Get rid if this pragma for gtk
260 #pragma warning( default: 4355 )
261 #endif
262 {
263  SetLayoutDirection(wxLayout_LeftToRight);
264  SetLabel(XO("Track Panel"));
265  SetName(XO("Track Panel"));
266  SetBackgroundStyle(wxBG_STYLE_PAINT);
267 
268  {
269  auto pAx = std::make_unique <TrackPanelAx>( *project );
270  pAx->SetWindow( this );
271  wxWeakRef< TrackPanel > weakThis{ this };
272  pAx->SetFinder(
273  [weakThis]( const Track &track ) -> wxRect {
274  if (weakThis)
275  return weakThis->FindTrackRect( &track );
276  return {};
277  }
278  );
279  TrackFocus::Get( *GetProject() ).SetAccessible(
280  *this, std::move( pAx ) );
281  }
282 
283  mTrackArtist = std::make_unique<TrackArtist>( this );
284 
285  mTimeCount = 0;
286  mTimer.parent = this;
287  // Timer is started after the window is visible
288  ProjectWindow::Get( *GetProject() ).Bind(wxEVT_IDLE,
289  &TrackPanel::OnIdle, this);
290 
291  // Register for tracklist updates
292  mTracks->Bind(EVT_TRACKLIST_RESIZING,
294  this);
295  mTracks->Bind(EVT_TRACKLIST_ADDITION,
297  this);
298  mTracks->Bind(EVT_TRACKLIST_DELETION,
300  this);
301  mTracks->Bind(EVT_TRACKLIST_TRACK_REQUEST_VISIBLE,
303  this);
304 
305  auto theProject = GetProject();
306  theProject->Bind(
307  EVT_PROJECT_SETTINGS_CHANGE, &TrackPanel::OnProjectSettingsChange, this);
308  theProject->Bind(
309  EVT_TRACK_FOCUS_CHANGE, &TrackPanel::OnTrackFocusChange, this );
310 
311  theProject->Bind(EVT_UNDO_RESET, &TrackPanel::OnUndoReset, this);
312 
313  wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
315  this);
316  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
318  this);
319  UpdatePrefs();
320 }
321 
322 
323 TrackPanel::~TrackPanel()
324 {
325  mTimer.Stop();
326 
327  // This can happen if a label is being edited and the user presses
328  // ALT+F4 or Command+Q
329  if (HasCapture())
330  ReleaseMouse();
331 }
332 
334 {
335  // All vertical rulers must be recalculated since the minimum and maximum
336  // frequencies may have been changed.
337  UpdateVRulers();
338 
339  Refresh();
340 }
341 
345 {
346  //JKC casting away constness here.
347  //Do it in two stages in case 'this' is not a wxWindow.
348  //when the compiler will flag the error.
349  wxWindow const * const pConstWind = this;
350  wxWindow * pWind=(wxWindow*)pConstWind;
351 #ifdef EXPERIMENTAL_NOTEBOOK
352  pWind = pWind->GetParent(); //Page
353  wxASSERT( pWind );
354  pWind = pWind->GetParent(); //Notebook
355  wxASSERT( pWind );
356 #endif
357  pWind = pWind->GetParent(); //MainPanel
358  wxASSERT( pWind );
359  pWind = pWind->GetParent(); //ProjectWindow
360  wxASSERT( pWind );
361  return &static_cast<ProjectWindow*>( pWind )->GetProject();
362 }
363 
364 void TrackPanel::OnSize( wxSizeEvent &evt )
365 {
366  evt.Skip();
367  const auto &size = evt.GetSize();
368  mViewInfo->SetWidth( size.GetWidth() );
369  mViewInfo->SetHeight( size.GetHeight() );
370 }
371 
372 void TrackPanel::OnIdle(wxIdleEvent& event)
373 {
374  event.Skip();
375  // The window must be ready when the timer fires (#1401)
376  if (IsShownOnScreen())
377  {
378  mTimer.Start(kTimerInterval, FALSE);
379 
380  // Timer is started, we don't need the event anymore
381  GetProjectFrame( *GetProject() ).Unbind(wxEVT_IDLE,
382  &TrackPanel::OnIdle, this);
383  }
384  else
385  {
386  // Get another idle event, wx only guarantees we get one
387  // event after "some other normal events occur"
388  event.RequestMore();
389  }
390 }
391 
393 void TrackPanel::OnTimer(wxTimerEvent& )
394 {
395  mTimeCount++;
396 
397  AudacityProject *const p = GetProject();
398  auto &window = ProjectWindow::Get( *p );
399 
400  auto &projectAudioIO = ProjectAudioIO::Get( *p );
401  auto gAudioIO = AudioIO::Get();
402 
403  // Check whether we were playing or recording, but the stream has stopped.
404  if (projectAudioIO.GetAudioIOToken()>0 && !IsAudioActive())
405  {
406  //the stream may have been started up after this one finished (by some other project)
407  //in that case reset the buttons don't stop the stream
408  auto &projectAudioManager = ProjectAudioManager::Get( *p );
409  projectAudioManager.Stop(!gAudioIO->IsStreamActive());
410  }
411 
412  // Next, check to see if we were playing or recording
413  // audio, but now Audio I/O is completely finished.
414  if (projectAudioIO.GetAudioIOToken()>0 &&
415  !gAudioIO->IsAudioTokenActive(projectAudioIO.GetAudioIOToken()))
416  {
417  projectAudioIO.SetAudioIOToken(0);
418  window.RedrawProject();
419  }
422  }
423 
424  // Notify listeners for timer ticks
425  {
426  wxCommandEvent e(EVT_TRACK_PANEL_TIMER);
427  p->ProcessEvent(e);
428  }
429 
430  DrawOverlays(false);
431  mRuler->DrawOverlays(false);
432 
433  if(IsAudioActive() && gAudioIO->GetNumCaptureChannels()) {
434 
435  // Periodically update the display while recording
436 
437  if ((mTimeCount % 5) == 0) {
438  // Must tell OnPaint() to recreate the backing bitmap
439  // since we've not done a full refresh.
440  mRefreshBacking = true;
441  Refresh( false );
442  }
443  }
444  if(mTimeCount > 1000)
445  mTimeCount = 0;
446 }
447 
448 void TrackPanel::OnProjectSettingsChange( wxCommandEvent &event )
449 {
450  event.Skip();
451  switch ( static_cast<ProjectSettings::EventCode>( event.GetInt() ) ) {
453  Refresh(false);
454  break;
455  default:
456  break;
457  }
458 }
459 
460 void TrackPanel::OnUndoReset( wxCommandEvent &event )
461 {
462  event.Skip();
463  TrackFocus::Get( *GetProject() ).Set( nullptr );
464  Refresh( false );
465 }
466 
469 void TrackPanel::OnPaint(wxPaintEvent & /* event */)
470 {
472 
473 #if DEBUG_DRAW_TIMING
474  wxStopWatch sw;
475 #endif
476 
477  {
478  wxPaintDC dc(this);
479 
480  // Retrieve the damage rectangle
481  wxRect box = GetUpdateRegion().GetBox();
482 
483  // Recreate the backing bitmap if we have a full refresh
484  // (See TrackPanel::Refresh())
485  if (mRefreshBacking || (box == GetRect()))
486  {
487  // Reset (should a mutex be used???)
488  mRefreshBacking = false;
489 
490  // Redraw the backing bitmap
492 
493  // Copy it to the display
494  DisplayBitmap(dc);
495  }
496  else
497  {
498  // Copy full, possibly clipped, damage rectangle
499  RepairBitmap(dc, box.x, box.y, box.width, box.height);
500  }
501 
502  // Done with the clipped DC
503 
504  // Drawing now goes directly to the client area.
505  // DrawOverlays() may need to draw outside the clipped region.
506  // (Used to make a NEW, separate wxClientDC, but that risks flashing
507  // problems on Mac.)
508  dc.DestroyClippingRegion();
509  DrawOverlays(true, &dc);
510  }
511 
512 #if DEBUG_DRAW_TIMING
513  sw.Pause();
514  wxLogDebug(wxT("Total: %ld milliseconds"), sw.Time());
515  wxPrintf(wxT("Total: %ld milliseconds\n"), sw.Time());
516 #endif
517 }
518 
520 {
522 }
523 
524 namespace {
525  std::shared_ptr<Track> FindTrack(TrackPanelCell *pCell )
526  {
527  if (pCell)
528  return static_cast<CommonTrackPanelCell*>( pCell )->FindTrack();
529  return {};
530  }
531 }
532 
534  (TrackPanelCell *pClickedCell, TrackPanelCell *pLatestCell,
535  UIHandle::Result refreshResult)
536 {
537  const auto panel = this;
538  auto pLatestTrack = FindTrack( pLatestCell ).get();
539 
540  // This precaution checks that the track is not only nonnull, but also
541  // really owned by the track list
542  auto pClickedTrack = GetTracks()->Lock(
543  std::weak_ptr<Track>{ FindTrack( pClickedCell ) }
544  ).get();
545 
546  // TODO: make a finer distinction between refreshing the track control area,
547  // and the waveform area. As it is, redraw both whenever you must redraw either.
548 
549  // Copy data from the underlying tracks to the pending tracks that are
550  // really displayed
551  TrackList::Get( *panel->GetProject() ).UpdatePendingTracks();
552 
553  using namespace RefreshCode;
554 
555  if (refreshResult & DestroyedCell) {
556  panel->UpdateViewIfNoTracks();
557  // Beware stale pointer!
558  if (pLatestTrack == pClickedTrack)
559  pLatestTrack = NULL;
560  pClickedTrack = NULL;
561  }
562 
563  if (pClickedTrack && (refreshResult & RefreshCode::UpdateVRuler))
564  panel->UpdateVRuler(pClickedTrack);
565 
566  if (refreshResult & RefreshCode::DrawOverlays) {
567  panel->DrawOverlays(false);
568  mRuler->DrawOverlays(false);
569  }
570 
571  // Refresh all if told to do so, or if told to refresh a track that
572  // is not known.
573  const bool refreshAll =
574  ( (refreshResult & RefreshAll)
575  || ((refreshResult & RefreshCell) && !pClickedTrack)
576  || ((refreshResult & RefreshLatestCell) && !pLatestTrack));
577 
578  if (refreshAll)
579  panel->Refresh(false);
580  else {
581  if (refreshResult & RefreshCell)
582  panel->RefreshTrack(pClickedTrack);
583  if (refreshResult & RefreshLatestCell)
584  panel->RefreshTrack(pLatestTrack);
585  }
586 
587  if (refreshResult & FixScrollbars)
588  panel->MakeParentRedrawScrollbars();
589 
590  if (refreshResult & Resize)
591  panel->GetListener()->TP_HandleResize();
592 
593  if ((refreshResult & RefreshCode::EnsureVisible) && pClickedTrack) {
594  TrackFocus::Get(*GetProject()).Set(pClickedTrack);
595  pClickedTrack->EnsureVisible();
596  }
597 }
598 
600 {
602 }
603 
605 {
607 }
608 
610 {
612  return ProjectAudioIO::Get( *p ).IsAudioActive();
613 }
614 
616 {
617  auto status = st;
618  if (HasEscape())
619  /* i18n-hint Esc is a key on the keyboard */
620  status.Join( XO("(Esc to cancel)"), " " );
621  ProjectStatus::Get( *GetProject() ).Set( status );
622 }
623 
625 {
626  // Full refresh since the label area may need to indicate
627  // newly selected tracks.
628  Refresh(false);
629 
630  // Make sure the ruler follows suit.
632 }
633 
634 // Counts selected tracks, counting stereo tracks as one track.
636 {
637  return GetTracks()->SelectedLeaders().size();
638 }
639 
641 {
642  if (mTracks->empty())
643  {
644  // BG: There are no more tracks on screen
645  //BG: Set zoom to normal
647 
648  //STM: Set selection to 0,0
649  //PRL: and default the rest of the selection information
651 
652  // PRL: Following causes the time ruler to align 0 with left edge.
653  // Bug 972
654  mViewInfo->h = 0;
655 
657  //STM: Clear message if all tracks are removed
659  }
660 }
661 
662 // The tracks positions within the list have changed, so update the vertical
663 // ruler size for the track that triggered the event.
665 {
666  auto t = e.mpTrack.lock();
667  // A deleted track can trigger the event. In which case do nothing here.
668  // A deleted track can have a valid pointer but no owner, bug 2060
669  if( t && t->HasOwner() )
670  UpdateVRuler(t.get());
671  e.Skip();
672 
673  // fix for bug 2477
675 }
676 
677 // Tracks have been removed from the list.
679 {
680  // copy shared_ptr for safety, as in HandleClick
681  auto handle = Target();
682  if (handle) {
683  handle->OnProjectChange(GetProject());
684  }
685 
686  // If the focused track disappeared but there are still other tracks,
687  // this reassigns focus.
688  TrackFocus( *GetProject() ).Get();
689 
691 
692  e.Skip();
693 }
694 
695 void TrackPanel::OnKeyDown(wxKeyEvent & event)
696 {
697  switch (event.GetKeyCode())
698  {
699  // Allow PageUp and PageDown keys to
700  //scroll the Track Panel left and right
701  case WXK_PAGEUP:
702  HandlePageUpKey();
703  return;
704 
705  case WXK_PAGEDOWN:
707  return;
708 
709  default:
710  // fall through to base class handler
711  event.Skip();
712  }
713 }
714 
715 void TrackPanel::OnMouseEvent(wxMouseEvent & event)
716 {
717  if (event.LeftDown()) {
718  // wxTimers seem to be a little unreliable, so this
719  // "primes" it to make sure it keeps going for a while...
720 
721  // When this timer fires, we call TrackPanel::OnTimer and
722  // possibly update the screen for offscreen scrolling.
723  mTimer.Stop();
724  mTimer.Start(kTimerInterval, FALSE);
725  }
726 
727 
728  if (event.ButtonUp()) {
729  //EnsureVisible should be called after processing the up-click.
730  this->CallAfter( [this, event]{
731  const auto foundCell = FindCell(event.m_x, event.m_y);
732  const auto t = FindTrack( foundCell.pCell.get() );
733  if ( t ) {
734  TrackFocus::Get(*GetProject()).Set(t.get());
735  t->EnsureVisible();
736  }
737  } );
738  }
739 
740  // Must also fall through to base class handler
741  event.Skip();
742 }
743 
745 {
746  return mViewInfo->PositionToTime(
748 }
749 
750 void TrackPanel::RefreshTrack(Track *trk, bool refreshbacking)
751 {
752  if (!trk)
753  return;
754 
755  trk = *GetTracks()->FindLeader(trk);
756  auto &view = TrackView::Get( *trk );
757  auto height =
760 
761  // subtract insets and shadows from the rectangle, but not border
762  // This matters because some separators do paint over the border
763  wxRect rect(kLeftInset,
764  -mViewInfo->vpos + view.GetY() + kTopInset,
765  GetRect().GetWidth() - kLeftInset - kRightInset - kShadowThickness,
766  height);
767 
768  if( refreshbacking )
769  {
770  mRefreshBacking = true;
771  }
772 
773  Refresh( false, &rect );
774 }
775 
776 
781 void TrackPanel::Refresh(bool eraseBackground /* = TRUE */,
782  const wxRect *rect /* = NULL */)
783 {
784  // Tell OnPaint() to refresh the backing bitmap.
785  //
786  // Originally I had the check within the OnPaint() routine and it
787  // was working fine. That was until I found that, even though a full
788  // refresh was requested, Windows only set the onscreen portion of a
789  // window as damaged.
790  //
791  // So, if any part of the trackpanel was off the screen, full refreshes
792  // didn't work and the display got corrupted.
793  if( !rect || ( *rect == GetRect() ) )
794  {
795  mRefreshBacking = true;
796  }
797  wxWindow::Refresh(eraseBackground, rect);
798 
799  CallAfter([this]{ CellularPanel::HandleCursorForPresentMouseState(); } );
800 }
801 
802 void TrackPanel::OnAudioIO(wxCommandEvent & evt)
803 {
804  evt.Skip();
805  // Some hit tests want to change their cursor to and from the ban symbol
806  CallAfter( [this]{ CellularPanel::HandleCursorForPresentMouseState(); } );
807 }
808 
810 
814 void TrackPanel::DrawTracks(wxDC * dc)
815 {
816  wxRegion region = GetUpdateRegion();
817 
818  const wxRect clip = GetRect();
819 
821  mTrackArtist->pSelectedRegion = &sr;
822  mTrackArtist->pZoomInfo = mViewInfo;
823  TrackPanelDrawingContext context {
824  *dc, Target(), mLastMouseState, mTrackArtist.get()
825  };
826 
827  // Don't draw a bottom margin here.
828 
829  const auto &settings = ProjectSettings::Get( *GetProject() );
830  bool bMultiToolDown =
831  (ToolCodes::multiTool == settings.GetTool());
832  bool envelopeFlag =
833  bMultiToolDown || (ToolCodes::envelopeTool == settings.GetTool());
834  bool bigPointsFlag =
835  bMultiToolDown || (ToolCodes::drawTool == settings.GetTool());
836  bool sliderFlag = bMultiToolDown;
837 
838  const bool hasSolo = GetTracks()->Any< PlayableTrack >()
839  .any_of( []( const PlayableTrack *pt ) {
840  pt = static_cast< const PlayableTrack * >(
841  pt->SubstitutePendingChangedTrack().get() );
842  return (pt && pt->GetSolo());
843  } );
844 
845  mTrackArtist->drawEnvelope = envelopeFlag;
846  mTrackArtist->bigPoints = bigPointsFlag;
847  mTrackArtist->drawSliders = sliderFlag;
848  mTrackArtist->hasSolo = hasSolo;
849 
850  this->CellularPanel::Draw( context, TrackArtist::NPasses );
851 }
852 
854 (const std::shared_ptr< TrackPanelCell > &pCell)
855 {
856  mpBackground = pCell;
857 }
858 
859 std::shared_ptr< TrackPanelCell > TrackPanel::GetBackgroundCell()
860 {
861  return mpBackground;
862 }
863 
865 {
866  for (auto t : GetTracks()->Any< WaveTrack >())
868 
870 }
871 
873 {
874  if (t)
876 
878 }
879 
881 {
882  wxASSERT(t);
883  if (!t)
884  return;
885 
886  wxRect rect(mViewInfo->GetVRulerOffset(),
887  0,
889  0);
890 
891 
892  for (auto channel : TrackList::Channels(t)) {
893  auto &view = TrackView::Get( *channel );
894  const auto height = view.GetHeight() - (kTopMargin + kBottomMargin);
895  rect.SetHeight( height );
896  const auto subViews = view.GetSubViews( rect );
897  if (subViews.empty())
898  continue;
899 
900  auto iter = subViews.begin(), end = subViews.end(), next = iter;
901  auto yy = iter->first;
902  wxSize vRulerSize{ 0, 0 };
903  for ( ; iter != end; iter = next ) {
904  ++next;
905  auto nextY = ( next == end )
906  ? height
907  : next->first;
908  rect.SetHeight( nextY - yy );
909  // This causes ruler size in the track to be reassigned:
910  TrackVRulerControls::Get( *iter->second ).UpdateRuler( rect );
911  // But we want to know the maximum width and height over all sub-views:
912  vRulerSize.IncTo( t->vrulerSize );
913  yy = nextY;
914  }
915  t->vrulerSize = vRulerSize;
916  }
917 }
918 
920 {
921  auto trackRange = GetTracks()->Any();
922  if (trackRange) {
923  wxSize s { 0, 0 };
924  for (auto t : trackRange)
925  s.IncTo(t->vrulerSize);
926 
927  if (mViewInfo->GetVRulerWidth() != s.GetWidth()) {
928  mViewInfo->SetVRulerWidth( s.GetWidth() );
930  mViewInfo->GetLeftOffset()); // bevel on AdornedRuler
931  mRuler->Refresh();
932  }
933  }
934  Refresh(false);
935 }
936 
938 {
939  CellularPanel::DoContextMenu( t ? &TrackView::Get( *t ) : nullptr );
940 }
941 
942 // Tracks have been removed from the list.
944 {
945  e.Skip();
946  bool modifyState = e.GetInt();
947 
948  auto pTrack = e.mpTrack.lock();
949  auto t = pTrack.get();
950 
951  int trackTop = 0;
952  int trackHeight =0;
953 
954  for (auto it : GetTracks()->Leaders()) {
955  trackTop += trackHeight;
956 
957  auto channels = TrackList::Channels(it);
958  trackHeight = channels.sum( TrackView::GetTrackHeight );
959 
960  //We have found the track we want to ensure is visible.
961  if (channels.contains(t)) {
962 
963  //Get the size of the trackpanel.
964  int width, height;
965  GetSize(&width, &height);
966 
967  if (trackTop < mViewInfo->vpos) {
968  height = mViewInfo->vpos - trackTop + mViewInfo->scrollStep;
969  height /= mViewInfo->scrollStep;
970  mListener->TP_ScrollUpDown(-height);
971  }
972  else if (trackTop + trackHeight > mViewInfo->vpos + height) {
973  height = (trackTop + trackHeight) - (mViewInfo->vpos + height);
974  height = (height + mViewInfo->scrollStep + 1) / mViewInfo->scrollStep;
975  mListener->TP_ScrollUpDown(height);
976  }
977 
978  break;
979  }
980  }
981  Refresh(false);
982 
983  if ( modifyState )
985 }
986 
987 // 0.0 scrolls to top
988 // 1.0 scrolls to bottom.
989 void TrackPanel::VerticalScroll( float fracPosition){
990 
991  int trackTop = 0;
992  int trackHeight = 0;
993 
994  auto tracks = GetTracks();
995 
996  auto range = tracks->Leaders();
997  if (!range.empty()) {
998  trackHeight = TrackView::GetChannelGroupHeight( *range.rbegin() );
999  --range.second;
1000  }
1001  trackTop = range.sum( TrackView::GetChannelGroupHeight );
1002 
1003  int delta;
1004 
1005  //Get the size of the trackpanel.
1006  int width, height;
1007  GetSize(&width, &height);
1008 
1009  delta = (fracPosition * (trackTop + trackHeight - height)) - mViewInfo->vpos + mViewInfo->scrollStep;
1010  //wxLogDebug( "Scroll down by %i pixels", delta );
1011  delta /= mViewInfo->scrollStep;
1012  mListener->TP_ScrollUpDown(delta);
1013  Refresh(false);
1014 }
1015 
1016 
1017 namespace {
1018  // Drawing constants
1019  // DisplaceX and MarginX are large enough to avoid overwriting <- symbol
1020  // See TrackArt::DrawNegativeOffsetTrackArrows
1021  enum : int {
1022  // Displacement of the rectangle from upper left corner
1024  // Size of margins about the text extent that determine the rectangle size
1025  MarginX = 8, MarginY = 2,
1026  // Derived constants
1028  };
1029 
1031  wxDC &dc, const Track *t, wxCoord *pW, wxCoord *pH )
1032 {
1033  wxFont labelFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
1034  dc.SetFont(labelFont);
1035  dc.GetTextExtent( t->GetName(), pW, pH );
1036 }
1037 
1039  int leftOffset,
1040  const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight )
1041 {
1042  return {
1043  leftOffset + DisplaceX,
1044  trackRect.y + DisplaceY,
1045  textWidth + MarginsX,
1046  textHeight + MarginsY
1047  };
1048 }
1049 
1050 // Draws the track name on the track, if it is needed.
1052  int leftOffset,
1053  TrackPanelDrawingContext &context, const Track * t, const wxRect & rect )
1054 {
1055  if( !TrackArtist::Get( context )->mbShowTrackNameInTrack )
1056  return;
1057  auto name = t->GetName();
1058  if( name.IsEmpty())
1059  return;
1060  if( !t->IsLeader())
1061  return;
1062  auto &dc = context.dc;
1063  wxBrush Brush;
1064  wxCoord textWidth, textHeight;
1065  GetTrackNameExtent( dc, t, &textWidth, &textHeight );
1066 
1067  // Logic for name background translucency (aka 'shields')
1068  // Tracks less than kOpaqueHeight high will have opaque shields.
1069  // Tracks more than kTranslucentHeight will have maximum translucency for shields.
1070  const int kOpaqueHeight = 44;
1071  const int kTranslucentHeight = 124;
1072  int h = TrackView::Get( *t ).GetHeight();
1073  // f codes the opacity as a number between 0.0 and 1.0
1074  float f = wxClip((h-kOpaqueHeight)/(float)(kTranslucentHeight-kOpaqueHeight),0.0,1.0);
1075  // kOpaque is the shield's alpha for tracks that are not tall
1076  // kTranslucent is the shield's alpha for tracks that are tall.
1077  const int kOpaque = 255;
1078  const int kTranslucent = 140;
1079  // 0.0 maps to full opacity, 1.0 maps to full translucency.
1080  int opacity = 255 - (255-140)*f;
1081 
1082  const auto nameRect =
1083  GetTrackNameRect( leftOffset, rect, textWidth, textHeight );
1084 
1085 #ifdef __WXMAC__
1086  // Mac dc is a graphics dc already.
1087  AColor::UseThemeColour( &dc, clrTrackInfoSelected, clrTrackPanelText, opacity );
1088  dc.DrawRoundedRectangle( nameRect, 8.0 );
1089 #else
1090  // This little dance with wxImage in order to draw to a graphic dc
1091  // which we can then paste as a translucent bitmap onto the real dc.
1092  enum : int {
1093  SecondMarginX = 1, SecondMarginY = 1,
1094  SecondMarginsX = 2 * SecondMarginX, SecondMarginsY = 2 * SecondMarginY,
1095  };
1096  wxImage image(
1097  textWidth + MarginsX + SecondMarginsX,
1098  textHeight + MarginsY + SecondMarginsY );
1099  image.InitAlpha();
1100  unsigned char *alpha=image.GetAlpha();
1101  memset(alpha, wxIMAGE_ALPHA_TRANSPARENT, image.GetWidth()*image.GetHeight());
1102 
1103  {
1104  std::unique_ptr< wxGraphicsContext >
1105  pGc{ wxGraphicsContext::Create(image) };
1106  auto &gc = *pGc;
1107  // This is to a gc, not a dc.
1108  AColor::UseThemeColour( &gc, clrTrackInfoSelected, clrTrackPanelText, opacity );
1109  // Draw at 1,1, not at 0,0 to avoid clipping of the antialiasing.
1110  gc.DrawRoundedRectangle(
1111  SecondMarginX, SecondMarginY,
1112  textWidth + MarginsX, textHeight + MarginsY, 8.0 );
1113  // destructor of gc updates the wxImage.
1114  }
1115  wxBitmap bitmap( image );
1116  dc.DrawBitmap( bitmap,
1117  nameRect.x - SecondMarginX, nameRect.y - SecondMarginY );
1118 #endif
1119  dc.SetTextForeground(theTheme.Colour( clrTrackPanelText ));
1120  dc.DrawText(t->GetName(),
1121  nameRect.x + MarginX,
1122  nameRect.y + MarginY);
1123 }
1124 
1125 /*
1126 
1127  The following classes define the subdivision of the area of the TrackPanel
1128  into cells with differing responses to mouse, keyboard, and scroll wheel
1129  events.
1130 
1131  The classes defining the less inclusive areas are earlier, while those
1132  defining ever larger hierarchical groupings of cells are later.
1133 
1134  To describe that subdivision again, informally, and top-down:
1135 
1136  Firstly subtract margin areas, on the left and right, that do not interact.
1137 
1138  Secondly subtract a noninterative margin above the first track, and an area
1139  below all tracks that causes deselection of all tracks if you click it.
1140  (One or both of those areas might be vertically scrolled off-screen, though.)
1141  Divide what remains into areas corresponding to the several tracks.
1142 
1143  Thirdly, for each track, subtract an area below, which you can click and drag
1144  to resize the track vertically.
1145 
1146  Fourthly, subtract an area at the left, which contains the track controls,
1147  such as the menu and delete and minimize buttons, and others appropriate
1148  to the track subtype.
1149 
1150  Fifthly, divide what remains into the vertically stacked channels, if there
1151  are more than one, alternating with separators, which can be clicked to
1152  resize the channel views.
1153 
1154  Sixthly, divide each channel into one or more vertically stacked sub-views.
1155 
1156  Lastly, split the area for each sub-view into a vertical ruler, and an area
1157  that displays the channel's own contents.
1158 
1159 */
1160 
1162  std::vector< UIHandlePtr > HitTest(
1163  const TrackPanelMouseState &, const AudacityProject *) override
1164  { return {}; }
1165  virtual std::shared_ptr< Track > DoFindTrack() override { return {}; }
1166  static std::shared_ptr<EmptyCell> Instance()
1167  {
1168  static auto instance = std::make_shared< EmptyCell >();
1169  return instance;
1170  }
1171 
1172  // TrackPanelDrawable implementation
1173  void Draw(
1174  TrackPanelDrawingContext &context,
1175  const wxRect &rect, unsigned iPass ) override
1176  {
1177  if ( iPass == TrackArtist::PassMargins ) {
1178  // Draw a margin area of TrackPanel
1179  auto dc = &context.dc;
1180 
1181  AColor::TrackPanelBackground( dc, false );
1182  dc->DrawRectangle( rect );
1183  }
1184  }
1185 };
1186 
1187 // A vertical ruler left of a channel
1190  const std::shared_ptr< TrackView > &pView, wxCoord leftOffset )
1191  : mpView{ pView }, mLeftOffset{ leftOffset } {}
1192  Subdivision Children( const wxRect &rect ) override
1193  {
1194  return { Axis::X, Refinement{
1195  { rect.GetLeft(),
1196  TrackVRulerControls::Get( *mpView ).shared_from_this() },
1197  { mLeftOffset, mpView }
1198  } };
1199  }
1200  std::shared_ptr< TrackView > mpView;
1201  wxCoord mLeftOffset;
1202 };
1203 
1204 // One or more sub-views of one channel, stacked vertically, each containing
1205 // a vertical ruler and a channel
1208  const std::shared_ptr<Track> &pTrack,
1209  TrackView::Refinement refinement, wxCoord leftOffset )
1210  : mpTrack{ pTrack }
1211  , mRefinement{ std::move( refinement ) }
1212  , mLeftOffset{ leftOffset } {}
1213  Subdivision Children( const wxRect &rect ) override
1214  {
1215  Refinement refinement;
1216  auto y1 = rect.GetTop();
1217  for ( const auto &subView : mRefinement ) {
1218  y1 = std::max( y1, subView.first );
1219  refinement.emplace_back( y1,
1220  std::make_shared< VRulerAndChannel >(
1221  subView.second, mLeftOffset ) );
1222  }
1223  return { Axis::Y, std::move( refinement ) };
1224  }
1225 
1226  // TrackPanelDrawable implementation
1227  void Draw(
1228  TrackPanelDrawingContext &context,
1229  const wxRect &rect, unsigned iPass ) override
1230  {
1231  // This overpaints the track area, but sometimes too the stereo channel
1232  // separator, so draw at least later than that
1233  if ( iPass == TrackArtist::PassBorders ) {
1234  DrawTrackName( mLeftOffset,
1235  context, mpTrack->SubstitutePendingChangedTrack().get(), rect );
1236  }
1237  if ( iPass == TrackArtist::PassControls ) {
1238  if (mRefinement.size() > 1) {
1239  // Draw lines separating sub-views
1240  auto &dc = context.dc;
1241  AColor::CursorColor( &dc );
1242  auto iter = mRefinement.begin() + 1, end = mRefinement.end();
1243  for ( ; iter != end; ++iter ) {
1244  auto yy = iter->first;
1245  AColor::Line( dc, mLeftOffset, yy, rect.GetRight(), yy );
1246  }
1247  }
1248  }
1249  }
1250 
1251  wxRect DrawingArea(
1252  TrackPanelDrawingContext &context,
1253  const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override
1254  {
1255  auto result = rect;
1256  if ( iPass == TrackArtist::PassBorders ) {
1257  if ( true ) {
1258  wxCoord textWidth, textHeight;
1259  GetTrackNameExtent( context.dc, mpTrack.get(),
1260  &textWidth, &textHeight );
1261  result =
1262  GetTrackNameRect( mLeftOffset, rect, textWidth, textHeight );
1263  }
1264  }
1265  return result;
1266  }
1267 
1268  std::shared_ptr< Track > mpTrack;
1270  wxCoord mLeftOffset;
1271 };
1272 
1273 // n channels with vertical rulers, alternating with n - 1 resizers;
1274 // each channel-ruler pair might be divided into multiple views
1276  ChannelGroup( const std::shared_ptr< Track > &pTrack, wxCoord leftOffset )
1277  : mpTrack{ pTrack }, mLeftOffset{ leftOffset } {}
1278  Subdivision Children( const wxRect &rect_ ) override
1279  {
1280  auto rect = rect_;
1281  Refinement refinement;
1282 
1283  const auto channels = TrackList::Channels( mpTrack.get() );
1284  const auto pLast = *channels.rbegin();
1285  wxCoord yy = rect.GetTop();
1286  for ( auto channel : channels ) {
1287  auto &view = TrackView::Get( *channel );
1288  auto height = view.GetHeight();
1289  rect.SetTop( yy );
1290  rect.SetHeight( height - kSeparatorThickness );
1291  refinement.emplace_back( yy,
1292  std::make_shared< VRulersAndChannels >(
1293  channel->shared_from_this(),
1294  TrackView::Get( *channel ).GetSubViews( rect ),
1295  mLeftOffset ) );
1296  if ( channel != pLast ) {
1297  yy += height;
1298  refinement.emplace_back(
1299  yy - kSeparatorThickness,
1300  TrackPanelResizerCell::Get( *channel ).shared_from_this() );
1301  }
1302  }
1303 
1304  return { Axis::Y, std::move( refinement ) };
1305  }
1306  std::shared_ptr< Track > mpTrack;
1307  wxCoord mLeftOffset;
1308 };
1309 
1310 // A track control panel, left of n vertical rulers and n channels
1311 // alternating with n - 1 resizers
1314  const std::shared_ptr< Track > &pTrack, wxCoord leftOffset )
1315  : mpTrack{ pTrack }, mLeftOffset{ leftOffset } {}
1316  Subdivision Children( const wxRect &rect ) override
1317  { return { Axis::X, Refinement{
1318  { rect.GetLeft(),
1319  TrackControls::Get( *mpTrack ).shared_from_this() },
1320  { rect.GetLeft() + kTrackInfoWidth,
1321  std::make_shared< ChannelGroup >( mpTrack, mLeftOffset ) }
1322  } }; }
1323 
1324  // TrackPanelDrawable implementation
1326  const wxRect &rect, unsigned iPass ) override
1327  {
1328  if ( iPass == TrackArtist::PassBorders ) {
1329  auto &dc = context.dc;
1330  dc.SetBrush(*wxTRANSPARENT_BRUSH);
1331  dc.SetPen(*wxBLACK_PEN);
1332 
1333  // border
1334  dc.DrawRectangle(
1335  rect.x, rect.y,
1336  rect.width - kShadowThickness, rect.height - kShadowThickness
1337  );
1338 
1339  // shadow
1340  // Stroke lines along bottom and right, which are slightly short at
1341  // bottom-left and top-right
1342  const auto right = rect.GetRight();
1343  const auto bottom = rect.GetBottom();
1344 
1345  // bottom
1346  AColor::Line(dc, rect.x + 2, bottom, right, bottom);
1347  // right
1348  AColor::Line(dc, right, rect.y + 2, right, bottom);
1349  }
1350  if ( iPass == TrackArtist::PassFocus ) {
1351  // Sometimes highlight is not drawn on backing bitmap. I thought
1352  // it was because FindFocus did not return the TrackPanel on Mac, but
1353  // when I removed that test, yielding this condition:
1354  // if (GetFocusedTrack() != NULL) {
1355  // the highlight was reportedly drawn even when something else
1356  // was the focus and no highlight should be drawn. -RBD
1357  const auto artist = TrackArtist::Get( context );
1358  auto &trackPanel = *artist->parent;
1359  auto &trackFocus = TrackFocus::Get( *trackPanel.GetProject() );
1360  if (trackFocus.Get() == mpTrack.get() &&
1361  wxWindow::FindFocus() == &trackPanel ) {
1363  wxRect theRect = rect;
1364  auto &dc = context.dc;
1365  dc.SetBrush(*wxTRANSPARENT_BRUSH);
1366 
1367  AColor::TrackFocusPen( &dc, 2 );
1368  dc.DrawRectangle(theRect);
1369  theRect.Deflate(1);
1370 
1371  AColor::TrackFocusPen( &dc, 1 );
1372  dc.DrawRectangle(theRect);
1373  theRect.Deflate(1);
1374 
1375  AColor::TrackFocusPen( &dc, 0 );
1376  dc.DrawRectangle(theRect);
1377  }
1378  }
1379  }
1380 
1381  wxRect DrawingArea(
1383  const wxRect &rect, const wxRect &, unsigned iPass ) override
1384  {
1385  if ( iPass == TrackArtist::PassBorders )
1386  return {
1387  rect.x - kBorderThickness,
1388  rect.y - kBorderThickness,
1389  rect.width + 2 * kBorderThickness + kShadowThickness,
1390  rect.height + 2 * kBorderThickness + kShadowThickness
1391  };
1392  else if ( iPass == TrackArtist::PassFocus ) {
1393  constexpr auto extra = kBorderThickness + 3;
1394  return {
1395  rect.x - extra,
1396  rect.y - extra,
1397  rect.width + 2 * extra + kShadowThickness,
1398  rect.height + 2 * extra + kShadowThickness
1399  };
1400  }
1401  else
1402  return rect;
1403  }
1404 
1405  std::shared_ptr< Track > mpTrack;
1406  wxCoord mLeftOffset;
1407 };
1408 
1409 // Stacks a label and a single or multi-channel track on a resizer below,
1410 // which is associated with the last channel
1413  const std::shared_ptr< Track > &pTrack, wxCoord leftOffset )
1414  : mpTrack{ pTrack }, mLeftOffset{ leftOffset } {}
1415  Subdivision Children( const wxRect &rect ) override
1416  { return { Axis::Y, Refinement{
1417  { rect.GetTop(),
1418  std::make_shared< LabeledChannelGroup >( mpTrack, mLeftOffset ) },
1419  { rect.GetTop() + rect.GetHeight() - kSeparatorThickness,
1421  **TrackList::Channels( mpTrack.get() ).rbegin() ).shared_from_this()
1422  }
1423  } }; }
1424  std::shared_ptr< Track > mpTrack;
1425  wxCoord mLeftOffset;
1426 };
1427 
1428 // Stacks a dead area at top, the tracks, and the click-to-deselect area below
1429 struct Subgroup final : TrackPanelGroup {
1430  explicit Subgroup( TrackPanel &panel ) : mPanel{ panel } {}
1431  Subdivision Children( const wxRect &rect ) override
1432  {
1433  const auto &viewInfo = *mPanel.GetViewInfo();
1434  wxCoord yy = -viewInfo.vpos;
1435  Refinement refinement;
1436 
1437  auto &tracks = *mPanel.GetTracks();
1438  if ( tracks.Any() )
1439  refinement.emplace_back( yy, EmptyCell::Instance() ),
1440  yy += kTopMargin;
1441 
1442  for ( const auto leader : tracks.Leaders() ) {
1443  wxCoord height = 0;
1444  for ( auto channel : TrackList::Channels( leader ) ) {
1445  auto &view = TrackView::Get( *channel );
1446  height += view.GetHeight();
1447  }
1448  refinement.emplace_back( yy,
1449  std::make_shared< ResizingChannelGroup >(
1450  leader->SharedPointer(), viewInfo.GetLeftOffset() )
1451  );
1452  yy += height;
1453  }
1454 
1455  refinement.emplace_back( std::max( 0, yy ), mPanel.GetBackgroundCell() );
1456 
1457  return { Axis::Y, std::move( refinement ) };
1458  }
1460 };
1461 
1462 // Main group shaves off the left and right margins
1463 struct MainGroup final : TrackPanelGroup {
1464  explicit MainGroup( TrackPanel &panel ) : mPanel{ panel } {}
1465  Subdivision Children( const wxRect &rect ) override
1466  { return { Axis::X, Refinement{
1467  { 0, EmptyCell::Instance() },
1468  { kLeftMargin, std::make_shared< Subgroup >( mPanel ) },
1469  { rect.GetRight() + 1 - kRightMargin, EmptyCell::Instance() }
1470  } }; }
1472 };
1473 
1474 }
1475 
1476 std::shared_ptr<TrackPanelNode> TrackPanel::Root()
1477 {
1478  // Root and other subgroup objects are throwaways.
1479  // They might instead be cached to avoid repeated allocation.
1480  // That cache would need invalidation when there is addition, deletion, or
1481  // permutation of tracks, or change of width of the vertical rulers.
1482  return std::make_shared< MainGroup >( *this );
1483 }
1484 
1485 // This finds the rectangle of a given track (including all channels),
1486 // either that of the label 'adornment' or the track itself
1487 // The given track is assumed to be the first channel
1488 wxRect TrackPanel::FindTrackRect( const Track * target )
1489 {
1490  auto leader = *GetTracks()->FindLeader( target );
1491  if (!leader) {
1492  return { 0, 0, 0, 0 };
1493  }
1494 
1495  return CellularPanel::FindRect( [&] ( TrackPanelNode &node ) {
1496  if (auto pGroup = dynamic_cast<const LabeledChannelGroup*>( &node ))
1497  return pGroup->mpTrack.get() == leader;
1498  return false;
1499  } );
1500 }
1501 
1503 {
1504  auto pTrack = TrackFocus::Get( *GetProject() ).Get();
1505  return pTrack ? &TrackView::Get( *pTrack ) : nullptr;
1506 }
1507 
1509 {
1510  // This may have a side-effect of assigning a focus if there was none
1511  auto& trackFocus = TrackFocus::Get(*GetProject());
1512  trackFocus.Set(trackFocus.Get());
1514 }
1515 
1516 void TrackPanel::OnTrackFocusChange( wxCommandEvent &event )
1517 {
1518  event.Skip();
1519  auto cell = GetFocusedCell();
1520 
1521  if (cell) {
1522  Refresh( false );
1523  }
1524 }
1525 
1527  : mPanelRect {
1528  wxPoint{ 0, ViewInfo::Get( *project ).vpos },
1529  wxSize{
1530  ViewInfo::Get( *project ).GetTracksUsableWidth(),
1531  ViewInfo::Get( *project ).GetHeight()
1532  }
1533  }
1534 {}
1535 
1536 bool IsVisibleTrack::operator () (const Track *pTrack) const
1537 {
1538  // Need to return true if this track or a later channel intersects
1539  // the view
1540  return
1541  TrackList::Channels(pTrack).StartingWith(pTrack).any_of(
1542  [this]( const Track *pT ) {
1543  auto &view = TrackView::Get( *pT );
1544  wxRect r(0, view.GetY(), 1, view.GetHeight());
1545  return r.Intersects(mPanelRect);
1546  }
1547  );
1548 }
IsVisibleTrack::operator()
bool operator()(const Track *pTrack) const
Definition: TrackPanel.cpp:1536
WaveTrack.h
ZoomInfo::vpos
int vpos
Definition: ZoomInfo.h:58
TrackPanel::OnTrackListResizing
void OnTrackListResizing(TrackListEvent &event)
Definition: TrackPanel.cpp:664
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::ChannelGroup
ChannelGroup(const std::shared_ptr< Track > &pTrack, wxCoord leftOffset)
Definition: TrackPanel.cpp:1276
ProjectHistory::ModifyState
void ModifyState(bool bWantsAutoSave)
Definition: ProjectHistory.cpp:124
kLeftInset
@ kLeftInset
Definition: ZoomInfo.h:31
anonymous_namespace{TrackPanel.cpp}::MarginsY
@ MarginsY
Definition: TrackPanel.cpp:1027
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
RefreshCode::DrawOverlays
@ DrawOverlays
Definition: RefreshCode.h:32
RefreshCode::FixScrollbars
@ FixScrollbars
Definition: RefreshCode.h:27
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:156
anonymous_namespace{TrackPanel.cpp}::EmptyCell::Draw
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
Definition: TrackPanel.cpp:1173
AColor::UseThemeColour
static void UseThemeColour(wxDC *dc, int iBrush, int iPen=-1, int alpha=255)
Definition: AColor.cpp:283
TrackPanel::GetTracks
const TrackList * GetTracks() const
Definition: TrackPanel.h:150
TrackPanel::UpdateVRulerSize
void UpdateVRulerSize()
Definition: TrackPanel.cpp:919
TrackPanelGroup::Refinement
std::vector< Child > Refinement
Definition: TrackPanelCell.h:64
TrackPanelMouseEvent.h
TrackPanelGroup::Subdivision
std::pair< Axis, Refinement > Subdivision
Definition: TrackPanelCell.h:65
AColor::TrackPanelBackground
static void TrackPanelBackground(wxDC *dc, bool selected)
Definition: AColor.cpp:365
kBottomMargin
@ kBottomMargin
Definition: ViewInfo.h:106
AdornedRulerPanel::Refresh
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: AdornedRulerPanel.cpp:964
TrackPanel::DrawTracks
void DrawTracks(wxDC *dc)
Definition: TrackPanel.cpp:814
ProjectStatus.h
CellularPanel::HandleCursorForPresentMouseState
void HandleCursorForPresentMouseState(bool doHit=true)
Definition: CellularPanel.cpp:231
AColor::CursorColor
static void CursorColor(wxDC *dc)
Definition: AColor.cpp:374
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: TrackPanel.cpp:245
AdornedRulerPanel
This is an Audacity Specific ruler panel which additionally has border, selection markers,...
Definition: AdornedRulerPanel.h:28
PlayableTrack::GetSolo
bool GetSolo() const
Definition: Track.h:844
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:51
TrackVRulerControls.h
TrackPanelListener::TP_RedrawScrollbars
virtual void TP_RedrawScrollbars()=0
anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup
Definition: TrackPanel.cpp:1312
ToolCodes::drawTool
@ drawTool
Definition: ProjectSettings.h:37
RefreshCode::RefreshAll
@ RefreshAll
Definition: RefreshCode.h:26
ZoomInfo::GetVRulerOffset
int GetVRulerOffset() const
Definition: ZoomInfo.h:100
TrackArtist::NPasses
@ NPasses
Definition: TrackArtist.h:72
TrackView::Get
static TrackView & Get(Track &)
Definition: TrackView.cpp:63
TrackPanel::UpdateVRuler
void UpdateVRuler(Track *t)
Definition: TrackPanel.cpp:872
TrackArtist.h
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
TrackFocus
Definition: TrackPanelAx.h:161
AllThemeResources.h
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mRefinement
TrackView::Refinement mRefinement
Definition: TrackPanel.cpp:1269
TrackView.h
TrackPanel::GetBackgroundCell
std::shared_ptr< TrackPanelCell > GetBackgroundCell()
Definition: TrackPanel.cpp:859
anonymous_namespace{TrackPanel.cpp}::Subgroup::Subgroup
Subgroup(TrackPanel &panel)
Definition: TrackPanel.cpp:1430
TrackList::Lock
std::shared_ptr< Subclass > Lock(const std::weak_ptr< Subclass > &wTrack)
Definition: Track.h:1523
Track::GetName
wxString GetName() const
Definition: Track.h:409
ZoomInfo::GetDefaultZoom
static double GetDefaultZoom()
Definition: ZoomInfo.h:121
Project.h
TrackPanel::OnIdle
void OnIdle(wxIdleEvent &event)
Definition: TrackPanel.cpp:372
Track::EnsureVisible
void EnsureVisible(bool modifyState=false)
Definition: Track.cpp:101
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
TrackControls::Get
static TrackControls & Get(Track &track)
Definition: TrackControls.cpp:25
anonymous_namespace{TrackPanel.cpp}::ResizingChannelGroup::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1425
TrackArtist::PassBorders
@ PassBorders
Definition: TrackArtist.h:65
KeyboardCapture.h
TrackPanelDrawingContext
Definition: TrackPanelDrawingContext.h:22
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1467
MakeCursor
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
Definition: TrackPanel.cpp:177
TrackView::Refinement
std::vector< std::pair< wxCoord, std::shared_ptr< TrackView > > > Refinement
Definition: TrackView.h:73
AColor::Line
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:112
TrackPanel.h
IsVisibleTrack::IsVisibleTrack
IsVisibleTrack(AudacityProject *project)
Definition: TrackPanel.cpp:1526
ViewInfo
Definition: ViewInfo.h:172
kBorderThickness
@ kBorderThickness
Definition: ZoomInfo.h:28
anonymous_namespace{TrackPanel.cpp}::DisplaceX
@ DisplaceX
Definition: TrackPanel.cpp:1023
anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::Draw
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
Definition: TrackPanel.cpp:1325
TrackPanelAx.h
AColor::TrackFocusPen
static void TrackFocusPen(wxDC *dc, int level)
Definition: AColor.cpp:400
kShadowThickness
@ kShadowThickness
Definition: ZoomInfo.h:29
TrackPanel::Get
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:222
TrackView::GetTrackHeight
static int GetTrackHeight(const Track *pTrack)
Definition: TrackView.cpp:29
XO
#define XO(s)
Definition: Internat.h:31
TrackPanel::OnKeyDown
void OnKeyDown(wxKeyEvent &event)
Definition: TrackPanel.cpp:695
ProjectSettings::Get
static ProjectSettings & Get(AudacityProject &project)
Definition: ProjectSettings.cpp:40
TrackPanel::FindTrackRect
wxRect FindTrackRect(const Track *target)
Definition: TrackPanel.cpp:1488
TrackPanel::GetMostRecentXPos
double GetMostRecentXPos()
Definition: TrackPanel.cpp:744
TrackPanel::AudacityTimer::parent
TrackPanel * parent
Definition: TrackPanel.h:190
anonymous_namespace{TrackPanel.cpp}::Subgroup
Definition: TrackPanel.cpp:1429
TrackPanelDrawingContext::dc
wxDC & dc
Definition: TrackPanelDrawingContext.h:23
ZoomInfo::SetVRulerWidth
void SetVRulerWidth(int width)
Definition: ZoomInfo.h:99
kRightInset
@ kRightInset
Definition: ZoomInfo.h:32
ProjectSettings.h
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:532
ZoomInfo::GetVRulerWidth
int GetVRulerWidth() const
Definition: ZoomInfo.h:98
CellularPanel::FindRect
wxRect FindRect(const TrackPanelCell &cell)
Definition: CellularPanel.cpp:1068
anonymous_namespace{TrackPanel.cpp}::MarginX
@ MarginX
Definition: TrackPanel.cpp:1025
ProjectAudioManager.h
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:23
TrackPanel::UpdateViewIfNoTracks
void UpdateViewIfNoTracks()
Definition: TrackPanel.cpp:640
TrackPanel::MakeParentRedrawScrollbars
void MakeParentRedrawScrollbars()
Definition: TrackPanel.cpp:519
TrackPanel::OnMouseEvent
void OnMouseEvent(wxMouseEvent &event)
Definition: TrackPanel.cpp:715
anonymous_namespace{TrackPanel.cpp}::VRulerAndChannel
Definition: TrackPanel.cpp:1188
anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler
Ruler & ruler()
Definition: TimeTrackVRulerControls.cpp:34
kTopMargin
@ kTopMargin
Definition: ViewInfo.h:105
TrackPanel
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:64
TrackList::SelectedLeaders
auto SelectedLeaders() -> TrackIterRange< TrackType >
Definition: Track.h:1405
anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1405
ClientData::Site::RegisteredFactory
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
Definition: ClientData.h:266
RefreshCode::EnsureVisible
@ EnsureVisible
Definition: RefreshCode.h:31
ProjectAudioIO::IsAudioActive
bool IsAudioActive() const
Definition: ProjectAudioIO.cpp:52
TrackPanel::ProcessUIHandleResult
void ProcessUIHandleResult(TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell, unsigned refreshResult) override
Definition: TrackPanel.cpp:534
TrackPanelListener::TP_ScrollUpDown
virtual bool TP_ScrollUpDown(int delta)=0
anonymous_namespace{TrackPanel.cpp}::EmptyCell::DoFindTrack
virtual std::shared_ptr< Track > DoFindTrack() override
Definition: TrackPanel.cpp:1165
anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::LabeledChannelGroup
LabeledChannelGroup(const std::shared_ptr< Track > &pTrack, wxCoord leftOffset)
Definition: TrackPanel.cpp:1313
anonymous_namespace{TrackPanel.cpp}::EmptyCell::HitTest
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &, const AudacityProject *) override
Definition: TrackPanel.cpp:1162
TrackPanel::GetSelectedTrackCount
size_t GetSelectedTrackCount() const
Definition: TrackPanel.cpp:635
TrackPanel::GetProject
AudacityProject * GetProject() const override
Definition: TrackPanel.cpp:344
ZoomInfo::GetLeftOffset
int GetLeftOffset() const
Definition: ZoomInfo.h:102
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::DrawingArea
wxRect DrawingArea(TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
Definition: TrackPanel.cpp:1251
TrackPanel::mpBackground
std::shared_ptr< TrackPanelCell > mpBackground
Definition: TrackPanel.h:204
TrackPanel::UpdatePrefs
void UpdatePrefs() override
Definition: TrackPanel.cpp:333
anonymous_namespace{TrackPanel.cpp}::MainGroup::MainGroup
MainGroup(TrackPanel &panel)
Definition: TrackPanel.cpp:1464
ViewInfo::scrollStep
int scrollStep
Definition: ViewInfo.h:217
TrackPanel::UpdateSelectionDisplay
void UpdateSelectionDisplay()
Definition: TrackPanel.cpp:624
TrackPanel::OnTrackListDeletion
void OnTrackListDeletion(wxEvent &event)
Definition: TrackPanel.cpp:678
ProjectSettings::EventCode
EventCode
Definition: ProjectSettings.h:59
anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::Children
Subdivision Children(const wxRect &rect) override
Definition: TrackPanel.cpp:1316
TrackPanel::GetFocusedCell
TrackPanelCell * GetFocusedCell() override
Definition: TrackPanel.cpp:1502
BackedPanel::GetBackingDCForRepaint
wxDC & GetBackingDCForRepaint()
Definition: BackedPanel.cpp:35
ProjectSettings::ChangedSyncLock
@ ChangedSyncLock
Definition: ProjectSettings.h:60
AdornedRulerPanel::Get
static AdornedRulerPanel & Get(AudacityProject &project)
Definition: AdornedRulerPanel.cpp:873
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:648
ProjectStatus::Set
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
Definition: ProjectStatus.cpp:65
Track::SubstitutePendingChangedTrack
std::shared_ptr< Track > SubstitutePendingChangedTrack()
Definition: Track.cpp:1186
anonymous_namespace{TrackPanel.cpp}::EmptyCell
Definition: TrackPanel.cpp:1161
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:199
TrackArtist::Get
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:75
CellularPanel::MostRecentXCoord
wxCoord MostRecentXCoord() const
Definition: CellularPanel.cpp:1106
TrackFocus::Get
static TrackFocus & Get(AudacityProject &project)
Definition: TrackPanelAx.cpp:736
TrackPanel::OnProjectSettingsChange
void OnProjectSettingsChange(wxCommandEvent &event)
Definition: TrackPanel.cpp:448
ToolCodes::multiTool
@ multiTool
Definition: ProjectSettings.h:40
CellularPanel::HasEscape
bool HasEscape()
Definition: CellularPanel.cpp:420
TrackListEvent
Notification of changes in individual tracks of TrackList, or of TrackList's composition.
Definition: Track.h:1205
anonymous_namespace{TrackPanel.cpp}::EmptyCell::Instance
static std::shared_ptr< EmptyCell > Instance()
Definition: TrackPanel.cpp:1166
TrackPanel::OnSize
void OnSize(wxSizeEvent &)
Definition: TrackPanel.cpp:364
ZoomInfo::SetZoom
void SetZoom(double pixelsPerSecond)
Definition: ZoomInfo.cpp:88
anonymous_namespace{TrackPanel.cpp}::DisplaceY
@ DisplaceY
Definition: TrackPanel.cpp:1023
TrackPanel::mLastDrawnSelectedRegion
SelectedRegion mLastDrawnSelectedRegion
Definition: TrackPanel.h:200
kTopInset
@ kTopInset
Definition: ViewInfo.h:104
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
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: Project.cpp:186
anonymous_namespace{TrackPanel.cpp}::MainGroup
Definition: TrackPanel.cpp:1463
UIHandle::Result
unsigned Result
Definition: UIHandle.h:37
Theme.h
AdornedRulerPanel::DrawSelection
void DrawSelection()
Definition: AdornedRulerPanel.cpp:2084
anonymous_namespace{TrackPanel.cpp}::ResizingChannelGroup::ResizingChannelGroup
ResizingChannelGroup(const std::shared_ptr< Track > &pTrack, wxCoord leftOffset)
Definition: TrackPanel.cpp:1412
KeyboardCapture::Capture
void Capture(wxWindow *handler)
Definition: KeyboardCapture.cpp:69
TrackVRulerControls::Get
static TrackVRulerControls & Get(TrackView &)
Definition: TrackVRulerControls.cpp:36
name
const TranslatableString name
Definition: Distortion.cpp:98
IsVisibleTrack::mPanelRect
wxRect mPanelRect
Definition: TrackPanel.h:222
RefreshCode::Resize
@ Resize
Definition: RefreshCode.h:28
TrackPanelCell
Definition: TrackPanelCell.h:74
@0::kTimerInterval
@ kTimerInterval
ZoomInfo::GetScreenEndTime
double GetScreenEndTime() const
Definition: ZoomInfo.h:112
TrackControls.h
TrackArtist::PassControls
@ PassControls
Definition: TrackArtist.h:66
AdornedRulerPanel::SetLeftOffset
void SetLeftOffset(int offset)
Definition: AdornedRulerPanel.cpp:2111
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1268
CellularPanel::Target
UIHandlePtr Target()
Definition: CellularPanel.cpp:1097
UndoManager.h
TrackFocus::Get
Track * Get()
Definition: TrackPanelAx.cpp:755
RefreshCode::UpdateVRuler
@ UpdateVRuler
Definition: RefreshCode.h:30
TrackPanel::OnTimer
void OnTimer(wxTimerEvent &event)
AS: This gets called on our wx timer events.
Definition: TrackPanel.cpp:393
TrackPanel::SetFocusedCell
void SetFocusedCell() override
Definition: TrackPanel.cpp:1508
TrackPanel::mTimer
TrackPanel::AudacityTimer mTimer
RefreshCode::RefreshCell
@ RefreshCell
Definition: RefreshCode.h:24
TrackPanel::mRuler
AdornedRulerPanel * mRuler
Definition: TrackPanel.h:173
TrackPanelGroup
Definition: TrackPanelCell.h:47
anonymous_namespace{TrackPanel.cpp}::VRulerAndChannel::mpView
std::shared_ptr< TrackView > mpView
Definition: TrackPanel.cpp:1200
TrackPanel::Root
std::shared_ptr< TrackPanelNode > Root() override
Definition: TrackPanel.cpp:1476
anonymous_namespace{TrackPanel.cpp}::FindTrack
std::shared_ptr< Track > FindTrack(TrackPanelCell *pCell)
Definition: TrackPanel.cpp:525
TrackVRulerControls::UpdateRuler
virtual void UpdateRuler(const wxRect &rect)=0
PlayableTrack
AudioTrack subclass that can also be audibly replayed by the program.
Definition: Track.h:837
RefreshCode::RefreshLatestCell
@ RefreshLatestCell
Definition: RefreshCode.h:25
anonymous_namespace{TrackPanel.cpp}::VRulerAndChannel::VRulerAndChannel
VRulerAndChannel(const std::shared_ptr< TrackView > &pView, wxCoord leftOffset)
Definition: TrackPanel.cpp:1189
anonymous_namespace{TrackPanel.cpp}::VRulerAndChannel::Children
Subdivision Children(const wxRect &rect) override
Definition: TrackPanel.cpp:1192
TrackPanel::OnPaint
void OnPaint(wxPaintEvent &event)
Definition: TrackPanel.cpp:469
anonymous_namespace{TrackPanel.cpp}::MarginsX
@ MarginsX
Definition: TrackPanel.cpp:1027
TrackPanel::HandlePageUpKey
void HandlePageUpKey()
Definition: TrackPanel.cpp:599
kSeparatorThickness
@ kSeparatorThickness
Definition: ViewInfo.h:107
TrackList::UpdatePendingTracks
void UpdatePendingTracks()
Definition: Track.cpp:1060
CellularPanel::Draw
void Draw(TrackPanelDrawingContext &context, unsigned nPasses)
Definition: CellularPanel.cpp:1129
anonymous_namespace{TrackPanel.cpp}::GetTrackNameExtent
void GetTrackNameExtent(wxDC &dc, const Track *t, wxCoord *pW, wxCoord *pH)
Definition: TrackPanel.cpp:1030
RefreshCode::DestroyedCell
@ DestroyedCell
Definition: RefreshCode.h:34
anonymous_namespace{TrackPanel.cpp}::VRulerAndChannel::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1201
anonymous_namespace{TrackPanel.cpp}::sKey
AudacityProject::AttachedWindows::RegisteredFactory sKey
Definition: TrackPanel.cpp:198
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1270
id
int id
Definition: WaveTrackControls.cpp:589
TrackPanel::mListener
TrackPanelListener * mListener
Definition: TrackPanel.h:169
TrackPanelDrawingContext.h
TrackPanel::UpdateVRulers
void UpdateVRulers()
Definition: TrackPanel.cpp:864
TrackPanel::UpdateStatusMessage
void UpdateStatusMessage(const TranslatableString &status) override
Definition: TrackPanel.cpp:615
wxPanelWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:61
anonymous_namespace{TrackPanel.cpp}::DrawTrackName
void DrawTrackName(int leftOffset, TrackPanelDrawingContext &context, const Track *t, const wxRect &rect)
Definition: TrackPanel.cpp:1051
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:495
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:238
Track::IsLeader
bool IsLeader() const
Definition: Track.cpp:370
ToolCodes::envelopeTool
@ envelopeTool
Definition: ProjectSettings.h:36
anonymous_namespace{TrackPanel.cpp}::Subgroup::Children
Subdivision Children(const wxRect &rect) override
Definition: TrackPanel.cpp:1431
TrackPanelResizeHandle.h
anonymous_namespace{TrackPanel.cpp}::MainGroup::mPanel
TrackPanel & mPanel
Definition: TrackPanel.cpp:1471
AudioIO.h
anonymous_namespace{TrackPanel.cpp}::ChannelGroup
Definition: TrackPanel.cpp:1275
ProjectStatus::Get
static ProjectStatus & Get(AudacityProject &project)
Definition: ProjectStatus.cpp:23
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1306
TrackPanel::Refresh
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: TrackPanel.cpp:781
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
TrackPanel::mRefreshBacking
bool mRefreshBacking
Definition: TrackPanel.h:195
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels
Definition: TrackPanel.cpp:1206
CellularPanel
Formerly part of TrackPanel, this abstract base class has no special knowledge of Track objects and i...
Definition: CellularPanel.h:34
TrackView::GetSubViews
virtual Refinement GetSubViews(const wxRect &rect)
Definition: TrackView.cpp:116
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::Children
Subdivision Children(const wxRect &rect) override
Definition: TrackPanel.cpp:1213
anonymous_namespace{TrackPanel.cpp}::MainGroup::Children
Subdivision Children(const wxRect &rect) override
Definition: TrackPanel.cpp:1465
TrackPanel::mTrackArtist
std::unique_ptr< TrackArtist > mTrackArtist
Definition: TrackPanel.h:175
AdornedRulerPanel.h
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::VRulersAndChannels
VRulersAndChannels(const std::shared_ptr< Track > &pTrack, TrackView::Refinement refinement, wxCoord leftOffset)
Definition: TrackPanel.cpp:1207
TrackPanelMouseState
Definition: TrackPanelMouseEvent.h:28
ProjectHistory.h
TrackPanel::OnTrackMenu
void OnTrackMenu(Track *t=NULL)
Definition: TrackPanel.cpp:937
CellularPanel::mLastMouseState
wxMouseState mLastMouseState
Definition: CellularPanel.h:164
ViewInfo::SetHeight
void SetHeight(int height)
Definition: ViewInfo.h:182
ThemeBase::Colour
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1193
anonymous_namespace{TrackPanel.cpp}::MarginY
@ MarginY
Definition: TrackPanel.cpp:1025
TrackPanel::OnAudioIO
void OnAudioIO(wxCommandEvent &evt)
Definition: TrackPanel.cpp:802
TrackPanel::SetBackgroundCell
void SetBackgroundCell(const std::shared_ptr< TrackPanelCell > &pCell)
Definition: TrackPanel.cpp:854
RefreshCode.h
TrackPanel::OnEnsureVisible
void OnEnsureVisible(TrackListEvent &event)
Definition: TrackPanel.cpp:943
kRightMargin
@ kRightMargin
Definition: ZoomInfo.h:34
OverlayPanel::DrawOverlays
void DrawOverlays(bool repaint_all, wxDC *pDC=nullptr)
Definition: OverlayPanel.cpp:43
TrackPanel::OnTrackFocusChange
void OnTrackFocusChange(wxCommandEvent &event)
Definition: TrackPanel.cpp:1516
CellularPanel::DoContextMenu
void DoContextMenu(TrackPanelCell *pCell=nullptr)
Definition: CellularPanel.cpp:876
ZoomInfo::GetLabelWidth
int GetLabelWidth() const
Definition: ZoomInfo.h:101
TrackView::GetChannelGroupHeight
static int GetChannelGroupHeight(const Track *pTrack)
Definition: TrackView.cpp:34
anonymous_namespace{TrackPanel.cpp}::ResizingChannelGroup
Definition: TrackPanel.cpp:1411
theTheme
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:202
Prefs.h
TrackListEvent::mpTrack
std::weak_ptr< Track > mpTrack
Definition: Track.h:1221
anonymous_namespace{TrackPanel.cpp}::GetTrackNameRect
wxRect GetTrackNameRect(int leftOffset, const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight)
Definition: TrackPanel.cpp:1038
ProjectWindow.h
TrackPanel::mTracks
std::shared_ptr< TrackList > mTracks
Definition: TrackPanel.h:171
TrackArtist::PassMargins
@ PassMargins
Definition: TrackArtist.h:64
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1307
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1354
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::Draw
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
Definition: TrackPanel.cpp:1227
anonymous_namespace{TrackPanel.cpp}::Subgroup::mPanel
TrackPanel & mPanel
Definition: TrackPanel.cpp:1459
CommonTrackPanelCell
Definition: CommonTrackPanelCell.h:26
TranslatableString::Join
TranslatableString & Join(TranslatableString arg, const wxString &separator={}) &
Append another translatable string.
Definition: TranslatableString.cpp:124
ZoomInfo::GetTracksUsableWidth
int GetTracksUsableWidth() const
Definition: ZoomInfo.h:104
TrackPanel::OnUndoReset
void OnUndoReset(wxCommandEvent &event)
Definition: TrackPanel.cpp:460
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:505
safenew
#define safenew
Definition: MemoryX.h:10
settings
static Settings & settings()
Definition: TrackInfo.cpp:87
RefreshCode
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16
float_cast.h
AColor.h
kTrackInfoWidth
@ kTrackInfoWidth
Definition: ZoomInfo.h:36
ViewInfo::GetHeight
int GetHeight() const
Definition: ViewInfo.h:181
within
bool within(A a, B b, DIST d)
Definition: TrackPanel.cpp:158
TrackPanel::HandlePageDownKey
void HandlePageDownKey()
Definition: TrackPanel.cpp:604
TrackPanelResizerCell.h
END_EVENT_TABLE
END_EVENT_TABLE()
CellularPanel::FindCell
FoundCell FindCell(int mouseX, int mouseY)
Definition: CellularPanel.cpp:1029
ProjectAudioIO.h
TrackPanel::Destroy
static void Destroy(AudacityProject &project)
Definition: TrackPanel.cpp:232
TrackPanel::mTimeCount
int mTimeCount
Definition: TrackPanel.h:193
TrackPanel::RefreshTrack
void RefreshTrack(Track *trk, bool refreshbacking=true)
Definition: TrackPanel.cpp:750
TrackPanel::VerticalScroll
void VerticalScroll(float fracPosition)
Definition: TrackPanel.cpp:989
ProjectHistory::Get
static ProjectHistory & Get(AudacityProject &project)
Definition: ProjectHistory.cpp:26
TrackArtist::PassFocus
@ PassFocus
Definition: TrackArtist.h:69
TrackPanelResizerCell::Get
static TrackPanelResizerCell & Get(Track &track)
Definition: TrackPanelResizerCell.cpp:119
ZoomInfo::h
double h
Definition: ZoomInfo.h:60
kLeftMargin
@ kLeftMargin
Definition: ZoomInfo.h:33
TrackPanel::IsAudioActive
bool IsAudioActive()
Definition: TrackPanel.cpp:609
ZoomInfo::PositionToTime
double PositionToTime(wxInt64 position, wxInt64 origin=0, bool ignoreFisheye=false) const
Definition: ZoomInfo.cpp:43
anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::DrawingArea
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &, unsigned iPass) override
Definition: TrackPanel.cpp:1381
TrackView::GetHeight
int GetHeight() const
Definition: TrackView.cpp:149
anonymous_namespace{TrackPanel.cpp}::ResizingChannelGroup::Children
Subdivision Children(const wxRect &rect) override
Definition: TrackPanel.cpp:1415
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::Children
Subdivision Children(const wxRect &rect_) override
Definition: TrackPanel.cpp:1278
TrackPanel::UpdateTrackVRuler
void UpdateTrackVRuler(Track *t)
Definition: TrackPanel.cpp:880
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:38
ZoomInfo::SetWidth
void SetWidth(int width)
Definition: ZoomInfo.h:96
Track::vrulerSize
wxSize vrulerSize
Definition: Track.h:342
anonymous_namespace{TrackPanel.cpp}::ResizingChannelGroup::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1424
anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1406