-
Notifications
You must be signed in to change notification settings - Fork 15
/
compile_playrec.m
53 lines (44 loc) · 1.91 KB
/
compile_playrec.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function compile_playrec
% Make sure we can see external m files, even if this file is not in the
% current working directory but on the path somewhere
mfilepath = mfilename('fullpath');
mfilepath = mfilepath(1:end-length(mfilename));
addpath([mfilepath,'m_files'])
pa_path = find_folder(mfilepath, '.*portaudio.*', {'src/common', ...
'src/hostapi', ...
'src/os', ...
'include' ...
}, 5);
if is_os('WIN') || is_os('MAC')
asio_path = find_folder(mfilepath, '.*asio.*', {'common', ...
'host' ...
}, 5);
else
asio_path = '';
end
if is_os('WIN')
dsound_path = find_folder(mfilepath, '.*directx.*', {'include', ...
'lib/x86/dsound.lib' ...
}, 5);
if isempty(dsound_path) && ~isempty(getenv('PROGRAMFILES')) ...
&& exist(getenv('PROGRAMFILES'), 'dir')
dsound_path = find_folder(getenv('PROGRAMFILES'), ...
'.*directx.*', ...
{'include', 'lib/x86/dsound.lib'}, ...
1);
end
if isempty(dsound_path) && ~isempty(getenv('HOMEDRIVE')) ...
&& exist(getenv('HOMEDRIVE'), 'dir')
dsound_path = find_folder(getenv('HOMEDRIVE'), ...
'.*directx.*', ...
{'include', 'lib/x86/dsound.lib'}, ...
1);
end
else
dsound_path = '';
end
if is_octave
compile_playrec_cmd(asio_path, dsound_path, pa_path);
else
compile_playrec_gui('', asio_path, dsound_path, pa_path);
end