annotate libinterp/dldfcn/__recorder_audiorecorder__.cc @ 19534:8bb399569393

Add Octave copyright header block to audio project files * libinterp/dldfcn/__player_audioplayer__.cc, libinterp/dldfcn/__recorder_audiorecorder__.cc, libinterp/dldfcn/audiodevinfo.cc, libinterp/dldfcn/audioinfo.cc, libinterp/dldfcn/audioread.cc, libinterp/dldfcn/audiowrite.cc, libinterp/dldfcn/player_class.cc, libinterp/dldfcn/player_class.h, libinterp/dldfcn/recorder_class.cc, libinterp/dldfcn/recorder_class.h, scripts/audio/@audioplayer/__get_properties__.m, scripts/audio/@audioplayer/audioplayer.m, scripts/audio/@audioplayer/display.m, scripts/audio/@audioplayer/get.m, scripts/audio/@audioplayer/isplaying.m, scripts/audio/@audioplayer/pause.m, scripts/audio/@audioplayer/play.m, scripts/audio/@audioplayer/playblocking.m, scripts/audio/@audioplayer/resume.m, scripts/audio/@audioplayer/set.m, scripts/audio/@audioplayer/stop.m, scripts/audio/@audioplayer/subsasgn.m, scripts/audio/@audioplayer/subsref.m, scripts/audio/@audiorecorder/__get_properties__.m, scripts/audio/@audiorecorder/audiorecorder.m, scripts/audio/@audiorecorder/display.m, scripts/audio/@audiorecorder/get.m, scripts/audio/@audiorecorder/getaudiodata.m, scripts/audio/@audiorecorder/getplayer.m, scripts/audio/@audiorecorder/isrecording.m, scripts/audio/@audiorecorder/pause.m, scripts/audio/@audiorecorder/play.m, scripts/audio/@audiorecorder/record.m, scripts/audio/@audiorecorder/recordblocking.m, scripts/audio/@audiorecorder/resume.m, scripts/audio/@audiorecorder/set.m, scripts/audio/@audiorecorder/stop.m, scripts/audio/@audiorecorder/subsasgn.m, scripts/audio/@audiorecorder/subsref.m: Add Octave copyright header.
author Mike Miller <mtmiller@ieee.org>
date Tue, 01 Oct 2013 23:36:37 -0400
parents 11a1e8e41835
children 1f551d169db2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19534
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
diff changeset
1 /*
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
diff changeset
2
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
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: 19516
diff changeset
4
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
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: 19516
diff changeset
6
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
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: 19516
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: 19516
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: 19516
diff changeset
10 option) any later version.
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
diff changeset
11
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
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: 19516
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: 19516
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: 19516
diff changeset
15 for more details.
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
diff changeset
16
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
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: 19516
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: 19516
diff changeset
19 <http://www.gnu.org/licenses/>.
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
diff changeset
20
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
diff changeset
21 */
8bb399569393 Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents: 19516
diff changeset
22
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
23 #include "oct.h"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
24 #include "ov-struct.h"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
25
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
26 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
27 #include "player_class.cc"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
28 #include "recorder_class.cc"
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
29 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
30
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
31 DEFUN_DLD(__recorder_audiorecorder__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
32 "__recorder_audiorecorder__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
33 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
34 {
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
35 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
36 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
37 audiorecorder* retval = new audiorecorder ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
38 int offset = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
39 if (nargin > 0)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
40 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
41 bool is_function = args(0).is_string () || args(0).is_function_handle () || args(0).is_inline_function ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
42 if (is_function)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
43 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
44 retval->octave_callback_function = args (0).function_value ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
45 offset = 1;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
46 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
47 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
48 switch (nargin - offset)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
49 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
50 case 3:
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
51 retval->set_fs (args(0 + offset).int_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
52 retval->set_nbits (args(1 + offset).int_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
53 retval->set_channels (args(2 + offset).int_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
54 break;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
55 case 4:
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
56 retval->set_fs (args(0 + offset).int_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
57 retval->set_nbits (args(1 + offset).int_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
58 retval->set_channels (args(2 + offset).int_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
59 retval->set_id (args(3 + offset).int_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
60 break;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
61 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
62 retval->init();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
63 return octave_value(retval);
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
64 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
65 octave_value retval;
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
66 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
67 return retval;
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
68 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
69 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
70
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
71 DEFUN_DLD(__recorder_getaudiodata__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
72 "__recorder_getaudiodata__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
73 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
74 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
75 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
76 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
77 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
78 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
79 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
80 retval = octave_value (recorder->getaudiodata ());
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
81 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
82 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
83 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
84 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
85 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
86
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
87 DEFUN_DLD(__recorder_get_channels__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
88 "__recorder_get_channels__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
89 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
90 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
91 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
92 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
93 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
94 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
95 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
96 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
97 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
98 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
99 retval = octave_value(recorder->get_channels());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
100 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
101 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
102 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
103 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
104 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
105 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
106
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
107 DEFUN_DLD(__recorder_get_fs__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
108 "__recorder_get_fs__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
109 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
110 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
111 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
112 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
113 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
114 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
115 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
116 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
117 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
118 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
119 retval = octave_value(recorder->get_fs());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
120 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
121 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
122 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
123 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
124 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
125 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
126
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
127 DEFUN_DLD(__recorder_get_id__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
128 "__recorder_get_id__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
129 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
130 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
131 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
132 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
133 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
134 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
135 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
136 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
137 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
138 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
139 retval = octave_value(recorder->get_id());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
140 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
141 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
142 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
143 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
144 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
145 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
146
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
147 DEFUN_DLD(__recorder_get_nbits__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
148 "__recorder_get_nbits__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
149 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
150 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
151 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
152 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
153 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
154 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
155 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
156 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
157 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
158 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
159 retval = octave_value(recorder->get_nbits ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
160 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
161 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
162 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
163 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
164 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
165 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
166
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
167 DEFUN_DLD(__recorder_get_sample_number__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
168 "__recorder_get_sample_number__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
169 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
170 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
171 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
172 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
173 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
174 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
175 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
176 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
177 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
178 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
179 retval = octave_value(recorder->get_sample_number());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
180 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
181 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
182 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
183 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
184 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
185 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
186
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
187 DEFUN_DLD(__recorder_get_tag__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
188 "__recorder_get_tag__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
189 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
190 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
191 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
192 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
193 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
194 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
195 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
196 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
197 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
198 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
199 retval = octave_value (recorder->get_tag ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
200 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
201 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
202 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
203 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
204 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
205 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
206
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
207 DEFUN_DLD(__recorder_get_total_samples__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
208 "__recorder_get_total_samples__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
209 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
210 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
211 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
212 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
213 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
214 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
215 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
216 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
217 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
218 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
219 retval = octave_value(recorder->get_total_samples());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
220 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
221 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
222 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
223 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
224 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
225 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
226
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
227 DEFUN_DLD(__recorder_get_userdata__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
228 "__recorder_get_userdata__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
229 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
230 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
231 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
232 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
233 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
234 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
235 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
236 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
237 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
238 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
239 retval = recorder->get_userdata ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
240 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
241 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
242 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
243 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
244 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
245 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
246
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
247 DEFUN_DLD(__recorder_isrecording__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
248 "__recorder_isrecording__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
249 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
250 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
251 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
252 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
253 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
254 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
255 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
256 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
257 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
258 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
259 if (recorder->isrecording())
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
260 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
261 return octave_value(1);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
262 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
263 else
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
264 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
265 return octave_value(0);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
266 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
267 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
268 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
269 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
270 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
271 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
272 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
273
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
274 DEFUN_DLD(__recorder_pause__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
275 "__recorder_pause__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
276 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
277 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
278 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
279 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
280 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
281 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
282 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
283 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
284 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
285 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
286 recorder->pause();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
287 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
288 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
289 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
290 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
291 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
292 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
293
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
294 DEFUN_DLD(__recorder_recordblocking__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
295 "__recorder_recordblocking__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
296 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
297 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
298 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
299 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
300 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
301 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
302 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
303 recorder->recordblocking (args (1).float_value ());
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
304 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
305 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
306 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
307 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
308 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
309
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
310 DEFUN_DLD(__recorder_record__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
311 "__recorder_record__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
312 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
313 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
314 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
315 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
316 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
317 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
318 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
319 if (args.length () == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
320 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
321 recorder->record ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
322 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
323 else if (args.length () == 2)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
324 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
325 recorder->set_end_sample (args (1).int_value () * recorder->get_fs ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
326 recorder->record ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
327 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
328 else
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
329 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
330 error ("audiorecorder: wrong number of arguments passed to record");
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
331 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
332 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
333 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
334 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
335 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
336 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
337
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
338 DEFUN_DLD(__recorder_resume__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
339 "__recorder_resume__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
340 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
341 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
342 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
343 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
344 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
345 if (nargin == 1)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
346 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
347 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
348 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
349 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
350 recorder->resume();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
351 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
352 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
353 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
354 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
355 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
356 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
357
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
358 DEFUN_DLD(__recorder_set_fs__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
359 "__recorder_set_fs__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
360 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
361 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
362 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
363 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
364 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
365 if (nargin == 2)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
366 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
367 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
368 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
369 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
370 recorder->set_fs (args (1).int_value());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
371 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
372 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
373 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
374 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
375 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
376 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
377
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
378 DEFUN_DLD(__recorder_set_tag__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
379 "__recorder_set_tag__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
380 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
381 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
382 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
383 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
384 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
385 if (nargin == 2)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
386 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
387 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
388 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
389 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
390 recorder->set_tag (args(1).char_matrix_value ());
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
391 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
392 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
393 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
394 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
395 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
396 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
397
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
398 DEFUN_DLD(__recorder_set_userdata__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
399 "__recorder_set_userdata__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
400 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
401 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
402 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
403 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
404 int nargin = args.length ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
405 if (nargin == 2)
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
406 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
407 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
408 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
409 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
410 recorder->set_userdata (args(1));
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
411 }
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
412 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
413 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
414 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
415 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
416 }
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
417
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
418 DEFUN_DLD(__recorder_stop__, args, ,
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
419 "__recorder_stop__"
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
420 )
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
421 {
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
422 octave_value retval;
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
423 #ifdef HAVE_PORTAUDIO
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
424 audiorecorder* recorder = 0;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
425 const octave_base_value& rep = args (0).get_rep ();
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
426 recorder = &((audiorecorder &)rep);
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
427 recorder->stop();
19516
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
428 #else
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
429 error ("portaudio not found on your system and thus audio functionality is not present");
11a1e8e41835 let audiodevinfo be built even when PortAudio is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents: 19514
diff changeset
430 #endif
19514
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
431 return retval;
13082628e7e8 added __recorder_audiorecorder__ file for wrapping recorder_class functionality
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff changeset
432 }