Logo Search packages:      
Sourcecode: jaaa version File versions  Download package

Spectwin::Spectwin ( X_window *  parent,
X_resman *  xres,
ITC_ctrl *  audio 
)

!!

Definition at line 42 of file spectwin.cc.

                                                                     :
    X_window (parent, XPOS, YPOS, XDEF, YDEF, Colors.main_bg), _xs (XDEF), _ys (YDEF), _running (1),
    _audio (audio), _input (-1), _drag (0), _p_ind (-1), _ngx (0), _ngy (0), _fftplan (0), _fftlen (64)
{
    int      x, y;
    X_hints  H;

    _exitatom = XInternAtom (dpy (), "WM_DELETE_WINDOW", True);
    XSetWMProtocols (dpy (), win (), &_exitatom, 1);
    _exitatom = XInternAtom (dpy (), "WM_PROTOCOLS", True);

    H.position (XPOS, YPOS);
    H.minsize (XMIN, YMIN);
    H.maxsize (XMAX, YMAX);
    H.rname (xres->rname ());
    H.rclas (xres->rclas ());
    x_apply (&H); 

    x_add_events (ExposureMask | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask | StructureNotifyMask);

    _plotwin = new X_window (this, LMAR, TMAR, XDEF - LMAR - RMAR, YDEF - TMAR - BMAR, Colors.spect_bg);
    _plotmap = XCreatePixmap (dpy (), _plotwin->win (), XDEF - LMAR - RMAR, YDEF - TMAR - BMAR, disp ()->depth ());
    _plotgct = XCreateGC (dpy (), _plotmap, 0, NULL);
     XSetWindowBackgroundPixmap (dpy (), _plotwin->win (), _plotmap);
    _plotwin->x_map ();     

    x = XDEF - RMAR + 3;
    y = 20;
    _butt [IP1] = new X_tbutton (this, this, &Bst0, x     , y, "1", 0, IP1);
    _butt [IP2] = new X_tbutton (this, this, &Bst0, x + 19, y, "2", 0, IP2);
    _butt [IP3] = new X_tbutton (this, this, &Bst0, x + 38, y, "3", 0, IP3);
    _butt [IP4] = new X_tbutton (this, this, &Bst0, x + 57, y, "4", 0, IP4);

    Bst1.size.x = RMAR - 6;
    y = 60;
    _butt [BANDW] = new X_tbutton (this, this, &Bst1, x, y, "Bandw",   0, BANDW);
    y += Bst1.size.y;  
    _butt [VIDAV] = new X_tbutton (this, this, &Bst1, x, y, "Vid.Av",  0, VIDAV);
    y += Bst1.size.y;
    _butt [PEAKH] = new X_tbutton (this, this, &Bst1, x, y, "Pk Hold", 0, PEAKH);
    y += Bst1.size.y;
    _butt [FREEZ] = new X_tbutton (this, this, &Bst1, x, y, "Freeze",  0, FREEZ);

    y = 153;
    _butt [MCLR]  = new X_tbutton (this, this, &Bst1, x, y, "Clear", 0, MCLR);
    y += Bst1.size.y;
    _butt [MPEAK] = new X_tbutton (this, this, &Bst1, x, y, "Peak",  0, MPEAK);
    y += Bst1.size.y;
    _butt [MNSE]  = new X_tbutton (this, this, &Bst1, x, y, "Noise", 0, MNSE);

    y = 229;
    _butt [FMIN]  = new X_tbutton (this, this, &Bst1, x, y, "Min",  0, FMIN);
    y += Bst1.size.y;
    _butt [FMAX]  = new X_tbutton (this, this, &Bst1, x, y, "Max",  0, FMAX);
    y += Bst1.size.y;
    _butt [FCENT] = new X_tbutton (this, this, &Bst1, x, y, "Cent", 0, FCENT);
    y += Bst1.size.y;
    _butt [FSPAN] = new X_tbutton (this, this, &Bst1, x, y, "Span", 0, FSPAN);

    y = 323;
    _butt [AMAX]  = new X_tbutton (this, this, &Bst1, x, y, "Max", 0, AMAX);
    y += Bst1.size.y;
    _butt [ASPAN] = new X_tbutton (this, this, &Bst1, x, y, "Range", 0, ASPAN);

    y = 383;
    _txt1 = new X_textip (this, this, &Tst1, x, y, RMAR - 6, 18, 16);
    _txt1->x_set_win_gravity (NorthEastGravity);
    _txt1->x_map ();

    Bst0.size.x = 15;
    Bst0.size.y = 15;
    y = 405;
    _butt [BTDN] = new X_ibutton (this, this, &Bst0, x + RMAR - 38, y, disp ()->image1515 (X_display::IMG_LT), BTDN);
    _butt [BTUP] = new X_ibutton (this, this, &Bst0, x + RMAR - 23, y, disp ()->image1515 (X_display::IMG_RT), BTUP);

    Bst0.size.x = 17;
    Bst0.size.y = 17;
    y = 452;
    _butt [OP1] = new X_tbutton (this, this, &Bst0, x     , y, "1", 0, OP1);
    _butt [OP2] = new X_tbutton (this, this, &Bst0, x + 19, y, "2", 0, OP2);
    _butt [OP3] = new X_tbutton (this, this, &Bst0, x + 38, y, "3", 0, OP3);
    _butt [OP4] = new X_tbutton (this, this, &Bst0, x + 57, y, "4", 0, OP4);

    Bst0.size.x = 27;
    Bst0.size.y = 17;
    y = 476;
    _butt [NSACT] = new X_tbutton (this, this, &Bst0, XDEF - 30, y, "On", 0, NSACT);
    y += Bst0.size.y + 4;
    _butt [NSLEV] = new X_tbutton (this, this, &Bst1, x, y, "Level", 0, NSLEV);

    y = 520;
    _butt [SIACT] = new X_tbutton (this, this, &Bst0, XDEF - 30, y, "On", 0, SIACT);
    y += Bst0.size.y + 4;
    _butt [SILEV] = new X_tbutton (this, this, &Bst1, x, y, "Ampl", 0, SILEV);
    y += Bst1.size.y;
    _butt [SFREQ] = new X_tbutton (this, this, &Bst1, x, y, "Freq", 0, SFREQ);

    for (int i = 0; i < NBUTT; i++)
    {
       _butt [i]->x_set_win_gravity (NorthEastGravity);
       _butt [i]->x_map ();
    }

    _ipbuf = (float *) fftwf_malloc (BUF_LEN * sizeof (float));
    _fftbuf = (float *) fftwf_malloc (FFT_MAX * sizeof (float));
    _trbuf = (fftwf_complex *) fftwf_malloc ((FFT_MAX / 2 + 9) * sizeof (fftwf_complex));
    _power = new float [FFT_MAX + 1]; //!!!

    _spect = new Spectdata (disp()->xsize() - LMAR - RMAR);    
    _spect->_npix = XDEF - LMAR - RMAR;
    _spect->_bits = 0;
    _spect->_avcnt = 0;
    _spect->_avmax = 1000;

    set_input (0);

    _g_bits = 0;
    _a_ns = -20;
    _a_si = -20;
    _f_si = 1000.0;
}

Generated by  Doxygen 1.6.0   Back to index