示例#1
0
void AudacityProject::Import(wxString fileName)
{
   WaveTrack **newTracks;
   int numTracks;

   numTracks =::Import(this, fileName, &newTracks);

   if (numTracks <= 0)
      return;

   SelectNone();

   bool initiallyEmpty = mTracks->IsEmpty();
   bool rateWarning = false;
   double newRate = newTracks[0]->GetRate();

   for (int i = 0; i < numTracks; i++) {
      if (newTracks[i]->GetRate() != mRate)
         rateWarning = true;
      mTracks->Add(newTracks[i]);
      newTracks[i]->SetSelected(true);
   }

   delete[]newTracks;

   if (initiallyEmpty) {
      mRate = newRate;
      mStatus->SetRate(mRate);
   } else if (rateWarning) {
      wxMessageBox(_("Warning: your file has multiple sampling rates.  "
                     "Audacity will ignore any track which is not at "
                     "the same sampling rate as the project."));
   }

   PushState(wxString::Format(_("Imported '%s'"), fileName.c_str()));
   ZoomFit();
   mTrackPanel->Refresh(false);

   if (initiallyEmpty) {
      wxString name =::TrackNameFromFileName(fileName);
      mFileName =::wxPathOnly(fileName) + wxFILE_SEP_PATH + name + ".aup";
      SetTitle(GetName());
   }

   HandleResize();
}
示例#2
0
void AudacityProject::OnZoomFit(wxCommandEvent & event)
{
   ZoomFit();
}
示例#3
0
void CRenWin3D::SetModel(CMesh *mdl)
{
    m_model = mdl;
    ZoomFit();
}