source_selection_label (_("Signal source")),
source_selection_ranges_rb (_("Selected ranges")),
source_selection_regions_rb (_("Selected regions")),
source_selection_label (_("Signal source")),
source_selection_ranges_rb (_("Selected ranges")),
source_selection_regions_rb (_("Selected regions")),
display_model_label (_("Display model")),
display_model_composite_separate_rb (_("Composite graphs for each track")),
display_model_composite_all_tracks_rb (_("Composite graph of all tracks")),
display_model_label (_("Display model")),
display_model_composite_separate_rb (_("Composite graphs for each track")),
display_model_composite_all_tracks_rb (_("Composite graph of all tracks")),
show_minmax_button (_("Show frequency power range")),
show_normalized_button (_("Normalize values")),
fft_graph (16384)
{
set_name(_("FFT analysis window"));
show_minmax_button (_("Show frequency power range")),
show_normalized_button (_("Normalize values")),
fft_graph (16384)
{
set_name(_("FFT analysis window"));
// Left side: track list + controls
tlmodel = Gtk::ListStore::create(tlcols);
track_list.set_model (tlmodel);
// Left side: track list + controls
tlmodel = Gtk::ListStore::create(tlcols);
track_list.set_model (tlmodel);
Gtk::TreeViewColumn* track_col = track_list.get_column(0);
Gtk::CellRendererText* renderer = dynamic_cast<Gtk::CellRendererText*>(track_list.get_column_cell_renderer (0));
Gtk::TreeViewColumn* track_col = track_list.get_column(0);
Gtk::CellRendererText* renderer = dynamic_cast<Gtk::CellRendererText*>(track_list.get_column_cell_renderer (0));
track_col->add_attribute(renderer->property_foreground_gdk(), tlcols.color);
track_col->set_expand(true);
tlmodel->signal_row_changed().connect (
mem_fun(*this, &AnalysisWindow::track_list_row_changed) );
track_col->add_attribute(renderer->property_foreground_gdk(), tlcols.color);
track_col->set_expand(true);
tlmodel->signal_row_changed().connect (
mem_fun(*this, &AnalysisWindow::track_list_row_changed) );
vbox.pack_start (source_selection_ranges_rb, false, false);
vbox.pack_start (source_selection_regions_rb, false, false);
vbox.pack_start (source_selection_ranges_rb, false, false);
vbox.pack_start (source_selection_regions_rb, false, false);
// "Selected ranges" radio
source_selection_ranges_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::source_selection_changed), &source_selection_ranges_rb));
// "Selected ranges" radio
source_selection_ranges_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::source_selection_changed), &source_selection_ranges_rb));
source_selection_regions_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::source_selection_changed), &source_selection_regions_rb));
}
source_selection_regions_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::source_selection_changed), &source_selection_regions_rb));
}
// "Display model"
vbox.pack_start(display_model_label, false, false);
{
Gtk::RadioButtonGroup group = display_model_composite_separate_rb.get_group();
display_model_composite_all_tracks_rb.set_group (group);
// "Display model"
vbox.pack_start(display_model_label, false, false);
{
Gtk::RadioButtonGroup group = display_model_composite_separate_rb.get_group();
display_model_composite_all_tracks_rb.set_group (group);
vbox.pack_start (display_model_composite_separate_rb, false, false);
vbox.pack_start (display_model_composite_all_tracks_rb, false, false);
// "Composite graphs for all tracks"
display_model_composite_separate_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_separate_rb));
vbox.pack_start (display_model_composite_separate_rb, false, false);
vbox.pack_start (display_model_composite_all_tracks_rb, false, false);
// "Composite graphs for all tracks"
display_model_composite_separate_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_separate_rb));
// "Composite graph of all tracks"
display_model_composite_all_tracks_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_all_tracks_rb));
// "Composite graph of all tracks"
display_model_composite_all_tracks_rb.signal_toggled().connect (
bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_all_tracks_rb));
- refresh_button.signal_clicked().connect ( bind ( mem_fun(*this, &AnalysisWindow::analyze_data), &refresh_button));
+ refresh_button.signal_clicked().connect ( bind ( mem_fun(*this, &AnalysisWindow::analyze_data), &refresh_button));
vbox.pack_start(refresh_button, false, false, 10);
vbox.pack_start(refresh_button, false, false, 10);
show_normalized_button.signal_toggled().connect( mem_fun(*this, &AnalysisWindow::show_normalized_changed));
vbox.pack_start(show_normalized_button, false, false);
show_normalized_button.signal_toggled().connect( mem_fun(*this, &AnalysisWindow::show_normalized_changed));
vbox.pack_start(show_normalized_button, false, false);
{
// Empty track list & free old graphs
Gtk::TreeNodeChildren children = track_list.get_model()->children();
{
// Empty track list & free old graphs
Gtk::TreeNodeChildren children = track_list.get_model()->children();
Sample *buf = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
Sample *mixbuf = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
float *gain = (float *) malloc(sizeof(float) * fft_graph.windowSize());
Sample *buf = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
Sample *mixbuf = (Sample *) malloc(sizeof(Sample) * fft_graph.windowSize());
float *gain = (float *) malloc(sizeof(float) * fft_graph.windowSize());
Selection s = PublicEditor::instance().get_selection();
TimeSelection ts = s.time;
RegionSelection ars = s.regions;
Selection s = PublicEditor::instance().get_selection();
TimeSelection ts = s.time;
RegionSelection ars = s.regions;
for (TrackSelection::iterator i = s.tracks.begin(); i != s.tracks.end(); ++i) {
boost::shared_ptr<AudioPlaylist> pl
= boost::dynamic_pointer_cast<AudioPlaylist>((*i)->playlist());
for (TrackSelection::iterator i = s.tracks.begin(); i != s.tracks.end(); ++i) {
boost::shared_ptr<AudioPlaylist> pl
= boost::dynamic_pointer_cast<AudioPlaylist>((*i)->playlist());
// if timeSelection
if (source_selection_ranges_rb.get_active()) {
// cerr << "Analyzing ranges on track " << *&rui->route().name() << endl;
// if timeSelection
if (source_selection_ranges_rb.get_active()) {
// cerr << "Analyzing ranges on track " << *&rui->route().name() << endl;
}
} else if (source_selection_regions_rb.get_active()) {
// cerr << "Analyzing selected regions on track " << *&rui->route().name() << endl;
}
} else if (source_selection_regions_rb.get_active()) {
// cerr << "Analyzing selected regions on track " << *&rui->route().name() << endl;
for (RegionSelection::iterator j = ars.begin(); j != ars.end(); ++j) {
// Check that the region is actually audio (so we can analyze it)
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*j);
if (!arv)
continue;
for (RegionSelection::iterator j = ars.begin(); j != ars.end(); ++j) {
// Check that the region is actually audio (so we can analyze it)
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*j);
if (!arv)
continue;
// Check that the region really is selected on _this_ track/solo
if ( &arv->get_time_axis_view() != current_axis)
continue;
// Check that the region really is selected on _this_ track/solo
if ( &arv->get_time_axis_view() != current_axis)
continue;
Gtk::TreeModel::Row newrow = *(tlmodel)->append();
newrow[tlcols.trackname] = rui->route()->name();
newrow[tlcols.visible] = true;
newrow[tlcols.color] = rui->color();
newrow[tlcols.graph] = res;
Gtk::TreeModel::Row newrow = *(tlmodel)->append();
newrow[tlcols.trackname] = rui->route()->name();
newrow[tlcols.visible] = true;
newrow[tlcols.color] = rui->color();
newrow[tlcols.graph] = res;
if (button == &display_model_composite_separate_rb) {
cerr << "separate composites of tracks" << endl;
} else if (button == &display_model_composite_all_tracks_rb) {
if (button == &display_model_composite_separate_rb) {
cerr << "separate composites of tracks" << endl;
} else if (button == &display_model_composite_all_tracks_rb) {