-
-gint
-AudioRegionEditor::breleased (GdkEventButton* /*ev*/, Gtk::SpinButton* /*but*/, void (AudioRegionEditor::*pmf)())
-{
- if (spin_arrow_grab) {
- (this->*pmf)();
- spin_arrow_grab = false;
- }
- return FALSE;
-}
-
-void
-AudioRegionEditor::connect_editor_events ()
-{
- name_entry.signal_changed().connect (mem_fun(*this, &AudioRegionEditor::name_entry_changed));
-
- position_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::position_clock_changed));
- end_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::end_clock_changed));
- length_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::length_clock_changed));
- sync_offset_absolute_clock.ValueChanged.connect (mem_fun (*this, &AudioRegionEditor::sync_offset_absolute_clock_changed));
- sync_offset_relative_clock.ValueChanged.connect (mem_fun (*this, &AudioRegionEditor::sync_offset_relative_clock_changed));
- gain_adjustment.signal_value_changed().connect (mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed));
-
- audition_button.signal_toggled().connect (mem_fun(*this, &AudioRegionEditor::audition_button_toggled));
- _session.AuditionActive.connect (mem_fun(*this, &AudioRegionEditor::audition_state_changed));
-}
-
-void
-AudioRegionEditor::position_clock_changed ()
-{
- _session.begin_reversible_command (_("change region start position"));
-
- boost::shared_ptr<Playlist> pl = _region->playlist();
-
- if (pl) {
- XMLNode &before = pl->get_state();
- _region->set_position (position_clock.current_time(), this);
- XMLNode &after = pl->get_state();
- _session.add_command(new MementoCommand<Playlist>(*pl, &before, &after));
- }
-
- _session.commit_reversible_command ();
-}
-
-void
-AudioRegionEditor::end_clock_changed ()
-{
- _session.begin_reversible_command (_("change region end position"));
-
- boost::shared_ptr<Playlist> pl = _region->playlist();
-
- if (pl) {
- XMLNode &before = pl->get_state();
- _region->trim_end (end_clock.current_time(), this);
- XMLNode &after = pl->get_state();
- _session.add_command(new MementoCommand<Playlist>(*pl, &before, &after));
- }
-
- _session.commit_reversible_command ();
-
- end_clock.set (_region->position() + _region->length() - 1, true);
-}
-
-void
-AudioRegionEditor::length_clock_changed ()
-{
- nframes_t frames = length_clock.current_time();
-
- _session.begin_reversible_command (_("change region length"));
-
- boost::shared_ptr<Playlist> pl = _region->playlist();
-
- if (pl) {
- XMLNode &before = pl->get_state();
- _region->trim_end (_region->position() + frames - 1, this);
- XMLNode &after = pl->get_state();
- _session.add_command(new MementoCommand<Playlist>(*pl, &before, &after));
- }
-
- _session.commit_reversible_command ();
-
- length_clock.set (_region->length());
-}
-