summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_streamview.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-17 19:43:09 -0500
committerDavid Robillard <d@drobilla.net>2014-12-17 19:43:09 -0500
commitd2cafbe95a5784b7c306c24b0008379a41a909f7 (patch)
tree03216b0bd933f4d774634a7f8e14965fcf79c990 /gtk2_ardour/automation_streamview.cc
parent6e912a0aa31313636e2957ec0aa97d4103ee117f (diff)
Remove some aborts that don't really need to be.
Enforce PatchPrimaryKey sanity at the type level rather than attempting to check for it everywhere. Remove dead file.
Diffstat (limited to 'gtk2_ardour/automation_streamview.cc')
-rw-r--r--gtk2_ardour/automation_streamview.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc
index e504d13931..a336bd6db5 100644
--- a/gtk2_ardour/automation_streamview.cc
+++ b/gtk2_ardour/automation_streamview.cc
@@ -16,7 +16,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <cassert>
#include <cmath>
#include <list>
#include <utility>
@@ -43,6 +42,8 @@
#include "rgb_macros.h"
#include "selection.h"
+#include "i18n.h"
+
using namespace std;
using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS;
@@ -71,7 +72,9 @@ AutomationStreamView::~AutomationStreamView ()
RegionView*
AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region, bool wait_for_data, bool /*recording*/)
{
- assert (region);
+ if (!region) {
+ return 0;
+ }
if (wait_for_data) {
boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region);
@@ -88,7 +91,10 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
boost::shared_ptr<AutomationList> list;
if (control) {
list = boost::dynamic_pointer_cast<AutomationList>(control->list());
- assert(!control->list() || list);
+ if (control->list() && !list) {
+ error << _("unable to display automation region for control without list") << endmsg;
+ return 0;
+ }
}
AutomationRegionView *region_view;
@@ -285,8 +291,9 @@ AutomationStreamView::get_selectables (framepos_t start, framepos_t end, double
}
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
- assert (arv);
- arv->line()->get_selectables (start, end, botfrac, topfrac, results);
+ if (arv) {
+ arv->line()->get_selectables (start, end, botfrac, topfrac, results);
+ }
}
}
@@ -307,8 +314,9 @@ AutomationStreamView::get_lines () const
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
- assert (arv);
- lines.push_back (arv->line());
+ if (arv) {
+ lines.push_back (arv->line());
+ }
}
return lines;