Audacity 3.2.0
Functions
NoteTrackButtonHandle.cpp File Reference
#include "NoteTrackButtonHandle.h"
#include "../../../../HitTestResult.h"
#include "NoteTrackControls.h"
#include "../../../../TrackPanelMouseEvent.h"
#include "NoteTrack.h"
#include "ProjectHistory.h"
#include "../../../../RefreshCode.h"
#include "../../../ui/CommonTrackInfo.h"
#include <wx/event.h>
Include dependency graph for NoteTrackButtonHandle.cpp:

Go to the source code of this file.

Functions

static int FindChannelNumber (const wxRect &rect, int mx, int my)
 
static bool LabelClick (NoteTrack &track, const wxRect &rect, int mx, int my, bool right)
 

Function Documentation

◆ FindChannelNumber()

static int FindChannelNumber ( const wxRect &  rect,
int  mx,
int  my 
)
static

Definition at line 58 of file NoteTrackButtonHandle.cpp.

59{
60 wxASSERT_MSG(rect.width % 4 == 0, "Midi channel control rect width must be divisible by 4");
61 wxASSERT_MSG(rect.height % 4 == 0, "Midi channel control rect height must be divisible by 4");
62
63 auto cellWidth = rect.width / 4;
64 auto cellHeight = rect.height / 4;
65
66 int col = (mx - rect.x) / cellWidth;
67 int row = (my - rect.y) / cellHeight;
68
69 return row * 4 + col;
70}

Referenced by NoteTrackButtonHandle::HitTest(), and LabelClick().

Here is the caller graph for this function:

◆ LabelClick()

static bool LabelClick ( NoteTrack track,
const wxRect &  rect,
int  mx,
int  my,
bool  right 
)
static

Definition at line 77 of file NoteTrackButtonHandle.cpp.

79{
80 auto channel = FindChannelNumber(rect, mx, my);
81 if (right)
82 track.SoloVisibleChan(channel);
83 else
84 track.ToggleVisibleChan(channel);
85
86 return true;
87}
static int FindChannelNumber(const wxRect &rect, int mx, int my)
void ToggleVisibleChan(int c)
Definition: NoteTrack.h:162
void SoloVisibleChan(int c)
Definition: NoteTrack.h:166

References FindChannelNumber(), NoteTrack::SoloVisibleChan(), and NoteTrack::ToggleVisibleChan().

Referenced by NoteTrackButtonHandle::Release().

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