Audacity  3.0.3
Functions
anonymous_namespace{NoteTrackControls.cpp} Namespace Reference

Functions

void GetMidiControlsHorizontalBounds (const wxRect &rect, wxRect &dest)
 
void SliderDrawFunction (LWSlider *(*Selector)(const wxRect &sliderRect, const NoteTrack *t, bool captured, wxWindow *), wxDC *dc, const wxRect &rect, const Track *pTrack, wxWindow *pParent, bool captured, bool highlight)
 
void MidiControlsDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 

Function Documentation

◆ GetMidiControlsHorizontalBounds()

void anonymous_namespace{NoteTrackControls.cpp}::GetMidiControlsHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)

Definition at line 164 of file NoteTrackControls.cpp.

165 {
166  dest.x = rect.x + 1; // To center slightly
167  // PRL: TODO: kMidiCellWidth is defined in terms of the other constant
168  // kTrackInfoWidth but I am trying to avoid use of that constant.
169  // Can cell width be computed from dest.width instead?
170  dest.width = kMidiCellWidth * 4;
171 }

References kMidiCellWidth.

Referenced by NoteTrackControls::GetMidiControlsRect(), and MidiControlsDrawFunction().

Here is the caller graph for this function:

◆ MidiControlsDrawFunction()

void anonymous_namespace{NoteTrackControls.cpp}::MidiControlsDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)

Definition at line 205 of file NoteTrackControls.cpp.

208 {
209  auto target = dynamic_cast<NoteTrackButtonHandle*>( context.target.get() );
210  bool hit = target && target->GetTrack().get() == pTrack;
211  auto channel = hit ? target->GetChannel() : -1;
212  auto &dc = context.dc;
213  wxRect midiRect = rect;
214  GetMidiControlsHorizontalBounds(rect, midiRect);
216  ( static_cast<const NoteTrack *>(pTrack), dc, midiRect, channel );
217 }

References TrackPanelDrawingContext::dc, NoteTrack::DrawLabelControls(), Track::GetChannel(), GetMidiControlsHorizontalBounds(), NoteTrackButtonHandle::GetTrack(), and TrackPanelDrawingContext::target.

Referenced by NoteTrackTCPLines::NoteTrackTCPLines().

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

◆ SliderDrawFunction()

void anonymous_namespace{NoteTrackControls.cpp}::SliderDrawFunction ( LWSlider *(*)(const wxRect &sliderRect, const NoteTrack *t, bool captured, wxWindow *)  Selector,
wxDC *  dc,
const wxRect &  rect,
const Track pTrack,
wxWindow *  pParent,
bool  captured,
bool  highlight 
)

Definition at line 173 of file NoteTrackControls.cpp.

179 {
180  wxRect sliderRect = rect;
181  TrackInfo::GetSliderHorizontalBounds( rect.GetTopLeft(), sliderRect );
182  auto nt = static_cast<const NoteTrack*>( pTrack );
183  Selector( sliderRect, nt, captured, pParent )->OnPaint(*dc, highlight);
184 }

References TrackInfo::GetSliderHorizontalBounds().

Here is the call graph for this function:
NoteTrack::DrawLabelControls
static void DrawLabelControls(const NoteTrack *pTrack, wxDC &dc, const wxRect &rect, int highlightedChannel=-1)
Definition: NoteTrack.cpp:262
TrackPanelDrawingContext::dc
wxDC & dc
Definition: TrackPanelDrawingContext.h:23
NoteTrackButtonHandle::GetTrack
std::shared_ptr< NoteTrack > GetTrack() const
Definition: NoteTrackButtonHandle.h:41
LWSlider::OnPaint
void OnPaint(wxDC &dc, bool highlighted)
Definition: ASlider.cpp:674
kMidiCellWidth
@ kMidiCellWidth
Definition: NoteTrackControls.cpp:155
Track::GetChannel
virtual ChannelType GetChannel() const
Definition: Track.h:438
TrackPanelDrawingContext::target
UIHandlePtr target
Definition: TrackPanelDrawingContext.h:24
TrackInfo::GetSliderHorizontalBounds
AUDACITY_DLL_API void GetSliderHorizontalBounds(const wxPoint &topleft, wxRect &dest)
Definition: TrackInfo.cpp:488
NoteTrackButtonHandle
Definition: NoteTrackButtonHandle.h:22
anonymous_namespace{NoteTrackControls.cpp}::GetMidiControlsHorizontalBounds
void GetMidiControlsHorizontalBounds(const wxRect &rect, wxRect &dest)
Definition: NoteTrackControls.cpp:164
NoteTrack
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:67