2 * Copyright (C) 2008-2009 David Robillard <d@drobilla.net>
3 * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
4 * Copyright (C) 2010-2011 Carl Hetherington <carl@carlh.net>
5 * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __gtk2_ardour_rhythm_ferret_h__
23 #define __gtk2_ardour_rhythm_ferret_h__
25 #include <gtkmm/box.h>
26 #include <gtkmm/scale.h>
27 #include <gtkmm/spinbutton.h>
28 #include <gtkmm/radiobutton.h>
29 #include <gtkmm/radiobuttongroup.h>
30 #include <gtkmm/frame.h>
31 #include <gtkmm/image.h>
32 #include <gtkmm/comboboxtext.h>
33 #include <gtkmm/button.h>
35 #include "ardour_dialog.h"
36 #include "region_selection.h"
45 class RhythmFerret : public ArdourDialog
48 /* order of these enums must match the _analyse_mode_strings
62 RhythmFerret (Editor&);
64 void set_session (ARDOUR::Session*);
65 void on_response (int);
73 Gtk::ComboBoxText operation_selector;
75 Gtk::ComboBoxText analysis_mode_selector;
77 /* transient detection widgets */
79 Gtk::Adjustment detection_threshold_adjustment;
80 Gtk::HScale detection_threshold_scale;
81 Gtk::Adjustment sensitivity_adjustment;
82 Gtk::HScale sensitivity_scale;
83 Gtk::Button analyze_button;
85 /* onset detection widgets */
87 Gtk::ComboBoxText onset_detection_function_selector;
88 Gtk::Adjustment peak_picker_threshold_adjustment;
89 Gtk::HScale peak_picker_threshold_scale;
90 Gtk::Adjustment silence_threshold_adjustment;
91 Gtk::HScale silence_threshold_scale;
93 Gtk::Adjustment minioi_adjustment;
94 Gtk::HScale minioi_scale;
99 Gtk::Adjustment trigger_gap_adjustment;
100 Gtk::SpinButton trigger_gap_spinner;
102 Gtk::Button action_button;
104 std::vector<std::string> analysis_mode_strings;
105 std::vector<std::string> onset_function_strings;
106 std::vector<std::string> operation_strings;
108 ARDOUR::AnalysisFeatureList current_results;
110 void clear_transients ();
111 /** Regions that we have added transient marks to */
112 RegionSelection regions_with_transients;
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, ARDOUR::sampleoffset_t offset, ARDOUR::AnalysisFeatureList& results);
121 int run_note_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, ARDOUR::sampleoffset_t offset, ARDOUR::AnalysisFeatureList& results);
124 void do_split_action ();
125 void do_region_split (RegionView* rv, const ARDOUR::AnalysisFeatureList&);
128 #endif /* __gtk2_ardour_rhythm_ferret_h__ */