Debian Codegraph @

src/core/ulib_std.h

raw symbols SCIP
1 /*----------------------------------------------------------------------------
2 ChucK Strongly-timed Audio Programming Language
3 Compiler, Virtual Machine, and Synthesis Engine
4
5 Copyright (c) 2003 Ge Wang and Perry R. Cook. All rights reserved.
6 http://chuck.stanford.edu/
7 http://chuck.cs.princeton.edu/
8
9 This program is free software; you can redistribute it and/or modify
10 it under the dual-license terms of EITHER the MIT License OR the GNU
11 General Public License (the latter as published by the Free Software
12 Foundation; either version 2 of the License or, at your option, any
13 later version).
14
15 This program is distributed in the hope that it will be useful and/or
16 interesting, but WITHOUT ANY WARRANTY; without even the implied warranty
17 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 MIT Licence and/or the GNU General Public License for details.
19
20 You should have received a copy of the MIT License and the GNU General
21 Public License (GPL) along with this program; a copy of the GPL can also
22 be obtained by writing to the Free Software Foundation, Inc., 59 Temple
23 Place, Suite 330, Boston, MA 02111-1307 U.S.A.
24 -----------------------------------------------------------------------------*/
25
26 //-----------------------------------------------------------------------------
27 // file: ulib_std.h
28 // desc: standard class library
29 //
30 // author: Ge Wang ([email protected] | [email protected])
31 // date: Spring 2004
32 //-----------------------------------------------------------------------------
33 #ifndef __ULIB_STD_H__
34 #define __ULIB_STD_H__
35
36 #include "chuck_dl.h"
37 #include "chuck_oo.h"
38
39 // query
40 DLL_QUERY libstd_query( Chuck_DL_Query * QUERY );
41
42 // exports
43 CK_DLL_SFUN( abs_impl );
44 CK_DLL_SFUN( fabs_impl );
45 CK_DLL_SFUN( rand_impl );
46 CK_DLL_SFUN( randf_impl );
47 CK_DLL_SFUN( rand2f_impl );
48 CK_DLL_SFUN( rand2_impl );
49 CK_DLL_SFUN( srand_impl );
50 CK_DLL_SFUN( sgn_impl );
51 CK_DLL_SFUN( system_impl );
52 CK_DLL_SFUN( atoi_impl );
53 CK_DLL_SFUN( atof_impl );
54 CK_DLL_SFUN( itoa_impl );
55 CK_DLL_SFUN( ftoa_impl );
56 CK_DLL_SFUN( ftoi_impl );
57 CK_DLL_SFUN( getenv_impl );
58 CK_DLL_SFUN( getenv2_impl );
59 CK_DLL_SFUN( setenv_impl );
60
61 CK_DLL_SFUN( mtof_impl );
62 CK_DLL_SFUN( ftom_impl );
63 CK_DLL_SFUN( powtodb_impl );
64 CK_DLL_SFUN( rmstodb_impl );
65 CK_DLL_SFUN( dbtopow_impl );
66 CK_DLL_SFUN( dbtorms_impl );
67 CK_DLL_SFUN( dbtolin_impl );
68 CK_DLL_SFUN( lintodb_impl );
69 CK_DLL_SFUN( clamp_impl );
70 CK_DLL_SFUN( clampf_impl );
71 CK_DLL_SFUN( scalef_impl );
72 CK_DLL_SFUN( range1_impl );
73 CK_DLL_SFUN( range2_impl );
74 CK_DLL_SFUN( range3_impl );
75
76
77
78
79 // forward reference
80 class CBufferAdvance;
81 struct ChucK_Object;
82 struct XThread;
83
84
85
86
87 //-----------------------------------------------------------------------------
88 // name: class KBHit
89 // desc: kbhit class
90 //-----------------------------------------------------------------------------
91 class KBHit : public Chuck_Event
92 {
93 public:
94 KBHit();
95 ~KBHit();
96
97 public:
98 t_CKBOOL open();
99 t_CKBOOL close();
100 void on();
101 void off();
102 t_CKBOOL good() { return m_valid; }
103 t_CKBOOL state() { return m_onoff; }
104
105 public:
106 void set_echo( t_CKBOOL echo ) { m_echo = echo; }
107 t_CKBOOL get_echo() { return m_echo; }
108
109 public:
110 t_CKBOOL empty();
111 t_CKINT getch();
112
113 public:
114 CBufferAdvance * m_buffer;
115 t_CKUINT m_read_index;
116 t_CKBOOL m_valid;
117 t_CKBOOL m_onoff;
118 t_CKBOOL m_echo;
119 Chuck_Object * SELF;
120 };
121
122
123
124
125 //-----------------------------------------------------------------------------
126 // name: class KBHitManager
127 // desc: ...
128 //-----------------------------------------------------------------------------
129 class KBHitManager
130 {
131 public:
132 static t_CKBOOL init();
133 static void shutdown();
134 static void on();
135 static void off();
136 static t_CKBOOL open( KBHit * kb );
137 static t_CKBOOL close( KBHit * kb );
138
139 public:
140 static CBufferAdvance * the_buf;
141 static t_CKINT the_onoff;
142 static t_CKBOOL the_init;
143 static XThread * the_thread;
144 };
145
146
147
148
149 #endif