diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2020-02-04 13:07:23 -0600 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2020-02-04 13:08:21 -0600 |
commit | a9b614fc188b06a149c7697d62c7cfbcbeb3ccce (patch) | |
tree | be48d6904f493997f745735b8ca18c506bdbce9b /libs/ardour/route.cc | |
parent | 00d1a0ed4d85ce72cf4efc30c30c54d38bb36fc5 (diff) |
Fix a potential case where PresentationInfo type flag is not set (see comment for details)
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 14805a62c4..07cc39669a 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2617,6 +2617,26 @@ Route::set_state (const XMLNode& node, int version) Stripable::set_state (node, version); + /* "This should never happen" + Stripable's job is to save/recall the PresentationInfo flags for bus/track audio/midi VCA etc. + But I found a case where no "type" flag is set, so the strip never shows up on any UI. + Since I don't know the source of the error, I have to assume that it could happen again. + So: if a stripable doesn't have any flags set, populate them from our audio/midi track/bus identity. + */ + PresentationInfo::Flag file_flags = _presentation_info.flags(); + if ( !(file_flags & PresentationInfo::TypeMask) ) { + if (dynamic_cast<AudioTrack*>(this)) { + _presentation_info.set_flags ( PresentationInfo::Flag (file_flags | PresentationInfo::AudioTrack) ); + } + else if (dynamic_cast<MidiTrack*>(this)) { + _presentation_info.set_flags ( PresentationInfo::Flag (file_flags | PresentationInfo::MidiTrack) ); + } + else if (dynamic_cast<Route*>(this)) { + //no idea what this is, so let's call it an audio bus + _presentation_info.set_flags ( PresentationInfo::Flag (file_flags | PresentationInfo::AudioBus) ); + } + } + node.get_property (X_("strict-io"), _strict_io); if (is_monitor()) { |