284 |
"Adding dimension (type=0x%x, bits=%d, zones=%d)\n", |
"Adding dimension (type=0x%x, bits=%d, zones=%d)\n", |
285 |
dim.dimension, dim.bits, dim.zones |
dim.dimension, dim.bits, dim.zones |
286 |
); |
); |
287 |
|
// notify everybody that we're going to update the region |
288 |
|
region_to_be_changed_signal.emit(region); |
289 |
// add the new dimension to the region |
// add the new dimension to the region |
290 |
// (implicitly creates new dimension regions) |
// (implicitly creates new dimension regions) |
291 |
region->AddDimension(&dim); |
region->AddDimension(&dim); |
292 |
// let everybody know there was a change |
// let everybody know there was a change |
293 |
articulation_changed_signal.emit(); |
region_changed_signal.emit(region); |
294 |
// update all GUI elements |
// update all GUI elements |
295 |
refreshManager(); |
refreshManager(); |
296 |
} |
} |
297 |
} catch (RIFF::Exception e) { |
} catch (RIFF::Exception e) { |
298 |
|
// notify that the changes are over (i.e. to avoid dead locks) |
299 |
|
region_changed_signal.emit(region); |
300 |
|
// show error message |
301 |
Glib::ustring txt = "Could not add dimension: " + e.Message; |
Glib::ustring txt = "Could not add dimension: " + e.Message; |
302 |
Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR); |
Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR); |
303 |
msg.run(); |
msg.run(); |
309 |
Gtk::TreeModel::iterator it = sel->get_selected(); |
Gtk::TreeModel::iterator it = sel->get_selected(); |
310 |
if (it) { |
if (it) { |
311 |
try { |
try { |
312 |
|
// notify everybody that we're going to update the region |
313 |
|
region_to_be_changed_signal.emit(region); |
314 |
// remove selected dimension |
// remove selected dimension |
315 |
Gtk::TreeModel::Row row = *it; |
Gtk::TreeModel::Row row = *it; |
316 |
gig::dimension_def_t* dim = row[tableModel.m_definition]; |
gig::dimension_def_t* dim = row[tableModel.m_definition]; |
318 |
// remove respective row from table |
// remove respective row from table |
319 |
refTableModel->erase(it); |
refTableModel->erase(it); |
320 |
// let everybody know there was a change |
// let everybody know there was a change |
321 |
articulation_changed_signal.emit(); |
region_changed_signal.emit(region); |
322 |
} catch (RIFF::Exception e) { |
} catch (RIFF::Exception e) { |
323 |
|
// notify that the changes are over (i.e. to avoid dead locks) |
324 |
|
region_changed_signal.emit(region); |
325 |
|
// show error message |
326 |
Glib::ustring txt = "Could not remove dimension: " + e.Message; |
Glib::ustring txt = "Could not remove dimension: " + e.Message; |
327 |
Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR); |
Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR); |
328 |
msg.run(); |
msg.run(); |