mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 20:26:30 +01:00
Update Region Property Layout
* Shrink Clocks * Align Checkboxes * Reindent and cleanup source
This commit is contained in:
parent
9e164bf0cf
commit
3ea0b11c7d
4 changed files with 317 additions and 296 deletions
|
|
@ -25,15 +25,15 @@
|
||||||
#include <gtkmm2ext/utils.h>
|
#include <gtkmm2ext/utils.h>
|
||||||
|
|
||||||
#include "pbd/memento_command.h"
|
#include "pbd/memento_command.h"
|
||||||
#include "pbd/stateful_diff_command.h"
|
|
||||||
#include "pbd/pthread_utils.h"
|
#include "pbd/pthread_utils.h"
|
||||||
|
#include "pbd/stateful_diff_command.h"
|
||||||
|
|
||||||
#include "temporal/tempo.h"
|
#include "temporal/tempo.h"
|
||||||
|
|
||||||
#include "ardour/audioregion.h"
|
#include "ardour/audioregion.h"
|
||||||
#include "ardour/session_event.h"
|
|
||||||
#include "ardour/dB.h"
|
#include "ardour/dB.h"
|
||||||
#include "ardour/region_fx_plugin.h"
|
#include "ardour/region_fx_plugin.h"
|
||||||
|
#include "ardour/session_event.h"
|
||||||
|
|
||||||
#include "audio_region_editor.h"
|
#include "audio_region_editor.h"
|
||||||
#include "audio_region_view.h"
|
#include "audio_region_view.h"
|
||||||
|
|
@ -58,53 +58,63 @@ AudioRegionEditor::AudioRegionEditor (Session* s, AudioRegionView* arv)
|
||||||
: RegionEditor (s, arv)
|
: RegionEditor (s, arv)
|
||||||
, _arv (arv)
|
, _arv (arv)
|
||||||
, _audio_region (arv->audio_region ())
|
, _audio_region (arv->audio_region ())
|
||||||
, gain_adjustment(accurate_coefficient_to_dB(fabsf (_audio_region->scale_amplitude())), -40.0, +40.0, 0.1, 1.0, 0)
|
, _gain_adjustment (accurate_coefficient_to_dB (fabsf (_audio_region->scale_amplitude ())), -40.0, +40.0, 0.1, 1.0, 0)
|
||||||
, _polarity_toggle (_("Invert"))
|
, _polarity_toggle (_("Polarity Invert"))
|
||||||
, _fade_before_fx_toggle (_("Fade before Fx"))
|
, _fade_before_fx_toggle (_("Fade before Fx"))
|
||||||
, _show_on_touch (_("Show on Touch"))
|
, _show_on_touch (_("Show on Touch"))
|
||||||
, _peak_channel (false)
|
, _peak_channel (false)
|
||||||
{
|
{
|
||||||
|
_gain_label.set_name ("AudioRegionEditorLabel");
|
||||||
|
_gain_label.set_text (_("Region gain"));
|
||||||
|
_gain_label.set_alignment (0, 0.5);
|
||||||
|
|
||||||
|
_peak_amplitude_label.set_name ("AudioRegionEditorLabel");
|
||||||
|
_peak_amplitude_label.set_text (_("Peak Amplitude"));
|
||||||
|
_peak_amplitude_label.set_alignment (1, 0.5);
|
||||||
|
|
||||||
|
_region_line_label.set_name ("AudioRegionEditorLabel");
|
||||||
|
_region_line_label.set_text (_("Region Line:"));
|
||||||
|
_region_line_label.set_alignment (1, 0.5);
|
||||||
|
|
||||||
|
_region_line.set_text_ellipsize (Pango::ELLIPSIZE_MIDDLE);
|
||||||
|
_region_line.set_layout_ellipsize_width (PANGO_SCALE * 240);
|
||||||
|
|
||||||
|
Gtk::Table* gain_table = manage (new Gtk::Table ());
|
||||||
|
gain_table->set_homogeneous ();
|
||||||
|
gain_table->set_col_spacings (12);
|
||||||
|
gain_table->set_row_spacings (6);
|
||||||
|
gain_table->set_border_width (0);
|
||||||
|
|
||||||
|
_gain_entry.configure (_gain_adjustment, 0, 1);
|
||||||
|
|
||||||
|
int row = 0;
|
||||||
|
gain_table->attach (_gain_label, 0, 2, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
|
gain_table->attach (_peak_amplitude_label, 2, 4, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
|
++row;
|
||||||
|
|
||||||
Gtk::HBox* b = Gtk::manage (new Gtk::HBox);
|
Gtk::HBox* b = Gtk::manage (new Gtk::HBox);
|
||||||
b->set_spacing (6);
|
b->set_spacing (6);
|
||||||
b->pack_start (gain_entry);
|
b->pack_start (_gain_entry);
|
||||||
b->pack_start (*Gtk::manage (new Gtk::Label (_("dB"))), false, false);
|
b->pack_start (*Gtk::manage (new Gtk::Label (_("dB"))), false, false);
|
||||||
|
gain_table->attach (*b, 0, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
gain_label.set_name ("AudioRegionEditorLabel");
|
|
||||||
gain_label.set_text (_("Region gain:"));
|
|
||||||
gain_label.set_alignment (1, 0.5);
|
|
||||||
gain_entry.configure (gain_adjustment, 0.0, 1);
|
|
||||||
_table.attach (gain_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
_table.attach (*b, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
++_table_row;
|
|
||||||
|
|
||||||
b = Gtk::manage (new Gtk::HBox);
|
b = Gtk::manage (new Gtk::HBox);
|
||||||
b->set_spacing (6);
|
b->set_spacing (6);
|
||||||
b->pack_start (_peak_amplitude);
|
b->pack_start (_peak_amplitude);
|
||||||
b->pack_start (*Gtk::manage (new Gtk::Label (_("dBFS"))), false, false);
|
b->pack_start (*Gtk::manage (new Gtk::Label (_("dBFS"))), false, false);
|
||||||
|
gain_table->attach (*b, 2, 4, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
|
++row;
|
||||||
|
|
||||||
_peak_amplitude_label.set_name ("AudioRegionEditorLabel");
|
gain_table->attach (_polarity_toggle, 0, 2, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
_peak_amplitude_label.set_text (_("Peak amplitude:"));
|
gain_table->attach (_fade_before_fx_toggle, 2, 4, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
_peak_amplitude_label.set_alignment (1, 0.5);
|
++row;
|
||||||
_table.attach (_peak_amplitude_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
_table.attach (*b, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
++_table_row;
|
|
||||||
|
|
||||||
_polarity_label.set_name ("AudioRegionEditorLabel");
|
/* Add to main layout */
|
||||||
_polarity_label.set_text (_("Polarity:"));
|
|
||||||
_polarity_label.set_alignment (1, 0.5);
|
|
||||||
_table.attach (_polarity_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
_table.attach (_polarity_toggle, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
_table.attach (_fade_before_fx_toggle, 2, 3, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
++_table_row;
|
|
||||||
|
|
||||||
_region_line_label.set_name ("AudioRegionEditorLabel");
|
_table_main.attach (*gain_table, 1, 2, 3, 4, Gtk::FILL, Gtk::SHRINK);
|
||||||
_region_line_label.set_text (_("Region Line:"));
|
_table_main.attach (_region_line_label, 0, 1, 5, 6, Gtk::FILL, Gtk::SHRINK);
|
||||||
_region_line_label.set_alignment (1, 0.5);
|
_table_main.attach (_region_line, 1, 3, 5, 6, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
|
||||||
_table.attach (_region_line_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
_table_main.attach (_show_on_touch, 3, 4, 5, 6, Gtk::FILL, Gtk::SHRINK);
|
||||||
_table.attach (_region_line, 1, 2, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
_table.attach (_show_on_touch, 2, 3, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
|
||||||
++_table_row;
|
|
||||||
|
|
||||||
UI::instance()->set_tip (_polarity_toggle, _("Invert the signal polarity (180deg phase shift)"));
|
UI::instance()->set_tip (_polarity_toggle, _("Invert the signal polarity (180deg phase shift)"));
|
||||||
UI::instance()->set_tip (_fade_before_fx_toggle, _("Apply region effects after the region fade.\nThis is useful if the effect(s) have tail, which would otherwise be faded out by the region fade (e.g. reverb, delay)"));
|
UI::instance()->set_tip (_fade_before_fx_toggle, _("Apply region effects after the region fade.\nThis is useful if the effect(s) have tail, which would otherwise be faded out by the region fade (e.g. reverb, delay)"));
|
||||||
|
|
@ -114,7 +124,7 @@ AudioRegionEditor::AudioRegionEditor (Session* s, AudioRegionView* arv)
|
||||||
fade_before_fx_changed ();
|
fade_before_fx_changed ();
|
||||||
refill_region_line ();
|
refill_region_line ();
|
||||||
|
|
||||||
gain_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed));
|
_gain_adjustment.signal_value_changed ().connect (sigc::mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed));
|
||||||
_polarity_toggle.signal_toggled ().connect (sigc::mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed));
|
_polarity_toggle.signal_toggled ().connect (sigc::mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed));
|
||||||
_fade_before_fx_toggle.signal_toggled ().connect (sigc::mem_fun (*this, &AudioRegionEditor::fade_before_fx_toggle_changed));
|
_fade_before_fx_toggle.signal_toggled ().connect (sigc::mem_fun (*this, &AudioRegionEditor::fade_before_fx_toggle_changed));
|
||||||
_show_on_touch.signal_toggled ().connect (sigc::mem_fun (*this, &AudioRegionEditor::show_on_touch_changed));
|
_show_on_touch.signal_toggled ().connect (sigc::mem_fun (*this, &AudioRegionEditor::show_on_touch_changed));
|
||||||
|
|
@ -122,7 +132,8 @@ AudioRegionEditor::AudioRegionEditor (Session* s, AudioRegionView* arv)
|
||||||
arv->region_line_changed.connect ((sigc::mem_fun (*this, &AudioRegionEditor::refill_region_line)));
|
arv->region_line_changed.connect ((sigc::mem_fun (*this, &AudioRegionEditor::refill_region_line)));
|
||||||
|
|
||||||
_peak_amplitude.property_editable () = false;
|
_peak_amplitude.property_editable () = false;
|
||||||
_peak_amplitude.set_text (_("Calculating..."));
|
_peak_amplitude.set_width_chars (9);
|
||||||
|
_peak_amplitude.set_text (_("Analyzing"));
|
||||||
|
|
||||||
PeakAmplitudeFound.connect (_peak_amplitude_connection, invalidator (*this), std::bind (&AudioRegionEditor::peak_amplitude_found, this, _1), gui_context ());
|
PeakAmplitudeFound.connect (_peak_amplitude_connection, invalidator (*this), std::bind (&AudioRegionEditor::peak_amplitude_found, this, _1), gui_context ());
|
||||||
|
|
||||||
|
|
@ -171,8 +182,8 @@ AudioRegionEditor::gain_changed ()
|
||||||
const gain_t scale_amplitude = _audio_region->scale_amplitude ();
|
const gain_t scale_amplitude = _audio_region->scale_amplitude ();
|
||||||
|
|
||||||
float const region_gain_dB = accurate_coefficient_to_dB (fabsf (scale_amplitude));
|
float const region_gain_dB = accurate_coefficient_to_dB (fabsf (scale_amplitude));
|
||||||
if (region_gain_dB != gain_adjustment.get_value()) {
|
if (region_gain_dB != _gain_adjustment.get_value ()) {
|
||||||
gain_adjustment.set_value(region_gain_dB);
|
_gain_adjustment.set_value (region_gain_dB);
|
||||||
}
|
}
|
||||||
_polarity_toggle.set_active (scale_amplitude < 0);
|
_polarity_toggle.set_active (scale_amplitude < 0);
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +191,7 @@ AudioRegionEditor::gain_changed ()
|
||||||
void
|
void
|
||||||
AudioRegionEditor::gain_adjustment_changed ()
|
AudioRegionEditor::gain_adjustment_changed ()
|
||||||
{
|
{
|
||||||
float gain = dB_to_coefficient (gain_adjustment.get_value());
|
float gain = dB_to_coefficient (_gain_adjustment.get_value ());
|
||||||
if (_polarity_toggle.get_active ()) {
|
if (_polarity_toggle.get_active ()) {
|
||||||
gain *= -1;
|
gain *= -1;
|
||||||
}
|
}
|
||||||
|
|
@ -292,8 +303,7 @@ AudioRegionEditor::refill_region_line ()
|
||||||
cmi->set_active (rfx_id == 0 || param_id == UINT32_MAX);
|
cmi->set_active (rfx_id == 0 || param_id == UINT32_MAX);
|
||||||
cmi->signal_activate ().connect ([cmi, arv] () { if (cmi->get_active ()) {arv->set_region_gain_line (); } });
|
cmi->signal_activate ().connect ([cmi, arv] () { if (cmi->get_active ()) {arv->set_region_gain_line (); } });
|
||||||
|
|
||||||
_audio_region->foreach_plugin ([&rm_items, arv, &nth, &grp, &active_text, rfx_id, param_id](std::weak_ptr<RegionFxPlugin> wfx)
|
_audio_region->foreach_plugin ([&rm_items, arv, &nth, &grp, &active_text, rfx_id, param_id] (std::weak_ptr<RegionFxPlugin> wfx) {
|
||||||
{
|
|
||||||
std::shared_ptr<RegionFxPlugin> fx (wfx.lock ());
|
std::shared_ptr<RegionFxPlugin> fx (wfx.lock ());
|
||||||
if (!fx) {
|
if (!fx) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -339,7 +349,6 @@ AudioRegionEditor::refill_region_line ()
|
||||||
++nth;
|
++nth;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (rm_items.size () > 1) {
|
if (rm_items.size () > 1) {
|
||||||
_show_on_touch.set_sensitive (true);
|
_show_on_touch.set_sensitive (true);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -24,25 +24,25 @@
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <gtkmm/label.h>
|
|
||||||
#include <gtkmm/entry.h>
|
|
||||||
#include <gtkmm/box.h>
|
|
||||||
#include <gtkmm/checkbutton.h>
|
|
||||||
#include <gtkmm/button.h>
|
|
||||||
#include <gtkmm/arrow.h>
|
|
||||||
#include <gtkmm/frame.h>
|
|
||||||
#include <gtkmm/table.h>
|
|
||||||
#include <gtkmm/adjustment.h>
|
#include <gtkmm/adjustment.h>
|
||||||
|
#include <gtkmm/arrow.h>
|
||||||
|
#include <gtkmm/box.h>
|
||||||
|
#include <gtkmm/button.h>
|
||||||
|
#include <gtkmm/checkbutton.h>
|
||||||
|
#include <gtkmm/entry.h>
|
||||||
|
#include <gtkmm/frame.h>
|
||||||
|
#include <gtkmm/label.h>
|
||||||
#include <gtkmm/separator.h>
|
#include <gtkmm/separator.h>
|
||||||
#include <gtkmm/spinbutton.h>
|
#include <gtkmm/spinbutton.h>
|
||||||
|
#include <gtkmm/table.h>
|
||||||
|
|
||||||
#include "widgets/ardour_dropdown.h"
|
#include "widgets/ardour_dropdown.h"
|
||||||
|
|
||||||
#include "pbd/signals.h"
|
|
||||||
#include "pbd/crossthread.h"
|
#include "pbd/crossthread.h"
|
||||||
|
#include "pbd/signals.h"
|
||||||
|
|
||||||
#include "audio_clock.h"
|
|
||||||
#include "ardour_dialog.h"
|
#include "ardour_dialog.h"
|
||||||
|
#include "audio_clock.h"
|
||||||
#include "region_editor.h"
|
#include "region_editor.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
|
|
@ -62,7 +62,6 @@ public:
|
||||||
void on_unmap ();
|
void on_unmap ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void region_changed (PBD::PropertyChange const&);
|
void region_changed (PBD::PropertyChange const&);
|
||||||
void region_fx_changed ();
|
void region_fx_changed ();
|
||||||
|
|
||||||
|
|
@ -79,9 +78,9 @@ private:
|
||||||
AudioRegionView* _arv;
|
AudioRegionView* _arv;
|
||||||
std::shared_ptr<ARDOUR::AudioRegion> _audio_region;
|
std::shared_ptr<ARDOUR::AudioRegion> _audio_region;
|
||||||
|
|
||||||
Gtk::Label gain_label;
|
Gtk::Label _gain_label;
|
||||||
Gtk::Adjustment gain_adjustment;
|
Gtk::Adjustment _gain_adjustment;
|
||||||
Gtk::SpinButton gain_entry;
|
Gtk::SpinButton _gain_entry;
|
||||||
|
|
||||||
Gtk::Label _polarity_label;
|
Gtk::Label _polarity_label;
|
||||||
Gtk::CheckButton _polarity_toggle;
|
Gtk::CheckButton _polarity_toggle;
|
||||||
|
|
@ -98,9 +97,11 @@ private:
|
||||||
PBD::ScopedConnection _ctrl_touched_connection;
|
PBD::ScopedConnection _ctrl_touched_connection;
|
||||||
|
|
||||||
void signal_peak_thread ();
|
void signal_peak_thread ();
|
||||||
pthread_t _peak_amplitude_thread_handle;
|
|
||||||
void peak_amplitude_found (double);
|
void peak_amplitude_found (double);
|
||||||
|
|
||||||
PBD::Signal<void (double)> PeakAmplitudeFound;
|
PBD::Signal<void (double)> PeakAmplitudeFound;
|
||||||
|
|
||||||
|
pthread_t _peak_amplitude_thread_handle;
|
||||||
PBD::ScopedConnection _peak_amplitude_connection;
|
PBD::ScopedConnection _peak_amplitude_connection;
|
||||||
CrossThreadChannel _peak_channel;
|
CrossThreadChannel _peak_channel;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include "gtkmm2ext/dndtreeview.h"
|
#include "gtkmm2ext/dndtreeview.h"
|
||||||
|
|
||||||
|
#include "widgets/ardour_spacer.h"
|
||||||
#include "widgets/tooltips.h"
|
#include "widgets/tooltips.h"
|
||||||
|
|
||||||
#include "ardour/plugin_manager.h"
|
#include "ardour/plugin_manager.h"
|
||||||
|
|
@ -50,12 +51,12 @@
|
||||||
#include "main_clock.h"
|
#include "main_clock.h"
|
||||||
#include "mixer_ui.h"
|
#include "mixer_ui.h"
|
||||||
#include "new_plugin_preset_dialog.h"
|
#include "new_plugin_preset_dialog.h"
|
||||||
#include "region_editor.h"
|
|
||||||
#include "region_view.h"
|
|
||||||
#include "timers.h"
|
|
||||||
#include "plugin_selector.h"
|
#include "plugin_selector.h"
|
||||||
#include "plugin_window_proxy.h"
|
#include "plugin_window_proxy.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
|
#include "region_editor.h"
|
||||||
|
#include "region_view.h"
|
||||||
|
#include "timers.h"
|
||||||
|
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
||||||
|
|
@ -70,19 +71,16 @@ RegionEditor::RegionFxBox* RegionEditor::RegionFxBox::current_rfx_box = 0;
|
||||||
|
|
||||||
RegionEditor::RegionEditor (Session* s, RegionView* rv)
|
RegionEditor::RegionEditor (Session* s, RegionView* rv)
|
||||||
: SessionHandlePtr (s)
|
: SessionHandlePtr (s)
|
||||||
, _table (9, 3)
|
|
||||||
, _table_row (0)
|
|
||||||
, _region (rv->region ())
|
, _region (rv->region ())
|
||||||
, name_label (_("Name:"))
|
, _name_label (_("Name:"))
|
||||||
, audition_button (_("Audition"))
|
, _audition_button (_("Audition"))
|
||||||
, _clock_group (new ClockGroup)
|
, _clock_group (new ClockGroup)
|
||||||
, position_clock (X_("regionposition"), true, "", true, false)
|
, _position_clock (X_("regionposition"), true, "", true, false)
|
||||||
, end_clock (X_("regionend"), true, "", true, false)
|
, _end_clock (X_("regionend"), true, "", true, false)
|
||||||
, length_clock (X_("regionlength"), true, "", true, false, true)
|
, _length_clock (X_("regionlength"), true, "", true, false, true)
|
||||||
, sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, "", true, false)
|
, _sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, "", true, false)
|
||||||
, sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, "", true, false)
|
, _sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, "", true, false)
|
||||||
/* XXX cannot file start yet */
|
, _start_clock (X_("regionstart"), true, "", false, false)
|
||||||
, start_clock (X_("regionstart"), true, "", false, false)
|
|
||||||
, _region_fx_box (_region)
|
, _region_fx_box (_region)
|
||||||
, _sources (1)
|
, _sources (1)
|
||||||
{
|
{
|
||||||
|
|
@ -96,43 +94,43 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv)
|
||||||
}
|
}
|
||||||
// ARDOUR_UI::instance()->primary_clock->mode_changed.connect (sigc::mem_fun (*this, &RegionEditor::set_clock_mode_from_primary));
|
// ARDOUR_UI::instance()->primary_clock->mode_changed.connect (sigc::mem_fun (*this, &RegionEditor::set_clock_mode_from_primary));
|
||||||
|
|
||||||
_clock_group->add (position_clock);
|
_clock_group->add (_position_clock);
|
||||||
_clock_group->add (end_clock);
|
_clock_group->add (_end_clock);
|
||||||
_clock_group->add (length_clock);
|
_clock_group->add (_length_clock);
|
||||||
_clock_group->add (sync_offset_relative_clock);
|
_clock_group->add (_sync_offset_relative_clock);
|
||||||
_clock_group->add (sync_offset_absolute_clock);
|
_clock_group->add (_sync_offset_absolute_clock);
|
||||||
_clock_group->add (start_clock);
|
_clock_group->add (_start_clock);
|
||||||
|
|
||||||
position_clock.set_session (_session);
|
_position_clock.set_session (_session);
|
||||||
end_clock.set_session (_session);
|
_end_clock.set_session (_session);
|
||||||
length_clock.set_session (_session);
|
_length_clock.set_session (_session);
|
||||||
sync_offset_relative_clock.set_session (_session);
|
_sync_offset_relative_clock.set_session (_session);
|
||||||
sync_offset_absolute_clock.set_session (_session);
|
_sync_offset_absolute_clock.set_session (_session);
|
||||||
start_clock.set_session (_session);
|
_start_clock.set_session (_session);
|
||||||
|
|
||||||
ArdourWidgets::set_tooltip (audition_button, _("audition this region"));
|
ArdourWidgets::set_tooltip (_audition_button, _("audition this region"));
|
||||||
|
|
||||||
audition_button.set_can_focus (false);
|
_audition_button.set_can_focus (false);
|
||||||
|
|
||||||
audition_button.set_events (audition_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));
|
||||||
|
|
||||||
name_entry.set_name ("RegionEditorEntry");
|
_name_entry.set_name ("RegionEditorEntry");
|
||||||
name_label.set_name ("RegionEditorLabel");
|
_name_label.set_name ("RegionEditorLabel");
|
||||||
position_label.set_name ("RegionEditorLabel");
|
_position_label.set_name ("RegionEditorLabel");
|
||||||
position_label.set_text (_("Position:"));
|
_position_label.set_text (_("Position"));
|
||||||
end_label.set_name ("RegionEditorLabel");
|
_end_label.set_name ("RegionEditorLabel");
|
||||||
end_label.set_text (_("End:"));
|
_end_label.set_text (_("End"));
|
||||||
length_label.set_name ("RegionEditorLabel");
|
_length_label.set_name ("RegionEditorLabel");
|
||||||
length_label.set_text (_("Length:"));
|
_length_label.set_text (_("Length"));
|
||||||
sync_relative_label.set_name ("RegionEditorLabel");
|
_sync_relative_label.set_name ("RegionEditorLabel");
|
||||||
sync_relative_label.set_text (_("Sync point (relative to region):"));
|
_sync_relative_label.set_text (_("Sync point (relative to region)"));
|
||||||
sync_absolute_label.set_name ("RegionEditorLabel");
|
_sync_absolute_label.set_name ("RegionEditorLabel");
|
||||||
sync_absolute_label.set_text (_("Sync point (absolute):"));
|
_sync_absolute_label.set_text (_("Sync point (absolute)"));
|
||||||
start_label.set_name ("RegionEditorLabel");
|
_start_label.set_name ("RegionEditorLabel");
|
||||||
start_label.set_text (_("File start:"));
|
_start_label.set_text (_("File start"));
|
||||||
_sources_label.set_name ("RegionEditorLabel");
|
_sources_label.set_name ("RegionEditorLabel");
|
||||||
region_fx_label.set_text (_("Region Effects"));
|
_region_fx_label.set_text (_("Region Effects"));
|
||||||
region_fx_label.set_name ("RegionEditorLabel");
|
_region_fx_label.set_name ("RegionEditorLabel");
|
||||||
|
|
||||||
if (_region->sources ().size () > 1) {
|
if (_region->sources ().size () > 1) {
|
||||||
_sources_label.set_text (_("Sources:"));
|
_sources_label.set_text (_("Sources:"));
|
||||||
|
|
@ -140,60 +138,74 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv)
|
||||||
_sources_label.set_text (_("Source:"));
|
_sources_label.set_text (_("Source:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
_table.set_col_spacings (12);
|
_table_clocks.set_col_spacings (12);
|
||||||
_table.set_row_spacings (6);
|
_table_clocks.set_row_spacings (6);
|
||||||
_table.set_border_width (12);
|
_table_clocks.set_border_width (0);
|
||||||
|
_table_clocks.set_homogeneous ();
|
||||||
|
|
||||||
name_label.set_alignment (1, 0.5);
|
_table_main.set_col_spacings (12);
|
||||||
position_label.set_alignment (1, 0.5);
|
_table_main.set_row_spacings (6);
|
||||||
end_label.set_alignment (1, 0.5);
|
_table_main.set_border_width (12);
|
||||||
length_label.set_alignment (1, 0.5);
|
|
||||||
sync_relative_label.set_alignment (1, 0.5);
|
_name_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);
|
_sources_label.set_alignment (1, 0.5);
|
||||||
|
_position_label.set_alignment (0, 0.5);
|
||||||
|
_end_label.set_alignment (1, 0.5);
|
||||||
|
_length_label.set_alignment (0, 0.5);
|
||||||
|
_sync_relative_label.set_alignment (1, 0.5);
|
||||||
|
_start_label.set_alignment (0, 0.5);
|
||||||
|
_sync_absolute_label.set_alignment (1, 0.5);
|
||||||
|
|
||||||
|
/* Name & Audition Box */
|
||||||
Gtk::HBox* nb = Gtk::manage (new Gtk::HBox);
|
Gtk::HBox* nb = Gtk::manage (new Gtk::HBox);
|
||||||
nb->set_spacing (6);
|
nb->set_spacing (6);
|
||||||
nb->pack_start (name_entry);
|
nb->pack_start (_name_entry);
|
||||||
nb->pack_start (audition_button, false, false);
|
nb->pack_start (_audition_button, false, false);
|
||||||
|
|
||||||
_table.attach (name_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
/* Clock Layout */
|
||||||
_table.attach (*nb, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
|
||||||
++_table_row;
|
|
||||||
|
|
||||||
_table.attach (position_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
int row = 0;
|
||||||
_table.attach (position_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
_table_clocks.attach (_position_label, 0, 2, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
++_table_row;
|
_table_clocks.attach (_end_label, 2, 4, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
|
++row;
|
||||||
|
|
||||||
_table.attach (end_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
_table_clocks.attach (_position_clock, 0, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
_table.attach (end_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
_table_clocks.attach (_end_clock, 2, 4, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
++_table_row;
|
++row;
|
||||||
|
|
||||||
_table.attach (length_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
_table_clocks.attach (_length_label, 0, 1, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
_table.attach (length_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
_table_clocks.attach (_sync_relative_label, 1, 4, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
++_table_row;
|
++row;
|
||||||
|
|
||||||
_table.attach (sync_relative_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
_table_clocks.attach (_length_clock, 0, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
_table.attach (sync_offset_relative_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
_table_clocks.attach (_sync_offset_relative_clock, 2, 4, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
++_table_row;
|
++row;
|
||||||
|
|
||||||
_table.attach (sync_absolute_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
_table_clocks.attach (_start_label, 0, 1, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
_table.attach (sync_offset_absolute_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
_table_clocks.attach (_sync_absolute_label, 1, 4, row, row + 1, Gtk::FILL, Gtk::FILL);
|
||||||
++_table_row;
|
++row;
|
||||||
|
|
||||||
_table.attach (start_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
_table_clocks.attach (_start_clock, 0, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
_table.attach (start_clock, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
_table_clocks.attach (_sync_offset_absolute_clock, 2, 4, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
++_table_row;
|
++row;
|
||||||
|
|
||||||
_table.attach (_sources_label, 0, 1, _table_row, _table_row + 1, Gtk::FILL, Gtk::FILL);
|
/* Main layout */
|
||||||
_table.attach (_sources, 1, 2, _table_row, _table_row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
|
||||||
++_table_row;
|
|
||||||
|
|
||||||
_table.attach (region_fx_label, 2, 3, 0, 1, Gtk::FILL, Gtk::FILL);
|
_table_main.attach (_name_label, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK);
|
||||||
_table.attach (_region_fx_box, 2, 3, 1, _table_row + 2, Gtk::FILL, Gtk::FILL);
|
_table_main.attach (*nb, 1, 3, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK);
|
||||||
|
|
||||||
add (_table);
|
_table_main.attach (_sources_label, 0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK);
|
||||||
|
_table_main.attach (_sources, 1, 3, 1, 2, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK);
|
||||||
|
|
||||||
|
_table_main.attach (_table_clocks, 1, 2, 2, 3, Gtk::FILL, Gtk::SHRINK);
|
||||||
|
|
||||||
|
_table_main.attach (*manage (new ArdourWidgets::ArdourVSpacer (0)), 2, 3, 2, 4, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
|
||||||
|
_table_main.attach (*manage (new ArdourWidgets::ArdourHSpacer (0)), 0, 3, 4, 5, Gtk::FILL, Gtk::FILL | Gtk::EXPAND);
|
||||||
|
|
||||||
|
_table_main.attach (_region_fx_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||||
|
_table_main.attach (_region_fx_box, 3, 4, 1, 5, Gtk::FILL, Gtk::EXPAND | Gtk::FILL);
|
||||||
|
|
||||||
|
add (_table_main);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < _region->sources ().size (); ++i) {
|
for (uint32_t i = 0; i < _region->sources ().size (); ++i) {
|
||||||
_sources.append (_region->source (i)->name ());
|
_sources.append (_region->source (i)->name ());
|
||||||
|
|
@ -204,7 +216,7 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv)
|
||||||
assert (t);
|
assert (t);
|
||||||
t->property_ellipsize () = Pango::ELLIPSIZE_END;
|
t->property_ellipsize () = Pango::ELLIPSIZE_END;
|
||||||
|
|
||||||
region_fx_label.set_no_show_all ();
|
_region_fx_label.set_no_show_all ();
|
||||||
_region_fx_box.set_no_show_all ();
|
_region_fx_box.set_no_show_all ();
|
||||||
|
|
||||||
show_all ();
|
show_all ();
|
||||||
|
|
@ -219,14 +231,14 @@ RegionEditor::RegionEditor (Session* s, RegionView* rv)
|
||||||
|
|
||||||
bounds_changed (change);
|
bounds_changed (change);
|
||||||
|
|
||||||
_region->PropertyChanged.connect (state_connection, invalidator (*this), std::bind (&RegionEditor::region_changed, this, _1), gui_context());
|
_region->PropertyChanged.connect (_state_connection, invalidator (*this), std::bind (&RegionEditor::region_changed, this, _1), gui_context ());
|
||||||
_region->RegionFxChanged.connect (region_connection, invalidator (*this), std::bind (&RegionEditor::region_fx_changed, this), gui_context ());
|
_region->RegionFxChanged.connect (_region_connection, invalidator (*this), std::bind (&RegionEditor::region_fx_changed, this), gui_context ());
|
||||||
|
|
||||||
spin_arrow_grab = false;
|
_spin_arrow_grab = false;
|
||||||
|
|
||||||
/* for now only audio region effects are supported */
|
/* for now only audio region effects are supported */
|
||||||
if (std::dynamic_pointer_cast<AudioRegion> (_region)) {
|
if (std::dynamic_pointer_cast<AudioRegion> (_region)) {
|
||||||
region_fx_label.show ();
|
_region_fx_label.show ();
|
||||||
_region_fx_box.show ();
|
_region_fx_box.show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -277,10 +289,10 @@ RegionEditor::bpressed (GdkEventButton* ev, Gtk::SpinButton* /*but*/, void (Regi
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
if (ev->type == GDK_BUTTON_PRESS) { /* no double clicks here */
|
if (ev->type == GDK_BUTTON_PRESS) { /* no double clicks here */
|
||||||
if (!spin_arrow_grab) {
|
if (!_spin_arrow_grab) {
|
||||||
// GTK2FIX probably nuke the region editor
|
// GTK2FIX probably nuke the region editor
|
||||||
// if ((ev->window == but->gobj()->panel)) {
|
// if ((ev->window == but->gobj()->panel)) {
|
||||||
// spin_arrow_grab = true;
|
// _spin_arrow_grab = true;
|
||||||
// (this->*pmf)();
|
// (this->*pmf)();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
@ -295,9 +307,9 @@ RegionEditor::bpressed (GdkEventButton* ev, Gtk::SpinButton* /*but*/, void (Regi
|
||||||
gint
|
gint
|
||||||
RegionEditor::breleased (GdkEventButton* /*ev*/, Gtk::SpinButton* /*but*/, void (RegionEditor::*pmf) ())
|
RegionEditor::breleased (GdkEventButton* /*ev*/, Gtk::SpinButton* /*but*/, void (RegionEditor::*pmf) ())
|
||||||
{
|
{
|
||||||
if (spin_arrow_grab) {
|
if (_spin_arrow_grab) {
|
||||||
(this->*pmf) ();
|
(this->*pmf) ();
|
||||||
spin_arrow_grab = false;
|
_spin_arrow_grab = false;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -305,17 +317,17 @@ RegionEditor::breleased (GdkEventButton* /*ev*/, Gtk::SpinButton* /*but*/, void
|
||||||
void
|
void
|
||||||
RegionEditor::connect_editor_events ()
|
RegionEditor::connect_editor_events ()
|
||||||
{
|
{
|
||||||
name_entry.signal_changed().connect (sigc::mem_fun(*this, &RegionEditor::name_entry_changed));
|
_name_entry.signal_changed ().connect (sigc::mem_fun (*this, &RegionEditor::name_entry_changed));
|
||||||
|
|
||||||
position_clock.ValueChanged.connect (sigc::mem_fun(*this, &RegionEditor::position_clock_changed));
|
_position_clock.ValueChanged.connect (sigc::mem_fun (*this, &RegionEditor::position_clock_changed));
|
||||||
end_clock.ValueChanged.connect (sigc::mem_fun(*this, &RegionEditor::end_clock_changed));
|
_end_clock.ValueChanged.connect (sigc::mem_fun (*this, &RegionEditor::end_clock_changed));
|
||||||
length_clock.ValueChanged.connect (sigc::mem_fun(*this, &RegionEditor::length_clock_changed));
|
_length_clock.ValueChanged.connect (sigc::mem_fun (*this, &RegionEditor::length_clock_changed));
|
||||||
sync_offset_absolute_clock.ValueChanged.connect (sigc::mem_fun (*this, &RegionEditor::sync_offset_absolute_clock_changed));
|
_sync_offset_absolute_clock.ValueChanged.connect (sigc::mem_fun (*this, &RegionEditor::sync_offset_absolute_clock_changed));
|
||||||
sync_offset_relative_clock.ValueChanged.connect (sigc::mem_fun (*this, &RegionEditor::sync_offset_relative_clock_changed));
|
_sync_offset_relative_clock.ValueChanged.connect (sigc::mem_fun (*this, &RegionEditor::sync_offset_relative_clock_changed));
|
||||||
|
|
||||||
audition_button.signal_toggled().connect (sigc::mem_fun(*this, &RegionEditor::audition_button_toggled));
|
_audition_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionEditor::audition_button_toggled));
|
||||||
|
|
||||||
_session->AuditionActive.connect (audition_connection, invalidator (*this), std::bind (&RegionEditor::audition_state_changed, this, _1), gui_context());
|
_session->AuditionActive.connect (_audition_connection, invalidator (*this), std::bind (&RegionEditor::audition_state_changed, this, _1), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -329,7 +341,7 @@ RegionEditor::position_clock_changed ()
|
||||||
in_command = true;
|
in_command = true;
|
||||||
|
|
||||||
_region->clear_changes ();
|
_region->clear_changes ();
|
||||||
_region->set_position (position_clock.last_when());
|
_region->set_position (_position_clock.last_when ());
|
||||||
_session->add_command (new StatefulDiffCommand (_region));
|
_session->add_command (new StatefulDiffCommand (_region));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -349,7 +361,7 @@ RegionEditor::end_clock_changed ()
|
||||||
in_command = true;
|
in_command = true;
|
||||||
|
|
||||||
_region->clear_changes ();
|
_region->clear_changes ();
|
||||||
_region->trim_end (end_clock.last_when());
|
_region->trim_end (_end_clock.last_when ());
|
||||||
_session->add_command (new StatefulDiffCommand (_region));
|
_session->add_command (new StatefulDiffCommand (_region));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,13 +369,13 @@ RegionEditor::end_clock_changed ()
|
||||||
PublicEditor::instance ().commit_reversible_command ();
|
PublicEditor::instance ().commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
end_clock.set (_region->nt_last(), true);
|
_end_clock.set (_region->nt_last (), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RegionEditor::length_clock_changed ()
|
RegionEditor::length_clock_changed ()
|
||||||
{
|
{
|
||||||
timecnt_t len = length_clock.current_duration();
|
timecnt_t len = _length_clock.current_duration ();
|
||||||
bool in_command = false;
|
bool in_command = false;
|
||||||
std::shared_ptr<Playlist> pl = _region->playlist ();
|
std::shared_ptr<Playlist> pl = _region->playlist ();
|
||||||
|
|
||||||
|
|
@ -384,13 +396,13 @@ RegionEditor::length_clock_changed ()
|
||||||
PublicEditor::instance ().commit_reversible_command ();
|
PublicEditor::instance ().commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
length_clock.set_duration (_region->length());
|
_length_clock.set_duration (_region->length ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RegionEditor::audition_button_toggled ()
|
RegionEditor::audition_button_toggled ()
|
||||||
{
|
{
|
||||||
if (audition_button.get_active()) {
|
if (_audition_button.get_active ()) {
|
||||||
_session->audition_region (_region);
|
_session->audition_region (_region);
|
||||||
} else {
|
} else {
|
||||||
_session->cancel_audition ();
|
_session->cancel_audition ();
|
||||||
|
|
@ -400,8 +412,8 @@ RegionEditor::audition_button_toggled ()
|
||||||
void
|
void
|
||||||
RegionEditor::name_changed ()
|
RegionEditor::name_changed ()
|
||||||
{
|
{
|
||||||
if (name_entry.get_text() != _region->name()) {
|
if (_name_entry.get_text () != _region->name ()) {
|
||||||
name_entry.set_text (_region->name());
|
_name_entry.set_text (_region->name ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -409,9 +421,9 @@ void
|
||||||
RegionEditor::bounds_changed (const PropertyChange& what_changed)
|
RegionEditor::bounds_changed (const PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
if (what_changed.contains (ARDOUR::Properties::length)) {
|
if (what_changed.contains (ARDOUR::Properties::length)) {
|
||||||
position_clock.set (_region->position(), true);
|
_position_clock.set (_region->position (), true);
|
||||||
end_clock.set (_region->nt_last(), true);
|
_end_clock.set (_region->nt_last (), true);
|
||||||
length_clock.set_duration (_region->length(), true);
|
_length_clock.set_duration (_region->length (), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::length)) {
|
if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::length)) {
|
||||||
|
|
@ -422,28 +434,27 @@ RegionEditor::bounds_changed (const PropertyChange& what_changed)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (what_changed.contains (ARDOUR::Properties::sync_position)) {
|
if (what_changed.contains (ARDOUR::Properties::sync_position)) {
|
||||||
sync_offset_relative_clock.set_duration (off, true);
|
_sync_offset_relative_clock.set_duration (off, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_offset_absolute_clock.set (_region->position () + off, true);
|
_sync_offset_absolute_clock.set (_region->position () + off, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (what_changed.contains (ARDOUR::Properties::start)) {
|
if (what_changed.contains (ARDOUR::Properties::start)) {
|
||||||
start_clock.set (timepos_t (_region->start()), true);
|
_start_clock.set (timepos_t (_region->start ()), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RegionEditor::activation ()
|
RegionEditor::activation ()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RegionEditor::name_entry_changed ()
|
RegionEditor::name_entry_changed ()
|
||||||
{
|
{
|
||||||
if (name_entry.get_text() != _region->name()) {
|
if (_name_entry.get_text () != _region->name ()) {
|
||||||
_region->set_name (name_entry.get_text());
|
_region->set_name (_name_entry.get_text ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -453,7 +464,7 @@ RegionEditor::audition_state_changed (bool yn)
|
||||||
ENSURE_GUI_THREAD (*this, &RegionEditor::audition_state_changed, yn)
|
ENSURE_GUI_THREAD (*this, &RegionEditor::audition_state_changed, yn)
|
||||||
|
|
||||||
if (!yn) {
|
if (!yn) {
|
||||||
audition_button.set_active (false);
|
_audition_button.set_active (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -463,7 +474,7 @@ RegionEditor::sync_offset_absolute_clock_changed ()
|
||||||
PublicEditor::instance ().begin_reversible_command (_("change region sync point"));
|
PublicEditor::instance ().begin_reversible_command (_("change region sync point"));
|
||||||
|
|
||||||
_region->clear_changes ();
|
_region->clear_changes ();
|
||||||
_region->set_sync_position (sync_offset_absolute_clock.last_when());
|
_region->set_sync_position (_sync_offset_absolute_clock.last_when ());
|
||||||
_session->add_command (new StatefulDiffCommand (_region));
|
_session->add_command (new StatefulDiffCommand (_region));
|
||||||
|
|
||||||
PublicEditor::instance ().commit_reversible_command ();
|
PublicEditor::instance ().commit_reversible_command ();
|
||||||
|
|
@ -475,7 +486,7 @@ RegionEditor::sync_offset_relative_clock_changed ()
|
||||||
PublicEditor::instance ().begin_reversible_command (_("change region sync point"));
|
PublicEditor::instance ().begin_reversible_command (_("change region sync point"));
|
||||||
|
|
||||||
_region->clear_changes ();
|
_region->clear_changes ();
|
||||||
_region->set_sync_position (sync_offset_relative_clock.last_when() + _region->position ());
|
_region->set_sync_position (_sync_offset_relative_clock.last_when () + _region->position ());
|
||||||
_session->add_command (new StatefulDiffCommand (_region));
|
_session->add_command (new StatefulDiffCommand (_region));
|
||||||
|
|
||||||
PublicEditor::instance ().commit_reversible_command ();
|
PublicEditor::instance ().commit_reversible_command ();
|
||||||
|
|
|
||||||
|
|
@ -23,20 +23,20 @@
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <gtkmm/label.h>
|
|
||||||
#include <gtkmm/entry.h>
|
|
||||||
#include <gtkmm/box.h>
|
|
||||||
#include <gtkmm/eventbox.h>
|
|
||||||
#include <gtkmm/togglebutton.h>
|
|
||||||
#include <gtkmm/button.h>
|
|
||||||
#include <gtkmm/arrow.h>
|
|
||||||
#include <gtkmm/frame.h>
|
|
||||||
#include <gtkmm/table.h>
|
|
||||||
#include <gtkmm/adjustment.h>
|
#include <gtkmm/adjustment.h>
|
||||||
#include <gtkmm/separator.h>
|
#include <gtkmm/arrow.h>
|
||||||
#include <gtkmm/spinbutton.h>
|
#include <gtkmm/box.h>
|
||||||
|
#include <gtkmm/button.h>
|
||||||
|
#include <gtkmm/entry.h>
|
||||||
|
#include <gtkmm/eventbox.h>
|
||||||
|
#include <gtkmm/frame.h>
|
||||||
|
#include <gtkmm/label.h>
|
||||||
#include <gtkmm/listviewtext.h>
|
#include <gtkmm/listviewtext.h>
|
||||||
#include <gtkmm/scrolledwindow.h>
|
#include <gtkmm/scrolledwindow.h>
|
||||||
|
#include <gtkmm/separator.h>
|
||||||
|
#include <gtkmm/spinbutton.h>
|
||||||
|
#include <gtkmm/table.h>
|
||||||
|
#include <gtkmm/togglebutton.h>
|
||||||
|
|
||||||
#include "gtkmm2ext/bindings.h"
|
#include "gtkmm2ext/bindings.h"
|
||||||
#include "gtkmm2ext/dndtreeview.h"
|
#include "gtkmm2ext/dndtreeview.h"
|
||||||
|
|
@ -70,8 +70,8 @@ protected:
|
||||||
virtual void region_changed (const PBD::PropertyChange&);
|
virtual void region_changed (const PBD::PropertyChange&);
|
||||||
virtual void region_fx_changed ();
|
virtual void region_fx_changed ();
|
||||||
|
|
||||||
Gtk::Table _table;
|
Gtk::Table _table_main;
|
||||||
int _table_row;
|
Gtk::Table _table_clocks;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class RegionFxEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable
|
class RegionFxEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable
|
||||||
|
|
@ -153,32 +153,37 @@ private:
|
||||||
|
|
||||||
void connect_editor_events ();
|
void connect_editor_events ();
|
||||||
|
|
||||||
Gtk::Label name_label;
|
Gtk::Label _name_label;
|
||||||
Gtk::Entry name_entry;
|
Gtk::Entry _name_entry;
|
||||||
Gtk::ToggleButton audition_button;
|
Gtk::Label _position_label;
|
||||||
|
Gtk::Label _end_label;
|
||||||
|
Gtk::Label _length_label;
|
||||||
|
Gtk::Label _sync_relative_label;
|
||||||
|
Gtk::Label _sync_absolute_label;
|
||||||
|
Gtk::Label _start_label;
|
||||||
|
Gtk::Label _region_fx_label;
|
||||||
|
|
||||||
Gtk::Label position_label;
|
Gtk::ToggleButton _audition_button;
|
||||||
Gtk::Label end_label;
|
|
||||||
Gtk::Label length_label;
|
|
||||||
Gtk::Label sync_relative_label;
|
|
||||||
Gtk::Label sync_absolute_label;
|
|
||||||
Gtk::Label start_label;
|
|
||||||
Gtk::Label region_fx_label;
|
|
||||||
|
|
||||||
ClockGroup* _clock_group;
|
ClockGroup* _clock_group;
|
||||||
|
|
||||||
AudioClock position_clock;
|
AudioClock _position_clock;
|
||||||
AudioClock end_clock;
|
AudioClock _end_clock;
|
||||||
AudioClock length_clock;
|
AudioClock _length_clock;
|
||||||
AudioClock sync_offset_relative_clock; ///< sync offset relative to the start of the region
|
AudioClock _sync_offset_relative_clock; ///< sync offset relative to the start of the region
|
||||||
AudioClock sync_offset_absolute_clock; ///< sync offset relative to the start of the timeline
|
AudioClock _sync_offset_absolute_clock; ///< sync offset relative to the start of the timeline
|
||||||
AudioClock start_clock;
|
AudioClock _start_clock;
|
||||||
|
|
||||||
RegionFxBox _region_fx_box;
|
RegionFxBox _region_fx_box;
|
||||||
|
|
||||||
PBD::ScopedConnection state_connection;
|
bool _spin_arrow_grab;
|
||||||
PBD::ScopedConnection audition_connection;
|
|
||||||
PBD::ScopedConnection region_connection;
|
Gtk::Label _sources_label;
|
||||||
|
Gtk::ListViewText _sources;
|
||||||
|
|
||||||
|
PBD::ScopedConnection _state_connection;
|
||||||
|
PBD::ScopedConnection _audition_connection;
|
||||||
|
PBD::ScopedConnection _region_connection;
|
||||||
|
|
||||||
void bounds_changed (const PBD::PropertyChange&);
|
void bounds_changed (const PBD::PropertyChange&);
|
||||||
void name_changed ();
|
void name_changed ();
|
||||||
|
|
@ -201,10 +206,5 @@ private:
|
||||||
|
|
||||||
bool on_delete_event (GdkEventAny*);
|
bool on_delete_event (GdkEventAny*);
|
||||||
|
|
||||||
bool spin_arrow_grab;
|
|
||||||
|
|
||||||
Gtk::Label _sources_label;
|
|
||||||
Gtk::ListViewText _sources;
|
|
||||||
|
|
||||||
void set_clock_mode_from_primary ();
|
void set_clock_mode_from_primary ();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue