From dae2f830f245e43e1ac12e7a596a1c0344368fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 24 Jan 2016 00:51:28 +0100 Subject: Include the memchecker into the other DG code. Especially, now check if a kit fits into RAM when loading it. --- src/drumgizmo.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/drumgizmo.cc') diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index f8f30b8..44cd73c 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -84,6 +84,13 @@ bool DrumGizmo::loadkit(std::string file) return false; } + // Check if there is enough free RAM to load the drumkit. + if(!memchecker.enoughFreeMemory(kit)) + { + ERR(drumgizmo, "Not enough free RAM to load the drumkit."); + return false; + } + loader.loadKit(&kit); #ifdef WITH_RESAMPLER -- cgit v1.2.3