Show a region's sources in its properties dialogue.
authorCarl Hetherington <carl@carlh.net>
Wed, 27 Oct 2010 21:18:44 +0000 (21:18 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 27 Oct 2010 21:18:44 +0000 (21:18 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7927 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_region_editor.cc
gtk2_ardour/region_editor.cc
gtk2_ardour/region_editor.h

index bade9b27d9a04e69cbd0bb5540faf0c388c42c3c..1823ab1303b5fd4e186afbf66f198921b786053d 100644 (file)
@@ -57,8 +57,8 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr<AudioRegion>
        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 ();
 
index 370859381f34c1c382ed034d5a419d1c82c32519..38f497527e9f3432c7e4bab6beb40478762aae88 100755 (executable)
@@ -25,7 +25,9 @@
 #include "ardour/playlist.h"
 #include "ardour/utils.h"
 #include "ardour/dB.h"
-#include <gtkmm2ext/utils.h>
+#include "ardour/source.h"
+#include "gtkmm2ext/utils.h"
+#include <gtkmm/listviewtext.h>
 #include <cmath>
 
 #include "region_editor.h"
@@ -43,6 +45,7 @@ using namespace Gtkmm2ext;
 RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> 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<Region> 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<Region> 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<Region> 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<Region> 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 ();
index 8fdb56321142d4bf8460740f85c87e5d7b99f958..df9df33fc8723325168bd66f25e1da6e6a3c02ae 100644 (file)
@@ -33,6 +33,7 @@
 #include <gtkmm/adjustment.h>
 #include <gtkmm/separator.h>
 #include <gtkmm/spinbutton.h>
+#include <gtkmm/listviewtext.h>
 
 #include <libgnomecanvas/libgnomecanvas.h>
 
@@ -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<ARDOUR::Region> _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__ */