Ardour  9.0-pre0-582-g084a23a80d
rhythm_ferret.h
Go to the documentation of this file.
1 /*
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>
6  *
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.
11  *
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.
16  *
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.
20  */
21 
22 #ifndef __gtk2_ardour_rhythm_ferret_h__
23 #define __gtk2_ardour_rhythm_ferret_h__
24 
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>
34 
35 #include "ardour_dialog.h"
36 #include "region_selection.h"
37 
38 namespace ARDOUR {
39  class AudioReadable;
40 }
41 
42 class Editor;
43 class RegionView;
44 
45 class RhythmFerret : public ArdourDialog
46 {
47 public:
48  /* order of these enums must match the _analyse_mode_strings
49  * in rhythm_ferret.cc
50  */
51  enum AnalysisMode {
53  NoteOnset
54  };
55 
56  enum Action {
60  };
61 
63 
65  void on_response (int);
66 
67 protected:
68  void on_hide ();
69 
70 private:
72 
74 
76 
77  /* transient detection widgets */
78 
84 
85  /* onset detection widgets */
86 
92 #ifdef HAVE_AUBIO4
93  Gtk::Adjustment minioi_adjustment;
94  Gtk::HScale minioi_scale;
95 #endif
96 
97  /* generic stuff */
98 
101 
103 
104  std::vector<std::string> analysis_mode_strings;
105  std::vector<std::string> onset_function_strings;
106  std::vector<std::string> operation_strings;
107 
109 
113 
118 
119  void run_analysis ();
120  int run_percussion_onset_analysis (std::shared_ptr<ARDOUR::AudioReadable> region, ARDOUR::sampleoffset_t offset, ARDOUR::AnalysisFeatureList& results);
121  int run_note_onset_analysis (std::shared_ptr<ARDOUR::AudioReadable> region, ARDOUR::sampleoffset_t offset, ARDOUR::AnalysisFeatureList& results);
122 
123  void do_action ();
126 };
127 
128 #endif /* __gtk2_ardour_rhythm_ferret_h__ */
Definition: editor.h:158
int run_percussion_onset_analysis(std::shared_ptr< ARDOUR::AudioReadable > region, ARDOUR::sampleoffset_t offset, ARDOUR::AnalysisFeatureList &results)
void on_response(int)
This is a default handler for the signal signal_response().
AnalysisMode get_analysis_mode() const
Gtk::Button action_button
std::vector< std::string > operation_strings
std::vector< std::string > analysis_mode_strings
Gtk::Adjustment trigger_gap_adjustment
Definition: rhythm_ferret.h:99
ARDOUR::RegionList regions_with_transients
Gtk::Adjustment sensitivity_adjustment
Definition: rhythm_ferret.h:81
void on_hide()
This is a default handler for the signal signal_hide().
RhythmFerret(Editor &)
void analysis_mode_changed()
void do_split_action()
Gtk::ComboBoxText onset_detection_function_selector
Definition: rhythm_ferret.h:87
void do_region_split(RegionView *rv, const ARDOUR::AnalysisFeatureList &)
int run_note_onset_analysis(std::shared_ptr< ARDOUR::AudioReadable > region, ARDOUR::sampleoffset_t offset, ARDOUR::AnalysisFeatureList &results)
Editor & editor
Definition: rhythm_ferret.h:71
void set_session(ARDOUR::Session *)
Gtk::HScale sensitivity_scale
Definition: rhythm_ferret.h:82
Gtk::Button analyze_button
Definition: rhythm_ferret.h:83
Gtk::ComboBoxText analysis_mode_selector
Definition: rhythm_ferret.h:75
void clear_transients()
Gtk::ComboBoxText operation_selector
Definition: rhythm_ferret.h:73
Gtk::HScale silence_threshold_scale
Definition: rhythm_ferret.h:91
Gtk::SpinButton trigger_gap_spinner
Gtk::HScale detection_threshold_scale
Definition: rhythm_ferret.h:80
Gtk::Adjustment silence_threshold_adjustment
Definition: rhythm_ferret.h:90
void run_analysis()
Action get_action() const
Gtk::Adjustment detection_threshold_adjustment
Definition: rhythm_ferret.h:79
void do_action()
Gtk::HScale peak_picker_threshold_scale
Definition: rhythm_ferret.h:89
int get_note_onset_function()
Gtk::Adjustment peak_picker_threshold_adjustment
Definition: rhythm_ferret.h:88
ARDOUR::AnalysisFeatureList current_results
std::vector< std::string > onset_function_strings
PBD::PropertyDescriptor< bool > region
std::list< samplepos_t > AnalysisFeatureList
std::list< std::shared_ptr< Region > > RegionList
Temporal::sampleoffset_t sampleoffset_t