From ed9f93063ce5d70cc7272cb52b8a9d2432ca9a99 Mon Sep 17 00:00:00 2001
From: Lewin Probst <info@emirror.de>
Date: Fri, 6 Sep 2019 14:41:27 +0200
Subject: [PATCH] Moved load functions of rfb and soundsource file to the file
 package.

---
 lib/+artoa/+controller/{ => +file}/loadRfb.m          | 11 ++++++++++-
 .../+controller/{ => +file}/loadSoundSourceFile.m     | 11 ++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)
 rename lib/+artoa/+controller/{ => +file}/loadRfb.m (65%)
 rename lib/+artoa/+controller/{ => +file}/loadSoundSourceFile.m (68%)

diff --git a/lib/+artoa/+controller/loadRfb.m b/lib/+artoa/+controller/+file/loadRfb.m
similarity index 65%
rename from lib/+artoa/+controller/loadRfb.m
rename to lib/+artoa/+controller/+file/loadRfb.m
index ad83cab..440827c 100644
--- a/lib/+artoa/+controller/loadRfb.m
+++ b/lib/+artoa/+controller/+file/loadRfb.m
@@ -6,10 +6,19 @@ global artoaDataInput;
 %% Initialize variables
 artoaDataInput.rfb = false;
 
+%% Get required variables
+folder = artoa.data.getMember(artoaDataInput, {'ini', 'directory', 'rfb'}, pwd());
+filter = artoa.data.getMember(artoaDataInput, {'ini', 'filemask', 'rfb'}, '*.rfb');
+
 %% Create file dialog and filename
-[file, path] = uigetfile('*.rfb');
+[file, path] = uigetfile(fullfile(folder, filter));
 filepath = fullfile(path, file);
 
+%% Check if the dialog has been aborted
+if file == 0
+    return;
+end
+
 %% Check if file exists
 if ~isfile(filepath)
     error([mfilename ': Selected file ' filepath ' is not a file! Please try again!']);
diff --git a/lib/+artoa/+controller/loadSoundSourceFile.m b/lib/+artoa/+controller/+file/loadSoundSourceFile.m
similarity index 68%
rename from lib/+artoa/+controller/loadSoundSourceFile.m
rename to lib/+artoa/+controller/+file/loadSoundSourceFile.m
index 4aaa1dd..e257cc6 100644
--- a/lib/+artoa/+controller/loadSoundSourceFile.m
+++ b/lib/+artoa/+controller/+file/loadSoundSourceFile.m
@@ -6,10 +6,19 @@ global artoaGui artoaDataInput;
 %% Initialize variables
 artoaDataInput.soundsources = false;
 
+%% Get required variables
+folder = artoa.data.getMember(artoaDataInput, {'ini', 'directory', 'soundsource'}, pwd());
+filter = artoa.data.getMember(artoaDataInput, {'ini', 'filemask', 'soundsource'}, '*.soso');
+
 %% Create file dialog and filename
-[file, path] = uigetfile('*.soso');
+[file, path] = uigetfile(fullfile(folder, filter));
 filepath = fullfile(path, file);
 
+%% Check if dialog has been aborted
+if file == 0
+    return;
+end
+
 %% Check if file exists
 if ~isfile(filepath)
     error([mfilename ': Selected file ' filepath ' is not a file! Please try again!']);
-- 
GitLab