mirror of
https://gitlab.com/samplehive/sample-hive.git
synced 2026-10-22 20:55:00 +02:00
Add ability make a selection for loop region.
This commit is contained in:
+29
-4
@@ -40,6 +40,13 @@ class WaveformViewer : public wxPanel
|
||||
wxTimer& timer, wxInfoBar& infoBar, const std::string& configFilepath, const std::string& databaseFilepath);
|
||||
~WaveformViewer();
|
||||
|
||||
private:
|
||||
// -------------------------------------------------------------------
|
||||
struct LoopPoints
|
||||
{
|
||||
double A, B;
|
||||
};
|
||||
|
||||
private:
|
||||
// -------------------------------------------------------------------
|
||||
wxWindow* m_ParentFrame;
|
||||
@@ -60,20 +67,38 @@ class WaveformViewer : public wxPanel
|
||||
wxColour m_PlayheadColour;
|
||||
wxColour m_WaveformColour;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Selection area coordinates
|
||||
wxPoint m_AnchorPoint;
|
||||
wxPoint m_CurrentPoint;
|
||||
|
||||
private:
|
||||
// -------------------------------------------------------------------
|
||||
bool bBitmapDirty;
|
||||
bool bBitmapDirty = false;
|
||||
bool bSelectRange = false;
|
||||
bool bDrawSelectedArea = false;
|
||||
bool bAreaSelected = false;
|
||||
|
||||
private:
|
||||
// -------------------------------------------------------------------
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void RenderPlayhead(wxDC& dc);
|
||||
void UpdateWaveformBitmap();
|
||||
void OnHoverPlayhead(wxMouseEvent& event);
|
||||
void OnGrabPlayhead(wxMouseEvent& event);
|
||||
void OnReleasePlayhead(wxMouseEvent& event);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
void OnMouseMotion(wxMouseEvent& event);
|
||||
void OnMouseLeftButtonDown(wxMouseEvent& event);
|
||||
void OnMouseLeftButtonUp(wxMouseEvent& event);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
void OnControlKeyUp(wxKeyEvent& event);
|
||||
void OnControlKeyDown(wxKeyEvent& event);
|
||||
|
||||
public:
|
||||
LoopPoints GetLoopPoints();
|
||||
|
||||
public:
|
||||
inline bool IsBitmapDirty() { return bBitmapDirty; }
|
||||
inline void SetBitmapDirty(bool dirty) { bBitmapDirty = dirty; }
|
||||
inline bool IsAreaSelected() { return bAreaSelected; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user