Mercurial > octave-nkf
annotate libinterp/dldfcn/__player_audioplayer__.cc @ 19538:d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
* libinterp/dldfcn/__player_audioplayer__.cc,
libinterp/dldfcn/__recorder_audiorecorder__.cc,
scripts/audio/@audioplayer/subsasgn.m, scripts/audio/@audioplayer/subsref.m,
scripts/audio/@audiorecorder/__get_properties__.m,
scripts/audio/@audiorecorder/subsasgn.m,
scripts/audio/@audiorecorder/subsref.m: Add texinfo docstrings to all
functions, internal or otherwise.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Thu, 03 Oct 2013 08:33:46 -0400 |
parents | 36a26a131209 |
children |
rev | line source |
---|---|
19534
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
1 /* |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
2 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
3 Copyright (C) 2013 Vytautas JanĨauskas |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
4 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
5 This file is part of Octave. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
6 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
10 option) any later version. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
11 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
15 for more details. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
16 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
20 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
21 */ |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19515
diff
changeset
|
22 |
19535
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
23 #ifdef HAVE_CONFIG_H |
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
24 #include <config.h> |
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
25 #endif |
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
26 |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
27 #include "oct.h" |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
28 #include "ov-struct.h" |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
29 |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
30 #ifdef HAVE_PORTAUDIO |
19513
b8ea3ff8f5fd
include player_class.cc and recorder_class.cc in __player_audioplayer__.cc
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19512
diff
changeset
|
31 #include "player_class.cc" |
b8ea3ff8f5fd
include player_class.cc and recorder_class.cc in __player_audioplayer__.cc
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19512
diff
changeset
|
32 #include "recorder_class.cc" |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
33 #endif |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
34 |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
35 DEFUN_DLD (__player_audioplayer__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
36 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
37 @deftypefn {Loadable Function} {@var{player} =} __player_audioplayer__ (@var{y}, @var{fs})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
38 @deftypefnx {Loadable Function} {@var{player} =} __player_audioplayer__ (@var{y}, @var{fs}, @var{nbits})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
39 @deftypefnx {Loadable Function} {@var{player} =} __player_audioplayer__ (@var{y}, @var{fs}, @var{nbits}, @var{id})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
40 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
41 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
42 { |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
43 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
44 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
45 audioplayer* retval = new audioplayer (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
46 bool is_function = args(0).is_string () || args(0).is_function_handle () || args(0).is_inline_function (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
47 if (is_function) |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
48 retval->set_y (args(0).function_value ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
49 else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
50 retval->set_y (args(0)); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
51 retval->set_fs (args(1).int_value ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
52 switch (nargin) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
53 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
54 case 3: |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
55 retval->set_nbits (args(2).int_value ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
56 break; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
57 case 4: |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
58 retval->set_nbits (args(2).int_value ()); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
59 retval->set_id (args(3).int_value ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
60 break; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
61 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
62 if (is_function) |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
63 retval->init_fn (); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
64 else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
65 retval->init (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
66 return octave_value (retval); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
67 #else |
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
68 octave_value retval; |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
69 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
70 return retval; |
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
71 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
72 } |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
73 |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
74 DEFUN_DLD (__player_get_channels__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
75 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
76 @deftypefn {Loadable Function} {@var{n} =} __player_get_channels__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
77 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
78 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
79 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
80 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
81 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
82 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
83 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
84 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
85 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
86 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
87 retval = octave_value (player->get_channels ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
88 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
89 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
90 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
91 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
92 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
93 } |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
94 |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
95 DEFUN_DLD (__player_get_fs__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
96 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
97 @deftypefn {Loadable Function} {@var{fs} =} __player_get_fs__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
98 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
99 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
100 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
101 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
102 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
103 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
104 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
105 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
106 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
107 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
108 retval = octave_value (player->get_fs ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
109 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
110 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
111 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
112 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
113 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
114 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
115 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
116 DEFUN_DLD (__player_get_id__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
117 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
118 @deftypefn {Loadable Function} {@var{id} =} __player_get_id__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
119 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
120 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
121 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
122 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
123 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
124 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
125 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
126 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
127 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
128 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
129 retval = octave_value (player->get_id ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
130 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
131 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
132 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
133 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
134 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
135 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
136 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
137 DEFUN_DLD (__player_get_nbits__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
138 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
139 @deftypefn {Loadable Function} {@var{nbits} =} __player_get_nbits__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
140 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
141 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
142 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
143 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
144 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
145 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
146 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
147 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
148 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
149 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
150 retval = octave_value (player->get_nbits ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
151 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
152 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
153 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
154 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
155 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
156 } |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
157 |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
158 DEFUN_DLD (__player_get_sample_number__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
159 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
160 @deftypefn {Loadable Function} {@var{n} =} __player_get_sample_number__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
161 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
162 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
163 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
164 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
165 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
166 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
167 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
168 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
169 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
170 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
171 retval = octave_value (player->get_sample_number ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
172 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
173 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
174 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
175 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
176 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
177 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
178 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
179 DEFUN_DLD (__player_get_tag__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
180 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
181 @deftypefn {Loadable Function} {@var{tag} =} __player_get_tag__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
182 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
183 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
184 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
185 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
186 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
187 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
188 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
189 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
190 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
191 audioplayer *player = &((audioplayer &)rep); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
192 retval = octave_value (player->get_tag ()); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
193 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
194 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
195 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
196 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
197 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
198 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
199 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
200 DEFUN_DLD (__player_get_total_samples__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
201 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
202 @deftypefn {Loadable Function} {@var{n} =} __player_get_total_samples__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
203 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
204 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
205 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
206 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
207 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
208 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
209 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
210 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
211 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
212 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
213 retval = octave_value (player->get_total_samples ()); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
214 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
215 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
216 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
217 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
218 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
219 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
220 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
221 DEFUN_DLD (__player_get_userdata__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
222 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
223 @deftypefn {Loadable Function} {@var{data} =} __player_get_userdata__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
224 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
225 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
226 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
227 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
228 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
229 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
230 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
231 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
232 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
233 audioplayer *player = &((audioplayer &)rep); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
234 retval = player->get_userdata (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
235 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
236 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
237 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
238 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
239 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
240 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
241 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
242 DEFUN_DLD (__player_isplaying__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
243 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
244 @deftypefn {Loadable Function} {} __player_isplaying__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
245 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
246 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
247 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
248 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
249 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
250 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
251 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
252 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
253 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
254 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
255 if (player->isplaying ()) |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
256 return octave_value (1); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
257 else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
258 return octave_value (0); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
259 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
260 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
261 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
262 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
263 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
264 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
265 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
266 DEFUN_DLD (__player_pause__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
267 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
268 @deftypefn {Loadable Function} {} __player_pause__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
269 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
270 @end deftypefn") |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
271 { |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
272 octave_value retval; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
273 #ifdef HAVE_PORTAUDIO |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
274 int nargin = args.length (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
275 if (nargin == 1) |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
276 { |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
277 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
278 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
279 player->pause (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
280 } |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
281 #else |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
282 error ("portaudio not found on your system and thus audio functionality is not present"); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
283 #endif |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
284 return retval; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
285 } |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
286 |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
287 DEFUN_DLD (__player_playblocking__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
288 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
289 @deftypefn {Loadable Function} {} __player_playblocking__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
290 @deftypefnx {Loadable Function} {} __player_playblocking__ (@var{player}, @var{start})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
291 @deftypefnx {Loadable Function} {} __player_playblocking__ (@var{player}, [@var{start}, @var{end}])\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
292 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
293 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
294 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
295 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
296 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
297 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
298 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
299 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
300 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
301 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
302 player->playblocking (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
303 } |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
304 else |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
305 { |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
306 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
307 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
308 if (args(1).is_matrix_type ()) |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
309 { |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
310 unsigned int start, end; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
311 RowVector range = args(1).row_vector_value (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
312 start = range.elem (0) - 1; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
313 end = range.elem (1) - 1; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
314 if (start < 0 or start > player->get_total_samples () or |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
315 start > end or end < 0 or end > player->get_total_samples ()) |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
316 error ("audioplayer: invalid range specified for playback"); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
317 player->set_sample_number (start); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
318 player->set_end_sample (end); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
319 } |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
320 else |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
321 { |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
322 unsigned int start; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
323 start = args(1).int_value () - 1; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
324 if (start < 0 or start > player->get_total_samples ()) |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
325 error ("audioplayer: invalid range specified for playback"); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
326 player->set_sample_number (start); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
327 } |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
328 player->playblocking (); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
329 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
330 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
331 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
332 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
333 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
334 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
335 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
336 DEFUN_DLD (__player_play__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
337 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
338 @deftypefn {Loadable Function} {} __player_play__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
339 @deftypefnx {Loadable Function} {} __player_play__ (@var{player}, @var{start})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
340 @deftypefnx {Loadable Function} {} __player_play__ (@var{player}, [@var{start}, @var{end}])\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
341 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
342 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
343 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
344 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
345 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
346 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
347 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
348 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
349 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
350 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
351 player->play (); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
352 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
353 else |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
354 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
355 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
356 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
357 if (args(1).is_matrix_type ()) |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
358 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
359 unsigned int start, end; |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
360 RowVector range = args(1).row_vector_value (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
361 start = range.elem (0) - 1; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
362 end = range.elem (1) - 1; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
363 if (start < 0 or start > player->get_total_samples () or |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
364 start > end or end < 0 or end > player->get_total_samples ()) |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
365 error ("audioplayer: invalid range specified for playback"); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
366 player->set_sample_number (start); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
367 player->set_end_sample (end); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
368 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
369 else |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
370 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
371 unsigned int start; |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
372 start = args(1).int_value () - 1; |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
373 if (start < 0 or start > player->get_total_samples ()) |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
374 error ("audioplayer: invalid range specified for playback"); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
375 player->set_sample_number (start); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
376 } |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
377 player->play (); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
378 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
379 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
380 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
381 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
382 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
383 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
384 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
385 DEFUN_DLD (__player_resume__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
386 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
387 @deftypefn {Loadable Function} {} __player_resume__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
388 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
389 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
390 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
391 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
392 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
393 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
394 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
395 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
396 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
397 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
398 player->resume (); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
399 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
400 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
401 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
402 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
403 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
404 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
405 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
406 DEFUN_DLD (__player_set_fs__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
407 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
408 @deftypefn {Loadable Function} {} __player_set_fs__ (@var{player}, @var{fs})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
409 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
410 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
411 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
412 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
413 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
414 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
415 if (nargin == 2) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
416 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
417 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
418 audioplayer *player = &((audioplayer &)rep); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
419 player->set_fs (args(1).int_value ()); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
420 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
421 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
422 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
423 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
424 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
425 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
426 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
427 DEFUN_DLD (__player_set_tag__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
428 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
429 @deftypefn {Loadable Function} {} __player_set_tag__ (@var{player}, @var{tag})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
430 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
431 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
432 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
433 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
434 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
435 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
436 if (nargin == 2) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
437 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
438 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
439 audioplayer *player = &((audioplayer &)rep); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
440 player->set_tag (args(1).char_matrix_value ()); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
441 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
442 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
443 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
444 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
445 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
446 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
447 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
448 DEFUN_DLD (__player_set_userdata__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
449 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
450 @deftypefn {Loadable Function} {} __player_set_userdata__ (@var{player}, @var{data})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
451 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
452 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
453 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
454 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
455 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
456 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
457 if (nargin == 2) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
458 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
459 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
460 audioplayer *player = &((audioplayer &)rep); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
461 player->set_userdata (args(1)); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
462 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
463 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
464 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
465 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
466 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
467 } |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
468 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
469 DEFUN_DLD (__player_stop__, args, , |
19538
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
470 "-*- texinfo -*-\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
471 @deftypefn {Loadable Function} {} __player_stop__ (@var{player})\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
472 Undocumented internal function.\n\ |
d7b55fc1b37d
Add missing texinfo docstrings to all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
473 @end deftypefn") |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
474 { |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
475 octave_value retval; |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
476 #ifdef HAVE_PORTAUDIO |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
477 int nargin = args.length (); |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
478 if (nargin == 1) |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
479 { |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
480 const octave_base_value& rep = args(0).get_rep (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
481 audioplayer *player = &((audioplayer &)rep); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
482 player->stop (); |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
483 } |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
484 #else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
485 error ("portaudio not found on your system and thus audio functionality is not present"); |
19515
9d1917a61759
allow __player_audioplayer__ to build even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19513
diff
changeset
|
486 #endif |
19511
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
487 return retval; |
ec76e10c28de
concatenated audioplayer wrapper code
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
488 } |