Mercurial > octave-nkf
comparison scripts/audio/@audiorecorder/get.m @ 19522:ee3ec3f02358
maint: moved @audiorecorder and @audioplayer folders inside the audio folder
author | Vytautas Jančauskas <unaudio@gmail.com> |
---|---|
date | Wed, 18 Sep 2013 00:16:28 +0300 |
parents | scripts/@audiorecorder/get.m@e1f98e402a7e |
children | 77b52b86b419 |
comparison
equal
deleted
inserted
replaced
19521:480407a8d226 | 19522:ee3ec3f02358 |
---|---|
1 ## -*- texinfo -*- | |
2 ## @deftypefn{Function File} @var{Value} = get (@var{recorderObj}, @var{Name}) | |
3 ## Returns the @var{Value} of the property identified by @var{Name}. | |
4 ## @deftypefnx{Function File} @var{Values} = get (@var{recorderObj}, @{@var{Name1}, ... , @var{NameN}@}) | |
5 ## Returns the @var{Values} of the properties identified by @var{Name1} to @var{NameN}. | |
6 ## @deftypefnx{Function File} @var{Values} = get (@var{recorderObj}) | |
7 ## Returns a scalar structure with values of all properties of @var{recorderObj}. | |
8 ## The field names correspond to property names. | |
9 ## @end deftypefn | |
10 | |
11 function result = get (varargin) | |
12 recorder = varargin{1}; | |
13 properties = __get_properties__ (recorder); | |
14 if nargin == 1 | |
15 result = properties; | |
16 elseif nargin == 2 | |
17 if ischar (varargin{2}) | |
18 result = getfield (properties, varargin{2}); | |
19 else | |
20 result = {}; | |
21 index = 1; | |
22 for property = varargin{2} | |
23 result{index} = getfield (properties, char(property)); | |
24 index = index + 1; | |
25 endfor | |
26 endif | |
27 else | |
28 error ('audiorecorder: wrong number of arguments to the get method'); | |
29 endif | |
30 endfunction |