Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[7c7a96]: blockproc / blockdone.m Maximize Restore History

Download this file

blockdone.m    29 lines (26 with data), 859 Bytes

 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
function blockdone(varargin)
%BLOCKDONE Destroy the current blockstream
% Usage: blockdone();
%
% `blockdone()` closes the current blockstream. The function resets
% the playrec tool and clear all buffers in block_interface.
%
% `blockdone(p1,p2,...)` in addition tries to call close methods on
% all input arguments which are JAVA objects (which are passed by reference).
%
% See also: block
% TO DO: Process additional zeros to compensate for the delay
block_interface('clearAll');
playrec('reset');
for ii=1:numel(varargin)
p = varargin{ii};
if isjava(p)
try
javaMethod('close',p);
catch
warning(sprintf('%s: Object %i does not have a close method.',upper(mfilename),ii));
end
elseif isstruct(p) && isfield(p,'destructor') && isa(p.destructor,'function_handle')
p.destructor();
end
end