mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Gracefully handle MIDI parse failure.
This commit is contained in:
parent
f499f4cfd2
commit
4facff3b8e
1 changed files with 9 additions and 4 deletions
|
|
@ -283,10 +283,15 @@ SoundFileBox::setup_labels (const string& filename)
|
||||||
|
|
||||||
if (SMFSource::valid_midi_file (path)) {
|
if (SMFSource::valid_midi_file (path)) {
|
||||||
|
|
||||||
boost::shared_ptr<SMFSource> ms =
|
boost::shared_ptr<SMFSource> ms;
|
||||||
boost::dynamic_pointer_cast<SMFSource> (
|
try {
|
||||||
SourceFactory::createExternal (DataType::MIDI, *_session,
|
ms = boost::dynamic_pointer_cast<SMFSource> (
|
||||||
path, 0, Source::Flag (0), false));
|
SourceFactory::createExternal (DataType::MIDI, *_session,
|
||||||
|
path, 0, Source::Flag (0), false));
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
error << string_compose(_("Could not read file: %1 (%2)."),
|
||||||
|
path, e.what()) << endmsg;
|
||||||
|
}
|
||||||
|
|
||||||
preview_label.set_markup (_("<b>Midi File Information</b>"));
|
preview_label.set_markup (_("<b>Midi File Information</b>"));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue