Mercurial > octave-nkf
annotate scripts/audio/@audiorecorder/get.m @ 19531:77b52b86b419
change @audiorecorder method docstrings to work with new texinfo
* audiorecorder.m, get.m, getaudiodata.m, play.m, record.m, set.m: change
stand-alone deftypefnx tags to deftypefn tags
author | Vytautas Jančauskas <unaudio@gmail.com> |
---|---|
date | Fri, 20 Sep 2013 00:51:21 +0300 |
parents | ee3ec3f02358 |
children | 8bb399569393 |
rev | line source |
---|---|
19510
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
1 ## -*- texinfo -*- |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
2 ## @deftypefn{Function File} @var{Value} = get (@var{recorderObj}, @var{Name}) |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
3 ## Returns the @var{Value} of the property identified by @var{Name}. |
19531
77b52b86b419
change @audiorecorder method docstrings to work with new texinfo
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19522
diff
changeset
|
4 ## @end deftypefn |
77b52b86b419
change @audiorecorder method docstrings to work with new texinfo
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19522
diff
changeset
|
5 ## @deftypefn{Function File} @var{Values} = get (@var{recorderObj}, @{@var{Name1}, ... , @var{NameN}@}) |
19510
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
6 ## Returns the @var{Values} of the properties identified by @var{Name1} to @var{NameN}. |
19531
77b52b86b419
change @audiorecorder method docstrings to work with new texinfo
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19522
diff
changeset
|
7 ## @end deftypefn |
77b52b86b419
change @audiorecorder method docstrings to work with new texinfo
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19522
diff
changeset
|
8 ## @deftypefn{Function File} @var{Values} = get (@var{recorderObj}) |
19510
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
9 ## Returns a scalar structure with values of all properties of @var{recorderObj}. |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
10 ## The field names correspond to property names. |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
11 ## @end deftypefn |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
12 |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
13 function result = get (varargin) |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
14 recorder = varargin{1}; |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
15 properties = __get_properties__ (recorder); |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
16 if nargin == 1 |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
17 result = properties; |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
18 elseif nargin == 2 |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
19 if ischar (varargin{2}) |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
20 result = getfield (properties, varargin{2}); |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
21 else |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
22 result = {}; |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
23 index = 1; |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
24 for property = varargin{2} |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
25 result{index} = getfield (properties, char(property)); |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
26 index = index + 1; |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
27 endfor |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
28 endif |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
29 else |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
30 error ('audiorecorder: wrong number of arguments to the get method'); |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
31 endif |
e1f98e402a7e
New files - @audiorecorder and @audioplayer classes
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
32 endfunction |