Repository navigation
Expand file tree
/
Copy pathwaveform_editor.h
More file actions
55 lines (44 loc) · 1.53 KB
/
Copy pathwaveform_editor.h
File metadata and controls
55 lines (44 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "sample_pool.h"
#include <wx/panel.h>
#include <wx/scrolbar.h>
#include <wx/stattext.h>
#include <wx/timer.h>
#include <wx/stopwatch.h>
#include <vector>
class WaveformCanvas;
class WaveformEditorPanel : public wxPanel
{
public:
WaveformEditorPanel(wxWindow* parent, wxWindowID id = wxID_ANY);
bool SetSample(const SamplePoolItem* item, wxString* errorMessage);
void ClearSample();
void StartPlayback();
void StopPlayback();
void SetSliceMarkers(bool visible, unsigned long long startFrame,
unsigned long long loopInFrame,
unsigned long long loopOutFrame,
unsigned long long endFrame);
void SetAutoSlicePreview(const std::vector<unsigned long long>& boundaries);
void ClearAutoSlicePreview();
bool HasSelection() const;
unsigned long long GetSelectionStartFrame() const;
unsigned long long GetSelectionEndFrame() const;
void OnCanvasViewChanged();
void OnCanvasSelectionChanged();
private:
void OnZoomIn(wxCommandEvent& event);
void OnZoomOut(wxCommandEvent& event);
void OnFit(wxCommandEvent& event);
void OnClearSelection(wxCommandEvent& event);
void OnScroll(wxScrollEvent& event);
void OnPlaybackTimer(wxTimerEvent& event);
void UpdateControls();
WaveformCanvas* m_canvas;
wxScrollBar* m_scrollBar;
wxStaticText* m_positionLabel;
wxStaticText* m_selectionLabel;
wxTimer m_playbackTimer;
wxStopWatch m_playbackClock;
bool m_playbackActive;
};