2006-03-12 16:58:52 -05:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2006 Sampo Savolainen <v2@iki.fi>
|
|
|
|
* Copyright (C) 2008-2012 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2006-03-12 16:58:52 -05:00
|
|
|
|
2024-09-25 20:38:59 -04:00
|
|
|
#pragma once
|
2006-03-12 16:58:52 -05:00
|
|
|
|
|
|
|
#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>
|
2008-03-17 16:54:03 -04:00
|
|
|
#include <gtkmm/window.h>
|
2006-03-12 16:58:52 -05:00
|
|
|
|
|
|
|
#include <gtkmm2ext/dndtreeview.h>
|
|
|
|
|
2012-07-25 13:48:55 -04:00
|
|
|
#include <glibmm/threads.h>
|
2006-03-12 16:58:52 -05:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
#include "ardour/session_handle.h"
|
|
|
|
|
2006-03-12 16:58:52 -05:00
|
|
|
#include "fft_graph.h"
|
|
|
|
#include "fft_result.h"
|
|
|
|
|
2009-06-28 20:38:32 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
}
|
2006-03-12 16:58:52 -05:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
class AnalysisWindow : public Gtk::Window, public ARDOUR::SessionHandlePtr
|
2006-03-12 16:58:52 -05:00
|
|
|
{
|
2009-02-25 19:58:35 -05:00
|
|
|
public:
|
|
|
|
AnalysisWindow ();
|
|
|
|
~AnalysisWindow ();
|
2006-03-12 16:58:52 -05:00
|
|
|
|
2009-02-25 19:58:35 -05:00
|
|
|
void set_rangemode();
|
|
|
|
void set_regionmode();
|
2006-03-12 16:58:52 -05:00
|
|
|
|
2009-02-25 19:58:35 -05:00
|
|
|
void track_list_row_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter);
|
2006-03-12 16:58:52 -05:00
|
|
|
|
2009-02-25 19:58:35 -05:00
|
|
|
void analyze ();
|
2008-03-17 16:54:03 -04:00
|
|
|
|
2009-02-25 19:58:35 -05:00
|
|
|
private:
|
|
|
|
void clear_tracklist();
|
|
|
|
|
|
|
|
void source_selection_changed (Gtk::RadioButton *);
|
|
|
|
void display_model_changed (Gtk::RadioButton *);
|
|
|
|
|
2016-05-22 13:29:08 -04:00
|
|
|
void show_minmax_changed ();
|
|
|
|
void show_normalized_changed ();
|
|
|
|
void show_proportional_changed ();
|
|
|
|
|
|
|
|
void analyze_data (Gtk::Button *);
|
2009-02-25 19:58:35 -05:00
|
|
|
|
|
|
|
struct TrackListColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
public:
|
|
|
|
TrackListColumns () {
|
|
|
|
add (trackname);
|
2006-03-12 16:58:52 -05:00
|
|
|
add (visible);
|
|
|
|
add (color);
|
|
|
|
add (graph);
|
2009-02-25 19:58:35 -05:00
|
|
|
}
|
|
|
|
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;
|
2016-05-22 13:29:08 -04:00
|
|
|
Gtk::CheckButton show_proportional_button;
|
2009-02-25 19:58:35 -05:00
|
|
|
|
|
|
|
// The graph
|
|
|
|
FFTGraph fft_graph;
|
|
|
|
|
|
|
|
bool track_list_ready;
|
2012-07-25 13:48:55 -04:00
|
|
|
Glib::Threads::Mutex track_list_lock;
|
2009-02-25 19:58:35 -05:00
|
|
|
|
|
|
|
friend class FFTGraph;
|
2006-03-12 16:58:52 -05:00
|
|
|
};
|
|
|
|
|