• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetActiveProject函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetActiveProject函数的典型用法代码示例。如果您正苦于以下问题:C++ GetActiveProject函数的具体用法?C++ GetActiveProject怎么用?C++ GetActiveProject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetActiveProject函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Reinit

SnapResults SnapManager::Snap
(Track *currentTrack, double t, bool rightEdge)
{

   SnapResults results;
   // Check to see if we need to reinitialize
   Reinit();

   results.timeSnappedTime = results.outTime = t;
   results.outCoord = mZoomInfo->TimeToPosition(t);

   // First snap to points in mSnapPoints
   results.snappedPoint =
      SnapToPoints(currentTrack, t, rightEdge, &results.outTime);

   if (mSnapToTime) {
      // Find where it would snap time to the grid
      mConverter.ValueToControls(t, GetActiveProject()->GetSnapTo() == SNAP_NEAREST);
      mConverter.ControlsToValue();
      results.timeSnappedTime = mConverter.GetValue();
   }

   results.snappedTime = false;
   if (mSnapToTime)
   {
      if (results.snappedPoint)
      {
         // Since mSnapPoints only contains points on the grid, we're done
         results.snappedTime = true;
      }
      else
      {
         results.outTime = results.timeSnappedTime;
         results.snappedTime = true;
      }
   }

   if (results.Snapped())
      results.outCoord = mZoomInfo->TimeToPosition(results.outTime);

   return results;
}
开发者ID:MindFy,项目名称:audacity,代码行数:42,代码来源:Snap.cpp


示例2: WXUNUSED

void TranscriptionToolBar::OnSelectSound(wxCommandEvent & WXUNUSED(event))
{

   //If IO is busy, abort immediately
   if (gAudioIO->IsBusy()){
      SetButton(false,mButtons[TTB_SelectSound]);
      return;
   }


   mVk->AdjustThreshold(GetSensitivity());
   AudacityProject *p = GetActiveProject();


   TrackList *tl = p->GetTracks();
   TrackListOfKindIterator iter(Track::Wave, tl);

   Track *t = iter.First();   //Make a track
   if(t)
      {
         auto wt = static_cast<const WaveTrack*>(t);
         sampleCount start, len;
         GetSamples(wt, &start, &len);

         //Adjust length to end if selection is null
         //if(len == 0)
         //len = wt->GetSequence()->GetNumSamples()-start;

         double rate =  wt->GetRate();
         auto newstart = mVk->OffBackward(*wt, start, start);
         auto newend   =
            mVk->OffForward(*wt, start + len, (int)(tl->GetEndTime() * rate));

         //reset the selection bounds.
         p->SetSel0(newstart.as_double() / rate);
         p->SetSel1(newend.as_double() /  rate);
         p->RedrawProject();

      }

   SetButton(false,mButtons[TTB_SelectSound]);
}
开发者ID:finefin,项目名称:audacity,代码行数:42,代码来源:TranscriptionToolBar.cpp


示例3: iter

void LabelDialog::OnSelectCell(wxGridEvent &event)
{
   TrackListIterator iter(mTracks);
   Track *t = iter.First();
   while( t )
   {
      t->SetSelected( true );
      t = iter.Next();
   }

   if (!mData.empty())
   {
      RowData &rd = mData[event.GetRow()];
      mViewInfo->selectedRegion = rd.selectedRegion;

      GetActiveProject()->RedrawProject();
   }

   event.Skip();
}
开发者ID:Avi2011class,项目名称:audacity,代码行数:20,代码来源:LabelDialog.cpp


示例4: wxString

void FileFormatPrefs::OnMP3FindButton(wxCommandEvent& evt)
{
   wxString oldPath = gPrefs->Read("/MP3/MP3LibPath", "");
 
   gPrefs->Write("/MP3/MP3LibPath", wxString(""));

   //Create dummy exporter to extract info from.
   MP3Exporter * tmpExporter = new PlatformMP3Exporter(GetActiveProject(),0.0,0.0,true,44100,2,0,0); 

   if (tmpExporter->FindLibrary(this))
      SetMP3VersionText();
   else {
      gPrefs->Write("/MP3/MP3LibPath", oldPath);
   }
   
   if(tmpExporter->GetConfigurationCaps() & MP3CONFIG_BITRATE)
     mMP3Bitrate->Enable(tmpExporter->ValidLibraryLoaded());

   delete tmpExporter;
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:20,代码来源:FileFormatPrefs.cpp


示例5: GetActiveProject

void APalette::OnRecord()
{
   if (gAudioIO->IsBusy())
      return;

   AudacityProject *p = GetActiveProject();
   if (p) {
      TrackList *t = p->GetTracks();
      double t0 = p->GetSel0();
      double t1 = p->GetSel1();
      if (t1 == t0)
         t1 = 1000000000.0;  // record for a long, long time (tens of years)
      bool success = gAudioIO->StartRecord(p, t, t0, t1);
      if (!success) {
         SetPlay(false);
         SetStop(false);
         SetRecord(false);
      }
   }
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:20,代码来源:APalette.cpp


示例6: rm_dash_rf_enumerate_prompt

static int rm_dash_rf_enumerate_prompt(wxString dirpath,
                                       wxArrayString &flist, 
                                       wxString dirspec,
                                       int files_p,int dirs_p,
                                       int progress_count,
                                       const wxChar *prompt){
   AudacityProject *p = GetActiveProject();

   if (p)
      p->ProgressShow(_("Progress"), prompt);

   int count=rm_dash_rf_enumerate_i(dirpath, flist, dirspec, files_p,dirs_p,
                                    progress_count,0,
                                    prompt);

   if (p)
      p->ProgressHide();

   return count;
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:20,代码来源:DirManager.cpp


示例7: WXUNUSED

void EffectRack::OnApply(wxCommandEvent & WXUNUSED(evt))
{
   AudacityProject *project = GetActiveProject();
   
   for (size_t i = 0, cnt = mEffects.GetCount(); i < cnt; i++)
   {
      if (mPowerState[i])
      {
         project->OnEffect(mEffects[i]->GetID(), true);

         mPowerState[i] = false;

         wxBitmapButton *btn = static_cast<wxBitmapButton *>(FindWindowById(ID_POWER + i));
         btn->SetBitmapLabel(mPowerRaised);
         btn->SetBitmapSelected(mPowerRaised);
      }
   }

   UpdateActive();
}
开发者ID:Avi2011class,项目名称:audacity,代码行数:20,代码来源:EffectRack.cpp


示例8: GetActiveProject

void ControlToolBar::PlayCurrentRegion(bool looped /* = false */,
                                       bool cutpreview /* = false */)
{
   AudacityProject *p = GetActiveProject();

   if (p)
   {
      if (looped)
         p->mLastPlayMode = loopedPlay;
      else
         p->mLastPlayMode = normalPlay;

      double playRegionStart, playRegionEnd;
      p->GetPlayRegion(&playRegionStart, &playRegionEnd);

      PlayPlayRegion(playRegionStart,
                     playRegionEnd,
                     looped, cutpreview);
   }
}
开发者ID:PhilSee,项目名称:audacity,代码行数:20,代码来源:ControlToolBar.cpp


示例9: ModuleDispatch

   // ModuleDispatch
   // is called by Audacity to initialize/terminmate the module,
   // and ask if it has anything for the menus.
   int ModuleDispatch(ModuleDispatchTypes type){
      switch (type){
         case AppQuiting: {
            //It is perfectly OK for gBench to be NULL.
            //Can happen if the menu item was never invoked.
            //wxASSERT(gBench != NULL);
            if (gBench) {
               gBench->Destroy();
               gBench = NULL;
            }
         }
         break;
         case ProjectInitialized:
         case MenusRebuilt:  {
            AudacityProject *p = GetActiveProject();
            wxASSERT(p != NULL);
            CommandManager *c = p->GetCommandManager();
            wxASSERT(c != NULL);

            wxMenuBar * pBar = p->GetMenuBar();
            wxASSERT(pBar != NULL );
            wxMenu * pMenu = pBar->GetMenu( 9 );  // Menu 9 is the Tools Menu.
            wxASSERT( pMenu != NULL );

            c->SetCurrentMenu(pMenu);
            c->AddSeparator();
            c->SetDefaultFlags(AudioIONotBusyFlag, AudioIONotBusyFlag);
            c->AddItem(wxT("NyqBench"),
               _("&Nyquist Workbench..."),
               true,
               findme,
               static_cast<CommandFunctorPointer>(&NyqBench::ShowNyqBench));

            c->ClearCurrentMenu();
         }
         break;
         default:
         break;
      }
      return 1;
   }
开发者ID:finefin,项目名称:audacity,代码行数:44,代码来源:NyqBench.cpp


示例10: WXUNUSED

void TranscriptionToolBar::OnCalibrate(wxCommandEvent & WXUNUSED(event))
{
   //If IO is busy, abort immediately
   if (gAudioIO->IsBusy()){
      SetButton(false,mButtons[TTB_Calibrate]);
      return;
   }


   AudacityProject *p = GetActiveProject();

   TrackList *tl = p->GetTracks();
   if(auto wt = *tl->Any<const WaveTrack>().begin()) {
      sampleCount start, len;
      GetSamples(wt, &start, &len);

      mVk->CalibrateNoise(*wt, start, len);
      mVk->AdjustThreshold(3);

      mButtons[TTB_StartOn]->Enable();
      mButtons[TTB_StartOff]->Enable();
      mButtons[TTB_EndOn]->Enable();
      mButtons[TTB_EndOff]->Enable();
      //mThresholdSensitivity->Set(3);

      SetButton(false,mButtons[TTB_Calibrate]);
   }

   mButtons[TTB_StartOn]->Enable();
   mButtons[TTB_StartOff]->Enable();
   mButtons[TTB_EndOn]->Enable();
   mButtons[TTB_EndOff]->Enable();
   mButtons[TTB_SelectSound]->Enable();
   mButtons[TTB_SelectSilence]->Enable();
   mButtons[TTB_AutomateSelection]->Enable();

   //Make the sensititivy slider set the sensitivity by processing an event.
   wxCommandEvent dummy;
   OnSensitivitySlider(dummy);

}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:41,代码来源:TranscriptionToolBar.cpp


示例11: ModuleDispatch

   // ModuleDispatch
   // is called by Audacity to initialize/terminmate the module,
   // and ask if it has anything for the menus.
   int ModuleDispatch(ModuleDispatchTypes type){
      switch (type){
         case AppInitialized:{
            wxASSERT(gBench == NULL);
            gBench = new NyqBench(NULL);
         }
         break;
         case AppQuiting: {
            wxASSERT(gBench != NULL);
            if (gBench) {
               delete gBench;
               gBench = NULL;
            }
         }
         break;
         case ProjectInitialized:
         case MenusRebuilt:  {
            AudacityProject *p = GetActiveProject();
            wxASSERT(p != NULL);
            CommandManager *c = p->GetCommandManager();
            wxASSERT(c != NULL);

            wxMenuBar * pBar = p->GetMenuBar();
            wxASSERT(pBar != NULL );
            wxMenu * pMenu = pBar->GetMenu( 2 );  // Menu 2 is the View Menu.
            wxASSERT( pMenu != NULL );

            c->SetToMenu( pMenu );
            c->AddSeparator();
            // c->BeginMenu(_("T&ools"));
            c->SetDefaultFlags(AudioIONotBusyFlag, AudioIONotBusyFlag);
            c->AddItem(wxT("NyqBench"),
                       _("&Nyquist Workbench..."),
                       new ModNyqBenchCommandFunctor());
         }
         break;
         default:
         break;
      }
      return 1;
   }
开发者ID:dannyflax,项目名称:audacity,代码行数:44,代码来源:NyqBench.cpp


示例12: WXUNUSED

void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
{
   auto doubleClicked = mPlay->IsDoubleClicked();
   mPlay->ClearDoubleClicked();

   auto p = GetActiveProject();

   if (doubleClicked)
      p->GetPlaybackScroller().Activate(true);
   else {
      if (!CanStopAudioStream())
         return;

      StopPlaying();

      if (p) p->TP_DisplaySelection();

      PlayDefault();
      UpdateStatusBar(p);
   }
}
开发者ID:ZenInTexas,项目名称:audacity,代码行数:21,代码来源:ControlToolBar.cpp


示例13: InitFreqWindow

void InitFreqWindow(wxWindow * parent)
{
   AudacityProject* p = GetActiveProject();
   if (!p)
      return;

   if(!p->mFreqWindow)
   {
      wxPoint where;

      where.x = 150;
      where.y = 150;

      p->mFreqWindow = new FreqWindow(parent, -1, _("Frequency Analysis"), where);
   }
   wxCommandEvent dummy;
   p->mFreqWindow->OnReplot(dummy);
   p->mFreqWindow->Show(true);
   p->mFreqWindow->Raise();
   p->mFreqWindow->SetFocus();
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:21,代码来源:FreqWindow.cpp


示例14: GetActiveProject

void NyqBench::OnRunUpdate(wxUpdateUIEvent & e)
{
   AudacityProject *p = GetActiveProject();
   wxToolBar *tbar = GetToolBar();
   wxMenuBar *mbar = GetMenuBar();

   if (p && gAudioIO->IsBusy()) {
      mbar->Enable(ID_GO, false);
      mbar->Enable(ID_STOP, false);

      tbar->EnableTool(ID_GO, false);
      tbar->EnableTool(ID_STOP, false);
   }
   else {
      mbar->Enable(ID_GO, (mScript->GetLastPosition() > 0) && !mRunning);
      mbar->Enable(ID_STOP, (mScript->GetLastPosition() > 0) && mRunning);

      tbar->EnableTool(ID_GO, (mScript->GetLastPosition() > 0) && !mRunning);
      tbar->EnableTool(ID_STOP, (mScript->GetLastPosition() > 0) && mRunning);
   }
}
开发者ID:finefin,项目名称:audacity,代码行数:21,代码来源:NyqBench.cpp


示例15: GetActiveProject

// Gets all commands that are valid for this mode.
wxArrayString BatchCommands::GetAllCommands()
{
   wxArrayString commands;
   wxString command;
   commands.Clear();

   AudacityProject *project = GetActiveProject();
   if (!project)
      return commands;

   EffectArray * effects;
   unsigned int i;

   for(i=0;i<sizeof(SpecialCommands)/sizeof(SpecialCommands[0]);i++)
   {
      commands.Add( SpecialCommands[i] );
   }
   
   int additionalEffects=ADVANCED_EFFECT;
   if( project->GetCleanSpeechMode() )
       additionalEffects = 0;
   effects = Effect::GetEffects(PROCESS_EFFECT | BUILTIN_EFFECT | additionalEffects);
   for(i=0; i<effects->GetCount(); i++) {
      command=(*effects)[i]->GetEffectName();
      command.Replace( wxT("..."), wxT(""));
      commands.Add( command);
   }
   delete effects;

/* This is for later in development: include the menu commands.
   CommandManager * mManager = project->GetCommandManager();
   wxArrayString mNames;
   mNames.Clear();
   mManager->GetAllCommandNames(mNames, false);
   for(i=0; i<mNames.GetCount(); i++) {
      commands.Add( mNames[i] );
   }
*/
   return commands;
}
开发者ID:andreipaga,项目名称:audacity,代码行数:41,代码来源:BatchCommands.cpp


示例16: GetActiveProject

void EffectNoiseRemoval::CleanSpeechMayReadNoisegate()
{
   int halfWindowSize = mWindowSize / 2;

   //lda-131a always try to get noisegate.nrp if in CleanSpeechMode
   // and it exists
   AudacityProject * project = GetActiveProject();
   if (project == NULL) {
      int mode = gPrefs->Read(wxT("/Batch/CleanSpeechMode"), 0L);
      if (mode == 0) {
         return;
      }
   }

   // Try to open the file.
   if( !wxDirExists( FileNames::NRPDir() ))
      return;

   // if file doesn't exist, return quietly.
   wxString fileName = FileNames::NRPFile();
   if( !wxFileExists( fileName ))
      return;

   wxFFile noiseGateFile(fileName, wxT("rb"));
   bool flag = noiseGateFile.IsOpened();
   if (flag != true)
      return;

   // Now get its data.
   int expectedCount = halfWindowSize * sizeof(float);
   int count = noiseGateFile.Read(mNoiseThreshold, expectedCount);
   noiseGateFile.Close();
   if (count == expectedCount) {
      for (int i = halfWindowSize; i < mSpectrumSize; ++i) {
         mNoiseThreshold[i] = float(0.0);  // only partly filled by Read?
      }
      mHasProfile = true;
      mDoProfile = false;
   }
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:40,代码来源:NoiseRemoval.cpp


示例17: GetActiveProject

int AudacityApp::OnAllKeys(wxKeyEvent& event)
{
   AudacityProject *audacityPrj = GetActiveProject();

   if (!audacityPrj) {
      return -1;
   }

   if(audacityPrj->IsActive())
   {
      if (event.GetEventType() == wxEVT_KEY_DOWN) {
         if (audacityPrj->HandleKeyDown(event))
            return true;
      }
      if (event.GetEventType() == wxEVT_KEY_UP) {
         if (audacityPrj->HandleKeyUp(event))
            return true;
      }
   }

   return -1;
}
开发者ID:Kirushanr,项目名称:audacity,代码行数:22,代码来源:AudacityApp.cpp


示例18:

const char * vsnet_addin::get_project_path()
{
	EnvDTE::ProjectPtr pProj;
	if (GetActiveProject(pProj) == S_FALSE || pProj == NULL)
	{
		return "";
	}
	EnvDTE::DocumentPtr pDoc;
	EnvDTE::TextDocumentPtr doc;
	EnvDTE::TextSelectionPtr p;
	CComBSTR name;
	pProj->get_FullName(&name);
	static CString s_path;
	s_path = name;
	int pos = s_path.ReverseFind(_T('\\'));
	if (pos)
	{
		s_path = s_path.Left(pos);
		return (char*)(const char*)s_path;
	}
	return "";
}
开发者ID:ohosrry,项目名称:visualfc,代码行数:22,代码来源:vsnet_addin.cpp


示例19: GetActiveProject

void TranscriptionToolBar::GetSamples(
   const WaveTrack *t, sampleCount *s0, sampleCount *slen)
{
   // GetSamples attempts to translate the start and end selection markers into sample indices
   // These selection numbers are doubles.

   AudacityProject *p = GetActiveProject();
   if (!p) {
      return;
   }

   //First, get the current selection. It is part of the mViewInfo, which is
   //part of the project

   const auto &selectedRegion = p->GetViewInfo().selectedRegion;
   double start = selectedRegion.t0();
   double end = selectedRegion.t1();

   auto ss0 = sampleCount( (start - t->GetOffset()) * t->GetRate() );
   auto ss1 = sampleCount( (end - t->GetOffset()) * t->GetRate() );

   if (start < t->GetOffset()) {
      ss0 = 0;
   }

#if 0
   //This adjusts the right samplecount to the maximum sample.
   if (ss1 >= t->GetNumSamples()) {
      ss1 = t->GetNumSamples();
   }
#endif

   if (ss1 < ss0) {
      ss1 = ss0;
   }

   *s0 = ss0;
   *slen = ss1 - ss0;
}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:39,代码来源:TranscriptionToolBar.cpp


示例20: GetActiveProject

void NyqBench::OnGo(wxCommandEvent & e)
{
    mEffect->SetCommand(mScript->GetValue());

    AudacityProject *p = GetActiveProject();
    wxASSERT(p != NULL);

    if (p) {
        wxWindowDisabler disable(this);
        NyqRedirector redir((NyqTextCtrl *)mOutput);

        mRunning = true;
        UpdateWindowUI();

        p->OnEffect(ALL_EFFECTS, mEffect->GetID());

        mRunning = false;
        UpdateWindowUI();
    }

    Raise();
}
开发者ID:dot-Sean,项目名称:audio,代码行数:22,代码来源:NyqBench.cpp



注:本文中的GetActiveProject函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetActiveView函数代码示例发布时间:2022-05-30
下一篇:
C++ GetActiveChild函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap