Пример #1
0
bool HDRCompositionInterface::Launch( const MetaProcess& P, const ProcessImplementation*, bool& dynamic, unsigned& /*flags*/ )
{
   // ### Deferred initialization
   if ( GUI == 0 )
   {
      GUI = new GUIData( *this );
      SetWindowTitle( "HDRComposition" );
      UpdateControls();

      // Restore position only
      if ( !RestoreGeometry() )
         SetDefaultPosition();
      AdjustToContents();
   }

   dynamic = false;
   return &P == TheHDRCompositionProcess;
}
Пример #2
0
STISpectrumDialog::STISpectrumDialog( wxWindow* pParent,
                                      AuroraSTI* pAs,
                                      AFConfig* pCfg,
                                      const bool bIsStereo)
  : STISpectrumDlg(pParent),
    m_pAs(pAs),
    m_bIsStereo(bIsStereo),
    m_nCurrentChnl(CH_LEFT),
    m_ExportsMgr(pParent, pAs, bIsStereo),
    m_pCfg(pCfg)
{
	// Set caption
	wxString wxszTitle(wxT("Aurora for Audacity - Octave Bands Analisys - (v."));
	wxszTitle << ::AuroraModuleVersionNumber(STI_VERSION_TYPE, STI_RELEASE_CANDIDATE) << wxT(")");
    SetTitle(wxszTitle);

	// Draw logo
/*	wxBoxSizer* pLogoSizer;
	pLogoSizer = new wxBoxSizer( wxHORIZONTAL );

	m_pwxbmpAuroraLogo = new wxStaticBitmap( m_pwxpnlLogo, wxID_ANY,
			                                 AFArtProvider::GetBitmap(wxT("Aurora_logo")),
			                                 wxDefaultPosition, wxDefaultSize, 0 );
	pLogoSizer->Add( m_pwxbmpAuroraLogo, 0, wxALL, 5 );

	pLogoSizer->Add( 0, 0, 1, wxEXPAND, 5 );

	m_pwxbmpLogo = new wxStaticBitmap( m_pwxpnlLogo, wxID_ANY,
			                           AFArtProvider::GetBitmap( wxT("sti_logo")),
			                           wxDefaultPosition, wxDefaultSize, 0 );
	pLogoSizer->Add( m_pwxbmpLogo, 0, wxALL, 5 );

	m_pwxpnlLogo->SetSizer( pLogoSizer );
	m_pwxpnlLogo->Layout();
*/
    // Set data
    m_pSpectrumPlot->GetBandsAxis()->SetTitle(wxT("Octave Bands [Hz]"));
    m_pSpectrumPlot->GetBandsAxis()->ShowTitle(true);
    m_pSpectrumPlot->GetBandsAxis()->AddCategories(g_awxpchBandLabels, 12);

    m_pSpectrumPlot->GetLevelAxis()->SetTitle(wxT("Level [dB]"));
    m_pSpectrumPlot->GetLevelAxis()->ShowTitle(true);
    m_pSpectrumPlot->GetLevelAxis()->ShowGrid(true);
    m_pSpectrumPlot->GetLevelAxis()->SetRange(30.0, 130.0, AFAxisBase::RF_REAL);

    m_pSpectrumPlot->AddSerie((const double*)m_pAs->GetNoiseSpectrumVector(CH_LEFT), 12);
    m_pSpectrumPlot->AddSerie((const double*)m_pAs->GetSignalSpectrumVector(CH_LEFT), 12);
    m_pSpectrumPlot->AddSerie((const double*)m_pAs->GetSigNoiseSpectrumVector(CH_LEFT), 12);

    if(!m_bIsStereo) 
    {
        m_pwxstChnlSel->Disable();
        m_pwxchoiceChannel->Disable();
    }

    ::AuroraUpdateGridBackgroundColor(m_pwxgridSpectrumTable);

    wxGridCellAttr*  pCellAttr = new wxGridCellAttr();
    pCellAttr->SetReadOnly();
    for(int nRow = 0; nRow < 3; nRow++)
    {
        m_pwxgridSpectrumTable->SetCellRenderer(nRow, 0, new STISpectrumGridCellColoredRectRenderer);
        m_pwxgridSpectrumTable->SetRowAttr(nRow, pCellAttr->Clone());
    }
#ifdef __WXGTK__
    m_pwxgridSpectrumTable->SetRowLabelSize(140);
#endif
    FillTable();
    
    RestoreGeometry();

    m_pSpectrumPlot->Refresh();

    // init table context menu
    m_pwxLevelContextMenu = new wxMenu;   
    m_pwxLevelContextMenu->Append(ID_LEVEL_COPY_SELECTION_MENU, wxT("&Copy\tCtrl+C"));
    m_pwxLevelContextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(STISpectrumDialog::OnLevelTableCopySelection), NULL, this );
    m_pwxgridSpectrumTable->Connect(wxEVT_CHAR, wxCharEventHandler(STISpectrumDialog::OnLevelTableKeyPress), NULL, this);
}
Пример #3
0
XFunctionsShowDialog::XFunctionsShowDialog(wxWindow* pParent, XFunctions *pXf, AFConfig* pCfg)
  : XFunctionsShowDlg(pParent),
    m_pXf(pXf),
    mExportData(pParent),
    m_pCfg(pCfg)
{
	// Set caption
	wxString wxszTitle(wxT("Aurora for Audacity - Cross Functions Calculation Module - (v."));
	wxszTitle << ::AuroraModuleVersionNumber(XF_VERSION_TYPE, XF_RELEASE_CANDIDATE) << wxT(")");
    SetTitle(wxszTitle);

	// Draw logo
	wxBoxSizer* pLogoSizer;
	pLogoSizer = new wxBoxSizer( wxHORIZONTAL );

	m_pwxbmpAuroraLogo = new wxStaticBitmap( m_pwxpnlLogo, wxID_ANY,
			                                 AFArtProvider::GetBitmap(wxT("Aurora_logo")),
			                                 wxDefaultPosition, wxDefaultSize, 0 );
	pLogoSizer->Add( m_pwxbmpAuroraLogo, 0, wxALL, 5 );

	pLogoSizer->Add( 0, 0, 1, wxEXPAND, 5 );

	m_pwxbmpLogo = new wxStaticBitmap( m_pwxpnlLogo, wxID_ANY,
			                           AFArtProvider::GetBitmap( wxT("xfn_logo")),
			                           wxDefaultPosition, wxDefaultSize, 0 );
	pLogoSizer->Add( m_pwxbmpLogo, 0, wxALL, 5 );

	m_pwxpnlLogo->SetSizer( pLogoSizer );
	m_pwxpnlLogo->Layout();


   wxString wxszValue;
   // ------- Fill Result boxes
   // Input waveform
   wxszValue.Printf(wxT("%d"), int(m_pXf->GetFFTLength()));
   mFftSizeStext->SetLabel(wxszValue);
   wxszValue.Printf(wxT("%d"), int(m_pXf->GetSamplerate()));
   mRateStext->SetLabel(wxszValue);
   wxszValue.Printf(wxT("%d"), int(m_pXf->GetBlocksNumber()));
   mNblocksStext->SetLabel(wxszValue);
    
   // Statistics
   mTransformTypeStext->SetLabel(m_pXf->GetCurrentXFunctionLabel());
   wxszValue.Printf(wxT("%.2f"), m_pXf->GetRMS(CH_LEFT));
   mRmsLeftStext->SetLabel(wxszValue);
   wxszValue.Printf(wxT("%.2f"), m_pXf->GetRMS(CH_RIGHT));
   mRmsRightStext->SetLabel(wxszValue);
   wxszValue.Printf(wxT("%.2f"), m_pXf->GetRMS(XFunctions::CH_CROSS));
   mRmsCrossStext->SetLabel(wxszValue);
    
   // Time of flight (only for Cross-Correlation)
   if(m_pXf->GetXFunctionType() == XFunctions::XFT_CROSS_CORRELATION)
   {
      mTimeOfFlightStext->Enable();
      mTriggerTimeLabelStext->Enable();
      mTriggerTimeStext->Enable();
      mTriggerTimeAtStext->Enable();
      mTriggerDelayStext->Enable();
       
      mNccMaxLabelStext->Enable();
      mNccMaxStext->Enable();
      mNccMaxAtStext->Enable();
      mNccMaxDelayStext->Enable();
       
      mSaveToTimeDelayCheck->Enable();
       
      wxszValue.Printf(wxT("%.1f%%"), m_pXf->GetTriggerLevel());
      mTriggerTimeStext->SetLabel(wxszValue);
      wxszValue.Printf(wxT("%.3f s"), m_pXf->GetTriggerTime());
      mTriggerDelayStext->SetLabel(wxszValue);
 
      wxszValue.Printf(wxT("%.4f"), m_pXf->GetXCorrelationMax());
      mNccMaxStext->SetLabel(wxszValue);
      wxszValue.Printf(wxT("%.3f s"), m_pXf->GetXCorrelationMaxDelay());
      mNccMaxDelayStext->SetLabel(wxszValue);
   }
   else
   {
      wxszValue.Printf(wxT("- %%"));
      mTriggerTimeStext->SetLabel(wxszValue);
      wxszValue.Printf(wxT("- s"));
      mTriggerDelayStext->SetLabel(wxszValue);
 
      wxszValue.Printf(wxT("- %%"));
      mNccMaxStext->SetLabel(wxszValue);
      wxszValue.Printf(wxT("- s"));
      mNccMaxDelayStext->SetLabel(wxszValue);
   }
   BuildPlotChoice(mFirstPlotChoice, 0);
   BuildPlotChoice(mSecondPlotChoice, 1);

   // By default horizontal axis is linear
   mLinearScaleCheck->SetValue(true);

   AddPlotDataSeries(mUpperPlot, *wxBLUE);
   AddPlotDataSeries(mLowerPlot, *wxRED);

   wxszValue = mFirstPlotChoice->GetStringSelection();
   UpdatePlotData(mUpperPlot, wxszValue);
   wxszValue = mSecondPlotChoice->GetStringSelection();
   UpdatePlotData(mLowerPlot, wxszValue);

   mUpperPlot->GetFreqAxis()->ShowGrid(true);
   mUpperPlot->GetFreqAxis()->ShowTitle(true);
   mUpperPlot->GetLevelAxis()->ShowGrid(true);
   mUpperPlot->GetLevelAxis()->ShowTitle(true);
   mUpperPlot->SetTopBorder(false);

   mLowerPlot->GetFreqAxis()->ShowGrid(true);
   mLowerPlot->GetFreqAxis()->ShowTitle(true);
   mLowerPlot->GetLevelAxis()->ShowGrid(true);
   mLowerPlot->GetLevelAxis()->ShowTitle(true);
   mLowerPlot->SetTopBorder(false);

   mUpperPlot->Refresh();
   mLowerPlot->Refresh();
   
//   mExportData.SetDataPlot(mUpperPlot, mLowerPlot);
   wxszValue = m_pXf->GetCurrentXFunctionLabel();
   mExportData.SetFunctionLabel(wxszValue);
   mExportData.SetDataSeriesArray(mUpperPlot->GetDataSeriesArray(), 0);
   mExportData.SetDataSeriesArray(mLowerPlot->GetDataSeriesArray(), 1);

   RestoreGeometry();
}