ardour
rhythm_ferret.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __gtk2_ardour_rhythm_ferret_h__
21 #define __gtk2_ardour_rhythm_ferret_h__
22 
23 #include <gtkmm/box.h>
24 #include <gtkmm/scale.h>
25 #include <gtkmm/spinbutton.h>
26 #include <gtkmm/radiobutton.h>
27 #include <gtkmm/radiobuttongroup.h>
28 #include <gtkmm/frame.h>
29 #include <gtkmm/image.h>
30 #include <gtkmm/comboboxtext.h>
31 #include <gtkmm/button.h>
32 
33 #include "ardour_dialog.h"
34 #include "region_selection.h"
35 
36 namespace ARDOUR {
37  class Readable;
38 }
39 
40 class Editor;
41 class RegionView;
42 
43 class RhythmFerret : public ArdourDialog {
44  public:
45  /* order of these enums must match the _analyse_mode_strings
46  in rhythm_ferret.cc
47  */
48  enum AnalysisMode {
51  };
52 
53  enum Action {
57  };
58 
60 
62 
63  protected:
64  void on_hide ();
65 
66  private:
68 
69  Gtk::ComboBoxText operation_selector;
70 
71  Gtk::ComboBoxText analysis_mode_selector;
72 
73  /* transient detection widgets */
74 
77  Gtk::Adjustment sensitivity_adjustment;
78  Gtk::HScale sensitivity_scale;
79  Gtk::Button analyze_button;
80 
81  /* onset detection widgets */
82 
88 
89  /* generic stuff */
90 
91  Gtk::Adjustment trigger_gap_adjustment;
92  Gtk::SpinButton trigger_gap_spinner;
93 
94  Gtk::Button action_button;
95 
96  std::vector<std::string> analysis_mode_strings;
97  std::vector<std::string> onset_function_strings;
98  std::vector<std::string> operation_strings;
99 
101 
102  void clear_transients ();
105 
107  Action get_action() const;
108  void analysis_mode_changed ();
110 
111  void run_analysis ();
114 
115  void do_action ();
116  void do_split_action ();
118 };
119 
120 #endif /* __gtk2_ardour_rhythm_ferret_h__ */
Gtk::SpinButton trigger_gap_spinner
Definition: rhythm_ferret.h:92
int run_note_onset_analysis(boost::shared_ptr< ARDOUR::Readable > region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList &results)
Readable
Definition: selectable.h:35
Gtk::HScale peak_picker_threshold_scale
Definition: rhythm_ferret.h:85
std::vector< std::string > analysis_mode_strings
Definition: rhythm_ferret.h:96
RegionSelection regions_with_transients
RhythmFerret(Editor &)
Gtk::Button action_button
Definition: rhythm_ferret.h:94
std::list< framepos_t > AnalysisFeatureList
Definition: types.h:530
Definition: amp.h:29
void run_analysis()
Gtk::Adjustment sensitivity_adjustment
Definition: rhythm_ferret.h:77
Gtk::ComboBoxText operation_selector
Definition: rhythm_ferret.h:69
Gtk::Adjustment trigger_gap_adjustment
Definition: rhythm_ferret.h:91
Editor & editor
Definition: rhythm_ferret.h:67
int run_percussion_onset_analysis(boost::shared_ptr< ARDOUR::Readable > region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList &results)
int64_t frameoffset_t
Definition: types.h:71
void clear_transients()
void do_split_action()
Action get_action() const
std::vector< std::string > operation_strings
Definition: rhythm_ferret.h:98
Definition: editor.h:134
int get_note_onset_function()
Gtk::Adjustment peak_picker_threshold_adjustment
Definition: rhythm_ferret.h:84
Gtk::HScale silence_threshold_scale
Definition: rhythm_ferret.h:87
void do_region_split(RegionView *rv, const ARDOUR::AnalysisFeatureList &)
std::vector< std::string > onset_function_strings
Definition: rhythm_ferret.h:97
Gtk::Adjustment silence_threshold_adjustment
Definition: rhythm_ferret.h:86
void set_session(ARDOUR::Session *)
Gtk::ComboBoxText onset_detection_function_selector
Definition: rhythm_ferret.h:83
void analysis_mode_changed()
Gtk::Adjustment detection_threshold_adjustment
Definition: rhythm_ferret.h:75
ARDOUR::AnalysisFeatureList current_results
Gtk::HScale sensitivity_scale
Definition: rhythm_ferret.h:78
AnalysisMode get_analysis_mode() const
Gtk::ComboBoxText analysis_mode_selector
Definition: rhythm_ferret.h:71
Gtk::Button analyze_button
Definition: rhythm_ferret.h:79
Gtk::HScale detection_threshold_scale
Definition: rhythm_ferret.h:76