I’m reviewing the @audioplayer
and @audiorecorder
classes and I believe the input validation can be simplified. Here is the complete function file for @audiorecorder/isrecording.m
function tf = isrecording (recorder)
if (nargin != 1)
print_usage ();
endif
tf = __recorder_isrecording__ (struct (recorder).recorder);
endfunction
My question is whether the nargin
check is required. When I am at a command prompt the function isrecording
is not visible. It only becomes visible when I use isrecording (recorder_obj)
. All of these old-style classes require a class object as the first input and so it seems unnecessary to make the check that there is at least one input.
@jwe: Is this correct about the way old-style classes work?