Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

GUISpect.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Transient spectrum GUI
00004     Copyright (C) 1999-2003 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <gtk/gtk.h>
00024 
00025 #include <Alloc.hh>
00026 #include <dsp/DSPOp.hh>
00027 
00028 #include "Config.h"
00029 #include "CfgFile.hh"
00030 #include "GtkUtils.hh"
00031 #include "Messages.hh"
00032 #include "SockClie.hh"
00033 #include "SockOp.hh"
00034 #include "FrameBuf.hh"
00035 
00036 
00037 #ifndef GUISPECT_HH
00038     #define GUISPECT_HH
00039 
00040 
00041     #define SGUI_VER_MAJ            GLOBAL_VERSMAJ
00042     #define SGUI_VER_MIN            GLOBAL_VERSMIN
00043     #define SGUI_VER_PL             GLOBAL_VERSPL
00044     #define SGUI_CONV_MAXLEN        255
00045     #define SGUI_DEF_WIDTH          1024
00046     #define SGUI_DEF_HEIGHT         700
00047     #define SGUI_PADDING            8
00048     #define SGUI_SERVER_MAXLEN      255
00049     #define SGUI_CH_LOWER           1.0
00050     #define SGUI_CH_UPPER           16.0
00051     #define SGUI_GRAM_BG            0x00ffffff
00052     #define SGUI_GRAM_FG            0x00000000
00053     #define SGUI_SPECT_BG           0x00ffffff
00054     #define SGUI_SPECT_FG           0x000000ff
00055 
00056     #define SGUI_TYPE_ITEMS         7
00057     #define SGUI_WINDOW_ITEMS       13
00058     #define SGUI_WINLEN_ITEMS       10
00059     #define SGUI_REMOVE_NOISE_ITEMS 5
00060     #define SGUI_PALETTE_ITEMS      9
00061 
00062 
00066     enum
00067     {
00068         SGUI_FIT_NONE = 0,
00069         SGUI_FIT_NEIGHBOR = 1,
00070         SGUI_FIT_AVERAGE = 2
00071     };
00072 
00073 
00077     enum
00078     {
00079         SGUI_PAL_BW = 0,
00080         SGUI_PAL_HSV = 1,
00081         SGUI_PAL_LIGHT = 2,
00082         SGUI_PAL_TEMP = 3,
00083         SGUI_PAL_DIR = 4,
00084         SGUI_PAL_GREEN = 5,
00085         SGUI_PAL_GREEN2 = 6,
00086         SGUI_PAL_PUREGREEN = 7,
00087         SGUI_PAL_WB = 8
00088     };
00089 
00090 
00094     class clSpectGUI
00095     {
00096             bool bRun;
00097             bool bConnected;
00098             bool bFreezed;
00099             bool bReConfig;
00100             int iSockH;
00101             int iRcvMsgSize;
00102             int iFit;
00103             int iPalette;
00104             int iGramW;
00105             int iGramH;
00106             int iSpectW;
00107             int iSpectH;
00108             int iScaleFactor;
00109             int iSpectPoints;
00110             int iClips;
00111             int iTIFFCompression;
00112             int iJPEGQuality;
00113             int iBeamCount;
00114             float fGramX;
00115             float fGramY;
00116             float fSpectX;
00117             float fSpectY;
00118             char cpGramXTime[20];
00119             char *cpRcvMsgBuf;
00120             GDT *fpSpect;
00121             GDT *fpIntSpect;
00122             gint giGdkTag;
00123             GList *glServers;
00124             // - Top level
00125             GtkWidget *gwWindow;
00126             GtkWidget *gwVBox;
00127             GtkWidget *gwCBHide;
00128             GtkWidget *gwVPaned;
00129             GtkWidget *gwScrolledW1;
00130             GtkWidget *gwScrolledW2;
00131             GtkWidget *gwStatusBar;
00132             guint guCtxtSB;
00133             // - Table 1
00134             GtkWidget *gwTable1;
00135             GtkWidget *gwLServer;
00136             GtkWidget *gwCServer;
00137             GtkWidget *gwLChannel;
00138             GtkObject *goAChannel;
00139             GtkWidget *gwSBChannel;
00140             GtkWidget *gwBConnect;
00141             GtkWidget *gwBDisconnect;
00142             GtkWidget *gwCBFreeze;
00143             // - Table 2
00144             GtkWidget *gwTable2;
00145             GtkWidget *gwLType;
00146             GtkWidget *gwOMType;
00147             GtkWidget *gwMType;
00148             GtkWidget *gwaMIType[SGUI_TYPE_ITEMS];
00149             GtkWidget *gwLWindow;
00150             GtkWidget *gwOMWindow;
00151             GtkWidget *gwMWindow;
00152             GtkWidget *gwaMIWindow[SGUI_WINDOW_ITEMS];
00153             GtkWidget *gwLWindowParam;
00154             GtkWidget *gwEWindowParam;
00155             GtkWidget *gwLWindowLen;
00156             GtkWidget *gwOMWindowLen;
00157             GtkWidget *gwMWindowLen;
00158             GtkWidget *gwaMIWindowLen[SGUI_WINLEN_ITEMS];
00159             GtkWidget *gwLLowFreq;
00160             GtkWidget *gwELowFreq;
00161             GtkWidget *gwLHighFreq;
00162             GtkWidget *gwEHighFreq;
00163             GtkWidget *gwLGain;
00164             GtkWidget *gwEGain;
00165             GtkWidget *gwLSlope;
00166             GtkWidget *gwESlope;
00167             GtkWidget *gwLOverlap;
00168             GtkWidget *gwEOverlap;
00169             GtkWidget *gwCBLinear;
00170             GtkWidget *gwCBNormalize;
00171             //GtkWidget *gwBApply;
00172             // - Table 3
00173             GtkWidget *gwTable3;
00174             GtkWidget *gwLRemoveNoise;
00175             GtkWidget *gwOMRemoveNoise;
00176             GtkWidget *gwMRemoveNoise;
00177             GtkWidget *gwaMIRemoveNoise[SGUI_REMOVE_NOISE_ITEMS];
00178             GtkWidget *gwLAlpha;
00179             GtkWidget *gwEAlpha;
00180             GtkWidget *gwLMeanLength;
00181             GtkWidget *gwEMeanLength;
00182             GtkWidget *gwLGapLength;
00183             GtkWidget *gwEGapLength;
00184             GtkWidget *gwLDynRange;
00185             GtkWidget *gwEDynRange;
00186             GtkWidget *gwLPalette;
00187             GtkWidget *gwOMPalette;
00188             GtkWidget *gwMPalette;
00189             GtkWidget *gwaMIPalette[SGUI_PALETTE_ITEMS];
00190             GtkWidget *gwBSave;
00191             GtkWidget *gwFSSave;
00192             // - Table Gram
00193             GtkWidget *gwTableGram;
00194             GtkWidget *gwHRTime;
00195             GtkWidget *gwVRFreq;
00196             GtkWidget *gwDASpectrogram;
00197             // - Table Spect
00198             GtkWidget *gwTableSpect;
00199             GtkWidget *gwHRFreq;
00200             GtkWidget *gwVRLevel;
00201             GtkWidget *gwDASpectrum;
00202             //-
00203             // Drawing primitives and cursors
00204             GdkGC *ggcGramBG;
00205             GdkGC *ggcGramFG;
00206             GdkGC *ggcSpectBG;
00207             GdkGC *ggcSpectFG;
00208             GdkCursor *gcCrossHair;
00209             //-
00210             stSpectReq sSRequest;
00211             stSpectRes sSResult;
00212             clAlloc RcvMsgBuf;
00213             clAlloc SpectBuf;
00214             clAlloc IntSpectBuf;
00215             clCfgFile *CfgFile;
00216             clDSPOp DSP;
00217             clGtkUtils GtkUtils;
00218             clSockClie SockClie;
00219             clSockOp *SockOp;
00220             clSpectMsg SpectMsg;
00221             clFrameBuf FrameBuf;
00222             bool Build ();
00223             bool BuildTable1 ();
00224             bool BuildTable2 ();
00225             bool BuildTable3 ();
00226             bool BuildTableGram ();
00227             bool BuildTableSpect ();
00228             bool BuildDrawingPrims ();
00229             void FreeDrawingPrims ();
00230             bool ConnectSignals ();
00231             int GetGramHeight ();
00232             bool ParseServerStr (char *, int *, const char *);
00233             bool InitConnection (const char *, int);
00234             void GetSettings ();
00235             bool SendSettings ();
00236             void ReConfigDisplay ();
00237             void DrawSpectrogram ();
00238             void DrawSpectrum ();
00239             void PrintRealTime ();
00240             long CountBands (long);
00241             void SaveInfo (const char *);
00242         public:
00243             clSpectGUI (int *, char ***);
00244             ~clSpectGUI ();
00245             int Exec ();
00246             gint OnDelete (GtkWidget *, GdkEventAny *);
00247             void OnHideToggled (GtkToggleButton *, gpointer);
00248             gint OnConnectClick (GtkWidget *, gpointer);
00249             void OnFreezeToggled (GtkToggleButton *, gpointer);
00250             gint OnPaletteActivate (GtkWidget *, gpointer);
00251             gint OnMotionSgram (GtkWidget *, GdkEventMotion *);
00252             gint OnMotionSpect (GtkWidget *, GdkEventMotion *);
00253             gint OnExposeSgram (GtkWidget *, GdkEventExpose *);
00254             gint OnExposeSpect (GtkWidget *, GdkEventExpose *);
00255             gboolean OnConfigure (GtkWidget *, GdkEventConfigure *, gpointer);
00256             void OnSizeAllocate (GtkWidget *, GtkAllocation *, gpointer);
00257             void GdkInput (gpointer, gint, GdkInputCondition);
00258             void OnSaveClicks (GtkButton *, gpointer);
00259     };
00260 
00261 #endif
00262 

Generated on Sun Oct 26 19:11:21 2003 for HASAS by doxygen 1.3.3