Audacity  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WaveTrackControls Class Referencefinal

#include <WaveTrackControls.h>

Inheritance diagram for WaveTrackControls:
TrackControls CommonTrackPanelCell TrackPanelCell

Public Member Functions

 WaveTrackControls (std::shared_ptr< Track > pTrack)
 
 ~WaveTrackControls ()
 
std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject) override
 
PopupMenuTableGetMenuExtension (Track *pTrack) override
 
- Public Member Functions inherited from TrackControls
 TrackControls (std::shared_ptr< Track > pTrack)
 
virtual ~TrackControls ()=0
 
std::shared_ptr< TrackFindTrack () override
 
- Public Member Functions inherited from CommonTrackPanelCell
 CommonTrackPanelCell ()
 
virtual ~CommonTrackPanelCell ()=0
 
- Public Member Functions inherited from TrackPanelCell
virtual ~TrackPanelCell ()=0
 
virtual unsigned CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 

Private Member Functions

 WaveTrackControls (const WaveTrackControls &)=delete
 
WaveTrackControlsoperator= (const WaveTrackControls &)=delete
 

Private Attributes

std::weak_ptr< MuteButtonHandlemMuteHandle
 
std::weak_ptr< SoloButtonHandlemSoloHandle
 
std::weak_ptr< GainSliderHandlemGainHandle
 
std::weak_ptr< PanSliderHandlemPanHandle
 

Additional Inherited Members

- Protected Member Functions inherited from TrackControls
unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, wxPoint *pPosition) override
 
TrackGetTrack () const
 
- Protected Member Functions inherited from CommonTrackPanelCell
unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
- Protected Attributes inherited from TrackControls
std::weak_ptr< TrackmwTrack
 
std::weak_ptr< CloseButtonHandlemCloseHandle
 
std::weak_ptr< MenuButtonHandlemMenuHandle
 
std::weak_ptr
< MinimizeButtonHandle
mMinimizeHandle
 
std::weak_ptr< TrackSelectHandlemSelectHandle
 

Detailed Description

Definition at line 21 of file WaveTrackControls.h.

Constructor & Destructor Documentation

WaveTrackControls::WaveTrackControls ( const WaveTrackControls )
privatedelete
WaveTrackControls::WaveTrackControls ( std::shared_ptr< Track pTrack)
inlineexplicit

Definition at line 28 of file WaveTrackControls.h.

29  : TrackControls( pTrack ) {}
TrackControls(std::shared_ptr< Track > pTrack)
WaveTrackControls::~WaveTrackControls ( )

Definition at line 52 of file WaveTrackControls.cpp.

53 {
54 }

Member Function Documentation

PopupMenuTable * WaveTrackControls::GetMenuExtension ( Track pTrack)
overridevirtual

Implements TrackControls.

Definition at line 1015 of file WaveTrackControls.cpp.

References WaveTrackMenuTable::Instance().

1016 {
1017 
1018  WaveTrackMenuTable & result = WaveTrackMenuTable::Instance( pTrack );
1019  return &result;
1020 }
static WaveTrackMenuTable & Instance(Track *pTrack)
std::vector< UIHandlePtr > WaveTrackControls::HitTest ( const TrackPanelMouseState state,
const AudacityProject pProject 
)
overridevirtual

Implements TrackControls.

Definition at line 58 of file WaveTrackControls.cpp.

References MuteButtonHandle::HitTest(), GainSliderHandle::HitTest(), TrackControls::HitTest(), SoloButtonHandle::HitTest(), PanSliderHandle::HitTest(), TrackPanelMouseState::rect, and TrackPanelMouseState::state.

60 {
61  // Hits are mutually exclusive, results single
62  const wxMouseState &state = st.state;
63  const wxRect &rect = st.rect;
64  if (state.ButtonIsDown(wxMOUSE_BTN_LEFT)) {
65  auto track = FindTrack();
66  std::vector<UIHandlePtr> results;
67  auto result = [&]{
68  UIHandlePtr result;
69  if (NULL != (result = MuteButtonHandle::HitTest(
70  mMuteHandle, state, rect, pProject, track)))
71  return result;
72 
73  if (NULL != (result = SoloButtonHandle::HitTest(
74  mSoloHandle, state, rect, pProject, track)))
75  return result;
76 
77  if (NULL != (result = GainSliderHandle::HitTest(
78  mGainHandle, state, rect, track)))
79  return result;
80 
81  if (NULL != (result = PanSliderHandle::HitTest(
82  mPanHandle, state, rect, track)))
83  return result;
84 
85  return result;
86  }();
87  if (result) {
88  results.push_back(result);
89  return results;
90  }
91  }
92 
93  return TrackControls::HitTest(st, pProject);
94 }
static UIHandlePtr HitTest(std::weak_ptr< SoloButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< Track > &pTrack)
virtual std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *) override=0
std::weak_ptr< GainSliderHandle > mGainHandle
std::shared_ptr< Track > FindTrack() override
std::weak_ptr< MuteButtonHandle > mMuteHandle
std::weak_ptr< SoloButtonHandle > mSoloHandle
std::shared_ptr< UIHandle > UIHandlePtr
Definition: TrackPanel.h:59
static UIHandlePtr HitTest(std::weak_ptr< GainSliderHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
static UIHandlePtr HitTest(std::weak_ptr< MuteButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< Track > &pTrack)
std::weak_ptr< PanSliderHandle > mPanHandle
static UIHandlePtr HitTest(std::weak_ptr< PanSliderHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
WaveTrackControls& WaveTrackControls::operator= ( const WaveTrackControls )
privatedelete

Member Data Documentation

std::weak_ptr<GainSliderHandle> WaveTrackControls::mGainHandle
private

Definition at line 41 of file WaveTrackControls.h.

std::weak_ptr<MuteButtonHandle> WaveTrackControls::mMuteHandle
private

Definition at line 39 of file WaveTrackControls.h.

std::weak_ptr<PanSliderHandle> WaveTrackControls::mPanHandle
private

Definition at line 42 of file WaveTrackControls.h.

std::weak_ptr<SoloButtonHandle> WaveTrackControls::mSoloHandle
private

Definition at line 40 of file WaveTrackControls.h.


The documentation for this class was generated from the following files: