/[qspeakers]/branches/qtcharts/mainwindow.cpp
ViewVC logotype

Diff of /branches/qtcharts/mainwindow.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 219 by ben, Sun Mar 18 13:50:00 2018 UTC revision 220 by ben, Sun Mar 18 21:16:30 2018 UTC
# Line 29  MainWindow::MainWindow(QWidget *parent) Line 29  MainWindow::MainWindow(QWidget *parent)
29      fileDialog(NULL),      fileDialog(NULL),
30      searchDialog(NULL),      searchDialog(NULL),
31      listDialog(NULL),      listDialog(NULL),
32        bandpassDialog(NULL),
33      currentSpeakerNumber(0),      currentSpeakerNumber(0),
34      currentTabIndex(-1),      currentTabIndex(-1),
35      sealedPlot(NULL),      sealedPlot(NULL),
# Line 129  MainWindow::MainWindow(QWidget *parent) Line 130  MainWindow::MainWindow(QWidget *parent)
130      connect(ui->actionBullock, SIGNAL(triggered()), this, SLOT(onAlignBullock()));      connect(ui->actionBullock, SIGNAL(triggered()), this, SLOT(onAlignBullock()));
131      connect(ui->actionKeele_Hoge, SIGNAL(triggered()), this, SLOT(onAlignKeele_Hoge()));      connect(ui->actionKeele_Hoge, SIGNAL(triggered()), this, SLOT(onAlignKeele_Hoge()));
132    
133        /* bandpass alignment */
134        connect(ui->actionBandpass_alignement, SIGNAL(triggered(bool)), this, SLOT(onBandpassAlignment()));
135    
136      /* tabs actions */      /* tabs actions */
137      connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onCurrentTabChanged(int)));      connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onCurrentTabChanged(int)));
138    
# Line 390  QString MainWindow::getHome() Line 394  QString MainWindow::getHome()
394      return home;      return home;
395  }  }
396    
397    void MainWindow::onBandpassAlignment()
398    {
399        bandpassDialog = new BandpassDialog(this);
400        connect(bandpassDialog, SIGNAL(optimizeRequested(double, double)), this, SLOT(onBandpassOptimizeRequested(double, double)));
401        connect(bandpassDialog, SIGNAL(optimizeCancelled()), this, SLOT(onBandpassOptimizeCancelled()));
402        bandpassDialog->show();
403    }
404    
405    void MainWindow::onBandpassOptimizeRequested(double s, double pa)
406    {
407        if (ui->tabWidget->currentWidget() == ui->bandpassTab) {
408            Optimizer optimizer(currentSpeaker, &currentBandPassBox, currentSpeakerNumber);
409            optimizer.bandpassAlignS_Pa(s, pa);
410            emit currentBandPassBoxChanged(currentBandPassBox);
411        }
412    
413        disconnect(bandpassDialog, SIGNAL(optimizeRequested(double,double)), this, SLOT(onBandpassOptimizeRequested(double,double)));
414        disconnect(bandpassDialog, SIGNAL(optimizeCancelled()), this, SLOT(onBandpassOptimizeCancelled()));
415        bandpassDialog->close();
416        delete bandpassDialog;
417        bandpassDialog = NULL;
418    }
419    
420    void MainWindow::onBandpassOptimizeCancelled()
421    {
422        disconnect(bandpassDialog, SIGNAL(optimizeRequested(double,double)), this, SLOT(onBandpassOptimizeRequested(double,double)));
423        disconnect(bandpassDialog, SIGNAL(optimizeCancelled()), this, SLOT(onBandpassOptimizeCancelled()));
424        bandpassDialog->close();
425        delete bandpassDialog;
426        bandpassDialog = NULL;
427    }
428    
429  void MainWindow::onSpeakerNew()  void MainWindow::onSpeakerNew()
430  {  {
431      isModifying = false;      isModifying = false;

Legend:
Removed from v.219  
changed lines
  Added in v.220

  ViewVC Help
Powered by ViewVC 1.1.26