add Delete button to patch change dialog when editing it

git-svn-id: svn://localhost/ardour2/branches/3.0@13710 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-12-22 18:27:33 +00:00
parent 1d7e9daea4
commit 76d85fb411
4 changed files with 20 additions and 4 deletions

View File

@ -1141,6 +1141,9 @@ Editor::sensitize_the_right_region_actions ()
_region_actions->get_action("show-region-properties")->set_sensitive (false);
_region_actions->get_action("rename-region")->set_sensitive (false);
if (have_audio) {
/* XXX need to check whether there is than 1 per
playlist, because otherwise this makes no sense.
*/
_region_actions->get_action("combine-regions")->set_sensitive (true);
} else {
_region_actions->get_action("combine-regions")->set_sensitive (false);

View File

@ -3783,11 +3783,19 @@ MidiRegionView::trim_front_ending ()
void
MidiRegionView::edit_patch_change (ArdourCanvas::CanvasPatchChange* pc)
{
PatchChangeDialog d (&_source_relative_time_converter, trackview.session(), *pc->patch (), instrument_info(), Gtk::Stock::APPLY);
PatchChangeDialog d (&_source_relative_time_converter, trackview.session(), *pc->patch (), instrument_info(), Gtk::Stock::APPLY, true);
d.set_position (Gtk::WIN_POS_MOUSE);
int response = d.run();
if (d.run () != Gtk::RESPONSE_ACCEPT) {
switch (response) {
case Gtk::RESPONSE_ACCEPT:
break;
case Gtk::RESPONSE_REJECT:
delete_patch_change (pc);
return;
default:
return;
}

View File

@ -44,7 +44,8 @@ PatchChangeDialog::PatchChangeDialog (
ARDOUR::Session* session,
Evoral::PatchChange<Evoral::MusicalTime> const & patch,
ARDOUR::InstrumentInfo& info,
const Gtk::BuiltinStockID& ok
const Gtk::BuiltinStockID& ok,
bool allow_delete
)
: ArdourDialog (_("Patch Change"), true)
, _time_converter (tc)
@ -114,6 +115,9 @@ PatchChangeDialog::PatchChangeDialog (
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (ok, RESPONSE_ACCEPT);
if (allow_delete) {
add_button (Stock::DELETE, RESPONSE_REJECT);
}
set_default_response (RESPONSE_ACCEPT);
fill_bank_combo ();

View File

@ -45,7 +45,8 @@ public:
ARDOUR::Session *,
Evoral::PatchChange<Evoral::MusicalTime> const &,
ARDOUR::InstrumentInfo&,
const Gtk::BuiltinStockID &
const Gtk::BuiltinStockID &,
bool allow_delete = false
);
Evoral::PatchChange<Evoral::MusicalTime> patch () const;