From 12e9daacb7c04f074f96e7401b224e5bf10c95e5 Mon Sep 17 00:00:00 2001
From: "Dipl.-Ing. Jonas Stienen" <jst@akustik.rwth-aachen.de>
Date: Tue, 18 Dec 2018 09:19:55 +0100
Subject: [PATCH] Improving load function of Zoom session class, now will also
 detect zoom sessions without the common directory naming from the device

---
 applications/Hardware/ZoomH6/@itaZOOMSession/load.m | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/applications/Hardware/ZoomH6/@itaZOOMSession/load.m b/applications/Hardware/ZoomH6/@itaZOOMSession/load.m
index 6b905a01..30926577 100644
--- a/applications/Hardware/ZoomH6/@itaZOOMSession/load.m
+++ b/applications/Hardware/ZoomH6/@itaZOOMSession/load.m
@@ -15,6 +15,15 @@ function load( obj, session_path )
     catch
 
     end
+    
+    if isempty( obj.identifier )
+        lst = dir('*.hprj' );
+        if numel( lst ) ~= 1
+            error 'Could not interpret the given path as a zoom session';
+        else
+             [ ~, obj.identifier ] = fileparts( lst.name );
+        end
+    end
 
     if strcmpi( 'ZOOM', obj.identifier( 1:4 ) )
         id_cells = textscan( obj.identifier( 5:8 ), '%d' );
@@ -23,7 +32,7 @@ function load( obj, session_path )
 
     obj.session_ready = true;
 
-    lst = dir( obj.path );    
+    lst = dir( obj.path );
     for i = 1:numel( lst )
 
         % Skip folders
-- 
GitLab