Show a region's sources in its properties dialogue.

git-svn-id: svn://localhost/ardour2/branches/3.0@7927 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington
2010-10-27 21:18:44 +00:00
parent ba6d6895f7
commit d31a63c685
3 changed files with 47 additions and 18 deletions

View 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 ();

View File

@@ -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 ();

View 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__ */