1 /*----------------------------------------------------------------------------
2 ChucK Concurrent, On-the-fly Audio Programming Language
3 Compiler and Virtual Machine
5 Copyright (c) 2004 Ge Wang and Perry R. Cook. All rights reserved.
6 http://chuck.cs.princeton.edu/
7 http://soundlab.cs.princeton.edu/
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 -----------------------------------------------------------------------------*/
25 //-----------------------------------------------------------------------------
29 // author: Ge Wang (gewang@cs.princeton.edu)
30 // Perry R. Cook (prc@cs.princeton.edu)
32 //-----------------------------------------------------------------------------
33 #ifndef __ULIB_STD_H__
34 #define __ULIB_STD_H__
39 DLL_QUERY
libstd_query( Chuck_DL_Query
* QUERY
);
42 CK_DLL_SFUN( abs_impl
);
43 CK_DLL_SFUN( fabs_impl
);
44 CK_DLL_SFUN( rand_impl
);
45 CK_DLL_SFUN( randf_impl
);
46 CK_DLL_SFUN( rand2f_impl
);
47 CK_DLL_SFUN( rand2_impl
);
48 CK_DLL_SFUN( srand_impl
);
49 CK_DLL_SFUN( sgn_impl
);
50 CK_DLL_SFUN( system_impl
);
51 CK_DLL_SFUN( atoi_impl
);
52 CK_DLL_SFUN( atof_impl
);
53 CK_DLL_SFUN( itoa_impl
);
54 CK_DLL_SFUN( ftoa_impl
);
55 CK_DLL_SFUN( getenv_impl
);
56 CK_DLL_SFUN( setenv_impl
);
58 CK_DLL_SFUN( mtof_impl
);
59 CK_DLL_SFUN( ftom_impl
);
60 CK_DLL_SFUN( powtodb_impl
);
61 CK_DLL_SFUN( rmstodb_impl
);
62 CK_DLL_SFUN( dbtopow_impl
);
63 CK_DLL_SFUN( dbtorms_impl
);
72 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 class KBHit
: public Chuck_Event
87 t_CKBOOL
good() { return m_valid
; }
88 t_CKBOOL
state() { return m_onoff
; }
91 void set_echo( t_CKBOOL echo
) { m_echo
= echo
; }
92 t_CKBOOL
get_echo() { return m_echo
; }
99 CBufferAdvance
* m_buffer
;
100 t_CKUINT m_read_index
;
108 //-----------------------------------------------------------------------------
109 // name: class KBHitManager
111 //-----------------------------------------------------------------------------
115 static t_CKBOOL
init();
116 static void shutdown();
119 static t_CKBOOL
open( KBHit
* kb
);
120 static t_CKBOOL
close( KBHit
* kb
);
123 static CBufferAdvance
* the_buf
;
124 static t_CKINT the_onoff
;
125 static t_CKBOOL the_init
;
126 static XThread
* the_thread
;