fix keyboard event handling for host-provided plugin GUIs
[ardour2.git] / gtk2_ardour / rhythm_ferret.h
blob91c10695ad38b1dd3ad4664771c2cc36a5a13067
1 #ifndef __gtk2_ardour_rhythm_ferret_h__
2 #define __gtk2_ardour_rhythm_ferret_h__
4 #include <gtkmm/box.h>
5 #include <gtkmm/scale.h>
6 #include <gtkmm/spinbutton.h>
7 #include <gtkmm/radiobutton.h>
8 #include <gtkmm/radiobuttongroup.h>
9 #include <gtkmm/frame.h>
10 #include <gtkmm/image.h>
11 #include <gtkmm/comboboxtext.h>
12 #include <gtkmm/button.h>
13 #include <gtkmm/label.h>
15 #include "ardour_dialog.h"
17 namespace ARDOUR {
18 class Readable;
21 class PublicEditor;
22 class RegionView;
24 class RhythmFerret : public ArdourDialog {
25 public:
26 /* order of these enums must match the _analyse_mode_strings
27 in rhythm_ferret.cc
29 enum AnalysisMode {
30 PercussionOnset,
31 NoteOnset
34 enum Action {
35 SplitRegion,
36 DefineTempoMap,
37 ConformRegion
40 RhythmFerret (PublicEditor&);
41 ~RhythmFerret ();
43 void set_session (ARDOUR::Session*);
45 protected:
46 void on_hide ();
48 private:
49 PublicEditor& editor;
51 Gtk::HBox upper_hpacker;
52 Gtk::HBox lower_hpacker;
54 Gtk::Frame operation_frame;
55 Gtk::Frame selection_frame;
56 Gtk::Frame ferret_frame;
58 Gtk::VBox op_logo_packer;
59 Gtk::Image* logo;
61 /* operation frame */
63 Gtk::VBox op_packer;
64 Gtk::RadioButtonGroup operation_button_group;
65 Gtk::RadioButton region_split_button;
66 Gtk::RadioButton tempo_button;
67 Gtk::RadioButton region_conform_button;
69 /* analysis frame */
71 Gtk::VBox ferret_packer;
72 Gtk::ComboBoxText analysis_mode_selector;
73 Gtk::Label analysis_mode_label;
75 /* transient detection widgets */
77 Gtk::Adjustment detection_threshold_adjustment;
78 Gtk::HScale detection_threshold_scale;
79 Gtk::Label detection_threshold_label;
80 Gtk::Adjustment sensitivity_adjustment;
81 Gtk::HScale sensitivity_scale;
82 Gtk::Label sensitivity_label;
83 Gtk::Button analyze_button;
84 Gtk::VBox perc_onset_packer;
86 /* onset detection widgets */
88 Gtk::ComboBoxText onset_detection_function_selector;
89 Gtk::Label onset_function_label;
90 Gtk::Adjustment peak_picker_threshold_adjustment;
91 Gtk::HScale peak_picker_threshold_scale;
92 Gtk::Label peak_picker_label;
93 Gtk::Adjustment silence_threshold_adjustment;
94 Gtk::HScale silence_threshold_scale;
95 Gtk::Label silence_label;
96 Gtk::VBox note_onset_packer;
98 /* generic stuff */
100 Gtk::Adjustment trigger_gap_adjustment;
101 Gtk::SpinButton trigger_gap_spinner;
102 Gtk::Label trigger_gap_label;
104 Gtk::VBox analysis_packer;
106 Gtk::Label operation_clarification_label;
107 Gtk::Button action_button;
109 std::vector<std::string> analysis_mode_strings;
110 std::vector<std::string> onset_function_strings;
112 ARDOUR::AnalysisFeatureList current_results;
114 AnalysisMode get_analysis_mode () const;
115 Action get_action() const;
116 void analysis_mode_changed ();
117 int get_note_onset_function ();
119 void run_analysis ();
120 int run_percussion_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, nframes64_t offset, ARDOUR::AnalysisFeatureList& results);
121 int run_note_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, nframes64_t offset, ARDOUR::AnalysisFeatureList& results);
123 void do_action ();
124 void do_split_action ();
125 void do_region_split (RegionView* rv, const ARDOUR::AnalysisFeatureList&);
128 #endif /* __gtk2_ardour_rhythm_ferret_h__ */