这篇教程C++ GetActiveProject函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetActiveProject函数的典型用法代码示例。如果您正苦于以下问题:C++ GetActiveProject函数的具体用法?C++ GetActiveProject怎么用?C++ GetActiveProject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetActiveProject函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ReinitSnapResults 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,
示例2: WXUNUSEDvoid 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,
示例3: itervoid 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,
示例4: wxStringvoid 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,
示例5: GetActiveProjectvoid 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,
示例6: rm_dash_rf_enumerate_promptstatic 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,
示例7: WXUNUSEDvoid 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,
示例8: GetActiveProjectvoid 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,
示例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,
示例10: WXUNUSEDvoid 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,
示例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,
示例12: WXUNUSEDvoid 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,
示例13: InitFreqWindowvoid 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,
示例14: GetActiveProjectvoid 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,
示例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,
示例16: GetActiveProjectvoid 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,
示例17: GetActiveProjectint 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,
示例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,
示例19: GetActiveProjectvoid 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,
示例20: GetActiveProjectvoid 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,
示例21: GetActiveProjectvoid Lyrics::Update(double t){ if (t < 0.0) { // TrackPanel::OnTimer passes gAudioIO->GetStreamTime(), which is -1000000000 if !IsStreamActive(). // In that case, use the selection start time. AudacityProject* pProj = GetActiveProject(); mT = pProj->GetSel0(); } else mT = t; if (mLyricsStyle == kBouncingBallLyrics) { wxRect karaokeRect(0, 0, mWidth, mKaraokeHeight); this->Refresh(false, &karaokeRect); } int i = FindSyllable(mT); if (i == mCurrentSyllable) return; mCurrentSyllable = i; if (mLyricsStyle == kHighlightLyrics) { mHighlightTextCtrl->SetSelection(mSyllables[i].char0, mSyllables[i].char1); //v No trail for now. //// Leave a trail behind the selection, by highlighting. //if (i == I_FIRST_REAL_SYLLABLE) // // Reset the trail to zero. // mHighlightTextCtrl->SetStyle(0, mHighlightTextCtrl->GetLastPosition(), wxTextAttr(wxNullColour, *wxWHITE)); //// Mark the trail for mSyllables[i]. //mHighlightTextCtrl->SetStyle(mSyllables[i].char0, mSyllables[i].char1, wxTextAttr(wxNullColour, *wxLIGHT_GREY)); //v Too much flicker: mHighlightTextCtrl->ShowPosition(mSyllables[i].char0); }}
开发者ID:ShockingIce,项目名称:audacity,代码行数:39,
示例22: PlatformMP3Exportervoid FileFormatPrefs::SetMP3VersionText(){ wxString versionString; bool doMP3 = true; //Create dummy exporter to extract info from. MP3Exporter * tmpExporter = new PlatformMP3Exporter(GetActiveProject(),0.0,0.0,true,44100,2,0,0); doMP3 = tmpExporter->LoadLibrary(); if (doMP3) doMP3 = tmpExporter->ValidLibraryLoaded(); if(doMP3) versionString = tmpExporter->GetLibraryVersion(); else versionString = _("MP3 exporting plugin not found"); delete tmpExporter; mMP3Version->SetLabel(versionString);}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:22,
示例23: itervoid LabelDialog::OnSelectCell(wxGridEvent &event){ TrackListIterator iter(mTracks); Track *t = iter.First(); RowData *rd; rd = mData[event.GetRow()]; t = iter.First(); while( t ) { t->SetSelected( true ); t = iter.Next(); } mViewInfo->sel0 = rd->stime; mViewInfo->sel1 = rd->etime; GetActiveProject()->RedrawProject(); event.Skip();}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:22,
示例24: ModuleDispatch// This is the function that connects us to Audacity.MOD_TRACK_PANEL_DLL_API int ModuleDispatch(ModuleDispatchTypes type){ switch (type) { case AppInitialized: Registrar::Start(); // Demand that all track panels be created using the TrackPanel2Factory. TrackPanel::FactoryFunction = TrackPanel2Factory; break; case AppQuiting: Registrar::Finish(); break; case ProjectInitialized: case MenusRebuilt: { AudacityProject *p = GetActiveProject(); if( p== NULL ) return 0; wxMenuBar * pBar = p->GetMenuBar(); wxMenu * pMenu = pBar->GetMenu( 7 ); // Menu 7 is the Analyze Menu. CommandManager * c = p->GetCommandManager(); c->SetToMenu( pMenu ); c->AddSeparator(); // We add two new commands into the Analyze menu. c->AddItem( _T("Extra Dialog..."), _T("Experimental Extra Dialog for whatever you want."), ModTrackPanelFN( OnFuncShowAudioExplorer ) ); //Second menu tweak no longer needed as we always make TrackPanel2's. //c->AddItem( _T("Replace TrackPanel..."), _T("Replace Current TrackPanel with TrackPanel2"), // ModTrackPanelFN( OnFuncReplaceTrackPanel ) ); } break; default: break; } return 1;}
开发者ID:luki122,项目名称:audacity,代码行数:40,
示例25: SetStopvoid ControlToolBar::StopPlaying(bool stopStream /* = true*/){ mStop->PushDown(); SetStop(false); if(stopStream) gAudioIO->StopStream(); SetPlay(false); SetRecord(false); #ifdef AUTOMATED_INPUT_LEVEL_ADJUSTMENT gAudioIO->AILADisable(); #endif mPause->PopUp(); mPaused=false; //Make sure you tell gAudioIO to unpause gAudioIO->SetPaused(mPaused); ClearCutPreviewTracks(); mBusyProject = NULL; // So that we continue monitoring after playing or recording. // also clean the MeterQueues AudacityProject *project = GetActiveProject(); if( project ) { project->MayStartMonitoring(); Meter *meter = project->GetPlaybackMeter(); if( meter ) { meter->Clear(); } meter = project->GetCaptureMeter(); if( meter ) { meter->Clear(); } }}
开发者ID:PhilSee,项目名称:audacity,代码行数:39,
示例26: OnKeyEventvoid ControlToolBar::OnKeyEvent(wxKeyEvent & event){ if (event.ControlDown() || event.AltDown()) { event.Skip(); return; } if (event.GetKeyCode() == WXK_SPACE) { if (gAudioIO->IsStreamActive(GetActiveProject()->GetAudioIOToken())) { SetPlay(false); SetStop(true); StopPlaying(); } else if (!gAudioIO->IsBusy()) { //SetPlay(true);// Not needed as done in PlayPlayRegion SetStop(false); PlayCurrentRegion(); } return; } event.Skip();}
开发者ID:PhilSee,项目名称:audacity,代码行数:22,
示例27: WXUNUSEDvoid ControlToolBar::SetupCutPreviewTracks(double WXUNUSED(playStart), double cutStart, double cutEnd, double WXUNUSED(playEnd)){ ClearCutPreviewTracks(); AudacityProject *p = GetActiveProject(); if (p) { // Find first selected track (stereo or mono) and duplicate it Track *track1 = NULL, *track2 = NULL; TrackListIterator it(p->GetTracks()); for (Track *t = it.First(); t; t = it.Next()) { if (t->GetKind() == Track::Wave && t->GetSelected()) { track1 = t; track2 = t->GetLink(); break; } } if (track1) { // Duplicate and change tracks auto new1 = track1->Duplicate(); new1->Clear(cutStart, cutEnd); decltype(new1) new2{}; if (track2) { new2 = track2->Duplicate(); new2->Clear(cutStart, cutEnd); } mCutPreviewTracks = new TrackList(); mCutPreviewTracks->Add(std::move(new1)); if (track2) mCutPreviewTracks->Add(std::move(new2)); } }}
开发者ID:amullins83,项目名称:audacity,代码行数:38,
示例28: HandleCommandEntry/// HandleTextualCommand() allows us a limitted version of script/batch/// behavior, since we can get from a string command name to the actual/// code to run.bool CommandManager::HandleTextualCommand(wxString & Str, wxUint32 flags, wxUint32 mask){ unsigned int i; // Linear search for now... for (i = 0; i < mCommandList.GetCount(); i++) { if (!mCommandList[i]->multi) { if( Str.IsSameAs( mCommandList[i]->name )) { return HandleCommandEntry( mCommandList[i], flags, mask); } } } // Not one of the singleton commands. // We could/should try all the list-style commands. // instead we only try the effects. AudacityProject * proj = GetActiveProject(); if( !proj ) { return false; } PluginManager & pm = PluginManager::Get(); EffectManager & em = EffectManager::Get(); const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect); while (plug) { if (em.GetEffectName(plug->GetID()).IsSameAs(Str)) { return proj->OnEffect( ALL_EFFECTS | CONFIGURED_EFFECT, plug->GetID()); } plug = pm.GetNextPlugin(PluginTypeEffect); } return false;}
开发者ID:dot-Sean,项目名称:audio,代码行数:41,
注:本文中的GetActiveProject函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetActiveView函数代码示例 C++ GetActiveChild函数代码示例 |