00001 /* 00002 cwindow.h: 00003 00004 Copyright (C) 1990 Dan Ellis 00005 00006 This file is part of Csound. 00007 00008 The Csound Library is free software; you can redistribute it 00009 and/or modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2.1 of the License, or (at your option) any later version. 00012 00013 Csound is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with Csound; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00021 02111-1307 USA 00022 */ 00023 00024 #ifndef CWINDOW_H 00025 #define CWINDOW_H 00026 00027 /*******************************************************\ 00028 * cwindow.h * 00029 * portable window graphs stolen from Csound * 00030 * necessary header declarations * 00031 * 08nov90 dpwe * 00032 \*******************************************************/ 00033 00034 #include "csound.h" 00035 00036 #define CAPSIZE 60 00037 00038 struct windat_ { 00039 uintptr_t windid; /* set by MakeGraph() */ 00040 MYFLT *fdata; /* data passed to DrawGraph */ 00041 long npts; /* size of above array */ 00042 char caption[CAPSIZE]; /* caption string for graph */ 00043 short waitflg; /* set =1 to wait for ms after Draw */ 00044 short polarity; /* controls positioning of X axis */ 00045 MYFLT max, min; /* workspace .. extrema this frame */ 00046 MYFLT absmax; /* workspace .. largest of above */ 00047 MYFLT oabsmax; /* Y axis scaling factor */ 00048 int danflag; /* set to 1 for extra Yaxis mid span */ 00049 }; 00050 00051 enum { /* symbols for WINDAT.polarity field */ 00052 NOPOL, 00053 NEGPOL, 00054 POSPOL, 00055 BIPOL 00056 }; 00057 00058 struct xyindat_ { /* for 'joystick' input window */ 00059 uintptr_t windid; /* xwindow handle */ 00060 int m_x,m_y; /* current crosshair pixel adr */ 00061 MYFLT x,y; /* current proportions of fsd */ 00062 int down; 00063 }; 00064 00065 /* ------------------------------------------------------------------------ */ 00066 00067 #ifdef __BUILDING_LIBCSOUND 00068 00069 void dispset(CSOUND *, WINDAT *, MYFLT *, long, char *, int, char *); 00070 int dispexit(CSOUND *); 00071 void display(CSOUND *, WINDAT*); 00072 #if 0 00073 /* create window for a graph */ 00074 void MakeGraph(CSOUND *, WINDAT *, const char *); 00075 /* create a mouse input window; init scale */ 00076 void MakeXYin(CSOUND *, XYINDAT *, MYFLT, MYFLT); 00077 /* update graph in existing window */ 00078 void DrawGraph(CSOUND *, WINDAT *); 00079 /* fetch latest value from mouse input window */ 00080 void ReadXYin(CSOUND *, XYINDAT *); 00081 /* remove a graph window */ 00082 void KillGraph(CSOUND *, WINDAT *); 00083 /* remove a mouse input window */ 00084 void KillXYin(CSOUND *, XYINDAT *); 00085 /* print click-Exit message in most recently active window */ 00086 int ExitGraph(CSOUND *); 00087 #endif 00088 00089 #endif /* __BUILDING_LIBCSOUND */ 00090 00091 #endif /* CWINDOW_H */ 00092