#include <ardour/utils.h>
#include <ardour/configuration.h>
#include <ardour/session.h>
+#include <pbd/memento_command.h>
#include "ardour_ui.h"
#include "prompter.h"
#include "i18n.h"
using namespace ARDOUR;
+using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;
cd_track_details_hbox.pack_start (composer_entry, true, true);
isrc_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::isrc_entry_changed));
- isrc_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
- isrc_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-
performer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::performer_entry_changed));
- performer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
- performer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-
composer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::composer_entry_changed));
- composer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
- composer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
-
scms_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::scms_toggled));
preemph_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::preemph_toggled));
name_entry.set_size_request (100, -1);
name_entry.set_editable (true);
name_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::name_entry_changed));
- name_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
- name_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
if (!name_entry.get_parent()) {
item_table.attach (name_entry, 1, 2, 0, 1, FILL | EXPAND, FILL, 4, 0);
}
-gint
-LocationEditRow::entry_focus_event (GdkEventFocus* ev)
-{
- if (ev->in) {
- ARDOUR_UI::instance()->allow_focus (true);
- } else {
- ARDOUR_UI::instance()->allow_focus (false);
- }
- return TRUE;
-}
-
-
void
LocationEditRow::name_entry_changed ()
{
set_wmclass(_("ardour_locations"), "Ardour");
set_name ("LocationWindow");
- signal_delete_event().connect (bind (ptr_fun (just_hide_it), static_cast<Window*>(this)));
-
- add (location_hpacker);
+ get_vbox()->pack_start (location_hpacker);
location_vpacker.set_border_width (10);
location_vpacker.set_spacing (5);
-
location_vpacker.pack_start (loop_edit_row, false, false);
location_vpacker.pack_start (punch_edit_row, false, false);
}
session->begin_reversible_command (_("remove marker"));
- session->add_undo (session->locations()->get_memento());
+ XMLNode &before = session->locations()->get_state();
session->locations()->remove (loc);
- session->add_redo_no_execute (session->locations()->get_memento());
+ XMLNode &after = session->locations()->get_state();
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
session->commit_reversible_command ();
return FALSE;
jack_nframes_t where = session->audible_frame();
Location *location = new Location (where, where, "mark", Location::IsMark);
session->begin_reversible_command (_("add marker"));
- session->add_undo (session->locations()->get_memento());
+ XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
- session->add_redo_no_execute (session->locations()->get_memento());
+ XMLNode &after = session->locations()->get_state();
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
session->commit_reversible_command ();
}
{
if (session) {
jack_nframes_t where = session->audible_frame();
- Location *location = new Location (where, where, "unnamed");
+ Location *location = new Location (where, where, "unnamed",
+ Location::IsRangeMarker);
session->begin_reversible_command (_("add range marker"));
- session->add_undo (session->locations()->get_memento());
+ XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
- session->add_redo_no_execute (session->locations()->get_memento());
+ XMLNode &after = session->locations()->get_state();
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
session->commit_reversible_command ();
}
}
punch_edit_row.set_session (0);
punch_edit_row.set_location (0);
-
- ArdourDialog::session_gone();
+
+ ArdourDialog::session_gone ();
}
+bool
+LocationUI::on_delete_event (GdkEventAny* ev)
+{
+ hide ();
+ return true;
+}