int main( int argc, char ** argv ) { QApplication a (argc, argv); QDesktopWidget * d = a.desktop(); int resolution_width = d->width(); // returns desktop width int resolution_heigth = d->height(); // returns desktop height hw = new HWSRV(); get_setup_params(); if (sp.autoblock_flag) bt =new BlockTimer(sp.autoblock_time); init_keyboard_device(&a); w = new MainWareform; a.setMainWidget(w); int wid = w->width(); int heig = w->height(); // printf("wid = %d heig = %d\n", wid, heig); if ((wid>resolution_width)||(heig>resolution_heigth)){ w->setWindowState(Qt::WindowFullScreen); w->setMinimumSize(QSize(resolution_width,resolution_heigth)); w->setMaximumSize(QSize(resolution_width,resolution_heigth)); w->adjustSize(); } w->limit = 20; w->FillTable("0"); w->show(); int ret = a.exec(); //printf("ret = %d\n",ret); if ( kbcode_scaner != NULL ) delete kbcode_scaner; if ( kbcode_reader != NULL ) delete kbcode_reader; return ret; }
int MBASE::init(double p[], int n_args) { int flag, UseMikes; float outskip, inskip, abs_factor, dummy; double R, T, dist; outskip = p[0]; inskip = p[1]; m_dur = p[2]; if (m_dur < 0) /* "dur" represents timend */ m_dur = -m_dur - inskip; if (rtsetinput(inskip, this) == -1) { // no input return(DONT_SCHEDULE); } insamps = (int)(m_dur * SR); inamp = p[3]; if (inamp < 0) { m_paths = 1; // Dont process secondary paths inamp = -inamp; } /* Get results of Minc setup calls (space, mikes_on, mikes_off, matrix) */ if (get_setup_params(Dimensions, &m_attenParams, &dummy, &abs_factor, &UseMikes, &MikeAngle, &MikePatternFactor) == -1) { return die(name(), "You must call setup routine `space' first."); } // call inst-specific init code if (localInit(p, n_args) == DONT_SCHEDULE) return die(name(), "localInit failed."); if (m_inchan >= inputChannels()) return die(name(), "You asked for channel %d of a %d-channel input file.", m_inchan, inputChannels()); if (inputChannels() == 1) m_inchan = 0; if (outputChannels() != 4) return die(name(), "Output must be 4-channel (2 signal, 2 reverb feed)."); /* (perform some initialization that used to be in space.c) */ int meanLength = MFP_samps(SR, Dimensions); // mean delay length for reverb get_lengths(meanLength); /* sets up delay lengths */ set_gains(); /* sets gains for filters */ set_walls(abs_factor); /* sets wall filts for move routine */ /* flag for use of ear filters */ m_binaural = (!UseMikes && m_dist < 0.8 && m_dist != 0.0); amparray = floc(1); if (amparray) { int amplen = fsize(1); tableset(SR, m_dur, amplen, amptabs); /* controls input dur only */ } /* determine extra run time for this routine before calling rtsetoutput() */ double reflectionDur = 0.0; finishInit(&reflectionDur); m_branch = 0; if (rtsetoutput(outskip, m_dur + reflectionDur, this) == -1) return DONT_SCHEDULE; DBG1(printf("nsamps = %d\n", nSamps())); return nSamps(); }
int main( int argc, char ** argv ) { QApplication a( argc, argv ); puts("`````````````````````````````````````````````````"); printf("RESHKA MAIN PROCESS ID - %d\n", getpid()); printf("VERSION: %s\n", PROGRAMM_VERSION); puts("`````````````````````````````````````````````````"); startHW(); get_setup_params(); hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); init_keyboard_device(&a); bool flag = auth_request(false); if ( flag ) { cfw = new mainmenuForm; cfw->setWindowState(Qt::WindowNoState); cfw->setWindowState(Qt::WindowFullScreen); //printf("Authorization::GetInstance()->GetUserName() = %s \n", Authorization::GetInstance()->GetUserName()); cfw->textLabel2->setText(DBCodec->toUnicode((Authorization::GetInstance()->GetUserName()))); applyRights(); while ( true ) { puts("------Main Menu------"); cfw->setWindowState(Qt::WindowNoState); cfw->setWindowState(Qt::WindowFullScreen); cfw->exec(); //printf("Selected point = %d \n", cfw->focus_num); cfw->releaseKeyboard(); if ( cfw->exec_flag ) { switch(cfw->focus_num) { case 0 : printf("--------lincash-------\n"); delete (hw); ExecProgram(REG_PATH, REG_NAME, uid);//, REG_NAME); ///-------------------------23/10 16.41--------------- cfw->grabKeyboard(); //---(+)---Zuskin---27/02/2012--- sp.ReloadSections(); //------------------------------- startHW(); hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); break; case 1 : printf("-------service-----\n"); //delete (hw); //QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); //ExecProgram(SERVICE_PATH, SERVICE_NAME, uid);//, SERVICE_NAME); StartService(); cfw->exec_flag = false; cfw->grabKeyboard(); //QApplication::restoreOverrideCursor(); //startHW(); hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); break; case 2 : printf("-------accessrights-------\n"); delete (hw); //printf("RIGHTS_PATH = %s \n", RIGHTS_PATH); ExecProgram(RIGHTS_PATH);//, RIGHTS_NAME); Authorization::GetInstance()->GetRights(Authorization::GetInstance()->GetUid()); applyRights(); cfw->grabKeyboard(); startHW(); hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); break; case 3 : printf("--------ware------\n"); delete (hw); ExecProgram(WARE_PATH);//, SETUP_NAME); cfw->grabKeyboard(); startHW(); hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); break; case 4 : printf("-------programsetup-----\n"); StartSetup(); cfw->grabKeyboard(); get_setup_params(); cfw->exec_flag = false; hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); break; case 5 : printf("--------devicesetup-------\n"); if ( kbcode_scaner != NULL ) { delete (kbcode_scaner); kbcode_scaner = NULL; } if ( kbcode_reader != NULL ) { delete (kbcode_reader); kbcode_reader = NULL; } delete (hw); ExecProgram(DCONF_PATH);//, DCONF_NAME); cfw->grabKeyboard(); startHW(); init_keyboard_device(&a); hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); break; case 6 : printf("--------setuploadunload------\n"); delete (hw); ExecProgram(EXCH_PATH);//, EXCH_NAME); cfw->grabKeyboard(); startHW(); hw->DSP_Up(UpStr); hw->DSP_Down(DownStr); break; case 7 : printf("-------changeuser------\n"); bool auth = auth_request(true); while ( !auth ) auth = auth_request(true); cfw->grabKeyboard(); cfw->exec_flag = false; cfw->textLabel2->setText(DBCodec->toUnicode((Authorization::GetInstance()->GetUserName()))); applyRights(); break; } cfw->exec_flag = false; } else break; } delete(cfw); } if ( kbcode_scaner != NULL ) delete (kbcode_scaner); if ( kbcode_reader != NULL ) delete (kbcode_reader); if ( hw != NULL ) delete (hw); puts("END OF RESHKA"); return 0; }
int BASE::init(double p[], int n_args) { int UseMikes; float outskip, inskip, abs_factor, rvb_time; outskip = p[0]; inskip = p[1]; m_dur = p[2]; if (m_dur < 0) /* "dur" represents timend */ m_dur = -m_dur - inskip; if (rtsetinput(inskip, this) == -1) { // no input return(DONT_SCHEDULE); } insamps = (int)(m_dur * SR); inamp = p[3]; double Matrix[12][12]; /* Get results of Minc setup calls (space, mikes_on, mikes_off, matrix) */ if (get_setup_params(Dimensions, Matrix, &abs_factor, &rvb_time, &UseMikes, &MikeAngle, &MikePatternFactor) == -1) { return die(name(), "You must call setup routine `space' first."); } // call inst-specific init code if (localInit(p, n_args) == DONT_SCHEDULE) { return die(name(), "localInit failed."); } if (m_inchan >= inputChannels()) { return die(name(), "You asked for channel %d of a %d-channel input file.", m_inchan, inputChannels()); } if (inputChannels() == 1) m_inchan = 0; if (outputChannels() != 2) { return die(name(), "Output must be stereo."); } wire_matrix(Matrix); /* (perform some initialization that used to be in space.c) */ int meanLength = MFP_samps(SR, Dimensions); // mean delay length for reverb get_lengths(meanLength); /* sets up delay lengths */ set_gains(rvb_time); /* sets gains for filters */ set_walls(abs_factor); /* sets wall filts for move routine */ set_allpass(); set_random(); /* sets up random variation of delays */ /* flag for use of ear filters */ m_binaural = (!UseMikes && m_dist < 0.8 && m_dist != 0.0); amparray = floc(1); if (amparray) { int amplen = fsize(1); tableset(SR, m_dur, amplen, amptabs); /* controls input dur only */ } else rtcmix_advise(name(), "Setting phrase curve to all 1's."); /* determine extra run time for this routine before calling rtsetoutput() */ double ringdur = 0.0; finishInit(rvb_time, &ringdur); m_branch = 0; if (rtsetoutput(outskip, m_dur + ringdur, this) == -1) return DONT_SCHEDULE; DBG1(printf("nsamps = %d\n", nSamps())); return nSamps(); }