don't throw an exception if /home/paul is not writable
[ardour2.git] / gtk2_ardour / analysis_window.h
blob45752c4a34a6886d4aa15f9e14d312d3a463d4eb
1 /*
2 Copyright (C) 2006 Paul Davis
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.
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.
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.
20 #ifndef __ardour_analysis_window_h__
21 #define __ardour_analysis_window_h__
23 #include <glibmm.h>
24 #include <glibmm/refptr.h>
26 #include <gtkmm/radiobutton.h>
27 #include <gtkmm/dialog.h>
28 #include <gtkmm/layout.h>
29 #include <gtkmm/treeview.h>
30 #include <gtkmm/notebook.h>
31 #include <gtkmm/label.h>
32 #include <gtkmm/liststore.h>
33 #include <gtkmm/separator.h>
34 #include <gtkmm/window.h>
36 #include <gtkmm2ext/dndtreeview.h>
38 #include <glibmm/thread.h>
41 #include "ardour_dialog.h"
42 #include "fft_graph.h"
43 #include "fft_result.h"
46 class AnalysisWindow : public Gtk::Window
48 public:
49 AnalysisWindow ();
50 ~AnalysisWindow ();
52 void set_rangemode();
53 void set_regionmode();
55 void track_list_row_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter);
57 void analyze ();
59 const void set_session(ARDOUR::Session *session) { _session = session; };
61 private:
63 ARDOUR::Session *_session;
65 void clear_tracklist();
67 void source_selection_changed (Gtk::RadioButton *);
68 void display_model_changed (Gtk::RadioButton *);
69 void show_minmax_changed ();
70 void show_normalized_changed ();
72 void analyze_data (Gtk::Button *);
74 struct TrackListColumns : public Gtk::TreeModel::ColumnRecord {
75 public:
76 TrackListColumns () {
77 add (trackname);
78 add (visible);
79 add (color);
80 add (graph);
82 Gtk::TreeModelColumn<std::string> trackname;
83 Gtk::TreeModelColumn<bool> visible;
84 Gtk::TreeModelColumn<Gdk::Color> color;
85 Gtk::TreeModelColumn<FFTResult *> graph;
88 // Packing essentials
89 Gtk::HBox hbox;
90 Gtk::VBox vbox;
92 // Left side
93 Glib::RefPtr<Gtk::ListStore> tlmodel;
94 TrackListColumns tlcols;
95 Gtk::TreeView track_list;
97 Gtk::Label source_selection_label;
100 Gtk::RadioButton source_selection_ranges_rb;
101 Gtk::RadioButton source_selection_regions_rb;
103 Gtk::HSeparator hseparator1;
105 Gtk::Label display_model_label;
106 Gtk::RadioButton display_model_composite_separate_rb;
107 Gtk::RadioButton display_model_composite_all_tracks_rb;
109 Gtk::Button refresh_button;
112 Gtk::CheckButton show_minmax_button;
113 Gtk::CheckButton show_normalized_button;
117 // The graph
118 FFTGraph fft_graph;
120 bool track_list_ready;
121 Glib::Mutex track_list_lock;
123 friend class FFTGraph;
126 #endif // __ardour_analysis_window_h