comment fix
[ardour2.git] / gtk2_ardour / rhythm_ferret.h
blob8132ad27b5a007f42aabd6771f9fa6bfa35f6e7c
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>
14 #include "ardour_dialog.h"
15 #include "region_selection.h"
17 namespace ARDOUR {
18 class Readable;
21 class Editor;
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 SnapRegionsToGrid,
37 ConformRegion
40 RhythmFerret (Editor&);
42 void set_session (ARDOUR::Session*);
44 protected:
45 void on_hide ();
47 private:
48 Editor& editor;
50 Gtk::ComboBoxText operation_selector;
52 Gtk::ComboBoxText analysis_mode_selector;
54 /* transient detection widgets */
56 Gtk::Adjustment detection_threshold_adjustment;
57 Gtk::HScale detection_threshold_scale;
58 Gtk::Adjustment sensitivity_adjustment;
59 Gtk::HScale sensitivity_scale;
60 Gtk::Button analyze_button;
62 /* onset detection widgets */
64 Gtk::ComboBoxText onset_detection_function_selector;
65 Gtk::Adjustment peak_picker_threshold_adjustment;
66 Gtk::HScale peak_picker_threshold_scale;
67 Gtk::Adjustment silence_threshold_adjustment;
68 Gtk::HScale silence_threshold_scale;
70 /* generic stuff */
72 Gtk::Adjustment trigger_gap_adjustment;
73 Gtk::SpinButton trigger_gap_spinner;
75 Gtk::Button action_button;
77 std::vector<std::string> analysis_mode_strings;
78 std::vector<std::string> onset_function_strings;
79 std::vector<std::string> operation_strings;
81 ARDOUR::AnalysisFeatureList current_results;
83 void clear_transients ();
84 /** Regions that we have added transient marks to */
85 RegionSelection regions_with_transients;
87 AnalysisMode get_analysis_mode () const;
88 Action get_action() const;
89 void analysis_mode_changed ();
90 int get_note_onset_function ();
92 void run_analysis ();
93 int run_percussion_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList& results);
94 int run_note_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList& results);
96 void do_action ();
97 void do_split_action ();
98 void do_region_split (RegionView* rv, const ARDOUR::AnalysisFeatureList&);
101 #endif /* __gtk2_ardour_rhythm_ferret_h__ */