Tscope reference-manual
Abstract:
This is the Tscope reference manual
. It gives an in-depth explanation of every function made available by Tscope.
Contents
Screen and double buffer operations
int ts_init ();
void ts_fatal (const char *format, ...);
void ts_scrcfg (char *file)
int ts_debug(int mode);
int ts_refreshrate (int rate);
int ts_colordepth (int depth);
int ts_scrsize (int size);
int ts_scrxy (int x, int y);
int ts_scrmode (int mode);
int ts_doublebuff (int mode);
void ts_clrscr();
void ts_scrdump ();
void ts_tobuff ();
void ts_toscr ();
void ts_clrbuff ();
void ts_blitbuff ();
Graphics parameters
int ts_bgcolor (int color);
int ts_fgcolor (int color);
int ts_textmode (int color);
int ts_makecolor (int r, int g, int b);
int ts_makehsvcolor(float h, float s, float v);
int ts_fill (int mode);
int ts_font (int type, int size, int style);
int ts_setfont (int fontno);
int ts_loadfont (char *fontfile);
Coordinate system
XMAX
YMAX
SXMAX
SYMAX
int ts_coordinates (int system);
int ax (float x);
int ay (float y);
int sx (float x);
int sy (float x);
int cx (float x);
int cy (float y);
void ts_agrid ();
void ts_rgrid ();
Formatted text input/output
int ts_printf(int x, int y, const char *txt, ...)
int ts_printf_centre(int x, int y, const char *txt, ...)
int ts_printf_right(int x, int y, const char *txt, ...)
int ts_printf_justify(int x1, int x2, int y, const char *txt, ...)
int ts_textheight ()
int ts_textlength (char *txt)
int ts_scanf (int x, int y, char *format, ...);
Drawing primitives
void ts_getpixel (int x, int y)
void ts_putpixel (int x, int y)
void ts_circle (int x, int y, int radius)
void ts_line (int x1, int y1, int x2, int y2)
void ts_hline (int x1, int x2, int y)
void ts_vline (int x, int y1, int y2)
void ts_rect (int x1, int y1, int x2, int y2)
void ts_triangle (int x1, int y1, int x2, int y2, int x3, int y3)
void ts_polygon (int points, int *xy)
void ts_arc (int x, int y, int ang1, int ang2, int r);
void ts_ellipse (int x, int y, int rx, int ry);
void ts_floodfill (int x, int y);
Timing and registering responses
void ts_timercfg (char *file)
int ts_priority (int prio)
__int64 ts_time();
void ts_wait(__int64 time);
int ts_waitmode(int mode);
int ts_defkey (int key)
int ts_hidekey(int key);
void ts_clrkeys();
int ts_resp(__int64 *time, __int64 *error, __int64 maxtime);
int ts_release(__int64 *time, __int64 *error, __int64 maxtime);
int ts_respstatus();
void ts_flushresp();
void ts_vsync(__int64 *time, __int64 *error);
void ts_vsyncs (__int64 *time, __int64 *error, int nsync);
int ts_vsyncresp(__int64 *time, __int64 *error, int maxsync);
int ts_vsyncstatus();
int ts_vsyncmode(int mode);
int ts_vsynclimit(int limit);
int ts_setserialport(int port);
void ts_settrigger (int port, __int64 time);
void ts_trigger (char val);
__int64 tts(__int64 time);
__int64 ttm(__int64 time);
__int64 ttmu(__int64 time);
__int64 stt(__int64 time);
__int64 mtt(__int64 time);
__int64 mutt(__int64 time);
Randomization
int ts_rseed (int newseed[3]);
int ts_rseedfile (char *file);
double ts_runif ();
double ts_rexp ();
double ts_rnorm (double mean, double sd);
int ts_rint (int nmax);
int ts_rlist (int nmax, int freq, int *list);
int ts_rslist (int nmax, int freq, int *list);
Mouse support
void ts_textbox (int x1, int y1, int x2, int y2);
void ts_button (int x, int y);
void ts_drawmouse();
void ts_hidemouse();
int ts_xmouse();
int ts_ymouse();
void ts_mousepos (int x, int y);
int ts_mousecolor (int color);
Bitmaps
struct map;
map *ts_makebmp (int w, int h);
map *ts_readbmp (char *file);
void ts_killbmp (map *what);
map *ts_tobmp (map *where);
void ts_clrbmp (map *what, int color);
void ts_blit (map *what, int dest_x, int dest_y);
void ts_partblit (map *what, int src_x1, int src_y1, int src_x2, int src_y2, int dest_x, int dest_y);
void ts_stretchblit (map *what, float ratio, int dest_x, int dest_y);
void ts_flipblit (map *what, int flip, int dest_x, int dest_y);
void ts_rotateblit (map *what, int cx, int cy, float angle, int dest_x, int dest_y);
Sound support
SAMPLE *ts_loadsample (char *filename);
void ts_killsample (SAMPLE *spl);
int ts_playsample (SAMPLE *spl);
void ts_adjustsample (SAMPLE *spl);
void ts_stopsample (SAMPLE *spl);
void ts_playstream(__int64 time);
int ts_rtstream(__int64 * time, __int64 * error, __int64 maxtime);
int ts_volume (int volume);
int ts_pan (int pan);
int ts_loop (int loop);
int ts_sinefreq (int freq);
unsigned char (*ts_streamfunc(unsigned char (*func) (__int64))) (__int64);
void ts_drawsound ();
int ts_streambufsize (int size);
int ts_samplerate (int rate);
AUDIOSTREAM * ts_makestream();
void ts_killstream (AUDIOSTREAM *stream);
void ts_updatestream (AUDIOSTREAM *stream);
Sound support - new (experimental) API
struct snd2_sample;
struct snd2_stream;
int snd2_channels(int channels);
int snd2_samplerate(int rate);
int snd2_sampleformat(int format);
snd2_sample *snd2_makesample(int length);
void snd2_allocatesample(snd2_sample *samp);
void snd2_killsample (snd2_sample *samp);
snd2_sample *snd2_readsample (char *file);
int snd2_writesample(snd2_sample *samp, char *file);
int snd2_recordsample_blocking(snd2_sample *samp);
void snd2_playsample_blocking(snd2_sample *samp);
snd2_stream * snd2_recordsample(snd2_sample *samp);
snd2_stream *snd2_playsample(snd2_sample *samp);
int snd2_querysample(snd2_stream * stream)
void snd2_stopsample(snd2_stream * stream);
float snd2_getstreamtime(snd2_stream * stream);
__int64 snd2_getsampletime(snd2_sample * samp);
void snd2_tobuffer(snd2_sample * samp);
void snd2_frombuffer(snd2_sample *samp);
Linux notes
ts_priority
ts_waitmode
ts_defkey
ts_vsync
Mac OS X notes
ts_priority
ts_waitmode
ts_defkey
ts_vsync
ts_trigger
Appendix A: Predefined values
Debug levels
Color depths
Screen sizes
Screen modes
Colors
Fonts
Font sizes
Font styles
Coordinate systems
Program priorities
Buttons
Wait modes
Vsync modes
Flipped blit modes
Sound: number of channels
Sound: sample format for output files
Appendix B: Tscope internals
Tscope
A C library for programming cognitive experiments on Windows
Index
Tscope
Introduction
License
Contributors
Documentation
Download
Quickstart
API ref
FAQ
Codebase
Examples
Experiments
Tests
Source
Contrib
Algorithms
Experiments
Stop-it
Pdm
Allegro
|
Cygwin
|
Gcc
Navigation
Up:
Documentation
Next:
Screen and double buffer
Previous: