Audacity  3.0.3
EffectUI.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  EffectUI.cpp
6 
7  Leland Lucius
8 
9  Audacity(R) is copyright (c) 1999-2008 Audacity Team.
10  License: GPL v2. See License.txt.
11 
12 **********************************************************************/
13 
14 
15 #include "EffectUI.h"
16 
17 #include "Effect.h"
18 #include "EffectManager.h"
19 #include "../ProjectHistory.h"
20 #include "../ProjectWindowBase.h"
21 #include "../TrackPanelAx.h"
22 #include "RealtimeEffectManager.h"
23 
24 #if defined(EXPERIMENTAL_EFFECTS_RACK)
25 
26 #include "../UndoManager.h"
27 
28 #include <wx/dcmemory.h>
29 #include <wx/defs.h>
30 #include <wx/bmpbuttn.h>
31 #include <wx/button.h>
32 #include <wx/frame.h>
33 #include <wx/image.h>
34 #include <wx/imaglist.h>
35 #include <wx/settings.h>
36 #include <wx/sizer.h>
37 #include <wx/statline.h>
38 #include <wx/stattext.h>
39 #include <wx/timer.h>
40 #include <wx/tglbtn.h>
41 
42 #include "../commands/CommandContext.h"
43 #include "../Prefs.h"
44 #include "../Project.h"
45 #include "../widgets/wxPanelWrapper.h"
46 
47 #include "../../images/EffectRack/EffectRack.h"
48 
49 #define COL_POWER 0
50 #define COL_EDITOR 1
51 #define COL_UP 2
52 #define COL_DOWN 3
53 #define COL_FAV 4
54 #define COL_REMOVE 5
55 #define COL_NAME 6
56 #define NUMCOLS 7
57 
58 #define ID_BASE 20000
59 #define ID_RANGE 100
60 #define ID_POWER (ID_BASE + (COL_POWER * ID_RANGE))
61 #define ID_EDITOR (ID_BASE + (COL_EDITOR * ID_RANGE))
62 #define ID_UP (ID_BASE + (COL_UP * ID_RANGE))
63 #define ID_DOWN (ID_BASE + (COL_DOWN * ID_RANGE))
64 #define ID_FAV (ID_BASE + (COL_FAV * ID_RANGE))
65 #define ID_REMOVE (ID_BASE + (COL_REMOVE * ID_RANGE))
66 #define ID_NAME (ID_BASE + (COL_NAME * ID_RANGE))
67 
68 BEGIN_EVENT_TABLE(EffectRack, wxFrame)
69  EVT_CLOSE(EffectRack::OnClose)
70  EVT_TIMER(wxID_ANY, EffectRack::OnTimer)
71 
72  EVT_BUTTON(wxID_APPLY, EffectRack::OnApply)
73  EVT_TOGGLEBUTTON(wxID_CLEAR, EffectRack::OnBypass)
74 
75  EVT_COMMAND_RANGE(ID_REMOVE, ID_REMOVE + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnRemove)
76  EVT_COMMAND_RANGE(ID_POWER, ID_POWER + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnPower)
77  EVT_COMMAND_RANGE(ID_EDITOR, ID_EDITOR + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnEditor)
78  EVT_COMMAND_RANGE(ID_UP, ID_UP + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnUp)
79  EVT_COMMAND_RANGE(ID_DOWN, ID_DOWN + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnDown)
80  EVT_COMMAND_RANGE(ID_FAV, ID_FAV + 99, wxEVT_COMMAND_BUTTON_CLICKED, EffectRack::OnFav)
82 
83 EffectRack::EffectRack( AudacityProject &project )
84 : wxFrame( &GetProjectFrame( project ),
85  wxID_ANY,
86  _("Effects Rack"),
87  wxDefaultPosition,
88  wxDefaultSize,
89  wxSYSTEM_MENU |
90  wxCLOSE_BOX |
91  wxCAPTION |
92  wxFRAME_NO_TASKBAR |
93  wxFRAME_FLOAT_ON_PARENT)
94 , mProject{ project }
95 {
96  mBypassing = false;
97  mNumEffects = 0;
98  mLastLatency = 0;
99  mTimer.SetOwner(this);
100 
101  mPowerPushed = CreateBitmap(power_on_16x16_xpm, false, false);
102  mPowerRaised = CreateBitmap(power_off_16x16_xpm, true, false);
103  mSettingsPushed = CreateBitmap(settings_up_16x16_xpm, false, true);
104  mSettingsRaised = CreateBitmap(settings_down_16x16_xpm, true, true);
105  mUpDisabled = CreateBitmap(up_9x16_xpm, true, true);
106  mUpPushed = CreateBitmap(up_9x16_xpm, false, true);
107  mUpRaised = CreateBitmap(up_9x16_xpm, true, true);
108  mDownDisabled = CreateBitmap(down_9x16_xpm, true, true);
109  mDownPushed = CreateBitmap(down_9x16_xpm, false, true);
110  mDownRaised = CreateBitmap(down_9x16_xpm, true, true);
111  mFavPushed = CreateBitmap(fav_down_16x16_xpm, false, false);
112  mFavRaised = CreateBitmap(fav_up_16x16_xpm, true, false);
113  mRemovePushed = CreateBitmap(remove_16x16_xpm, false, true);
114  mRemoveRaised = CreateBitmap(remove_16x16_xpm, true, true);
115 
116  {
117  auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL);
118  mPanel = safenew wxPanelWrapper(this, wxID_ANY);
119  bs->Add(mPanel, 1, wxEXPAND);
120  SetSizer(bs.release());
121  }
122 
123  {
124  auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL);
125  {
126  auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
127  wxASSERT(mPanel); // To justify safenew
128  hs->Add(safenew wxButton(mPanel, wxID_APPLY, _("&Apply")), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
129  hs->AddStretchSpacer();
130  mLatency = safenew wxStaticText(mPanel, wxID_ANY, _("Latency: 0"));
131  hs->Add(mLatency, 0, wxALIGN_CENTER);
132  hs->AddStretchSpacer();
133  hs->Add(safenew wxToggleButton(mPanel, wxID_CLEAR, _("&Bypass")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
134  bs->Add(hs.release(), 0, wxEXPAND);
135  }
136  bs->Add(safenew wxStaticLine(mPanel, wxID_ANY), 0, wxEXPAND);
137 
138  {
139  auto uMainSizer = std::make_unique<wxFlexGridSizer>(7);
140  uMainSizer->AddGrowableCol(6);
141  uMainSizer->SetHGap(0);
142  uMainSizer->SetVGap(0);
143  bs->Add((mMainSizer = uMainSizer.release()), 1, wxEXPAND);
144  }
145 
146  mPanel->SetSizer(bs.release());
147  }
148 
149  wxString oldPath = gPrefs->GetPath();
150  gPrefs->SetPath(wxT("/EffectsRack"));
151  size_t cnt = gPrefs->GetNumberOfEntries();
152  gPrefs->SetPath(oldPath);
153 
155  for (size_t i = 0; i < cnt; i++)
156  {
157  wxString slot;
158  gPrefs->Read(wxString::Format(wxT("/EffectsRack/Slot%02d"), i), &slot);
159 
160  Effect *effect = em.GetEffect(slot.AfterFirst(wxT(',')));
161  if (effect)
162  {
163  Add(effect, slot.BeforeFirst(wxT(',')) == wxT("1"), true);
164  }
165  }
166 
167  Fit();
168 }
169 
170 EffectRack::~EffectRack()
171 {
172  gPrefs->DeleteGroup(wxT("/EffectsRack"));
173 
174  for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
175  {
176  if (mFavState[i])
177  {
178  Effect *effect = mEffects[i];
179  gPrefs->Write(wxString::Format(wxT("/EffectsRack/Slot%02d"), i),
180  wxString::Format(wxT("%d,%s"),
181  mPowerState[i],
182  effect->GetID()));
183  }
184  }
185 }
186 
187 void EffectRack::Add(Effect *effect, bool active, bool favorite)
188 {
189  if (mEffects.end() != std::find(mEffects.begin(), mEffects.end(), effect))
190  {
191  return;
192  }
193 
194  wxBitmapButton *bb;
195 
196  wxASSERT(mPanel); // To justify safenew
197  bb = safenew wxBitmapButton(mPanel, ID_POWER + mNumEffects, mPowerRaised);
198  bb->SetBitmapSelected(mPowerRaised);
199  bb->SetName(_("Active State"));
200  bb->SetToolTip(_("Set effect active state"));
201  mPowerState.push_back(active);
202  if (active)
203  {
204  bb->SetBitmapLabel(mPowerPushed);
205  bb->SetBitmapSelected(mPowerPushed);
206  }
207  else
208  {
209  bb->SetBitmapLabel(mPowerRaised);
210  bb->SetBitmapSelected(mPowerRaised);
211  }
212  mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
213 
214  bb = safenew wxBitmapButton(mPanel, ID_EDITOR + mNumEffects, mSettingsRaised);
215  bb->SetBitmapSelected(mSettingsPushed);
216  bb->SetName(_("Show/Hide Editor"));
217  bb->SetToolTip(_("Open/close effect editor"));
218  mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
219 
220  bb = safenew wxBitmapButton(mPanel, ID_UP + mNumEffects, mUpRaised);
221  bb->SetBitmapSelected(mUpPushed);
222  bb->SetBitmapDisabled(mUpDisabled);
223  bb->SetName(_("Move Up"));
224  bb->SetToolTip(_("Move effect up in the rack"));
225  mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
226 
227  bb = safenew wxBitmapButton(mPanel, ID_DOWN + mNumEffects, mDownRaised);
228  bb->SetBitmapSelected(mDownPushed);
229  bb->SetBitmapDisabled(mDownDisabled);
230  bb->SetName(_("Move Down"));
231  bb->SetToolTip(_("Move effect down in the rack"));
232  mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
233 
234  bb = safenew wxBitmapButton(mPanel, ID_FAV + mNumEffects, mFavRaised);
235  bb->SetBitmapSelected(mFavPushed);
236  bb->SetName(_("Favorite"));
237  bb->SetToolTip(_("Mark effect as a favorite"));
238  mFavState.push_back(favorite);
239  if (favorite)
240  {
241  bb->SetBitmapLabel(mFavPushed);
242  bb->SetBitmapSelected(mFavPushed);
243  }
244  else
245  {
246  bb->SetBitmapLabel(mFavRaised);
247  bb->SetBitmapSelected(mFavRaised);
248  }
249  mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
250 
251  bb = safenew wxBitmapButton(mPanel, ID_REMOVE + mNumEffects, mRemoveRaised);
252  bb->SetBitmapSelected(mRemovePushed);
253  bb->SetName(_("Remove"));
254  bb->SetToolTip(_("Remove effect from the rack"));
255  mMainSizer->Add(bb, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
256 
257  wxStaticText *text = safenew wxStaticText(mPanel, ID_NAME + mNumEffects,
258  effect->GetName().Translation() );
259  text->SetToolTip(_("Name of the effect"));
260  mMainSizer->Add(text, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5);
261 
262  mMainSizer->Layout();
263  SetSize(GetMinSize());
264  Fit();
265  Update();
266 
267  mEffects.push_back(effect);
268  mNumEffects++;
269 
270  if (!mTimer.IsRunning())
271  {
272  mTimer.Start(1000);
273  }
274 
275  if (active)
276  {
277  UpdateActive();
278  }
279 }
280 
281 void EffectRack::OnClose(wxCloseEvent & evt)
282 {
283  Show(false);
284  evt.Veto();
285 }
286 
287 void EffectRack::OnTimer(wxTimerEvent & WXUNUSED(evt))
288 {
290  if (latency != mLastLatency)
291  {
292  mLatency->SetLabel(wxString::Format(_("Latency: %4d"), latency));
293  mLatency->Refresh();
294  mLastLatency = latency;
295  }
296 }
297 
298 void EffectRack::OnApply(wxCommandEvent & WXUNUSED(evt))
299 {
300  AudacityProject *project = &mProject;
301 
302  bool success = false;
303  auto state = UndoManager::Get( *project ).GetCurrentState();
304  auto cleanup = finally( [&] {
305  if(!success)
306  // This is like a rollback of state
307  ProjectHistory::Get( *project ).SetStateTo( state, false );
308  } );
309 
310  for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
311  {
312  if (mPowerState[i])
313  {
314  if (!EffectUI::DoEffect(mEffects[i]->GetID(),
315  *project,
317  // If any effect fails (or throws), then stop.
318  return;
319  }
320  }
321 
322  success = true;
323 
324  // Only after all succeed, do the following.
325  for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
326  {
327  if (mPowerState[i])
328  {
329  mPowerState[i] = false;
330 
331  wxBitmapButton *btn =
332  static_cast<wxBitmapButton *>(FindWindowById(ID_POWER + i));
333  btn->SetBitmapLabel(mPowerRaised);
334  btn->SetBitmapSelected(mPowerRaised);
335  }
336  }
337 
338  UpdateActive();
339 }
340 
341 void EffectRack::OnBypass(wxCommandEvent & evt)
342 {
343  mBypassing = evt.GetInt() != 0;
344  UpdateActive();
345 }
346 
347 void EffectRack::OnPower(wxCommandEvent & evt)
348 {
349  wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
350 
351  int index = GetEffectIndex(btn);
352  mPowerState[index] = !mPowerState[index];
353  if (mPowerState[index])
354  {
355  btn->SetBitmapLabel(mPowerPushed);
356  btn->SetBitmapSelected(mPowerPushed);
357  }
358  else
359  {
360  btn->SetBitmapLabel(mPowerRaised);
361  btn->SetBitmapSelected(mPowerRaised);
362  }
363 
364  UpdateActive();
365 }
366 
367 void EffectRack::OnEditor(wxCommandEvent & evt)
368 {
369  wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
370 
371  evt.Skip();
372 
373  int index = GetEffectIndex(btn);
374  if (index < 0)
375  {
376  return;
377  }
378 
379  auto pEffect = mEffects[index];
380  pEffect->ShowInterface( *GetParent(), EffectUI::DialogFactory,
381  pEffect->IsBatchProcessing() );
382 }
383 
384 void EffectRack::OnUp(wxCommandEvent & evt)
385 {
386  wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
387 
388  evt.Skip();
389 
390  int index = GetEffectIndex(btn);
391  if (index <= 0)
392  {
393  return;
394  }
395 
396  MoveRowUp(index);
397 }
398 
399 void EffectRack::OnDown(wxCommandEvent & evt)
400 {
401  wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
402 
403  evt.Skip();
404 
405  int index = GetEffectIndex(btn);
406  if (index < 0 || index == (mMainSizer->GetChildren().GetCount() / NUMCOLS) - 1)
407  {
408  return;
409  }
410 
411  MoveRowUp(index + 1);
412 }
413 
414 void EffectRack::OnFav(wxCommandEvent & evt)
415 {
416  wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
417 
418  int index = GetEffectIndex(btn);
419  mFavState[index] = !mFavState[index];
420  if (mFavState[index])
421  {
422  btn->SetBitmapLabel(mFavPushed);
423  btn->SetBitmapSelected(mFavPushed);
424  }
425  else
426  {
427  btn->SetBitmapLabel(mFavRaised);
428  btn->SetBitmapSelected(mFavRaised);
429  }
430 }
431 
432 void EffectRack::OnRemove(wxCommandEvent & evt)
433 {
434  wxBitmapButton *btn = static_cast<wxBitmapButton *>(evt.GetEventObject());
435 
436  evt.Skip();
437 
438  int index = GetEffectIndex(btn);
439  if (index < 0)
440  {
441  return;
442  }
443 
444  mEffects.erase(mEffects.begin() + index);
445  mPowerState.erase(mPowerState.begin() + index);
446  mFavState.erase(mFavState.begin() + index);
447 
448  if (mEffects.size() == 0)
449  {
450  if (mTimer.IsRunning())
451  {
452  mTimer.Stop();
453  }
454  }
455 
456  index *= NUMCOLS;
457 
458  for (int i = 0; i < NUMCOLS; i++)
459  {
460  std::unique_ptr<wxWindow> w {mMainSizer->GetItem(index)->GetWindow()};
461  mMainSizer->Detach(index);
462  }
463 
464  mMainSizer->Layout();
465  Fit();
466 
467  UpdateActive();
468 }
469 
470 wxBitmap EffectRack::CreateBitmap(const char *const xpm[], bool up, bool pusher)
471 {
472  wxMemoryDC dc;
473  wxBitmap pic(xpm);
474 
475  wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6);
476  dc.SelectObject(mod);
477 #if defined( __WXGTK__ )
478  wxColour newColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
479 #else
480  wxColour newColour = wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE );
481 #endif
482  dc.SetBackground(wxBrush(newColour));
483  dc.Clear();
484 
485  int offset = 3;
486  if (pusher)
487  {
488  if (!up)
489  {
490  offset += 1;
491  }
492  }
493  dc.DrawBitmap(pic, offset, offset, true);
494 
495  dc.SelectObject(wxNullBitmap);
496 
497  return mod;
498 }
499 
500 int EffectRack::GetEffectIndex(wxWindow *win)
501 {
502  int col = (win->GetId() - ID_BASE) / ID_RANGE;
503  int row;
504  int cnt = mMainSizer->GetChildren().GetCount() / NUMCOLS;
505  for (row = 0; row < cnt; row++)
506  {
507  wxSizerItem *si = mMainSizer->GetItem((row * NUMCOLS) + col);
508  if (si->GetWindow() == win)
509  {
510  break;
511  }
512  }
513 
514  if (row == cnt)
515  {
516  return -1;
517  }
518 
519  return row;
520 }
521 
522 void EffectRack::MoveRowUp(int row)
523 {
524  Effect *effect = mEffects[row];
525  mEffects.erase(mEffects.begin() + row);
526  mEffects.insert(mEffects.begin() + row - 1, effect);
527 
528  int state = mPowerState[row];
529  mPowerState.erase(mPowerState.begin() + row);
530  mPowerState.insert(mPowerState.begin() + row - 1, state);
531 
532  state = mFavState[row];
533  mFavState.erase(mFavState.begin() + row);
534  mFavState.insert(mFavState.begin() + row - 1, state);
535 
536  row *= NUMCOLS;
537 
538  for (int i = 0; i < NUMCOLS; i++)
539  {
540  wxSizerItem *si = mMainSizer->GetItem(row + NUMCOLS - 1);
541  wxWindow *w = si->GetWindow();
542  int flags = si->GetFlag();
543  int border = si->GetBorder();
544  int prop = si->GetProportion();
545  mMainSizer->Detach(row + NUMCOLS - 1);
546  mMainSizer->Insert(row - NUMCOLS, w, prop, flags, border);
547  }
548 
549  mMainSizer->Layout();
550  Refresh();
551 
552  UpdateActive();
553 }
554 
555 void EffectRack::UpdateActive()
556 {
557  mActive.clear();
558 
559  if (!mBypassing)
560  {
561  for (size_t i = 0, cnt = mEffects.size(); i < cnt; i++)
562  {
563  if (mPowerState[i])
564  {
565  mActive.push_back(mEffects[i]);
566  }
567  }
568  }
569 
571  { mActive.begin(), mActive.end() }
572  );
573 }
574 
575 namespace
576 {
578  []( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
579  auto result = safenew EffectRack( parent );
580  result->CenterOnParent();
581  return result;
582  }
583 };
584 }
585 
586 EffectRack &EffectRack::Get( AudacityProject &project )
587 {
588  return project.AttachedWindows::Get< EffectRack >( sKey );
589 }
590 
591 #endif
592 
594 //
595 // EffectPanel
596 //
598 
599 class EffectPanel final : public wxPanelWrapper
600 {
601 public:
602  EffectPanel(wxWindow *parent)
603  : wxPanelWrapper(parent)
604  {
605  // This fools NVDA into not saying "Panel" when the dialog gets focus
608 
609  mAcceptsFocus = true;
610  }
611 
612  virtual ~EffectPanel()
613  {
614  }
615 
616  // ============================================================================
617  // wxWindow implementation
618  // ============================================================================
619 
620  bool AcceptsFocus() const override
621  {
622  return mAcceptsFocus;
623  }
624 
625  // So that wxPanel is not included in Tab traversal, when required - see wxWidgets bug 15581
626  bool AcceptsFocusFromKeyboard() const override
627  {
628  return mAcceptsFocus;
629  }
630 
631  // ============================================================================
632  // EffectPanel implementation
633  // ============================================================================
634  void SetAccept(bool accept)
635  {
636  mAcceptsFocus = accept;
637  }
638 
639 private:
641 };
642 
644 //
645 // EffectUIHost
646 //
648 
649 #include "../../images/Effect.h"
650 #include "../AudioIO.h"
651 #include "../CommonCommandFlags.h"
652 #include "../Menus.h"
653 #include "../prefs/GUISettings.h" // for RTL_WORKAROUND
654 #include "../Project.h"
655 #include "../ProjectAudioManager.h"
656 #include "../ShuttleGui.h"
657 #include "../ViewInfo.h"
658 #include "../commands/AudacityCommand.h"
659 #include "../commands/CommandContext.h"
660 #include "../widgets/AudacityMessageBox.h"
661 #include "../widgets/HelpSystem.h"
662 
663 #include <wx/app.h>
664 #include <wx/bmpbuttn.h>
665 #include <wx/checkbox.h>
666 #include <wx/dcclient.h>
667 #include <wx/dcmemory.h>
668 #include <wx/menu.h>
669 #include <wx/settings.h>
670 #include <wx/sizer.h>
671 #include <wx/textctrl.h>
672 
673 #if defined(__WXMAC__)
674 #include <Cocoa/Cocoa.h>
675 #endif
676 
677 static const int kDummyID = 20000;
678 static const int kSaveAsID = 20001;
679 static const int kImportID = 20002;
680 static const int kExportID = 20003;
681 static const int kDefaultsID = 20004;
682 static const int kOptionsID = 20005;
683 static const int kUserPresetsDummyID = 20006;
684 static const int kDeletePresetDummyID = 20007;
685 static const int kMenuID = 20100;
686 static const int kEnableID = 20101;
687 static const int kPlayID = 20102;
688 static const int kRewindID = 20103;
689 static const int kFFwdID = 20104;
690 static const int kPlaybackID = 20105;
691 static const int kCaptureID = 20106;
692 static const int kUserPresetsID = 21000;
693 static const int kDeletePresetID = 22000;
694 static const int kFactoryPresetsID = 23000;
695 
696 BEGIN_EVENT_TABLE(EffectUIHost, wxDialogWrapper)
697 EVT_INIT_DIALOG(EffectUIHost::OnInitDialog)
698 EVT_ERASE_BACKGROUND(EffectUIHost::OnErase)
699 EVT_PAINT(EffectUIHost::OnPaint)
700 EVT_CLOSE(EffectUIHost::OnClose)
706 EVT_CHECKBOX(kEnableID, EffectUIHost::OnEnable)
719 
720 EffectUIHost::EffectUIHost(wxWindow *parent,
721  AudacityProject &project,
722  Effect *effect,
723  EffectUIClientInterface *client)
724 : wxDialogWrapper(parent, wxID_ANY, effect->GetName(),
725  wxDefaultPosition, wxDefaultSize,
726  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
727 {
728 #if defined(__WXMAC__)
729  // Make sure the effect window actually floats above the main window
730  [ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
731 #endif
732 
733  SetName( effect->GetName() );
734  SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
735 
736  mParent = parent;
737  mEffect = effect;
738  mCommand = NULL;
739  mClient = client;
740 
741  mProject = &project;
742 
743  mInitialized = false;
744  mSupportsRealtime = false;
745 
746  mDisableTransport = false;
747 
748  mEnabled = true;
749 
750  mPlayPos = 0.0;
751  mClient->SetHostUI(this);
752 }
753 
754 EffectUIHost::EffectUIHost(wxWindow *parent,
755  AudacityProject &project,
756  AudacityCommand *command,
757  EffectUIClientInterface *client)
758 : wxDialogWrapper(parent, wxID_ANY, XO("Some Command") /*command->GetName()*/,
759  wxDefaultPosition, wxDefaultSize,
760  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
761 {
762 #if defined(__WXMAC__)
763  // Make sure the effect window actually floats above the main window
764  [ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
765 #endif
766 
767  //SetName( command->GetName() );
768  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
769 
770  mParent = parent;
771  mEffect = NULL;
772  mCommand = command;
773  mClient = client;
774 
775  mProject = &project;
776 
777  mInitialized = false;
778  mSupportsRealtime = false;
779 
780  mDisableTransport = false;
781 
782  mEnabled = true;
783 
784  mPlayPos = 0.0;
785  mClient->SetHostUI(this);
786 }
787 
788 
789 
790 
792 {
793  CleanupRealtime();
794 
795  if (mClient)
796  {
797  if (mNeedsResume)
798  Resume();
799 
800  mClient->CloseUI();
801  mClient = NULL;
802  }
803 }
804 
805 // ============================================================================
806 // wxWindow implementation
807 // ============================================================================
808 
810 {
811  if( mEffect )
812  return mEffect->TransferDataToWindow();
813  if( mCommand )
814  return mCommand->TransferDataToWindow();
815  return false;
816 }
817 
819 {
820  if( mEffect)
822  if( mCommand)
824  return false;
825 }
826 
827 // ============================================================================
828 // wxDialog implementation
829 // ============================================================================
830 
832 {
833 #if defined(__WXMSW__)
834  // Swap the Close and Apply buttons
835  wxSizer *sz = mApplyBtn->GetContainingSizer();
836  wxASSERT(mApplyBtn->GetParent()); // To justify safenew
837  wxButton *apply = safenew wxButton(mApplyBtn->GetParent(), wxID_APPLY);
838  sz->Replace(mCloseBtn, apply);
839  sz->Replace(mApplyBtn, mCloseBtn);
840  sz->Layout();
841  mApplyBtn->Destroy();
842  mApplyBtn = apply;
843  mApplyBtn->SetDefault();
844  mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK, 0));
845  mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL, 0));
846 #else
847  mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK));
848  mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL));
849 #endif
850 
851  Layout();
852 
853  return wxDialogWrapper::ShowModal();
854 }
855 
856 // ============================================================================
857 // EffectUIHost implementation
858 // ============================================================================
859 
860 wxPanel *EffectUIHost::BuildButtonBar(wxWindow *parent)
861 {
866 
867  int margin = 0;
868 #if defined(__WXMAC__)
869  margin = 3; // I'm sure it's needed because of the order things are created...
870 #endif
871 
872  const auto bar = safenew wxPanelWrapper(parent, wxID_ANY);
873 
874  // This fools NVDA into not saying "Panel" when the dialog gets focus
875  bar->SetName(TranslatableString::Inaudible);
876  bar->SetLabel(TranslatableString::Inaudible);
877 
878  ShuttleGui S{ bar, eIsCreating,
879  false /* horizontal */,
880  { -1, -1 } /* minimum size */
881  };
882  {
883  S.SetBorder( margin );
884 
885  if (!mIsGUI)
886  {
887  mMenuBtn = S.Id( kMenuID )
888  .ToolTip(XO("Manage presets and options"))
889  .AddButton( XXO("&Manage"), wxALIGN_CENTER | wxTOP | wxBOTTOM );
890  }
891  else
892  {
893  mMenuBtn = S.Id( kMenuID )
894  .ToolTip(XO("Manage presets and options"))
895  .Name(XO("&Manage"))
896  .AddBitmapButton( CreateBitmap(effect_menu_xpm, true, true) );
897  mMenuBtn->SetBitmapPressed(CreateBitmap(effect_menu_xpm, false, true));
898  }
899 
900  S.AddSpace( 5, 5 );
901 
902  if (!mIsBatch)
903  {
904  if (!mIsGUI)
905  {
906  if (mSupportsRealtime)
907  {
908  mPlayToggleBtn = S.Id( kPlayID )
909  .ToolTip(XO("Start and stop playback"))
910  .AddButton( XXO("Start &Playback"),
911  wxALIGN_CENTER | wxTOP | wxBOTTOM );
912  }
913  else if (mEffect &&
915  (mEffect->GetType() != EffectTypeTool) )
916  {
917  mPlayToggleBtn = S.Id( kPlayID )
918  .ToolTip(XO("Preview effect"))
919  .AddButton( XXO("&Preview"),
920  wxALIGN_CENTER | wxTOP | wxBOTTOM );
921  }
922  }
923  else
924  {
925  mPlayBM = CreateBitmap(effect_play_xpm, true, false);
926  mPlayDisabledBM = CreateBitmap(effect_play_disabled_xpm, true, true);
927  mStopBM = CreateBitmap(effect_stop_xpm, true, false);
928  mStopDisabledBM = CreateBitmap(effect_stop_disabled_xpm, true, false);
929  mPlayBtn = S.Id( kPlayID ).AddBitmapButton( mPlayBM );
930  mPlayBtn->SetBitmapDisabled(mPlayDisabledBM);
931  mPlayBtn->SetBitmapPressed(CreateBitmap(effect_play_xpm, false, true));
932  if (!mSupportsRealtime)
933  {
934  mPlayBtn->SetToolTip(_("Preview effect"));
935 #if defined(__WXMAC__)
936  mPlayBtn->SetName(_("Preview effect"));
937 #else
938  mPlayBtn->SetLabel(_("&Preview effect"));
939 #endif
940  }
941  }
942 
943  if (mSupportsRealtime)
944  {
945  if (!mIsGUI)
946  {
947  mRewindBtn = S.Id( kRewindID )
948  .ToolTip(XO("Skip backward"))
949  .AddButton( XXO("Skip &Backward"),
950  wxALIGN_CENTER | wxTOP | wxBOTTOM );
951  }
952  else
953  {
954  mRewindBtn = S.Id( kRewindID )
955  .ToolTip(XO("Skip backward"))
956  .Name(XO("Skip &Backward"))
957  .AddBitmapButton( CreateBitmap(
958  effect_rewind_xpm, true, true) );
959  mRewindBtn->SetBitmapDisabled(
960  CreateBitmap(effect_rewind_disabled_xpm, true, false));
961  mRewindBtn->SetBitmapPressed(CreateBitmap(effect_rewind_xpm, false, true));
962  }
963 
964  if (!mIsGUI)
965  {
966  mFFwdBtn = S.Id( kFFwdID )
967  .ToolTip(XO("Skip forward"))
968  .AddButton( XXO("Skip &Forward"),
969  wxALIGN_CENTER | wxTOP | wxBOTTOM );
970  }
971  else
972  {
973  mFFwdBtn = S.Id( kFFwdID )
974  .ToolTip(XO("Skip forward"))
975  .Name(XO("Skip &Forward"))
976  .AddBitmapButton( CreateBitmap(
977  effect_ffwd_xpm, true, true) );
978  mFFwdBtn->SetBitmapDisabled(
979  CreateBitmap(effect_ffwd_disabled_xpm, true, false));
980  mFFwdBtn->SetBitmapPressed(CreateBitmap(effect_ffwd_xpm, false, true));
981  }
982 
983  S.AddSpace( 5, 5 );
984 
985  mEnableCb = S.Id( kEnableID )
986  .Position(wxALIGN_CENTER | wxTOP | wxBOTTOM)
987  .Name(XO("Enable"))
988  .AddCheckBox( XXO("&Enable"), mEnabled );
989  //
990  }
991  }
992  }
993 
994  bar->GetSizer()->SetSizeHints( bar );
995 
996  return bar;
997 }
998 
1000 {
1001  {
1002  auto gAudioIO = AudioIO::Get();
1003  mDisableTransport = !gAudioIO->IsAvailable(mProject);
1004  mPlaying = gAudioIO->IsStreamActive(); // not exactly right, but will suffice
1005  mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0 && !gAudioIO->IsMonitoring();
1006  }
1007 
1008  EffectPanel *w {};
1009  ShuttleGui S{ this, eIsCreating };
1010  {
1011  S.StartHorizontalLay( wxEXPAND );
1012  {
1013  Destroy_ptr<EffectPanel> uw{ safenew EffectPanel( S.GetParent() ) };
1014  RTL_WORKAROUND(uw.get());
1015 
1016  // Try to give the window a sensible default/minimum size
1017  uw->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
1018  mParent->GetSize().GetHeight() / 2));
1019 
1020  ShuttleGui S1{ uw.get(), eIsCreating };
1021  if (!mClient->PopulateUI(S1))
1022  {
1023  return false;
1024  }
1025 
1026  S.Prop( 1 )
1027  .Position(wxEXPAND)
1028  .AddWindow((w = uw.release()));
1029  }
1030  S.EndHorizontalLay();
1031 
1032  S.StartPanel();
1033  {
1034  const auto bar = BuildButtonBar( S.GetParent() );
1035 
1036  long buttons;
1037  if ( mEffect && mEffect->ManualPage().empty() && mEffect->HelpPage().empty()) {
1038  buttons = eApplyButton | eCloseButton;
1039  this->SetAcceleratorTable(wxNullAcceleratorTable);
1040  }
1041  else {
1042  buttons = eApplyButton | eCloseButton | eHelpButton;
1043  wxAcceleratorEntry entries[1];
1044 #if defined(__WXMAC__)
1045  // Is there a standard shortcut on Mac?
1046 #else
1047  entries[0].Set(wxACCEL_NORMAL, (int) WXK_F1, wxID_HELP);
1048 #endif
1049  wxAcceleratorTable accel(1, entries);
1050  this->SetAcceleratorTable(accel);
1051  }
1052 
1053  if (mEffect && mEffect->mUIDebug) {
1054  buttons |= eDebugButton;
1055  }
1056 
1057  S.AddStandardButtons(buttons, bar);
1058  }
1059  S.EndPanel();
1060  }
1061 
1062  Layout();
1063  Fit();
1064  Center();
1065 
1066  mApplyBtn = (wxButton *) FindWindow(wxID_APPLY);
1067  mCloseBtn = (wxButton *) FindWindow(wxID_CANCEL);
1068 
1069  UpdateControls();
1070 
1071  w->SetAccept(!mIsGUI);
1072  (!mIsGUI ? w : FindWindow(wxID_APPLY))->SetFocus();
1073 
1074  LoadUserPresets();
1075 
1077 
1078  SetMinSize(GetSize());
1079  return true;
1080 }
1081 
1082 void EffectUIHost::OnInitDialog(wxInitDialogEvent & evt)
1083 {
1084  // Do default handling
1085  wxDialogWrapper::OnInitDialog(evt);
1086 
1087 #if wxCHECK_VERSION(3, 0, 0)
1088  //#warning "check to see if this still needed in wx3"
1089 #endif
1090 
1091  // Pure hackage coming down the pike...
1092  //
1093  // I have no idea why, but if a wxTextCtrl is the first control in the
1094  // panel, then its contents will not be automatically selected when the
1095  // dialog is displayed.
1096  //
1097  // So, we do the selection manually.
1098  wxTextCtrl *focused = wxDynamicCast(FindFocus(), wxTextCtrl);
1099  if (focused)
1100  {
1101  focused->SelectAll();
1102  }
1103 }
1104 
1105 void EffectUIHost::OnErase(wxEraseEvent & WXUNUSED(evt))
1106 {
1107  // Ignore it
1108 }
1109 
1110 void EffectUIHost::OnPaint(wxPaintEvent & WXUNUSED(evt))
1111 {
1112  wxPaintDC dc(this);
1113 
1114  dc.Clear();
1115 }
1116 
1117 void EffectUIHost::OnClose(wxCloseEvent & WXUNUSED(evt))
1118 {
1119  DoCancel();
1120 
1121  CleanupRealtime();
1122 
1123  Hide();
1124 
1125  if (mNeedsResume)
1126  Resume();
1127  mClient->CloseUI();
1128  mClient = NULL;
1129 
1130  Destroy();
1131 }
1132 
1133 void EffectUIHost::OnApply(wxCommandEvent & evt)
1134 {
1135  auto &project = *mProject;
1136 
1137  // On wxGTK (wx2.8.12), the default action is still executed even if
1138  // the button is disabled. This appears to affect all wxDialogs, not
1139  // just our Effects dialogs. So, this is a only temporary workaround
1140  // for legacy effects that disable the OK button. Hopefully this has
1141  // been corrected in wx3.
1142  if (!FindWindow(wxID_APPLY)->IsEnabled())
1143  {
1144  return;
1145  }
1146 
1147  // Honor the "select all if none" preference...a little hackish, but whatcha gonna do...
1148  if (!mIsBatch &&
1149  mEffect &&
1151  mEffect->GetType() != EffectTypeTool &&
1152  ViewInfo::Get( project ).selectedRegion.isPoint())
1153  {
1154  auto flags = AlwaysEnabledFlag;
1155  bool allowed =
1157  mEffect->GetName(),
1158  flags,
1160  if (!allowed)
1161  return;
1162  }
1163 
1164  if (!mClient->ValidateUI())
1165  {
1166  return;
1167  }
1168 
1169  // This will take care of calling TransferDataFromWindow() for an effect.
1171  {
1172  return;
1173  }
1174  // This will take care of calling TransferDataFromWindow() for a command.
1175  if (mCommand ){
1176  wxString params;
1178  }
1179 
1180  if( mEffect )
1181  mEffect->mUIResultID = evt.GetId();
1182 
1183  if (IsModal())
1184  {
1185  mDismissed = true;
1186 
1187  EndModal(true);
1188 
1189  Close();
1190 
1191  return;
1192  }
1193 
1194  // Progress dialog no longer yields, so this "shouldn't" be necessary (yet to be proven
1195  // for sure), but it is a nice visual cue that something is going on.
1196  mApplyBtn->Disable();
1197  auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
1198 
1199  if( mEffect ) {
1200  CommandContext context( project );
1201  // This is absolute hackage...but easy and I can't think of another way just now.
1202  //
1203  // It should callback to the EffectManager to kick off the processing
1204  EffectUI::DoEffect(mEffect->GetID(), context,
1206  }
1207 
1208  if( mCommand )
1209  // PRL: I don't like the global and would rather pass *mProject!
1210  // But I am preserving old behavior
1211  mCommand->Apply( CommandContext{ project } );
1212 }
1213 
1215 {
1216  if (!mDismissed) {
1217  if( mEffect )
1218  mEffect->mUIResultID = wxID_CANCEL;
1219 
1220  if (IsModal())
1221  EndModal(false);
1222  else
1223  Hide();
1224 
1225  mDismissed = true;
1226  }
1227 }
1228 
1229 void EffectUIHost::OnCancel(wxCommandEvent & WXUNUSED(evt))
1230 {
1231  DoCancel();
1232  Close();
1233 }
1234 
1235 void EffectUIHost::OnHelp(wxCommandEvent & WXUNUSED(event))
1236 {
1238  // Old ShowHelp required when there is no on-line manual.
1239  // Always use default web browser to allow full-featured HTML pages.
1240  HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->HelpPage(), wxEmptyString, true, true);
1241  }
1242  else if( mEffect )
1243  {
1244  // otherwise use the NEW ShowHelp
1245  HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->ManualPage(), true);
1246  }
1247 }
1248 
1249 void EffectUIHost::OnDebug(wxCommandEvent & evt)
1250 {
1251  OnApply(evt);
1252  if( mEffect )
1253  mEffect->mUIResultID = evt.GetId();
1254 }
1255 
1256 void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt))
1257 {
1258  wxMenu menu;
1259  if( !mEffect )
1260  return;
1261 
1262  LoadUserPresets();
1263 
1264  if (mUserPresets.size() == 0)
1265  {
1266  menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false);
1267  }
1268  else
1269  {
1270  auto sub = std::make_unique<wxMenu>();
1271  for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
1272  {
1273  sub->Append(kUserPresetsID + i, mUserPresets[i]);
1274  }
1275  menu.Append(0, _("User Presets"), sub.release());
1276  }
1277 
1278  menu.Append(kSaveAsID, _("Save Preset..."));
1279 
1280  if (mUserPresets.size() == 0)
1281  {
1282  menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false);
1283  }
1284  else
1285  {
1286  auto sub = std::make_unique<wxMenu>();
1287  for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
1288  {
1289  sub->Append(kDeletePresetID + i, mUserPresets[i]);
1290  }
1291  menu.Append(0, _("Delete Preset"), sub.release());
1292  }
1293 
1294  menu.AppendSeparator();
1295 
1296  auto factory = mEffect->GetFactoryPresets();
1297 
1298  {
1299  auto sub = std::make_unique<wxMenu>();
1300  sub->Append(kDefaultsID, _("Defaults"));
1301  if (factory.size() > 0)
1302  {
1303  sub->AppendSeparator();
1304  for (size_t i = 0, cnt = factory.size(); i < cnt; i++)
1305  {
1306  auto label = factory[i];
1307  if (label.empty())
1308  {
1309  label = _("None");
1310  }
1311 
1312  sub->Append(kFactoryPresetsID + i, label);
1313  }
1314  }
1315  menu.Append(0, _("Factory Presets"), sub.release());
1316  }
1317 
1318  menu.AppendSeparator();
1319  menu.Append(kImportID, _("Import..."))->Enable(mClient->CanExportPresets());
1320  menu.Append(kExportID, _("Export..."))->Enable(mClient->CanExportPresets());
1321  menu.AppendSeparator();
1322  menu.Append(kOptionsID, _("Options..."))->Enable(mClient->HasOptions());
1323  menu.AppendSeparator();
1324 
1325  {
1326  auto sub = std::make_unique<wxMenu>();
1327 
1328  sub->Append(kDummyID, wxString::Format(_("Type: %s"),
1329  ::wxGetTranslation( mEffect->GetFamily().Translation() )));
1330  sub->Append(kDummyID, wxString::Format(_("Name: %s"), mEffect->GetName().Translation()));
1331  sub->Append(kDummyID, wxString::Format(_("Version: %s"), mEffect->GetVersion()));
1332  sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), mEffect->GetVendor().Translation()));
1333  sub->Append(kDummyID, wxString::Format(_("Description: %s"), mEffect->GetDescription().Translation()));
1334 
1335  menu.Append(0, _("About"), sub.release());
1336  }
1337 
1338  wxWindow *btn = FindWindow(kMenuID);
1339  wxRect r = btn->GetRect();
1340  btn->PopupMenu(&menu, r.GetLeft(), r.GetBottom());
1341 }
1342 
1344 {
1345  if (!mClient->ValidateUI()) {
1346  // If we're previewing we should still be able to stop playback
1347  // so don't disable transport buttons.
1348  // mEffect->EnableApply(false); // currently this would also disable transport buttons.
1349  // The preferred behaviour is currently undecided, so for now
1350  // just disallow enabling until settings are valid.
1351  mEnabled = false;
1352  mEnableCb->SetValue(mEnabled);
1353  return;
1354  }
1356 }
1357 
1358 void EffectUIHost::OnEnable(wxCommandEvent & WXUNUSED(evt))
1359 {
1360  mEnabled = mEnableCb->GetValue();
1361 
1362  if (mEnabled) {
1363  Resume();
1364  mNeedsResume = false;
1365  }
1366  else
1367  {
1369  mNeedsResume = true;
1370  }
1371 
1372  UpdateControls();
1373 }
1374 
1375 void EffectUIHost::OnPlay(wxCommandEvent & WXUNUSED(evt))
1376 {
1377  if (!mSupportsRealtime)
1378  {
1380  {
1381  return;
1382  }
1383 
1384  mEffect->Preview(false);
1385 
1386  return;
1387  }
1388 
1389  if (mPlaying)
1390  {
1391  auto gAudioIO = AudioIO::Get();
1392  mPlayPos = gAudioIO->GetStreamTime();
1393  auto &projectAudioManager = ProjectAudioManager::Get( *mProject );
1394  projectAudioManager.Stop();
1395  }
1396  else
1397  {
1398  auto &viewInfo = ViewInfo::Get( *mProject );
1399  const auto &selectedRegion = viewInfo.selectedRegion;
1400  const auto &playRegion = viewInfo.playRegion;
1401  if ( playRegion.Locked() )
1402  {
1403  mRegion.setTimes(playRegion.GetStart(), playRegion.GetEnd());
1404  mPlayPos = mRegion.t0();
1405  }
1406  else if (selectedRegion.t0() != mRegion.t0() ||
1407  selectedRegion.t1() != mRegion.t1())
1408  {
1409  mRegion = selectedRegion;
1410  mPlayPos = mRegion.t0();
1411  }
1412 
1413  if (mPlayPos > mRegion.t1())
1414  {
1415  mPlayPos = mRegion.t1();
1416  }
1417 
1418  auto &projectAudioManager = ProjectAudioManager::Get( *mProject );
1419  projectAudioManager.PlayPlayRegion(
1423  }
1424 }
1425 
1426 void EffectUIHost::OnRewind(wxCommandEvent & WXUNUSED(evt))
1427 {
1428  if (mPlaying)
1429  {
1430  auto gAudioIO = AudioIO::Get();
1431  double seek;
1432  gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
1433 
1434  double pos = gAudioIO->GetStreamTime();
1435  if (pos - seek < mRegion.t0())
1436  {
1437  seek = pos - mRegion.t0();
1438  }
1439 
1440  gAudioIO->SeekStream(-seek);
1441  }
1442  else
1443  {
1444  mPlayPos = mRegion.t0();
1445  }
1446 }
1447 
1448 void EffectUIHost::OnFFwd(wxCommandEvent & WXUNUSED(evt))
1449 {
1450  if (mPlaying)
1451  {
1452  double seek;
1453  gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
1454 
1455  auto gAudioIO = AudioIO::Get();
1456  double pos = gAudioIO->GetStreamTime();
1457  if (mRegion.t0() < mRegion.t1() && pos + seek > mRegion.t1())
1458  {
1459  seek = mRegion.t1() - pos;
1460  }
1461 
1462  gAudioIO->SeekStream(seek);
1463  }
1464  else
1465  {
1466  // It allows to play past end of selection...probably useless
1467  mPlayPos = mRegion.t1();
1468  }
1469 }
1470 
1471 void EffectUIHost::OnPlayback(wxCommandEvent & evt)
1472 {
1473  evt.Skip();
1474 
1475  if (evt.GetInt() != 0)
1476  {
1477  if (evt.GetEventObject() != mProject)
1478  {
1479  mDisableTransport = true;
1480  }
1481  else
1482  {
1483  mPlaying = true;
1484  }
1485  }
1486  else
1487  {
1488  mDisableTransport = false;
1489  mPlaying = false;
1490  }
1491 
1492  if (mPlaying)
1493  {
1494  mRegion = ViewInfo::Get( *mProject ).selectedRegion;
1495  mPlayPos = mRegion.t0();
1496  }
1497 
1498  UpdateControls();
1499 }
1500 
1501 void EffectUIHost::OnCapture(wxCommandEvent & evt)
1502 {
1503  evt.Skip();
1504 
1505  if (evt.GetInt() != 0)
1506  {
1507  if (evt.GetEventObject() != mProject)
1508  {
1509  mDisableTransport = true;
1510  }
1511  else
1512  {
1513  mCapturing = true;
1514  }
1515  }
1516  else
1517  {
1518  mDisableTransport = false;
1519  mCapturing = false;
1520  }
1521 
1522  UpdateControls();
1523 }
1524 
1525 void EffectUIHost::OnUserPreset(wxCommandEvent & evt)
1526 {
1527  int preset = evt.GetId() - kUserPresetsID;
1528 
1530 
1531  return;
1532 }
1533 
1534 void EffectUIHost::OnFactoryPreset(wxCommandEvent & evt)
1535 {
1537 
1538  return;
1539 }
1540 
1541 void EffectUIHost::OnDeletePreset(wxCommandEvent & evt)
1542 {
1543  auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
1544 
1545  int res = AudacityMessageBox(
1546  XO("Are you sure you want to delete \"%s\"?").Format( preset ),
1547  XO("Delete Preset"),
1548  wxICON_QUESTION | wxYES_NO);
1549  if (res == wxYES)
1550  {
1552  }
1553 
1554  LoadUserPresets();
1555 
1556  return;
1557 }
1558 
1559 void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt))
1560 {
1561  wxTextCtrl *text;
1562  wxString name;
1563  wxDialogWrapper dlg(this, wxID_ANY, XO("Save Preset"));
1564 
1565  ShuttleGui S(&dlg, eIsCreating);
1566 
1567  S.StartPanel();
1568  {
1569  S.StartVerticalLay(1);
1570  {
1571  S.StartHorizontalLay(wxALIGN_LEFT, 0);
1572  {
1573  text = S.AddTextBox(XXO("Preset name:"), name, 30);
1574  }
1575  S.EndHorizontalLay();
1576  S.SetBorder(10);
1577  S.AddStandardButtons();
1578  }
1579  S.EndVerticalLay();
1580  }
1581  S.EndPanel();
1582 
1583  dlg.SetSize(dlg.GetSizer()->GetMinSize());
1584  dlg.Center();
1585  dlg.Fit();
1586 
1587  while (true)
1588  {
1589  int rc = dlg.ShowModal();
1590 
1591  if (rc != wxID_OK)
1592  {
1593  break;
1594  }
1595 
1596  name = text->GetValue();
1597  if (name.empty())
1598  {
1600  this,
1601  XO("You must specify a name"),
1602  XO("Save Preset") );
1603  md.Center();
1604  md.ShowModal();
1605  continue;
1606  }
1607 
1608  if ( make_iterator_range( mUserPresets ).contains( name ) )
1609  {
1611  this,
1612  XO("Preset already exists.\n\nReplace?"),
1613  XO("Save Preset"),
1614  wxYES_NO | wxCANCEL | wxICON_EXCLAMATION );
1615  md.Center();
1616  int choice = md.ShowModal();
1617  if (choice == wxID_CANCEL)
1618  {
1619  break;
1620  }
1621 
1622  if (choice == wxID_NO)
1623  {
1624  continue;
1625  }
1626  }
1627 
1629  LoadUserPresets();
1630 
1631  break;
1632  }
1633 
1634  return;
1635 }
1636 
1637 void EffectUIHost::OnImport(wxCommandEvent & WXUNUSED(evt))
1638 {
1640 
1641  LoadUserPresets();
1642 
1643  return;
1644 }
1645 
1646 void EffectUIHost::OnExport(wxCommandEvent & WXUNUSED(evt))
1647 {
1648  // may throw
1649  // exceptions are handled in AudacityApp::OnExceptionInMainLoop
1651 
1652  return;
1653 }
1654 
1655 void EffectUIHost::OnOptions(wxCommandEvent & WXUNUSED(evt))
1656 {
1657  mClient->ShowOptions();
1658 
1659  return;
1660 }
1661 
1662 void EffectUIHost::OnDefaults(wxCommandEvent & WXUNUSED(evt))
1663 {
1665 
1666  return;
1667 }
1668 
1669 wxBitmap EffectUIHost::CreateBitmap(const char * const xpm[], bool up, bool pusher)
1670 {
1671  wxMemoryDC dc;
1672  wxBitmap pic(xpm);
1673 
1674  wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6, 24);
1675  dc.SelectObject(mod);
1676 
1677 #if defined(__WXGTK__)
1678  wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND);
1679 #else
1680  wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
1681 #endif
1682 
1683  dc.SetBackground(wxBrush(newColour));
1684  dc.Clear();
1685 
1686  int offset = 3;
1687  if (pusher)
1688  {
1689  if (!up)
1690  {
1691  offset += 1;
1692  }
1693  }
1694 
1695  dc.DrawBitmap(pic, offset, offset, true);
1696 
1697  dc.SelectObject(wxNullBitmap);
1698 
1699  return mod;
1700 }
1701 
1703 {
1704  if (mIsBatch)
1705  {
1706  return;
1707  }
1708 
1710  {
1711  // Don't allow focus to get trapped
1712  wxWindow *focus = FindFocus();
1713  if (focus == mRewindBtn || focus == mFFwdBtn || focus == mPlayBtn || focus == mEnableCb)
1714  {
1715  mCloseBtn->SetFocus();
1716  }
1717  }
1718 
1719  mApplyBtn->Enable(!mCapturing);
1721  {
1723  }
1724 
1725  if (mSupportsRealtime)
1726  {
1727  mRewindBtn->Enable(!(mCapturing || mDisableTransport));
1728  mFFwdBtn->Enable(!(mCapturing || mDisableTransport));
1729  mEnableCb->Enable(!(mCapturing || mDisableTransport));
1730 
1731  wxBitmapButton *bb;
1732 
1733  if (mPlaying)
1734  {
1735  if (!mIsGUI)
1736  {
1737  /* i18n-hint: The access key "&P" should be the same in
1738  "Stop &Playback" and "Start &Playback" */
1739  mPlayToggleBtn->SetLabel(_("Stop &Playback"));
1740  mPlayToggleBtn->Refresh();
1741  }
1742  else
1743  {
1744  bb = (wxBitmapButton *) mPlayBtn;
1745  bb->SetBitmapLabel(mStopBM);
1746  bb->SetBitmapDisabled(mStopDisabledBM);
1747  bb->SetToolTip(_("Stop"));
1748 #if defined(__WXMAC__)
1749  bb->SetName(_("Stop &Playback"));
1750 #else
1751  bb->SetLabel(_("Stop &Playback"));
1752 #endif
1753  }
1754  }
1755  else
1756  {
1757  if (!mIsGUI)
1758  {
1759  /* i18n-hint: The access key "&P" should be the same in
1760  "Stop &Playback" and "Start &Playback" */
1761  mPlayToggleBtn->SetLabel(_("Start &Playback"));
1762  mPlayToggleBtn->Refresh();
1763  }
1764  else
1765  {
1766  bb = (wxBitmapButton *) mPlayBtn;
1767  bb->SetBitmapLabel(mPlayBM);
1768  bb->SetBitmapDisabled(mPlayDisabledBM);
1769  bb->SetToolTip(_("Play"));
1770 #if defined(__WXMAC__)
1771  bb->SetName(_("Start &Playback"));
1772 #else
1773  bb->SetLabel(_("Start &Playback"));
1774 #endif
1775  }
1776  }
1777  }
1778 }
1779 
1781 {
1782  mUserPresets.clear();
1783 
1784  if( mEffect )
1786 
1787  std::sort( mUserPresets.begin(), mUserPresets.end() );
1788 
1789  return;
1790 }
1791 
1793 {
1795  {
1797 
1798  wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
1800  this);
1801 
1802  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
1804  this);
1805 
1806  mInitialized = true;
1807  }
1808 }
1809 
1811 {
1813  {
1815 
1816  mInitialized = false;
1817  }
1818 }
1819 
1820 wxDialog *EffectUI::DialogFactory( wxWindow &parent, EffectHostInterface *pHost,
1821  EffectUIClientInterface *client)
1822 {
1823  auto pEffect = dynamic_cast< Effect* >( pHost );
1824  if ( ! pEffect )
1825  return nullptr;
1826 
1827  // Make sure there is an associated project, whose lifetime will
1828  // govern the lifetime of the dialog, even when the dialog is
1829  // non-modal, as for realtime effects
1830  auto project = FindProjectFromWindow(&parent);
1831  if ( !project )
1832  return nullptr;
1833 
1835  safenew EffectUIHost{ &parent, *project, pEffect, client} };
1836 
1837  if (dlg->Initialize())
1838  {
1839  // release() is safe because parent will own it
1840  return dlg.release();
1841  }
1842 
1843  return nullptr;
1844 };
1845 
1846 #include "../PluginManager.h"
1847 #include "../ProjectSettings.h"
1848 #include "../ProjectWindow.h"
1849 #include "../SelectUtilities.h"
1850 #include "../TrackPanel.h"
1851 #include "../WaveTrack.h"
1852 #include "../commands/CommandManager.h"
1853 
1857 // parameters, whether to save the state to history and whether to allow
1859 
1860 /* static */ bool EffectUI::DoEffect(
1861  const PluginID & ID, const CommandContext &context, unsigned flags )
1862 {
1863  AudacityProject &project = context.project;
1864  const auto &settings = ProjectSettings::Get( project );
1865  auto &tracks = TrackList::Get( project );
1866  auto &trackPanel = TrackPanel::Get( project );
1867  auto &trackFactory = WaveTrackFactory::Get( project );
1868  auto rate = settings.GetRate();
1869  auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
1870  auto &commandManager = CommandManager::Get( project );
1871  auto &window = ProjectWindow::Get( project );
1872 
1873  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
1874  if (!plug)
1875  return false;
1876 
1877  EffectType type = plug->GetEffectType();
1878 
1879  // Make sure there's no activity since the effect is about to be applied
1880  // to the project's tracks. Mainly for Apply during RTP, but also used
1881  // for batch commands
1882  if (flags & EffectManager::kConfigured)
1883  {
1884  ProjectAudioManager::Get( project ).Stop();
1885  //Don't Select All if repeating Generator Effect
1886  if (!(flags & EffectManager::kConfigured)) {
1888  }
1889  }
1890 
1891  auto nTracksOriginally = tracks.size();
1892  wxWindow *focus = wxWindow::FindFocus();
1893  wxWindow *parent = nullptr;
1894  if (focus != nullptr) {
1895  parent = focus->GetParent();
1896  }
1897 
1898  bool success = false;
1899  auto cleanup = finally( [&] {
1900 
1901  if (!success) {
1902  // For now, we're limiting realtime preview to a single effect, so
1903  // make sure the menus reflect that fact that one may have just been
1904  // opened.
1905  MenuManager::Get(project).UpdateMenus( false );
1906  }
1907 
1908  } );
1909 
1910  int count = 0;
1911  bool clean = true;
1912  for (auto t : tracks.Selected< const WaveTrack >()) {
1913  if (t->GetEndTime() != 0.0)
1914  clean = false;
1915  count++;
1916  }
1917 
1919 
1920  em.SetSkipStateFlag( false );
1921  if (auto effect = em.GetEffect(ID)) {
1922 #if defined(EXPERIMENTAL_EFFECTS_RACK)
1923  if (effect->SupportsRealtime())
1924  {
1925  EffectRack::Get( context.project ).Add(effect);
1926  }
1927 #endif
1928  effect->SetUIFlags(flags);
1929  success = effect->DoEffect(
1930  rate,
1931  &tracks,
1932  &trackFactory,
1933  selectedRegion,
1934  &window,
1935  (flags & EffectManager::kConfigured) == 0
1936  ? DialogFactory
1937  : nullptr
1938  );
1939  }
1940  else
1941  success = false;
1942 
1943  if (!success)
1944  return false;
1945 
1946  if (em.GetSkipStateFlag())
1947  flags = flags | EffectManager::kSkipState;
1948 
1949  if (!(flags & EffectManager::kSkipState))
1950  {
1951  auto shortDesc = em.GetCommandName(ID);
1952  auto longDesc = em.GetCommandDescription(ID);
1953  ProjectHistory::Get( project ).PushState(longDesc, shortDesc);
1954  }
1955 
1956  if (!(flags & EffectManager::kDontRepeatLast))
1957  {
1958  // Remember a successful generator, effect, analyzer, or tool Process
1959  auto shortDesc = em.GetCommandName(ID);
1960  /* i18n-hint: %s will be the name of the effect which will be
1961  * repeated if this menu item is chosen */
1962  auto lastEffectDesc = XO("Repeat %s").Format(shortDesc);
1963  auto& menuManager = MenuManager::Get(project);
1964  switch ( type ) {
1965  case EffectTypeGenerate:
1966  commandManager.Modify(wxT("RepeatLastGenerator"), lastEffectDesc);
1967  menuManager.mLastGenerator = ID;
1968  menuManager.mRepeatGeneratorFlags = EffectManager::kConfigured;
1969  break;
1970  case EffectTypeProcess:
1971  commandManager.Modify(wxT("RepeatLastEffect"), lastEffectDesc);
1972  menuManager.mLastEffect = ID;
1973  menuManager.mRepeatEffectFlags = EffectManager::kConfigured;
1974  break;
1975  case EffectTypeAnalyze:
1976  commandManager.Modify(wxT("RepeatLastAnalyzer"), lastEffectDesc);
1977  menuManager.mLastAnalyzer = ID;
1978  menuManager.mLastAnalyzerRegistration = MenuCreator::repeattypeplugin;
1979  menuManager.mRepeatAnalyzerFlags = EffectManager::kConfigured;
1980  break;
1981  case EffectTypeTool:
1982  commandManager.Modify(wxT("RepeatLastTool"), lastEffectDesc);
1983  menuManager.mLastTool = ID;
1984  menuManager.mLastToolRegistration = MenuCreator::repeattypeplugin;
1985  menuManager.mRepeatToolFlags = EffectManager::kConfigured;
1986  if (shortDesc == NYQUIST_PROMPT_NAME) {
1987  menuManager.mRepeatToolFlags = EffectManager::kRepeatNyquistPrompt; //Nyquist Prompt is not configured
1988  }
1989  break;
1990  }
1991  }
1992 
1993  //STM:
1994  //The following automatically re-zooms after sound was generated.
1995  // IMO, it was disorienting, removing to try out without re-fitting
1996  //mchinen:12/14/08 reapplying for generate effects
1997  if (type == EffectTypeGenerate)
1998  {
1999  if (count == 0 || (clean && selectedRegion.t0() == 0.0))
2000  window.DoZoomFit();
2001  // trackPanel->Refresh(false);
2002  }
2003 
2004  // PRL: RedrawProject explicitly because sometimes history push is skipped
2005  window.RedrawProject();
2006 
2007  if (focus != nullptr && focus->GetParent()==parent) {
2008  focus->SetFocus();
2009  }
2010 
2011  // A fix for Bug 63
2012  // New tracks added? Scroll them into view so that user sees them.
2013  // Don't care what track type. An analyser might just have added a
2014  // Label track and we want to see it.
2015  if( tracks.size() > nTracksOriginally ){
2016  // 0.0 is min scroll position, 1.0 is max scroll position.
2017  trackPanel.VerticalScroll( 1.0 );
2018  }
2019  else {
2020  auto pTrack = *tracks.Selected().begin();
2021  if (!pTrack)
2022  pTrack = *tracks.Any().begin();
2023  if (pTrack) {
2024  TrackFocus::Get(project).Set(pTrack);
2025  pTrack->EnsureVisible();
2026  }
2027  }
2028 
2029  return true;
2030 }
2031 
2033 BEGIN_EVENT_TABLE(EffectDialog, wxDialogWrapper)
2034  EVT_BUTTON(wxID_OK, EffectDialog::OnOk)
2036 
2037 EffectDialog::EffectDialog(wxWindow * parent,
2038  const TranslatableString & title,
2039  int type,
2040  int flags,
2041  int additionalButtons)
2042 : wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
2043 {
2044  mType = type;
2045  mAdditionalButtons = additionalButtons;
2046 }
2047 
2049 {
2050  long buttons = eOkButton;
2051  if ((mType != EffectTypeAnalyze) && (mType != EffectTypeTool))
2052  {
2053  buttons |= eCancelButton;
2054  if (mType == EffectTypeProcess)
2055  {
2056  buttons |= ePreviewButton;
2057  }
2058  }
2059 
2060  ShuttleGui S(this, eIsCreating);
2061 
2062  S.SetBorder(5);
2063  S.StartVerticalLay(true);
2064  {
2065  PopulateOrExchange(S);
2067  }
2068  S.EndVerticalLay();
2069 
2070  Layout();
2071  Fit();
2072  SetMinSize(GetSize());
2073  Center();
2074 }
2075 
2080 {
2081  return;
2082 }
2083 
2085 {
2086  ShuttleGui S(this, eIsSettingToDialog);
2087  PopulateOrExchange(S);
2088 
2089  return true;
2090 }
2091 
2093 {
2095  PopulateOrExchange(S);
2096 
2097  return true;
2098 }
2099 
2101 {
2102  return true;
2103 }
2104 
2105 void EffectDialog::OnPreview(wxCommandEvent & WXUNUSED(evt))
2106 {
2107  return;
2108 }
2109 
2110 void EffectDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
2111 {
2112  // On wxGTK (wx2.8.12), the default action is still executed even if
2113  // the button is disabled. This appears to affect all wxDialogs, not
2114  // just our Effects dialogs. So, this is a only temporary workaround
2115  // for legacy effects that disable the OK button. Hopefully this has
2116  // been corrected in wx3.
2117  if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
2118  {
2119  EndModal(true);
2120  }
2121 
2122  return;
2123 }
EffectUIClientInterface
EffectUIClientInterface is an abstract base class to populate a UI and validate UI values....
Definition: EffectInterface.h:271
EffectManager::GetSkipStateFlag
bool GetSkipStateFlag()
Definition: EffectManager.cpp:219
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
EffectUIHost::ShowModal
int ShowModal() override
Definition: EffectUI.cpp:831
FileConfig::SetPath
virtual void SetPath(const wxString &strPath) wxOVERRIDE
Definition: FileConfig.cpp:93
EffectDialog::mAdditionalButtons
int mAdditionalButtons
Definition: EffectUI.h:265
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
EffectUIHost::mStopBM
wxBitmap mStopBM
Definition: EffectUI.h:204
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:156
EffectUIHost::mIsBatch
bool mIsBatch
Definition: EffectUI.h:189
EffectUIHost::mDisableTransport
bool mDisableTransport
Definition: EffectUI.h:209
Effect::DoEffect
bool DoEffect(double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
Definition: Effect.cpp:1208
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
WaveTrackFactory::Get
static WaveTrackFactory & Get(AudacityProject &project)
Definition: WaveTrack.cpp:2799
EffectDialog::OnPreview
virtual void OnPreview(wxCommandEvent &evt)
Definition: EffectUI.cpp:2105
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
EffectUIHost::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:818
kDeletePresetID
static const int kDeletePresetID
Definition: EffectUI.cpp:693
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=XO("Message"), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
RealtimeEffectManager::RealtimeSetEffects
void RealtimeSetEffects(const EffectArray &mActive)
kImportID
static const int kImportID
Definition: EffectUI.cpp:679
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:549
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:50
eIsGettingFromDialog
@ eIsGettingFromDialog
Definition: ShuttleGui.h:39
ComponentInterfaceSymbol::Translation
const wxString Translation() const
Definition: ComponentInterfaceSymbol.h:58
EffectHostInterface
EffectHostInterface is a decorator of a EffectUIClientInterface. It adds virtual (abstract) functions...
Definition: EffectInterface.h:121
Effect::ManualPage
virtual ManualPageID ManualPage()
Definition: Effect.cpp:1171
Effect.h
EffectDialog::Init
void Init()
Definition: EffectUI.cpp:2048
kRewindID
static const int kRewindID
Definition: EffectUI.cpp:688
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
SelectedRegion::t1
double t1() const
Definition: SelectedRegion.h:95
Effect::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: Effect.cpp:1915
eHelpButton
@ eHelpButton
Definition: ShuttleGui.h:604
ePreviewButton
@ ePreviewButton
Definition: ShuttleGui.h:605
EffectUIHost::DoCancel
void DoCancel()
Definition: EffectUI.cpp:1214
Effect::SupportsRealtime
bool SupportsRealtime() override
Definition: Effect.cpp:234
DefaultPlayOptions
AudioIOStartStreamOptions DefaultPlayOptions(AudacityProject &project)
Definition: ProjectAudioManager.cpp:1000
Track::EnsureVisible
void EnsureVisible(bool modifyState=false)
Definition: Track.cpp:101
Effect::GetID
virtual PluginID GetID()
Definition: Effect.cpp:1023
wxPanelWrapper
Definition: wxPanelWrapper.h:41
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:72
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:58
wxPanelWrapper::SetLabel
void SetLabel(const TranslatableString &label)
Definition: wxPanelWrapper.cpp:46
Effect::mUIResultID
int mUIResultID
Definition: Effect.h:479
kPlaybackID
static const int kPlaybackID
Definition: EffectUI.cpp:690
EffectUIClientInterface::ImportPresets
virtual void ImportPresets()=0
EffectUIHost::mEffect
Effect * mEffect
Definition: EffectUI.h:181
EffectUIHost::OnClose
void OnClose(wxCloseEvent &evt)
Definition: EffectUI.cpp:1117
Format
Abstract base class used in importing a file.
kFactoryPresetsID
static const int kFactoryPresetsID
Definition: EffectUI.cpp:694
TranslatableString::Inaudible
static const TranslatableString Inaudible
A special string value that will have no screen reader pronunciation.
Definition: TranslatableString.h:34
EffectUIHost::OnApply
void OnApply(wxCommandEvent &evt)
Definition: EffectUI.cpp:1133
kCaptureID
static const int kCaptureID
Definition: EffectUI.cpp:691
ID_RANGE
@ ID_RANGE
Definition: WaveformPrefs.cpp:78
Effect::LoadUserPreset
bool LoadUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:553
EffectUIHost::OnSaveAs
void OnSaveAs(wxCommandEvent &evt)
Definition: EffectUI.cpp:1559
EffectManager::kConfigured
@ kConfigured
Definition: EffectManager.h:53
EffectManager::kDontRepeatLast
@ kDontRepeatLast
Definition: EffectManager.h:57
EffectUIHost::Initialize
bool Initialize()
Definition: EffectUI.cpp:999
EffectManager::GetCommandName
TranslatableString GetCommandName(const PluginID &ID)
Definition: EffectManager.cpp:101
FileConfig::GetNumberOfEntries
virtual size_t GetNumberOfEntries(bool bRecursive=false) const wxOVERRIDE
Definition: FileConfig.cpp:123
EffectUIHost::OnDebug
void OnDebug(wxCommandEvent &evt)
Definition: EffectUI.cpp:1249
EffectUIHost::mMenuBtn
wxButton * mMenuBtn
Definition: EffectUI.h:193
TrackPanel::Get
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:221
XO
#define XO(s)
Definition: Internat.h:31
EffectUIHost::OnEnable
void OnEnable(wxCommandEvent &evt)
Definition: EffectUI.cpp:1358
EffectUIHost::OnCancel
void OnCancel(wxCommandEvent &evt)
Definition: EffectUI.cpp:1229
ProjectSettings::Get
static ProjectSettings & Get(AudacityProject &project)
Definition: ProjectSettings.cpp:40
SelectedRegion::setTimes
bool setTimes(double t0, double t1)
Definition: SelectedRegion.h:139
kPlayID
static const int kPlayID
Definition: EffectUI.cpp:687
EffectUIHost::EffectUIHost
EffectUIHost(wxWindow *parent, AudacityProject &project, Effect *effect, EffectUIClientInterface *client)
Definition: EffectUI.cpp:720
NYQUISTEFFECTS_FAMILY
#define NYQUISTEFFECTS_FAMILY
Definition: Effect.h:60
EffectUIHost::OnFFwd
void OnFFwd(wxCommandEvent &evt)
Definition: EffectUI.cpp:1448
eDebugButton
@ eDebugButton
Definition: ShuttleGui.h:606
EffectDialog::TransferDataToWindow
bool TransferDataToWindow() override
Definition: EffectUI.cpp:2084
Effect::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: Effect.cpp:1189
kUserPresetsID
static const int kUserPresetsID
Definition: EffectUI.cpp:692
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:533
FindProjectFromWindow
AudacityProject * FindProjectFromWindow(wxWindow *pWindow)
Definition: ProjectWindowBase.cpp:39
AlwaysEnabledFlag
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:35
ID_REMOVE
@ ID_REMOVE
Definition: LabelDialog.cpp:75
EffectManager::Get
static EffectManager & Get()
Definition: EffectManager.cpp:42
Effect::GetUserPresetsGroup
RegistryPath GetUserPresetsGroup(const RegistryPath &name) override
Definition: Effect.cpp:854
EffectUIHost::mInitialized
bool mInitialized
Definition: EffectUI.h:186
EffectUIHost::OnOptions
void OnOptions(wxCommandEvent &evt)
Definition: EffectUI.cpp:1655
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:569
EffectUIHost::Resume
void Resume()
Definition: EffectUI.cpp:1343
ShuttleGuiBase::StartPanel
wxPanel * StartPanel(int iStyle=0)
Definition: ShuttleGui.cpp:990
EffectUIHost::mCommand
AudacityCommand * mCommand
Definition: EffectUI.h:182
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:237
MenuCreator::repeattypeplugin
@ repeattypeplugin
Definition: Menus.h:61
eIsSettingToDialog
@ eIsSettingToDialog
Definition: ShuttleGui.h:40
Effect::GetPrivateConfigSubgroups
bool GetPrivateConfigSubgroups(const RegistryPath &group, RegistryPaths &paths) override
Definition: Effect.cpp:956
ShuttleGuiBase::EndPanel
void EndPanel()
Definition: ShuttleGui.cpp:1018
AudacityMessageDialog
Wrap wxMessageDialog so that caption IS translatable.
Definition: wxPanelWrapper.h:215
ClientData::Site::RegisteredFactory
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
Definition: ClientData.h:266
WaveTracksSelectedFlag
const ReservedCommandFlag & WaveTracksSelectedFlag()
Definition: CommonCommandFlags.cpp:164
Effect::TransferDataFromWindow
virtual bool TransferDataFromWindow()
Definition: Effect.cpp:1920
EffectUIHost::OnPlayback
void OnPlayback(wxCommandEvent &evt)
Definition: EffectUI.cpp:1471
EffectUI::DialogFactory
AUDACITY_DLL_API wxDialog * DialogFactory(wxWindow &parent, EffectHostInterface *pHost, EffectUIClientInterface *client)
Definition: EffectUI.cpp:1820
eApplyButton
@ eApplyButton
Definition: ShuttleGui.h:609
EffectUIHost::mCapturing
bool mCapturing
Definition: EffectUI.h:211
EffectManager::SetSkipStateFlag
void SetSkipStateFlag(bool flag)
Definition: EffectManager.cpp:214
kDummyID
static const int kDummyID
Definition: EffectUI.cpp:677
RealtimeEffectManager::RealtimeResumeOne
void RealtimeResumeOne(EffectClientInterface &effect)
Definition: RealtimeEffectManager.cpp:271
EffectUIHost::mPlayBtn
wxButton * mPlayBtn
Definition: EffectUI.h:194
PlayMode::normalPlay
@ normalPlay
AudacityCommand::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: AudacityCommand.h:69
EffectUIHost::OnImport
void OnImport(wxCommandEvent &evt)
Definition: EffectUI.cpp:1637
kFFwdID
static const int kFFwdID
Definition: EffectUI.cpp:689
kExportID
static const int kExportID
Definition: EffectUI.cpp:680
RealtimeEffectManager::RealtimeSuspendOne
void RealtimeSuspendOne(EffectClientInterface &effect)
Definition: RealtimeEffectManager.cpp:238
kOptionsID
static const int kOptionsID
Definition: EffectUI.cpp:682
EffectUI.h
EffectUIHost::mEnableCb
wxCheckBox * mEnableCb
Definition: EffectUI.h:197
EffectUIHost::mFFwdBtn
wxButton * mFFwdBtn
Definition: EffectUI.h:196
EffectDialog::Validate
bool Validate() override
Definition: EffectUI.cpp:2100
EffectPanel::~EffectPanel
virtual ~EffectPanel()
Definition: EffectUI.cpp:612
eDebugID
@ eDebugID
Definition: ShuttleGui.h:619
EffectUIClientInterface::ShowOptions
virtual void ShowOptions()=0
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:200
XXO
#define XXO(s)
Definition: Internat.h:44
eCancelButton
@ eCancelButton
Definition: ShuttleGui.h:601
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
EffectManager
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:46
MenuManager::UpdateMenus
void UpdateMenus(bool checkActive=true)
Definition: Menus.cpp:634
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:806
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:22
RealtimeEffectManager.h
EffectUIHost::mStopDisabledBM
wxBitmap mStopDisabledBM
Definition: EffectUI.h:205
EffectUIHost::mDismissed
bool mDismissed
Definition: EffectUI.h:216
EffectManager::GetEffect
Effect * GetEffect(const PluginID &ID)
Definition: EffectManager.cpp:708
label
TranslatableString label
Definition: Tags.cpp:756
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
Effect::GetFactoryPresets
RegistryPaths GetFactoryPresets() override
Definition: Effect.cpp:585
EffectUIHost::mParent
wxWindow * mParent
Definition: EffectUI.h:180
EffectUIHost::InitializeRealtime
void InitializeRealtime()
Definition: EffectUI.cpp:1792
AudacityCommand::Apply
virtual bool Apply(const CommandContext &WXUNUSED(context))
Definition: AudacityCommand.h:72
ShuttleGuiBase::AddTextBox
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:638
EffectUIHost::mProject
AudacityProject * mProject
Definition: EffectUI.h:179
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
NYQUIST_PROMPT_NAME
#define NYQUIST_PROMPT_NAME
Definition: PluginManager.h:362
EffectUIHost::mRegion
SelectedRegion mRegion
Definition: EffectUI.h:213
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: Project.cpp:188
Effect::LoadFactoryDefaults
bool LoadFactoryDefaults() override
Definition: Effect.cpp:605
RealtimeEffectManager::RealtimeAddEffect
void RealtimeAddEffect(EffectClientInterface *effect)
Definition: RealtimeEffectManager.cpp:113
EffectPanel::AcceptsFocus
bool AcceptsFocus() const override
Definition: EffectUI.cpp:620
EffectUIHost::OnPlay
void OnPlay(wxCommandEvent &evt)
Definition: EffectUI.cpp:1375
kDeletePresetDummyID
static const int kDeletePresetDummyID
Definition: EffectUI.cpp:684
anonymous_namespace{AdornedRulerPanel.cpp}::sKey
AudacityProject::AttachedWindows::RegisteredFactory sKey
Definition: AdornedRulerPanel.cpp:858
EffectPanel::SetAccept
void SetAccept(bool accept)
Definition: EffectUI.cpp:634
EffectUIHost::mClient
EffectUIClientInterface * mClient
Definition: EffectUI.h:183
Effect::GetType
EffectType GetType() override
Definition: Effect.cpp:132
PluginID
wxString PluginID
Definition: EffectManager.h:30
AudacityCommand::GetAutomationParameters
virtual bool GetAutomationParameters(wxString &parms)
Definition: AudacityCommand.cpp:139
EffectDialog::PopulateOrExchange
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: EffectUI.cpp:2079
EffectPanel::mAcceptsFocus
bool mAcceptsFocus
Definition: EffectUI.cpp:640
AudacityCommand
Base class for command in Audacity.
Definition: AudacityCommand.h:41
SelectUtilities::SelectAllIfNone
void SelectAllIfNone(AudacityProject &project)
Definition: SelectUtilities.cpp:84
name
const TranslatableString name
Definition: Distortion.cpp:98
EffectTypeTool
@ EffectTypeTool
Definition: EffectInterface.h:61
EffectUIHost::mPlaying
bool mPlaying
Definition: EffectUI.h:210
kEnableID
static const int kEnableID
Definition: EffectUI.cpp:686
EffectDialog
Definition: EffectUI.h:243
EffectPanel
Definition: EffectUI.cpp:600
EffectUIHost::mEnabled
bool mEnabled
Definition: EffectUI.h:207
TrackFocus::Get
Track * Get()
Definition: TrackPanelAx.cpp:755
EffectUIHost::OnDeletePreset
void OnDeletePreset(wxCommandEvent &evt)
Definition: EffectUI.cpp:1541
EffectUIHost::OnRewind
void OnRewind(wxCommandEvent &evt)
Definition: EffectUI.cpp:1426
PluginManager::GetPlugin
const PluginDescriptor * GetPlugin(const PluginID &ID) const
Definition: PluginManager.cpp:1445
PluginDescriptor
Definition: PluginManager.h:44
Effect::RemovePrivateConfigSubgroup
bool RemovePrivateConfigSubgroup(const RegistryPath &group) override
Definition: Effect.cpp:1011
RealtimeEffectManager::RealtimeRemoveEffect
void RealtimeRemoveEffect(EffectClientInterface *effect)
Definition: RealtimeEffectManager.cpp:140
RealtimeEffectManager::GetRealtimeLatency
int GetRealtimeLatency()
Definition: RealtimeEffectManager.cpp:402
EffectUIHost::OnCapture
void OnCapture(wxCommandEvent &evt)
Definition: EffectUI.cpp:1501
Effect::mUIDebug
bool mUIDebug
Definition: Effect.h:519
ProjectAudioManager::Stop
void Stop(bool stopStream=true)
Definition: ProjectAudioManager.cpp:311
EffectUIClientInterface::SetHostUI
virtual void SetHostUI(EffectUIHostInterface *host)=0
RealtimeEffectManager::Get
static RealtimeEffectManager & Get()
Definition: RealtimeEffectManager.cpp:43
title
static const auto title
Definition: UpdateNoticeDialog.cpp:23
EffectUIHost::OnInitDialog
void OnInitDialog(wxInitDialogEvent &evt)
Definition: EffectUI.cpp:1082
ID_UP
@ ID_UP
Definition: NyqBench.cpp:556
EffectUIHost::OnPaint
void OnPaint(wxPaintEvent &evt)
Definition: EffectUI.cpp:1110
EffectUIHost::mApplyBtn
wxButton * mApplyBtn
Definition: EffectUI.h:191
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:865
EffectUIHost::OnUserPreset
void OnUserPreset(wxCommandEvent &evt)
Definition: EffectUI.cpp:1525
EffectUIHost::OnHelp
void OnHelp(wxCommandEvent &evt)
Definition: EffectUI.cpp:1235
Effect::Preview
virtual void Preview(bool dryOnly)
Definition: Effect.cpp:2294
EffectManager::kRepeatNyquistPrompt
@ kRepeatNyquistPrompt
Definition: EffectManager.h:61
EffectUIHost::mIsGUI
bool mIsGUI
Definition: EffectUI.h:188
Effect::GetVendor
VendorSymbol GetVendor() override
Definition: Effect.cpp:162
FileConfig::DeleteGroup
virtual bool DeleteGroup(const wxString &key) wxOVERRIDE
Definition: FileConfig.cpp:219
ProjectHistory::PushState
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
Definition: ProjectHistory.cpp:90
EffectUIHost::mUserPresets
RegistryPaths mUserPresets
Definition: EffectUI.h:185
wxDialogWrapper
Definition: wxPanelWrapper.h:81
wxPanelWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:61
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:94
EffectUIHost::mPlayBM
wxBitmap mPlayBM
Definition: EffectUI.h:202
EffectUIHost::BuildButtonBar
wxPanel * BuildButtonBar(wxWindow *parent)
Definition: EffectUI.cpp:860
PluginManager::Get
static PluginManager & Get()
Definition: PluginManager.cpp:695
EffectUIHost::OnMenu
void OnMenu(wxCommandEvent &evt)
Definition: EffectUI.cpp:1256
PluginDescriptor::GetEffectType
EffectType GetEffectType() const
Definition: PluginManager.cpp:192
EffectUIHost::OnDefaults
void OnDefaults(wxCommandEvent &evt)
Definition: EffectUI.cpp:1662
eOkButton
@ eOkButton
Definition: ShuttleGui.h:600
Effect::GetFamily
EffectFamilySymbol GetFamily() override
Definition: Effect.cpp:192
MenuManager::ReportIfActionNotAllowed
bool ReportIfActionNotAllowed(const TranslatableString &Name, CommandFlag &flags, CommandFlag flagsRqd)
Definition: Menus.cpp:696
EffectUIClientInterface::PopulateUI
virtual bool PopulateUI(ShuttleGui &S)=0
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:495
kUserPresetsDummyID
static const int kUserPresetsDummyID
Definition: EffectUI.cpp:683
EffectUIHost::OnFactoryPreset
void OnFactoryPreset(wxCommandEvent &evt)
Definition: EffectUI.cpp:1534
EffectUIHost::mPlayDisabledBM
wxBitmap mPlayDisabledBM
Definition: EffectUI.h:203
_
#define _(s)
Definition: Internat.h:75
EffectUIHost::CreateBitmap
wxBitmap CreateBitmap(const char *const xpm[], bool up, bool pusher)
Definition: EffectUI.cpp:1669
UndoManager::Get
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:57
Effect::GetDescription
TranslatableString GetDescription() override
Definition: Effect.cpp:182
EffectTypeAnalyze
@ EffectTypeAnalyze
Definition: EffectInterface.h:60
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:113
EffectUIClientInterface::CloseUI
virtual bool CloseUI()=0
eCloseButton
@ eCloseButton
Definition: ShuttleGui.h:610
TimeSelectedFlag
const ReservedCommandFlag & TimeSelectedFlag()
Definition: CommonCommandFlags.cpp:159
EffectUIHost::mRewindBtn
wxButton * mRewindBtn
Definition: EffectUI.h:195
kDefaultsID
static const int kDefaultsID
Definition: EffectUI.cpp:681
Effect::HelpPage
virtual FilePath HelpPage()
Definition: Effect.cpp:1176
EffectUIHost::OnExport
void OnExport(wxCommandEvent &evt)
Definition: EffectUI.cpp:1646
MenuManager::Get
static MenuManager & Get(AudacityProject &project)
Definition: Menus.cpp:69
EffectUIHost::~EffectUIHost
virtual ~EffectUIHost()
Definition: EffectUI.cpp:791
kMenuID
static const int kMenuID
Definition: EffectUI.cpp:685
EffectPanel::AcceptsFocusFromKeyboard
bool AcceptsFocusFromKeyboard() const override
Definition: EffectUI.cpp:626
EffectUIHost
Definition: EffectUI.h:122
EffectPanel::EffectPanel
EffectPanel(wxWindow *parent)
Definition: EffectUI.cpp:602
EffectManager::kSkipState
@ kSkipState
Definition: EffectManager.h:55
EffectDialog::mType
int mType
Definition: EffectUI.h:264
EffectUI::DoEffect
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1860
EffectManager::GetCommandDescription
TranslatableString GetCommandDescription(const PluginID &ID)
Definition: EffectManager.cpp:128
RTL_WORKAROUND
#define RTL_WORKAROUND(pWnd)
Definition: GUISettings.h:21
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2432
UndoManager::GetCurrentState
unsigned int GetCurrentState()
Definition: UndoManager.cpp:265
EffectUIClientInterface::CanExportPresets
virtual bool CanExportPresets()=0
NotifyingSelectedRegion::isPoint
bool isPoint() const
Definition: ViewInfo.h:50
params
EffectDistortion::Params params
Definition: Distortion.cpp:99
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
EffectUIHost::mPlayPos
double mPlayPos
Definition: EffectUI.h:214
anonymous_namespace{wxWidgetsBasicUI.cpp}::GetParent
wxWindow * GetParent(const BasicUI::WindowPlacement &placement)
Definition: wxWidgetsBasicUI.cpp:39
ComponentInterface::GetName
TranslatableString GetName()
Definition: PluginManager.cpp:2083
EffectUIHost::mPlayToggleBtn
wxButton * mPlayToggleBtn
Definition: EffectUI.h:200
CommandManager::Get
static CommandManager & Get(AudacityProject &project)
Definition: CommandManager.cpp:203
EffectUIHost::mCloseBtn
wxButton * mCloseBtn
Definition: EffectUI.h:192
Destroy_ptr
std::unique_ptr< T, Destroyer< T > > Destroy_ptr
a convenience for using Destroyer
Definition: MemoryX.h:290
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:505
EffectUIClientInterface::IsGraphicalUI
virtual bool IsGraphicalUI()=0
EffectType
EffectType
Definition: EffectInterface.h:55
safenew
#define safenew
Definition: MemoryX.h:10
EffectManager.h
settings
static Settings & settings()
Definition: TrackInfo.cpp:86
EVT_MENU_RANGE
EVT_MENU_RANGE(FileHistory::ID_RECENT_FIRST, FileHistory::ID_RECENT_LAST, AudacityApp::OnMRUFile) bool AudacityApp
Definition: AudacityApp.cpp:820
EffectUIClientInterface::ExportPresets
virtual void ExportPresets()=0
ActiveProjects::Add
void Add(const FilePath &path)
EffectDialog::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:2092
EffectUIClientInterface::HasOptions
virtual bool HasOptions()=0
EffectUIHost::UpdateControls
void UpdateControls()
Definition: EffectUI.cpp:1702
EffectUIHost::mNeedsResume
bool mNeedsResume
Definition: EffectUI.h:217
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:52
EffectUIHost::CleanupRealtime
void CleanupRealtime()
Definition: EffectUI.cpp:1810
EffectUIHost::OnErase
void OnErase(wxEraseEvent &evt)
Definition: EffectUI.cpp:1105
END_EVENT_TABLE
END_EVENT_TABLE()
kSaveAsID
static const int kSaveAsID
Definition: EffectUI.cpp:678
EffectUIHost::LoadUserPresets
void LoadUserPresets()
Definition: EffectUI.cpp:1780
Effect::GetVersion
wxString GetVersion() override
Definition: Effect.cpp:172
AudacityCommand::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: AudacityCommand.cpp:227
EffectUIHost::TransferDataToWindow
bool TransferDataToWindow() override
Definition: EffectUI.cpp:809
Identifier::empty
bool empty() const
Definition: Identifier.h:61
EffectUIClientInterface::ValidateUI
virtual bool ValidateUI()=0
ProjectHistory::Get
static ProjectHistory & Get(AudacityProject &project)
Definition: ProjectHistory.cpp:26
EVT_COMMAND_RANGE
EVT_COMMAND_RANGE(ID_Slider, ID_Slider+NUMBER_OF_BANDS - 1, wxEVT_COMMAND_SLIDER_UPDATED, EffectEqualization::OnSlider) EffectEqualization
Definition: Equalization.cpp:218
EffectDialog::OnOk
virtual void OnOk(wxCommandEvent &evt)
Definition: EffectUI.cpp:2110
AudacityCommand::TransferDataFromWindow
virtual bool TransferDataFromWindow()
Definition: AudacityCommand.cpp:234
EffectUIHost::mSupportsRealtime
bool mSupportsRealtime
Definition: EffectUI.h:187
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
ProjectHistory::SetStateTo
void SetStateTo(unsigned int n, bool doAutosave=true)
Definition: ProjectHistory.cpp:170
Effect::LoadFactoryPreset
bool LoadFactoryPreset(int id) override
Definition: Effect.cpp:595
FileConfig::GetPath
virtual const wxString & GetPath() const wxOVERRIDE
Definition: FileConfig.cpp:98
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:38
Effect::SetUIFlags
virtual void SetUIFlags(unsigned flags)
Definition: Effect.cpp:1181