Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion m_files/build_mex.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,24 @@
mex(build_args{:});
failed = 0;
else
failed = mex(build_args{:});
try
failed = mex(build_args{:});
catch
if is_os('MAC')
% this is expected because of mex can't cope with linking to framework
fprintf('\n\nmex cannot include the required frameworks on macos\n')
fprintf('Try compiling again with verbose mode turned on.\n')
fprintf('The last command to run probably starts somethinng like...\n')
fprintf('\tusr/bin/xcrun -sdk macosx11.1 clang -Wl,\n')
fprintf('Copy and paste this line onto the terminal and insert the\n')
fprintf('following text just before "mex_dll_core.o"\n')
fprintf('\t-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreFoundation -framework CoreServices\n')
fprintf('Running the modified link command should produce playrec.mexmaci\n\n')
end
end
end


function print_flush(varargin)

fprintf(varargin{:});
Expand Down
7 changes: 4 additions & 3 deletions m_files/compile_playrec_func.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
'src/hostapi/wasapi',...
'src/hostapi/wdmks',...
'src/hostapi/wmme',...
'src/os/mac_osx',...
'src/os/unix',...
'src/os/win',...
'include'}; %just include all possibilities!
Expand All @@ -76,7 +75,7 @@
%-platform /api specific
if is_os('MAC')
pa_os_specific_files = [pa_os_specific_files, ...
{'src/os/mac_osx/pa_mac_hostapis.c', ...
{'src/os/unix/pa_unix_hostapis.c', ...
'src/os/unix/pa_unix_util.c'}];
if use_asio
pa_api_specific_files = [pa_api_specific_files,...
Expand All @@ -101,7 +100,9 @@
'src/hostapi/coreaudio/pa_mac_core_utilities.c',...
'src/hostapi/coreaudio/pa_mac_core_blocking.c'}];

compiler_flags = [compiler_flags, {'PA_USE_COREAUDIO'}];
compiler_flags = [compiler_flags, {'PA_USE_COREAUDIO=1',...
'__MACOSX_CORE__'}];

end

if use_jack
Expand Down
4 changes: 2 additions & 2 deletions m_files/is_os.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
elseif strcmpi(required_os, 'MAC')
% Older versions of Matlab don't have 'ismac', so assume
% if ismac doesn't exist then it's not a mac!
if exist('ismac', 'builtin')
if exist('ismac')
ret_val = ismac;
end
elseif strcmpi(required_os, 'UNIX')
% UNIX should not be true if it's a mac.
ret_val = isunix;
if exist('ismac', 'builtin')
if exist('ismac')
if ismac
ret_val = 0;
end
Expand Down
4 changes: 2 additions & 2 deletions src/pa_dll_playrec.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
* Multiple states can be set at one time by using single bits for each state
* If required more states can be used by adding an additional #define and
* an additional element in _stateOpts[] for each state required.

/*
*
*
* BASIC_INIT = The exit function has been registered with mexAtExit.
* PortAudio has been succesfully initialised
* The state to return to on reset.
Expand Down