summaryrefslogtreecommitdiff
path: root/gtk2_ardour/analysis_window.h
blob: cee37b308fb746d333465768766d0c694a904e3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
    Copyright (C) 2006 Paul Davis

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#ifndef __ardour_analysis_window_h__
#define __ardour_analysis_window_h__

#include <glibmm.h>
#include <glibmm/refptr.h>

#include <gtkmm/radiobutton.h>
#include <gtkmm/dialog.h>
#include <gtkmm/layout.h>
#include <gtkmm/treeview.h>
#include <gtkmm/notebook.h>
#include <gtkmm/label.h>
#include <gtkmm/liststore.h>
#include <gtkmm/separator.h>
#include <gtkmm/window.h>

#include <gtkmm2ext/dndtreeview.h>

#include <glibmm/threads.h>

#include "ardour/session_handle.h"

#include "fft_graph.h"
#include "fft_result.h"

namespace ARDOUR {
	class Session;
}

class AnalysisWindow : public Gtk::Window, public ARDOUR::SessionHandlePtr
{
public:
	AnalysisWindow  ();
	~AnalysisWindow ();

	void set_rangemode();
	void set_regionmode();

	void track_list_row_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter);

	void analyze ();

private:
	void clear_tracklist();

	void source_selection_changed (Gtk::RadioButton *);
	void display_model_changed    (Gtk::RadioButton *);

	void show_minmax_changed ();
	void show_normalized_changed ();
	void show_proportional_changed ();

	void analyze_data (Gtk::Button *);

	struct TrackListColumns : public Gtk::TreeModel::ColumnRecord {
		public:
			TrackListColumns () {
				add (trackname);
				add (visible);
				add (color);
				add (graph);
			}
			Gtk::TreeModelColumn<std::string> trackname;
			Gtk::TreeModelColumn<bool>        visible;
			Gtk::TreeModelColumn<Gdk::Color>  color;
			Gtk::TreeModelColumn<FFTResult *>  graph;
	};

	// Packing essentials
	Gtk::HBox hbox;
	Gtk::VBox vbox;

	// Left  side
	Glib::RefPtr<Gtk::ListStore> tlmodel;
	TrackListColumns tlcols;
	Gtk::TreeView track_list;

	Gtk::Label source_selection_label;

	Gtk::RadioButton source_selection_ranges_rb;
	Gtk::RadioButton source_selection_regions_rb;

	Gtk::HSeparator hseparator1;

	Gtk::Button refresh_button;

	Gtk::CheckButton show_minmax_button;
	Gtk::CheckButton show_normalized_button;
	Gtk::CheckButton show_proportional_button;

	// The graph
	FFTGraph fft_graph;

	bool track_list_ready;
	Glib::Threads::Mutex track_list_lock;

	friend class FFTGraph;
};

#endif // __ardour_analysis_window_h