remove almost everything from region editor, make popup menu more useful and accurate and informative
git-svn-id: svn://localhost/ardour2/trunk@1128 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
c09ce201cd
commit
78e6e3f5ff
|
@ -45,22 +45,12 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
|
|||
_region (r),
|
||||
_region_view (rv),
|
||||
name_label (_("NAME:")),
|
||||
lock_button (_("lock")),
|
||||
mute_button (_("mute")),
|
||||
opaque_button (_("opaque")),
|
||||
envelope_active_button(_("active")),
|
||||
envelope_view_button(_("visible")),
|
||||
raise_arrow (Gtk::ARROW_UP, Gtk::SHADOW_OUT),
|
||||
lower_arrow (Gtk::ARROW_DOWN, Gtk::SHADOW_OUT),
|
||||
layer_label (_("Layer")),
|
||||
audition_button (_("play")),
|
||||
time_table (3, 2),
|
||||
start_clock ("AudioRegionEditorClock", true),
|
||||
end_clock ("AudioRegionEditorClock", true),
|
||||
length_clock ("AudioRegionEditorClock", true, true),
|
||||
sync_offset_clock ("AudioRegionEditorClock", true, true),
|
||||
envelope_loop_table (1, 3),
|
||||
envelope_label (_("ENVELOPE"))
|
||||
sync_offset_clock ("AudioRegionEditorClock", true, true)
|
||||
|
||||
{
|
||||
start_clock.set_session (&_session);
|
||||
|
@ -74,57 +64,15 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
|
|||
name_hbox.pack_start (name_label, false, false);
|
||||
name_hbox.pack_start (name_entry, false, false);
|
||||
|
||||
raise_button.add (raise_arrow);
|
||||
lower_button.add (lower_arrow);
|
||||
layer_frame.set_name ("BaseFrame");
|
||||
layer_frame.set_shadow_type (Gtk::SHADOW_IN);
|
||||
layer_frame.add (layer_value_label);
|
||||
layer_label.set_name ("AudioRegionEditorLabel");
|
||||
layer_value_label.set_name ("AudioRegionEditorLabel");
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (layer_value_label, "99", 5, 2);
|
||||
|
||||
layer_hbox.set_spacing (5);
|
||||
layer_hbox.pack_start (layer_label, false, false);
|
||||
layer_hbox.pack_start (layer_frame, false, false);
|
||||
#if 0
|
||||
layer_hbox.pack_start (raise_button, false, false);
|
||||
layer_hbox.pack_start (lower_button, false, false);
|
||||
#endif
|
||||
|
||||
mute_button.set_name ("AudioRegionEditorToggleButton");
|
||||
opaque_button.set_name ("AudioRegionEditorToggleButton");
|
||||
lock_button.set_name ("AudioRegionEditorToggleButton");
|
||||
envelope_active_button.set_name ("AudioRegionEditorToggleButton");
|
||||
envelope_view_button.set_name ("AudioRegionEditorToggleButton");
|
||||
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (mute_button, _("mute this region"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (opaque_button, _("regions underneath this one cannot be heard"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (lock_button, _("prevent any changes to this region"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (envelope_active_button, _("use the gain envelope during playback"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (envelope_view_button, _("show the gain envelope"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (audition_button, _("audition this region"));
|
||||
|
||||
mute_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
opaque_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
lock_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
envelope_active_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
envelope_view_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
audition_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
|
||||
mute_button.set_events (mute_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
opaque_button.set_events (opaque_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
lock_button.set_events (lock_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
envelope_active_button.set_events (envelope_active_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
envelope_view_button.set_events (envelope_view_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
audition_button.set_events (audition_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
|
||||
top_row_button_hbox.set_border_width (5);
|
||||
top_row_button_hbox.set_spacing (5);
|
||||
top_row_button_hbox.set_homogeneous (false);
|
||||
top_row_button_hbox.pack_start (mute_button, false, false);
|
||||
top_row_button_hbox.pack_start (opaque_button, false, false);
|
||||
top_row_button_hbox.pack_start (lock_button, false, false);
|
||||
top_row_button_hbox.pack_start (layer_hbox, false, false, 5);
|
||||
top_row_button_hbox.pack_end (audition_button, false, false);
|
||||
|
||||
top_row_hbox.pack_start (name_hbox, true, true);
|
||||
|
@ -158,17 +106,8 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
|
|||
time_table.attach (length_alignment, 0, 1, 2, 3, Gtk::FILL, Gtk::FILL);
|
||||
time_table.attach (length_clock, 1, 2, 2, 3, Gtk::FILL, Gtk::FILL);
|
||||
|
||||
envelope_label.set_name ("AudioRegionEditorLabel");
|
||||
|
||||
envelope_loop_table.set_border_width (5);
|
||||
envelope_loop_table.set_row_spacings (2);
|
||||
envelope_loop_table.attach (envelope_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
|
||||
envelope_loop_table.attach (envelope_active_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
|
||||
envelope_loop_table.attach (envelope_view_button, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
|
||||
|
||||
lower_hbox.pack_start (time_table, true, true);
|
||||
lower_hbox.pack_start (sep1, false, false);
|
||||
lower_hbox.pack_start (envelope_loop_table, true, true);
|
||||
lower_hbox.pack_start (sep2, false, false);
|
||||
|
||||
get_vbox()->pack_start (top_row_hbox, true, true);
|
||||
|
@ -188,27 +127,8 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr<AudioRegion>
|
|||
|
||||
name_changed ();
|
||||
bounds_changed (Change (StartChanged|LengthChanged|PositionChanged));
|
||||
envelope_active_changed ();
|
||||
mute_changed ();
|
||||
opacity_changed ();
|
||||
lock_changed ();
|
||||
layer_changed ();
|
||||
|
||||
XMLNode *node = _region->extra_xml ("GUI");
|
||||
XMLProperty *prop = 0;
|
||||
bool showing_envelope = false;
|
||||
|
||||
if (node && (prop = node->property ("envelope-visible")) != 0) {
|
||||
if (prop->value() == "yes") {
|
||||
showing_envelope = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (showing_envelope) {
|
||||
envelope_view_button.set_active (true);
|
||||
} else {
|
||||
envelope_view_button.set_active (false);
|
||||
}
|
||||
|
||||
_region->StateChanged.connect (mem_fun(*this, &AudioRegionEditor::region_changed));
|
||||
|
||||
|
@ -230,23 +150,6 @@ AudioRegionEditor::region_changed (Change what_changed)
|
|||
if (what_changed & BoundsChanged) {
|
||||
bounds_changed (what_changed);
|
||||
}
|
||||
|
||||
if (what_changed & Region::OpacityChanged) {
|
||||
opacity_changed ();
|
||||
}
|
||||
if (what_changed & Region::MuteChanged) {
|
||||
mute_changed ();
|
||||
}
|
||||
if (what_changed & Region::LockChanged) {
|
||||
lock_changed ();
|
||||
}
|
||||
if (what_changed & Region::LayerChanged) {
|
||||
layer_changed ();
|
||||
}
|
||||
|
||||
if (what_changed & AudioRegion::EnvelopeActiveChanged) {
|
||||
envelope_active_changed ();
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
|
@ -291,15 +194,7 @@ AudioRegionEditor::connect_editor_events ()
|
|||
end_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::end_clock_changed));
|
||||
length_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::length_clock_changed));
|
||||
|
||||
envelope_active_button.signal_button_press_event().connect (mem_fun(*this, &AudioRegionEditor::envelope_active_button_press));
|
||||
envelope_active_button.signal_button_release_event().connect (mem_fun(*this, &AudioRegionEditor::envelope_active_button_release));
|
||||
audition_button.signal_toggled().connect (mem_fun(*this, &AudioRegionEditor::audition_button_toggled));
|
||||
envelope_view_button.signal_toggled().connect (mem_fun(*this, &AudioRegionEditor::envelope_view_button_toggled));
|
||||
lock_button.signal_clicked().connect (mem_fun(*this, &AudioRegionEditor::lock_button_clicked));
|
||||
mute_button.signal_clicked().connect (mem_fun(*this, &AudioRegionEditor::mute_button_clicked));
|
||||
opaque_button.signal_clicked().connect (mem_fun(*this, &AudioRegionEditor::opaque_button_clicked));
|
||||
raise_button.signal_clicked().connect (mem_fun(*this, &AudioRegionEditor::raise_button_clicked));
|
||||
lower_button.signal_clicked().connect (mem_fun(*this, &AudioRegionEditor::lower_button_clicked));
|
||||
_session.AuditionActive.connect (mem_fun(*this, &AudioRegionEditor::audition_state_changed));
|
||||
}
|
||||
|
||||
|
@ -360,27 +255,6 @@ AudioRegionEditor::length_clock_changed ()
|
|||
length_clock.set (_region->length());
|
||||
}
|
||||
|
||||
gint
|
||||
AudioRegionEditor::envelope_active_button_press(GdkEventButton *ev)
|
||||
{
|
||||
return stop_signal (envelope_active_button, "button_press_event");
|
||||
}
|
||||
|
||||
gint
|
||||
AudioRegionEditor::envelope_active_button_release (GdkEventButton *ev)
|
||||
{
|
||||
_region->set_envelope_active (!_region->envelope_active());
|
||||
return stop_signal (envelope_active_button, "button_release_event");
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::envelope_view_button_toggled ()
|
||||
{
|
||||
bool visible = envelope_view_button.get_active ();
|
||||
|
||||
_region_view.set_envelope_visible (visible);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::audition_button_toggled ()
|
||||
{
|
||||
|
@ -391,56 +265,6 @@ AudioRegionEditor::audition_button_toggled ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::raise_button_clicked ()
|
||||
{
|
||||
_region->raise ();
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::lower_button_clicked ()
|
||||
{
|
||||
_region->lower ();
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::opaque_button_clicked ()
|
||||
{
|
||||
bool ractive = _region->opaque();
|
||||
|
||||
if (opaque_button.get_active() != ractive) {
|
||||
_region->set_opaque (!ractive);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::mute_button_clicked ()
|
||||
{
|
||||
bool ractive = _region->muted();
|
||||
|
||||
if (mute_button.get_active() != ractive) {
|
||||
_region->set_muted (!ractive);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::lock_button_clicked ()
|
||||
{
|
||||
bool ractive = _region->locked();
|
||||
|
||||
if (lock_button.get_active() != ractive) {
|
||||
_region->set_locked (!ractive);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::layer_changed ()
|
||||
{
|
||||
char buf[8];
|
||||
snprintf (buf, sizeof(buf), "%d", (int) _region->layer() + 1);
|
||||
layer_value_label.set_text (buf);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::name_changed ()
|
||||
{
|
||||
|
@ -449,48 +273,6 @@ AudioRegionEditor::name_changed ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::lock_changed ()
|
||||
{
|
||||
bool yn;
|
||||
|
||||
if ((yn = _region->locked()) != lock_button.get_active()) {
|
||||
lock_button.set_active (yn);
|
||||
}
|
||||
|
||||
start_clock.set_sensitive (!yn);
|
||||
end_clock.set_sensitive (!yn);
|
||||
length_clock.set_sensitive (!yn);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::envelope_active_changed ()
|
||||
{
|
||||
bool yn;
|
||||
|
||||
if ((yn = _region->envelope_active()) != envelope_active_button.get_active()) {
|
||||
envelope_active_button.set_active (yn);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::opacity_changed ()
|
||||
{
|
||||
bool yn;
|
||||
if ((yn = _region->opaque()) != opaque_button.get_active()) {
|
||||
opaque_button.set_active (yn);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::mute_changed ()
|
||||
{
|
||||
bool yn;
|
||||
if ((yn = _region->muted()) != mute_button.get_active()) {
|
||||
mute_button.set_active (yn);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionEditor::bounds_changed (Change what_changed)
|
||||
{
|
||||
|
|
|
@ -69,21 +69,6 @@ class AudioRegionEditor : public RegionEditor
|
|||
Gtk::HBox top_row_hbox;
|
||||
Gtk::HBox top_row_button_hbox;
|
||||
|
||||
Gtk::ToggleButton lock_button;
|
||||
Gtk::ToggleButton mute_button;
|
||||
Gtk::ToggleButton opaque_button;
|
||||
Gtk::ToggleButton envelope_active_button;
|
||||
Gtk::ToggleButton envelope_view_button;
|
||||
|
||||
Gtk::Button raise_button;
|
||||
Gtk::Arrow raise_arrow;
|
||||
Gtk::Button lower_button;
|
||||
Gtk::Arrow lower_arrow;
|
||||
Gtk::Frame layer_frame;
|
||||
Gtk::Label layer_value_label;
|
||||
Gtk::Label layer_label;
|
||||
Gtk::HBox layer_hbox;
|
||||
|
||||
Gtk::ToggleButton audition_button;
|
||||
|
||||
Gtk::HBox lower_hbox;
|
||||
|
@ -102,11 +87,6 @@ class AudioRegionEditor : public RegionEditor
|
|||
AudioClock length_clock;
|
||||
AudioClock sync_offset_clock;
|
||||
|
||||
Gtk::Table envelope_loop_table;
|
||||
Gtk::Button loop_button;
|
||||
Gtk::Label loop_label;
|
||||
Gtk::Label envelope_label;
|
||||
|
||||
Gtk::HSeparator sep3;
|
||||
Gtk::VSeparator sep1;
|
||||
Gtk::VSeparator sep2;
|
||||
|
@ -114,11 +94,6 @@ class AudioRegionEditor : public RegionEditor
|
|||
void region_changed (ARDOUR::Change);
|
||||
void bounds_changed (ARDOUR::Change);
|
||||
void name_changed ();
|
||||
void opacity_changed ();
|
||||
void mute_changed ();
|
||||
void envelope_active_changed ();
|
||||
void lock_changed ();
|
||||
void layer_changed ();
|
||||
|
||||
void audition_state_changed (bool);
|
||||
|
||||
|
@ -129,16 +104,7 @@ class AudioRegionEditor : public RegionEditor
|
|||
void end_clock_changed ();
|
||||
void length_clock_changed ();
|
||||
|
||||
gint envelope_active_button_press (GdkEventButton *);
|
||||
gint envelope_active_button_release (GdkEventButton *);
|
||||
|
||||
void audition_button_toggled ();
|
||||
void envelope_view_button_toggled ();
|
||||
void lock_button_clicked ();
|
||||
void mute_button_clicked ();
|
||||
void opaque_button_clicked ();
|
||||
void raise_button_clicked ();
|
||||
void lower_button_clicked ();
|
||||
|
||||
gint bpressed (GdkEventButton* ev, Gtk::SpinButton* but, void (AudioRegionEditor::*pmf)());
|
||||
gint breleased (GdkEventButton* ev, Gtk::SpinButton* but, void (AudioRegionEditor::*pmf)());
|
||||
|
|
|
@ -1716,32 +1716,48 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr<Region>
|
|||
|
||||
items.push_back (SeparatorElem());
|
||||
|
||||
/* XXX hopefully this nonsense will go away with SigC++ 2.X, where the compiler
|
||||
might be able to figure out which overloaded member function to use in
|
||||
a bind() call ...
|
||||
*/
|
||||
|
||||
void (Editor::*type_A_pmf)(void (Region::*pmf)(bool), bool) = &Editor::region_selection_op;
|
||||
|
||||
items.push_back (MenuElem (_("Lock"), bind (mem_fun(*this, type_A_pmf), &Region::set_locked, true)));
|
||||
items.push_back (MenuElem (_("Unlock"), bind (mem_fun(*this, type_A_pmf), &Region::set_locked, false)));
|
||||
items.push_back (SeparatorElem());
|
||||
|
||||
if (region->muted()) {
|
||||
items.push_back (MenuElem (_("Unmute"), bind (mem_fun(*this, type_A_pmf), &Region::set_muted, false)));
|
||||
} else {
|
||||
items.push_back (MenuElem (_("Mute"), bind (mem_fun(*this, type_A_pmf), &Region::set_muted, true)));
|
||||
items.push_back (CheckMenuElem (_("Lock"), mem_fun(*this, &Editor::toggle_region_lock)));
|
||||
region_lock_item = static_cast<CheckMenuItem*>(&items.back());
|
||||
if (region->locked()) {
|
||||
region_lock_item->set_active();
|
||||
}
|
||||
items.push_back (CheckMenuElem (_("Mute"), mem_fun(*this, &Editor::toggle_region_mute)));
|
||||
region_mute_item = static_cast<CheckMenuItem*>(&items.back());
|
||||
if (region->muted()) {
|
||||
region_mute_item->set_active();
|
||||
}
|
||||
items.push_back (CheckMenuElem (_("Opaque"), mem_fun(*this, &Editor::toggle_region_opaque)));
|
||||
region_opaque_item = static_cast<CheckMenuItem*>(&items.back());
|
||||
if (region->opaque()) {
|
||||
region_opaque_item->set_active();
|
||||
}
|
||||
items.push_back (SeparatorElem());
|
||||
|
||||
items.push_back (MenuElem (_("Original position"), mem_fun(*this, &Editor::naturalize)));
|
||||
items.push_back (SeparatorElem());
|
||||
items.push_back (CheckMenuElem (_("Original position"), mem_fun(*this, &Editor::naturalize)));
|
||||
if (region->at_natural_position()) {
|
||||
items.back().set_sensitive (false);
|
||||
}
|
||||
|
||||
items.push_back (SeparatorElem());
|
||||
|
||||
if (ar) {
|
||||
|
||||
RegionView* rv = sv->find_view (ar);
|
||||
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(rv);
|
||||
|
||||
items.push_back (CheckMenuElem (_("Envelope visible"), mem_fun(*this, &Editor::toggle_gain_envelope_visibility)));
|
||||
region_envelope_visible_item = static_cast<CheckMenuItem*> (&items.back());
|
||||
|
||||
if (arv->envelope_visible()) {
|
||||
region_envelope_visible_item->set_active (true);
|
||||
}
|
||||
|
||||
items.push_back (CheckMenuElem (_("Envelope active"), mem_fun(*this, &Editor::toggle_gain_envelope_active)));
|
||||
region_envelope_active_item = static_cast<CheckMenuItem*> (&items.back());
|
||||
|
||||
if (ar->envelope_active()) {
|
||||
region_envelope_active_item->set_active (true);
|
||||
}
|
||||
|
||||
items.push_back (MenuElem (_("Toggle envelope visibility"), mem_fun(*this, &Editor::toggle_gain_envelope_visibility)));
|
||||
items.push_back (MenuElem (_("Toggle envelope active"), mem_fun(*this, &Editor::toggle_gain_envelope_active)));
|
||||
items.push_back (SeparatorElem());
|
||||
|
||||
if (ar->scale_amplitude() != 1.0f) {
|
||||
|
|
|
@ -835,6 +835,7 @@ class Editor : public PublicEditor
|
|||
|
||||
void reset_point_selection ();
|
||||
void toggle_region_mute ();
|
||||
void toggle_region_lock ();
|
||||
void toggle_region_opaque ();
|
||||
void raise_region ();
|
||||
void raise_region_to_top ();
|
||||
|
@ -1772,6 +1773,12 @@ class Editor : public PublicEditor
|
|||
|
||||
void toggle_gain_envelope_visibility ();
|
||||
void toggle_gain_envelope_active ();
|
||||
|
||||
Gtk::CheckMenuItem* region_envelope_visible_item;
|
||||
Gtk::CheckMenuItem* region_envelope_active_item;
|
||||
Gtk::CheckMenuItem* region_mute_item;
|
||||
Gtk::CheckMenuItem* region_lock_item;
|
||||
Gtk::CheckMenuItem* region_opaque_item;
|
||||
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
|
||||
|
|
|
@ -1930,28 +1930,6 @@ Editor::loop_location (Location& location)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_region_mute ()
|
||||
{
|
||||
if (clicked_regionview) {
|
||||
clicked_regionview->region()->set_muted (!clicked_regionview->region()->muted());
|
||||
} else if (!selection->regions.empty()) {
|
||||
bool yn = ! (*selection->regions.begin())->region()->muted();
|
||||
selection->foreach_region (&Region::set_muted, yn);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_region_opaque ()
|
||||
{
|
||||
if (clicked_regionview) {
|
||||
clicked_regionview->region()->set_opaque (!clicked_regionview->region()->opaque());
|
||||
} else if (!selection->regions.empty()) {
|
||||
bool yn = ! (*selection->regions.begin())->region()->opaque();
|
||||
selection->foreach_region (&Region::set_opaque, yn);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::raise_region ()
|
||||
{
|
||||
|
@ -3501,8 +3479,12 @@ Editor::toggle_gain_envelope_visibility ()
|
|||
{
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv)
|
||||
arv->set_envelope_visible (!arv->envelope_visible());
|
||||
if (arv) {
|
||||
bool x = region_envelope_visible_item->get_active();
|
||||
if (x != arv->envelope_visible()) {
|
||||
arv->set_envelope_visible (x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3511,7 +3493,53 @@ Editor::toggle_gain_envelope_active ()
|
|||
{
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv)
|
||||
arv->audio_region()->set_envelope_active (true);
|
||||
if (arv) {
|
||||
bool x = region_envelope_active_item->get_active();
|
||||
if (x != arv->audio_region()->envelope_active()) {
|
||||
arv->audio_region()->set_envelope_active (x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_region_lock ()
|
||||
{
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv) {
|
||||
bool x = region_lock_item->get_active();
|
||||
if (x != arv->audio_region()->locked()) {
|
||||
arv->audio_region()->set_locked (x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_region_mute ()
|
||||
{
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv) {
|
||||
bool x = region_mute_item->get_active();
|
||||
if (x != arv->audio_region()->muted()) {
|
||||
arv->audio_region()->set_muted (x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_region_opaque ()
|
||||
{
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv) {
|
||||
bool x = region_opaque_item->get_active();
|
||||
if (x != arv->audio_region()->opaque()) {
|
||||
arv->audio_region()->set_opaque (x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ class AudioRegion : public Region
|
|||
|
||||
int exportme (ARDOUR::Session&, ARDOUR::AudioExportSpecification&);
|
||||
|
||||
boost::shared_ptr<Region> get_parent();
|
||||
boost::shared_ptr<Region> get_parent() const;
|
||||
|
||||
/* xfade/fade interactions */
|
||||
|
||||
|
|
|
@ -139,6 +139,7 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro
|
|||
void special_set_position (nframes_t);
|
||||
void nudge_position (long, void *src);
|
||||
|
||||
bool at_natural_position () const;
|
||||
void move_to_natural_position (void *src);
|
||||
|
||||
void trim_start (nframes_t new_position, void *src);
|
||||
|
@ -172,7 +173,7 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro
|
|||
virtual int set_state (const XMLNode&);
|
||||
virtual int set_live_state (const XMLNode&, Change&, bool send);
|
||||
|
||||
virtual boost::shared_ptr<Region> get_parent() = 0;
|
||||
virtual boost::shared_ptr<Region> get_parent() const = 0;
|
||||
|
||||
uint64_t last_layer_op() const { return _last_layer_op; }
|
||||
void set_last_layer_op (uint64_t when);
|
||||
|
|
|
@ -549,7 +549,7 @@ class Session : public PBD::StatefulDestructible
|
|||
string new_region_name (string);
|
||||
string path_from_region_name (string name, string identifier);
|
||||
|
||||
boost::shared_ptr<AudioRegion> find_whole_file_parent (boost::shared_ptr<AudioRegion>);
|
||||
boost::shared_ptr<AudioRegion> find_whole_file_parent (boost::shared_ptr<AudioRegion const>);
|
||||
void find_equivalent_playlist_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >& result);
|
||||
|
||||
boost::shared_ptr<AudioRegion> XMLRegionFactory (const XMLNode&, bool full);
|
||||
|
|
|
@ -98,6 +98,7 @@ AudioTrack::can_use_mode (TrackMode m, bool& bounce_required)
|
|||
return true;
|
||||
|
||||
case Destructive:
|
||||
default:
|
||||
return _diskstream->can_become_destructive (bounce_required);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1149,11 +1149,11 @@ AudioRegion::exportme (Session& session, AudioExportSpecification& spec)
|
|||
}
|
||||
|
||||
boost::shared_ptr<Region>
|
||||
AudioRegion::get_parent()
|
||||
AudioRegion::get_parent() const
|
||||
{
|
||||
if (_playlist) {
|
||||
boost::shared_ptr<AudioRegion> ar;
|
||||
boost::shared_ptr<AudioRegion> grrr2 = boost::dynamic_pointer_cast<AudioRegion> (shared_from_this());
|
||||
boost::shared_ptr<AudioRegion const> grrr2 = boost::dynamic_pointer_cast<AudioRegion const> (shared_from_this());
|
||||
|
||||
if (grrr2 && (ar = _playlist->session().find_whole_file_parent (grrr2))) {
|
||||
return boost::static_pointer_cast<Region> (ar);
|
||||
|
|
|
@ -216,6 +216,24 @@ Region::first_edit ()
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Region::at_natural_position () const
|
||||
{
|
||||
if (!_playlist) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Region> whole_file_region = get_parent();
|
||||
|
||||
if (whole_file_region) {
|
||||
if (_position == whole_file_region->position() + _start) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Region::move_to_natural_position (void *src)
|
||||
{
|
||||
|
|
|
@ -2540,7 +2540,7 @@ Session::remove_region (boost::weak_ptr<Region> weak_region)
|
|||
}
|
||||
|
||||
boost::shared_ptr<AudioRegion>
|
||||
Session::find_whole_file_parent (boost::shared_ptr<AudioRegion> child)
|
||||
Session::find_whole_file_parent (boost::shared_ptr<AudioRegion const> child)
|
||||
{
|
||||
AudioRegionList::iterator i;
|
||||
boost::shared_ptr<AudioRegion> region;
|
||||
|
|
Loading…
Reference in New Issue