*** empty log message ***
[chuck-blob.git] / v2 / ulib_std.h
blob56e963d9910cf20632dec21f6cb05a27609d4c05
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
22 U.S.A.
23 -----------------------------------------------------------------------------*/
25 //-----------------------------------------------------------------------------
26 // file: ulib_std.h
27 // desc: ...
29 // author: Ge Wang (gewang@cs.princeton.edu)
30 // Perry R. Cook (prc@cs.princeton.edu)
31 // date: Spring 2004
32 //-----------------------------------------------------------------------------
33 #ifndef __ULIB_STD_H__
34 #define __ULIB_STD_H__
36 #include "chuck_dl.h"
38 // query
39 DLL_QUERY libstd_query( Chuck_DL_Query * QUERY );
41 // exports
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 );
66 // forward reference
67 class CBufferAdvance;
68 struct ChucK_Object;
69 struct XThread;
72 //-----------------------------------------------------------------------------
73 // name: class KBHit
74 // desc: kbhit class
75 //-----------------------------------------------------------------------------
76 class KBHit : public Chuck_Event
78 public:
79 KBHit();
80 ~KBHit();
82 public:
83 t_CKBOOL open();
84 t_CKBOOL close();
85 void on();
86 void off();
87 t_CKBOOL good() { return m_valid; }
88 t_CKBOOL state() { return m_onoff; }
90 public:
91 void set_echo( t_CKBOOL echo ) { m_echo = echo; }
92 t_CKBOOL get_echo() { return m_echo; }
94 public:
95 t_CKBOOL empty();
96 t_CKINT getch();
98 public:
99 CBufferAdvance * m_buffer;
100 t_CKUINT m_read_index;
101 t_CKBOOL m_valid;
102 t_CKBOOL m_onoff;
103 t_CKBOOL m_echo;
104 Chuck_Object * SELF;
108 //-----------------------------------------------------------------------------
109 // name: class KBHitManager
110 // desc: ...
111 //-----------------------------------------------------------------------------
112 class KBHitManager
114 public:
115 static t_CKBOOL init();
116 static void shutdown();
117 static void on();
118 static void off();
119 static t_CKBOOL open( KBHit * kb );
120 static t_CKBOOL close( KBHit * kb );
122 public:
123 static CBufferAdvance * the_buf;
124 static t_CKINT the_onoff;
125 static t_CKBOOL the_init;
126 static XThread * the_thread;
132 #endif