From d31a63c68592d8a54d9a728c787c17885677151f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 27 Oct 2010 21:18:44 +0000 Subject: Show a region's sources in its properties dialogue. git-svn-id: svn://localhost/ardour2/branches/3.0@7927 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_region_editor.cc | 4 +-- gtk2_ardour/region_editor.cc | 56 +++++++++++++++++++++++++++----------- gtk2_ardour/region_editor.h | 5 ++++ 3 files changed, 47 insertions(+), 18 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index bade9b27d9..1823ab1303 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -57,8 +57,8 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr gain_label.set_name ("AudioRegionEditorLabel"); gain_label.set_text (_("Region gain:")); gain_entry.configure (gain_adjustment, 0.0, 1); - _table.attach (gain_label, 0, 1, 7, 8, Gtk::FILL, Gtk::FILL); - _table.attach (*gb, 1, 2, 7, 8, Gtk::FILL, Gtk::FILL); + _table.attach (gain_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (*gb, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); gain_changed (); diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index 370859381f..38f497527e 100755 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -25,7 +25,9 @@ #include "ardour/playlist.h" #include "ardour/utils.h" #include "ardour/dB.h" -#include +#include "ardour/source.h" +#include "gtkmm2ext/utils.h" +#include #include #include "region_editor.h" @@ -43,6 +45,7 @@ using namespace Gtkmm2ext; RegionEditor::RegionEditor (Session* s, boost::shared_ptr r) : ArdourDialog (_("Region")), _table (8, 2), + _table_row (0), _region (r), name_label (_("Name:")), audition_button (_("Play")), @@ -52,7 +55,8 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr r) sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, X_("RegionEditorClock"), true, false), sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, X_("RegionEditorClock"), true, false), /* XXX cannot file start yet */ - start_clock (X_("regionstart"), true, X_("RegionEditorClock"), false, false) + start_clock (X_("regionstart"), true, X_("RegionEditorClock"), false, false), + _sources (1) { set_session (s); @@ -83,6 +87,8 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr r) sync_absolute_label.set_text (_("Sync point (absolute):")); start_label.set_name ("RegionEditorLabel"); start_label.set_text (_("File start:")); + _sources_label.set_name ("RegionEditorLabel"); + _sources_label.set_text (_("Sources:")); _table.set_col_spacings (12); _table.set_row_spacings (6); @@ -95,32 +101,44 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr r) sync_relative_label.set_alignment (1, 0.5); sync_absolute_label.set_alignment (1, 0.5); start_label.set_alignment (1, 0.5); + _sources_label.set_alignment (1, 0.5); Gtk::HBox* nb = Gtk::manage (new Gtk::HBox); nb->set_spacing (6); nb->pack_start (name_entry); nb->pack_start (audition_button); - _table.attach (name_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); - _table.attach (*nb, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL); + _table.attach (name_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (*nb, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; - _table.attach (position_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL); - _table.attach (position_clock, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL); + _table.attach (position_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (position_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; - _table.attach (end_label, 0, 1, 2, 3, Gtk::FILL, Gtk::FILL); - _table.attach (end_clock, 1, 2, 2, 3, Gtk::FILL, Gtk::FILL); + _table.attach (end_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (end_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; - _table.attach (length_label, 0, 1, 3, 4, Gtk::FILL, Gtk::FILL); - _table.attach (length_clock, 1, 2, 3, 4, Gtk::FILL, Gtk::FILL); + _table.attach (length_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (length_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; - _table.attach (sync_relative_label, 0, 1, 4, 5, Gtk::FILL, Gtk::FILL); - _table.attach (sync_offset_relative_clock, 1, 2, 4, 5, Gtk::FILL, Gtk::FILL); + _table.attach (sync_relative_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (sync_offset_relative_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; - _table.attach (sync_absolute_label, 0, 1, 5, 6, Gtk::FILL, Gtk::FILL); - _table.attach (sync_offset_absolute_clock, 1, 2, 5, 6, Gtk::FILL, Gtk::FILL); + _table.attach (sync_absolute_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (sync_offset_absolute_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; - _table.attach (start_label, 0, 1, 6, 7, Gtk::FILL, Gtk::FILL); - _table.attach (start_clock, 1, 2, 6, 7, Gtk::FILL, Gtk::FILL); + _table.attach (start_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (start_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; + + _table.attach (_sources_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + _table.attach (_sources, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL); + ++_table_row; get_vbox()->pack_start (_table, true, true); @@ -134,6 +152,12 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr r) set_title (string_compose (_("Region '%1'"), _region->name())); + for (uint32_t i = 0; i < _region->n_channels(); ++i) { + _sources.append_text (_region->source(i)->name()); + } + + _sources.set_headers_visible (false); + show_all(); name_changed (); diff --git a/gtk2_ardour/region_editor.h b/gtk2_ardour/region_editor.h index 8fdb563211..df9df33fc8 100644 --- a/gtk2_ardour/region_editor.h +++ b/gtk2_ardour/region_editor.h @@ -33,6 +33,7 @@ #include #include #include +#include #include @@ -56,6 +57,7 @@ class RegionEditor : public ArdourDialog virtual void region_changed (const PBD::PropertyChange&); Gtk::Table _table; + int _table_row; private: boost::shared_ptr _region; @@ -106,6 +108,9 @@ class RegionEditor : public ArdourDialog void handle_response (int); bool spin_arrow_grab; + + Gtk::Label _sources_label; + Gtk::ListViewText _sources; }; #endif /* __gtk_ardour_region_edit_h__ */ -- cgit v1.2.3