Audacity  3.0.3
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EffectUIHost Class Referencefinal

#include <EffectUI.h>

Inheritance diagram for EffectUIHost:
[legend]
Collaboration diagram for EffectUIHost:
[legend]

Public Member Functions

 EffectUIHost (wxWindow *parent, AudacityProject &project, Effect *effect, EffectUIClientInterface *client)
 
 EffectUIHost (wxWindow *parent, AudacityProject &project, AudacityCommand *command, EffectUIClientInterface *client)
 
virtual ~EffectUIHost ()
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
int ShowModal () override
 
bool Initialize ()
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 
- Public Member Functions inherited from EffectUIHostInterface
virtual ~EffectUIHostInterface ()
 

Private Member Functions

wxPanel * BuildButtonBar (wxWindow *parent)
 
void OnInitDialog (wxInitDialogEvent &evt)
 
void OnErase (wxEraseEvent &evt)
 
void OnPaint (wxPaintEvent &evt)
 
void OnClose (wxCloseEvent &evt)
 
void OnApply (wxCommandEvent &evt)
 
void DoCancel ()
 
void OnCancel (wxCommandEvent &evt)
 
void OnHelp (wxCommandEvent &evt)
 
void OnDebug (wxCommandEvent &evt)
 
void OnMenu (wxCommandEvent &evt)
 
void OnEnable (wxCommandEvent &evt)
 
void OnPlay (wxCommandEvent &evt)
 
void OnRewind (wxCommandEvent &evt)
 
void OnFFwd (wxCommandEvent &evt)
 
void OnPlayback (wxCommandEvent &evt)
 
void OnCapture (wxCommandEvent &evt)
 
void OnUserPreset (wxCommandEvent &evt)
 
void OnFactoryPreset (wxCommandEvent &evt)
 
void OnDeletePreset (wxCommandEvent &evt)
 
void OnSaveAs (wxCommandEvent &evt)
 
void OnImport (wxCommandEvent &evt)
 
void OnExport (wxCommandEvent &evt)
 
void OnOptions (wxCommandEvent &evt)
 
void OnDefaults (wxCommandEvent &evt)
 
void UpdateControls ()
 
wxBitmap CreateBitmap (const char *const xpm[], bool up, bool pusher)
 
void LoadUserPresets ()
 
void InitializeRealtime ()
 
void CleanupRealtime ()
 
void Resume ()
 

Private Attributes

AudacityProjectmProject
 
wxWindow * mParent
 
EffectmEffect
 
AudacityCommandmCommand
 
EffectUIClientInterfacemClient
 
RegistryPaths mUserPresets
 
bool mInitialized
 
bool mSupportsRealtime
 
bool mIsGUI
 
bool mIsBatch
 
wxButton * mApplyBtn
 
wxButton * mCloseBtn
 
wxButton * mMenuBtn
 
wxButton * mPlayBtn
 
wxButton * mRewindBtn
 
wxButton * mFFwdBtn
 
wxCheckBox * mEnableCb
 
wxButton * mEnableToggleBtn
 
wxButton * mPlayToggleBtn
 
wxBitmap mPlayBM
 
wxBitmap mPlayDisabledBM
 
wxBitmap mStopBM
 
wxBitmap mStopDisabledBM
 
bool mEnabled
 
bool mDisableTransport
 
bool mPlaying
 
bool mCapturing
 
SelectedRegion mRegion
 
double mPlayPos
 
bool mDismissed {}
 
bool mNeedsResume {}
 

Detailed Description

Definition at line 117 of file EffectUI.h.

Constructor & Destructor Documentation

◆ EffectUIHost() [1/2]

EffectUIHost::EffectUIHost ( wxWindow *  parent,
AudacityProject project,
Effect effect,
EffectUIClientInterface client 
)

Definition at line 719 of file EffectUI.cpp.

723 : wxDialogWrapper(parent, wxID_ANY, effect->GetName(),
724  wxDefaultPosition, wxDefaultSize,
725  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
726 {
727 #if defined(__WXMAC__)
728  // Make sure the effect window actually floats above the main window
729  [ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
730 #endif
731 
732  SetName( effect->GetName() );
733  SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
734 
735  mParent = parent;
736  mEffect = effect;
737  mCommand = NULL;
738  mClient = client;
739 
740  mProject = &project;
741 
742  mInitialized = false;
743  mSupportsRealtime = false;
744 
745  mDisableTransport = false;
746 
747  mEnabled = true;
748 
749  mPlayPos = 0.0;
750  mClient->SetHostUI(this);
751 }

◆ EffectUIHost() [2/2]

EffectUIHost::EffectUIHost ( wxWindow *  parent,
AudacityProject project,
AudacityCommand command,
EffectUIClientInterface client 
)

Definition at line 753 of file EffectUI.cpp.

757 : wxDialogWrapper(parent, wxID_ANY, XO("Some Command") /*command->GetName()*/,
758  wxDefaultPosition, wxDefaultSize,
759  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
760 {
761 #if defined(__WXMAC__)
762  // Make sure the effect window actually floats above the main window
763  [ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
764 #endif
765 
766  //SetName( command->GetName() );
767  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
768 
769  mParent = parent;
770  mEffect = NULL;
771  mCommand = command;
772  mClient = client;
773 
774  mProject = &project;
775 
776  mInitialized = false;
777  mSupportsRealtime = false;
778 
779  mDisableTransport = false;
780 
781  mEnabled = true;
782 
783  mPlayPos = 0.0;
784  mClient->SetHostUI(this);
785 }

References mClient, mCommand, mDisableTransport, mEffect, mEnabled, mInitialized, mParent, mPlayPos, mProject, mSupportsRealtime, and EffectUIClientInterface::SetHostUI().

Here is the call graph for this function:

◆ ~EffectUIHost()

EffectUIHost::~EffectUIHost ( )
virtual

Definition at line 790 of file EffectUI.cpp.

791 {
792  CleanupRealtime();
793 
794  if (mClient)
795  {
796  if (mNeedsResume)
797  Resume();
798 
799  mClient->CloseUI();
800  mClient = NULL;
801  }
802 }

References CleanupRealtime(), EffectUIClientInterface::CloseUI(), mClient, mNeedsResume, and Resume().

Here is the call graph for this function:

Member Function Documentation

◆ BuildButtonBar()

wxPanel * EffectUIHost::BuildButtonBar ( wxWindow *  parent)
private

Definition at line 859 of file EffectUI.cpp.

860 {
865 
866  int margin = 0;
867 #if defined(__WXMAC__)
868  margin = 3; // I'm sure it's needed because of the order things are created...
869 #endif
870 
871  const auto bar = safenew wxPanelWrapper(parent, wxID_ANY);
872 
873  // This fools NVDA into not saying "Panel" when the dialog gets focus
874  bar->SetName(TranslatableString::Inaudible);
875  bar->SetLabel(TranslatableString::Inaudible);
876 
877  ShuttleGui S{ bar, eIsCreating,
878  false /* horizontal */,
879  { -1, -1 } /* minimum size */
880  };
881  {
882  S.SetBorder( margin );
883 
884  if (!mIsGUI)
885  {
886  mMenuBtn = S.Id( kMenuID )
887  .ToolTip(XO("Manage presets and options"))
888  .AddButton( XXO("&Manage"), wxALIGN_CENTER | wxTOP | wxBOTTOM );
889  }
890  else
891  {
892  mMenuBtn = S.Id( kMenuID )
893  .ToolTip(XO("Manage presets and options"))
894  .Name(XO("&Manage"))
895  .AddBitmapButton( CreateBitmap(effect_menu_xpm, true, true) );
896  mMenuBtn->SetBitmapPressed(CreateBitmap(effect_menu_xpm, false, true));
897  }
898 
899  S.AddSpace( 5, 5 );
900 
901  if (!mIsBatch)
902  {
903  if (!mIsGUI)
904  {
905  if (mSupportsRealtime)
906  {
907  mPlayToggleBtn = S.Id( kPlayID )
908  .ToolTip(XO("Start and stop playback"))
909  .AddButton( XXO("Start &Playback"),
910  wxALIGN_CENTER | wxTOP | wxBOTTOM );
911  }
912  else if (mEffect &&
914  (mEffect->GetType() != EffectTypeTool) )
915  {
916  mPlayToggleBtn = S.Id( kPlayID )
917  .ToolTip(XO("Preview effect"))
918  .AddButton( XXO("&Preview"),
919  wxALIGN_CENTER | wxTOP | wxBOTTOM );
920  }
921  }
922  else
923  {
924  mPlayBM = CreateBitmap(effect_play_xpm, true, false);
925  mPlayDisabledBM = CreateBitmap(effect_play_disabled_xpm, true, true);
926  mStopBM = CreateBitmap(effect_stop_xpm, true, false);
927  mStopDisabledBM = CreateBitmap(effect_stop_disabled_xpm, true, false);
928  mPlayBtn = S.Id( kPlayID ).AddBitmapButton( mPlayBM );
929  mPlayBtn->SetBitmapDisabled(mPlayDisabledBM);
930  mPlayBtn->SetBitmapPressed(CreateBitmap(effect_play_xpm, false, true));
931  if (!mSupportsRealtime)
932  {
933  mPlayBtn->SetToolTip(_("Preview effect"));
934 #if defined(__WXMAC__)
935  mPlayBtn->SetName(_("Preview effect"));
936 #else
937  mPlayBtn->SetLabel(_("&Preview effect"));
938 #endif
939  }
940  }
941 
942  if (mSupportsRealtime)
943  {
944  if (!mIsGUI)
945  {
946  mRewindBtn = S.Id( kRewindID )
947  .ToolTip(XO("Skip backward"))
948  .AddButton( XXO("Skip &Backward"),
949  wxALIGN_CENTER | wxTOP | wxBOTTOM );
950  }
951  else
952  {
953  mRewindBtn = S.Id( kRewindID )
954  .ToolTip(XO("Skip backward"))
955  .Name(XO("Skip &Backward"))
956  .AddBitmapButton( CreateBitmap(
957  effect_rewind_xpm, true, true) );
958  mRewindBtn->SetBitmapDisabled(
959  CreateBitmap(effect_rewind_disabled_xpm, true, false));
960  mRewindBtn->SetBitmapPressed(CreateBitmap(effect_rewind_xpm, false, true));
961  }
962 
963  if (!mIsGUI)
964  {
965  mFFwdBtn = S.Id( kFFwdID )
966  .ToolTip(XO("Skip forward"))
967  .AddButton( XXO("Skip &Forward"),
968  wxALIGN_CENTER | wxTOP | wxBOTTOM );
969  }
970  else
971  {
972  mFFwdBtn = S.Id( kFFwdID )
973  .ToolTip(XO("Skip forward"))
974  .Name(XO("Skip &Forward"))
975  .AddBitmapButton( CreateBitmap(
976  effect_ffwd_xpm, true, true) );
977  mFFwdBtn->SetBitmapDisabled(
978  CreateBitmap(effect_ffwd_disabled_xpm, true, false));
979  mFFwdBtn->SetBitmapPressed(CreateBitmap(effect_ffwd_xpm, false, true));
980  }
981 
982  S.AddSpace( 5, 5 );
983 
984  mEnableCb = S.Id( kEnableID )
985  .Position(wxALIGN_CENTER | wxTOP | wxBOTTOM)
986  .Name(XO("Enable"))
987  .AddCheckBox( XXO("&Enable"), mEnabled );
988  //
989  }
990  }
991  }
992 
993  bar->GetSizer()->SetSizeHints( bar );
994 
995  return bar;
996 }

References _, CreateBitmap(), EffectTypeAnalyze, EffectTypeTool, eIsCreating, Effect::GetType(), TranslatableString::Inaudible, AudacityCommand::IsBatchProcessing(), Effect::IsBatchProcessing(), EffectUIClientInterface::IsGraphicalUI(), kEnableID, kFFwdID, kMenuID, kPlayID, kRewindID, mClient, mCommand, mEffect, mEnableCb, mEnabled, mFFwdBtn, mIsBatch, mIsGUI, mMenuBtn, mPlayBM, mPlayBtn, mPlayDisabledBM, mPlayToggleBtn, mRewindBtn, mStopBM, mStopDisabledBM, mSupportsRealtime, safenew, Effect::SupportsRealtime(), XO, and XXO.

Referenced by Initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanupRealtime()

void EffectUIHost::CleanupRealtime ( )
private

Definition at line 1809 of file EffectUI.cpp.

1810 {
1812  {
1814 
1815  mInitialized = false;
1816  }
1817 }

References RealtimeEffectManager::Get(), mEffect, mInitialized, mSupportsRealtime, and RealtimeEffectManager::RealtimeRemoveEffect().

Referenced by OnClose(), and ~EffectUIHost().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateBitmap()

wxBitmap EffectUIHost::CreateBitmap ( const char *const  xpm[],
bool  up,
bool  pusher 
)
private

Definition at line 1668 of file EffectUI.cpp.

1669 {
1670  wxMemoryDC dc;
1671  wxBitmap pic(xpm);
1672 
1673  wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6, 24);
1674  dc.SelectObject(mod);
1675 
1676 #if defined(__WXGTK__)
1677  wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND);
1678 #else
1679  wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
1680 #endif
1681 
1682  dc.SetBackground(wxBrush(newColour));
1683  dc.Clear();
1684 
1685  int offset = 3;
1686  if (pusher)
1687  {
1688  if (!up)
1689  {
1690  offset += 1;
1691  }
1692  }
1693 
1694  dc.DrawBitmap(pic, offset, offset, true);
1695 
1696  dc.SelectObject(wxNullBitmap);
1697 
1698  return mod;
1699 }

Referenced by BuildButtonBar().

Here is the caller graph for this function:

◆ DoCancel()

void EffectUIHost::DoCancel ( )
private

Definition at line 1213 of file EffectUI.cpp.

1214 {
1215  if (!mDismissed) {
1216  if( mEffect )
1217  mEffect->mUIResultID = wxID_CANCEL;
1218 
1219  if (IsModal())
1220  EndModal(false);
1221  else
1222  Hide();
1223 
1224  mDismissed = true;
1225  }
1226 }

References mDismissed, mEffect, and Effect::mUIResultID.

Referenced by OnCancel(), and OnClose().

Here is the caller graph for this function:

◆ Initialize()

bool EffectUIHost::Initialize ( )

Definition at line 998 of file EffectUI.cpp.

999 {
1000  {
1001  auto gAudioIO = AudioIO::Get();
1002  mDisableTransport = !gAudioIO->IsAvailable(mProject);
1003  mPlaying = gAudioIO->IsStreamActive(); // not exactly right, but will suffice
1004  mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0 && !gAudioIO->IsMonitoring();
1005  }
1006 
1007  EffectPanel *w {};
1008  ShuttleGui S{ this, eIsCreating };
1009  {
1010  S.StartHorizontalLay( wxEXPAND );
1011  {
1012  Destroy_ptr<EffectPanel> uw{ safenew EffectPanel( S.GetParent() ) };
1013  RTL_WORKAROUND(uw.get());
1014 
1015  // Try to give the window a sensible default/minimum size
1016  uw->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
1017  mParent->GetSize().GetHeight() / 2));
1018 
1019  ShuttleGui S1{ uw.get(), eIsCreating };
1020  if (!mClient->PopulateUI(S1))
1021  {
1022  return false;
1023  }
1024 
1025  S.Prop( 1 )
1026  .Position(wxEXPAND)
1027  .AddWindow((w = uw.release()));
1028  }
1029  S.EndHorizontalLay();
1030 
1031  S.StartPanel();
1032  {
1033  const auto bar = BuildButtonBar( S.GetParent() );
1034 
1035  long buttons;
1036  if ( mEffect && mEffect->ManualPage().empty() && mEffect->HelpPage().empty()) {
1037  buttons = eApplyButton | eCloseButton;
1038  this->SetAcceleratorTable(wxNullAcceleratorTable);
1039  }
1040  else {
1041  buttons = eApplyButton | eCloseButton | eHelpButton;
1042  wxAcceleratorEntry entries[1];
1043 #if defined(__WXMAC__)
1044  // Is there a standard shortcut on Mac?
1045 #else
1046  entries[0].Set(wxACCEL_NORMAL, (int) WXK_F1, wxID_HELP);
1047 #endif
1048  wxAcceleratorTable accel(1, entries);
1049  this->SetAcceleratorTable(accel);
1050  }
1051 
1052  if (mEffect && mEffect->mUIDebug) {
1053  buttons |= eDebugButton;
1054  }
1055 
1056  S.AddStandardButtons(buttons, bar);
1057  }
1058  S.EndPanel();
1059  }
1060 
1061  Layout();
1062  Fit();
1063  Center();
1064 
1065  mApplyBtn = (wxButton *) FindWindow(wxID_APPLY);
1066  mCloseBtn = (wxButton *) FindWindow(wxID_CANCEL);
1067 
1068  UpdateControls();
1069 
1070  w->SetAccept(!mIsGUI);
1071  (!mIsGUI ? w : FindWindow(wxID_APPLY))->SetFocus();
1072 
1073  LoadUserPresets();
1074 
1076 
1077  SetMinSize(GetSize());
1078  return true;
1079 }

References BuildButtonBar(), eApplyButton, eCloseButton, eDebugButton, eHelpButton, eIsCreating, AudioIO::Get(), Effect::HelpPage(), InitializeRealtime(), LoadUserPresets(), Effect::ManualPage(), mApplyBtn, mCapturing, mClient, mCloseBtn, mDisableTransport, mEffect, mIsGUI, mParent, mPlaying, mProject, Effect::mUIDebug, EffectUIClientInterface::PopulateUI(), RTL_WORKAROUND, safenew, and UpdateControls().

Here is the call graph for this function:

◆ InitializeRealtime()

void EffectUIHost::InitializeRealtime ( )
private

Definition at line 1791 of file EffectUI.cpp.

1792 {
1794  {
1796 
1797  wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
1799  this);
1800 
1801  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
1803  this);
1804 
1805  mInitialized = true;
1806  }
1807 }

References RealtimeEffectManager::Get(), mEffect, mInitialized, mSupportsRealtime, OnCapture(), OnPlayback(), and RealtimeEffectManager::RealtimeAddEffect().

Referenced by Initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadUserPresets()

void EffectUIHost::LoadUserPresets ( )
private

Definition at line 1779 of file EffectUI.cpp.

1780 {
1781  mUserPresets.clear();
1782 
1783  if( mEffect )
1785 
1786  std::sort( mUserPresets.begin(), mUserPresets.end() );
1787 
1788  return;
1789 }

References Effect::GetPrivateConfigSubgroups(), Effect::GetUserPresetsGroup(), mEffect, and mUserPresets.

Referenced by Initialize(), OnDeletePreset(), OnImport(), OnMenu(), and OnSaveAs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnApply()

void EffectUIHost::OnApply ( wxCommandEvent &  evt)
private

Definition at line 1132 of file EffectUI.cpp.

1133 {
1134  auto &project = *mProject;
1135 
1136  // On wxGTK (wx2.8.12), the default action is still executed even if
1137  // the button is disabled. This appears to affect all wxDialogs, not
1138  // just our Effects dialogs. So, this is a only temporary workaround
1139  // for legacy effects that disable the OK button. Hopefully this has
1140  // been corrected in wx3.
1141  if (!FindWindow(wxID_APPLY)->IsEnabled())
1142  {
1143  return;
1144  }
1145 
1146  // Honor the "select all if none" preference...a little hackish, but whatcha gonna do...
1147  if (!mIsBatch &&
1148  mEffect &&
1150  mEffect->GetType() != EffectTypeTool &&
1151  ViewInfo::Get( project ).selectedRegion.isPoint())
1152  {
1153  auto flags = AlwaysEnabledFlag;
1154  bool allowed =
1156  mEffect->GetName(),
1157  flags,
1159  if (!allowed)
1160  return;
1161  }
1162 
1163  if (!mClient->ValidateUI())
1164  {
1165  return;
1166  }
1167 
1168  // This will take care of calling TransferDataFromWindow() for an effect.
1170  {
1171  return;
1172  }
1173  // This will take care of calling TransferDataFromWindow() for a command.
1174  if (mCommand ){
1175  wxString params;
1177  }
1178 
1179  if( mEffect )
1180  mEffect->mUIResultID = evt.GetId();
1181 
1182  if (IsModal())
1183  {
1184  mDismissed = true;
1185 
1186  EndModal(true);
1187 
1188  Close();
1189 
1190  return;
1191  }
1192 
1193  // Progress dialog no longer yields, so this "shouldn't" be necessary (yet to be proven
1194  // for sure), but it is a nice visual cue that something is going on.
1195  mApplyBtn->Disable();
1196  auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
1197 
1198  if( mEffect ) {
1199  CommandContext context( project );
1200  // This is absolute hackage...but easy and I can't think of another way just now.
1201  //
1202  // It should callback to the EffectManager to kick off the processing
1203  EffectUI::DoEffect(mEffect->GetID(), context,
1205  }
1206 
1207  if( mCommand )
1208  // PRL: I don't like the global and would rather pass *mProject!
1209  // But I am preserving old behavior
1210  mCommand->Apply( CommandContext{ project } );
1211 }

References AlwaysEnabledFlag, AudacityCommand::Apply(), EffectUI::DoEffect(), EffectTypeGenerate, EffectTypeTool, MenuManager::Get(), ViewInfo::Get(), AudacityCommand::GetAutomationParameters(), Effect::GetCurrentSettingsGroup(), Effect::GetID(), ComponentInterface::GetName(), Effect::GetType(), NotifyingSelectedRegion::isPoint(), EffectManager::kConfigured, mApplyBtn, mClient, mCommand, mDismissed, mEffect, mIsBatch, mProject, Effect::mUIResultID, params, MenuManager::ReportIfActionNotAllowed(), Effect::SaveUserPreset(), ViewInfo::selectedRegion, TimeSelectedFlag(), EffectUIClientInterface::ValidateUI(), and WaveTracksSelectedFlag().

Referenced by OnDebug().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnCancel()

void EffectUIHost::OnCancel ( wxCommandEvent &  evt)
private

Definition at line 1228 of file EffectUI.cpp.

1229 {
1230  DoCancel();
1231  Close();
1232 }

References DoCancel().

Here is the call graph for this function:

◆ OnCapture()

void EffectUIHost::OnCapture ( wxCommandEvent &  evt)
private

Definition at line 1500 of file EffectUI.cpp.

1501 {
1502  evt.Skip();
1503 
1504  if (evt.GetInt() != 0)
1505  {
1506  if (evt.GetEventObject() != mProject)
1507  {
1508  mDisableTransport = true;
1509  }
1510  else
1511  {
1512  mCapturing = true;
1513  }
1514  }
1515  else
1516  {
1517  mDisableTransport = false;
1518  mCapturing = false;
1519  }
1520 
1521  UpdateControls();
1522 }

References mCapturing, mDisableTransport, mProject, and UpdateControls().

Referenced by InitializeRealtime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnClose()

void EffectUIHost::OnClose ( wxCloseEvent &  evt)
private

Definition at line 1116 of file EffectUI.cpp.

1117 {
1118  DoCancel();
1119 
1120  CleanupRealtime();
1121 
1122  Hide();
1123 
1124  if (mNeedsResume)
1125  Resume();
1126  mClient->CloseUI();
1127  mClient = NULL;
1128 
1129  Destroy();
1130 }

References CleanupRealtime(), EffectUIClientInterface::CloseUI(), DoCancel(), mClient, mNeedsResume, and Resume().

Here is the call graph for this function:

◆ OnDebug()

void EffectUIHost::OnDebug ( wxCommandEvent &  evt)
private

Definition at line 1248 of file EffectUI.cpp.

1249 {
1250  OnApply(evt);
1251  if( mEffect )
1252  mEffect->mUIResultID = evt.GetId();
1253 }

References mEffect, Effect::mUIResultID, and OnApply().

Here is the call graph for this function:

◆ OnDefaults()

void EffectUIHost::OnDefaults ( wxCommandEvent &  evt)
private

Definition at line 1661 of file EffectUI.cpp.

1662 {
1664 
1665  return;
1666 }

References Effect::LoadFactoryDefaults(), and mEffect.

Here is the call graph for this function:

◆ OnDeletePreset()

void EffectUIHost::OnDeletePreset ( wxCommandEvent &  evt)
private

Definition at line 1540 of file EffectUI.cpp.

1541 {
1542  auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
1543 
1544  int res = AudacityMessageBox(
1545  XO("Are you sure you want to delete \"%s\"?").Format( preset ),
1546  XO("Delete Preset"),
1547  wxICON_QUESTION | wxYES_NO);
1548  if (res == wxYES)
1549  {
1551  }
1552 
1553  LoadUserPresets();
1554 
1555  return;
1556 }

References AudacityMessageBox(), Effect::GetUserPresetsGroup(), kDeletePresetID, LoadUserPresets(), mEffect, mUserPresets, Effect::RemovePrivateConfigSubgroup(), and XO.

Here is the call graph for this function:

◆ OnEnable()

void EffectUIHost::OnEnable ( wxCommandEvent &  evt)
private

Definition at line 1357 of file EffectUI.cpp.

1358 {
1359  mEnabled = mEnableCb->GetValue();
1360 
1361  if (mEnabled) {
1362  Resume();
1363  mNeedsResume = false;
1364  }
1365  else
1366  {
1368  mNeedsResume = true;
1369  }
1370 
1371  UpdateControls();
1372 }

References RealtimeEffectManager::Get(), mEffect, mEnableCb, mEnabled, mNeedsResume, RealtimeEffectManager::RealtimeSuspendOne(), Resume(), and UpdateControls().

Here is the call graph for this function:

◆ OnErase()

void EffectUIHost::OnErase ( wxEraseEvent &  evt)
private

Definition at line 1104 of file EffectUI.cpp.

1105 {
1106  // Ignore it
1107 }

◆ OnExport()

void EffectUIHost::OnExport ( wxCommandEvent &  evt)
private

Definition at line 1645 of file EffectUI.cpp.

1646 {
1647  // may throw
1648  // exceptions are handled in AudacityApp::OnExceptionInMainLoop
1650 
1651  return;
1652 }

References EffectUIClientInterface::ExportPresets(), and mClient.

Here is the call graph for this function:

◆ OnFactoryPreset()

void EffectUIHost::OnFactoryPreset ( wxCommandEvent &  evt)
private

Definition at line 1533 of file EffectUI.cpp.

1534 {
1536 
1537  return;
1538 }

References kFactoryPresetsID, Effect::LoadFactoryPreset(), and mEffect.

Here is the call graph for this function:

◆ OnFFwd()

void EffectUIHost::OnFFwd ( wxCommandEvent &  evt)
private

Definition at line 1447 of file EffectUI.cpp.

1448 {
1449  if (mPlaying)
1450  {
1451  double seek;
1452  gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
1453 
1454  auto gAudioIO = AudioIO::Get();
1455  double pos = gAudioIO->GetStreamTime();
1456  if (mRegion.t0() < mRegion.t1() && pos + seek > mRegion.t1())
1457  {
1458  seek = mRegion.t1() - pos;
1459  }
1460 
1461  gAudioIO->SeekStream(seek);
1462  }
1463  else
1464  {
1465  // It allows to play past end of selection...probably useless
1466  mPlayPos = mRegion.t1();
1467  }
1468 }

References AudioIO::Get(), gPrefs, mPlaying, mPlayPos, mRegion, SelectedRegion::t0(), and SelectedRegion::t1().

Here is the call graph for this function:

◆ OnHelp()

void EffectUIHost::OnHelp ( wxCommandEvent &  evt)
private

Definition at line 1234 of file EffectUI.cpp.

1235 {
1236  if (mEffect && mEffect->GetFamily() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().empty())) {
1237  // Old ShowHelp required when there is no on-line manual.
1238  // Always use default web browser to allow full-featured HTML pages.
1239  HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->HelpPage(), wxEmptyString, true, true);
1240  }
1241  else if( mEffect )
1242  {
1243  // otherwise use the NEW ShowHelp
1244  HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->ManualPage(), true);
1245  }
1246 }

References Effect::GetFamily(), Effect::HelpPage(), Effect::ManualPage(), mEffect, NYQUISTEFFECTS_FAMILY, and HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ OnImport()

void EffectUIHost::OnImport ( wxCommandEvent &  evt)
private

Definition at line 1636 of file EffectUI.cpp.

1637 {
1639 
1640  LoadUserPresets();
1641 
1642  return;
1643 }

References EffectUIClientInterface::ImportPresets(), LoadUserPresets(), and mClient.

Here is the call graph for this function:

◆ OnInitDialog()

void EffectUIHost::OnInitDialog ( wxInitDialogEvent &  evt)
private

Definition at line 1081 of file EffectUI.cpp.

1082 {
1083  // Do default handling
1084  wxDialogWrapper::OnInitDialog(evt);
1085 
1086 #if wxCHECK_VERSION(3, 0, 0)
1087  //#warning "check to see if this still needed in wx3"
1088 #endif
1089 
1090  // Pure hackage coming down the pike...
1091  //
1092  // I have no idea why, but if a wxTextCtrl is the first control in the
1093  // panel, then its contents will not be automatically selected when the
1094  // dialog is displayed.
1095  //
1096  // So, we do the selection manually.
1097  wxTextCtrl *focused = wxDynamicCast(FindFocus(), wxTextCtrl);
1098  if (focused)
1099  {
1100  focused->SelectAll();
1101  }
1102 }

◆ OnMenu()

void EffectUIHost::OnMenu ( wxCommandEvent &  evt)
private

Definition at line 1255 of file EffectUI.cpp.

1256 {
1257  wxMenu menu;
1258  if( !mEffect )
1259  return;
1260 
1261  LoadUserPresets();
1262 
1263  if (mUserPresets.size() == 0)
1264  {
1265  menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false);
1266  }
1267  else
1268  {
1269  auto sub = std::make_unique<wxMenu>();
1270  for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
1271  {
1272  sub->Append(kUserPresetsID + i, mUserPresets[i]);
1273  }
1274  menu.Append(0, _("User Presets"), sub.release());
1275  }
1276 
1277  menu.Append(kSaveAsID, _("Save Preset..."));
1278 
1279  if (mUserPresets.size() == 0)
1280  {
1281  menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false);
1282  }
1283  else
1284  {
1285  auto sub = std::make_unique<wxMenu>();
1286  for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
1287  {
1288  sub->Append(kDeletePresetID + i, mUserPresets[i]);
1289  }
1290  menu.Append(0, _("Delete Preset"), sub.release());
1291  }
1292 
1293  menu.AppendSeparator();
1294 
1295  auto factory = mEffect->GetFactoryPresets();
1296 
1297  {
1298  auto sub = std::make_unique<wxMenu>();
1299  sub->Append(kDefaultsID, _("Defaults"));
1300  if (factory.size() > 0)
1301  {
1302  sub->AppendSeparator();
1303  for (size_t i = 0, cnt = factory.size(); i < cnt; i++)
1304  {
1305  auto label = factory[i];
1306  if (label.empty())
1307  {
1308  label = _("None");
1309  }
1310 
1311  sub->Append(kFactoryPresetsID + i, label);
1312  }
1313  }
1314  menu.Append(0, _("Factory Presets"), sub.release());
1315  }
1316 
1317  menu.AppendSeparator();
1318  menu.Append(kImportID, _("Import..."))->Enable(mClient->CanExportPresets());
1319  menu.Append(kExportID, _("Export..."))->Enable(mClient->CanExportPresets());
1320  menu.AppendSeparator();
1321  menu.Append(kOptionsID, _("Options..."))->Enable(mClient->HasOptions());
1322  menu.AppendSeparator();
1323 
1324  {
1325  auto sub = std::make_unique<wxMenu>();
1326 
1327  sub->Append(kDummyID, wxString::Format(_("Type: %s"),
1328  ::wxGetTranslation( mEffect->GetFamily().Translation() )));
1329  sub->Append(kDummyID, wxString::Format(_("Name: %s"), mEffect->GetName().Translation()));
1330  sub->Append(kDummyID, wxString::Format(_("Version: %s"), mEffect->GetVersion()));
1331  sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), mEffect->GetVendor().Translation()));
1332  sub->Append(kDummyID, wxString::Format(_("Description: %s"), mEffect->GetDescription().Translation()));
1333 
1334  menu.Append(0, _("About"), sub.release());
1335  }
1336 
1337  wxWindow *btn = FindWindow(kMenuID);
1338  wxRect r = btn->GetRect();
1339  btn->PopupMenu(&menu, r.GetLeft(), r.GetBottom());
1340 }

References _, EffectUIClientInterface::CanExportPresets(), TranslatableString::empty(), factory, Effect::GetDescription(), Effect::GetFactoryPresets(), Effect::GetFamily(), ComponentInterface::GetName(), Effect::GetVendor(), Effect::GetVersion(), EffectUIClientInterface::HasOptions(), kDefaultsID, kDeletePresetDummyID, kDeletePresetID, kDummyID, kExportID, kFactoryPresetsID, kImportID, kMenuID, kOptionsID, kSaveAsID, kUserPresetsDummyID, kUserPresetsID, label, LoadUserPresets(), mClient, mEffect, mUserPresets, ComponentInterfaceSymbol::Translation(), and TranslatableString::Translation().

Here is the call graph for this function:

◆ OnOptions()

void EffectUIHost::OnOptions ( wxCommandEvent &  evt)
private

Definition at line 1654 of file EffectUI.cpp.

1655 {
1656  mClient->ShowOptions();
1657 
1658  return;
1659 }

References mClient, and EffectUIClientInterface::ShowOptions().

Here is the call graph for this function:

◆ OnPaint()

void EffectUIHost::OnPaint ( wxPaintEvent &  evt)
private

Definition at line 1109 of file EffectUI.cpp.

1110 {
1111  wxPaintDC dc(this);
1112 
1113  dc.Clear();
1114 }

◆ OnPlay()

void EffectUIHost::OnPlay ( wxCommandEvent &  evt)
private

Definition at line 1374 of file EffectUI.cpp.

1375 {
1376  if (!mSupportsRealtime)
1377  {
1379  {
1380  return;
1381  }
1382 
1383  mEffect->Preview(false);
1384 
1385  return;
1386  }
1387 
1388  if (mPlaying)
1389  {
1390  auto gAudioIO = AudioIO::Get();
1391  mPlayPos = gAudioIO->GetStreamTime();
1392  auto &projectAudioManager = ProjectAudioManager::Get( *mProject );
1393  projectAudioManager.Stop();
1394  }
1395  else
1396  {
1397  auto &viewInfo = ViewInfo::Get( *mProject );
1398  const auto &selectedRegion = viewInfo.selectedRegion;
1399  const auto &playRegion = viewInfo.playRegion;
1400  if ( playRegion.Locked() )
1401  {
1402  mRegion.setTimes(playRegion.GetStart(), playRegion.GetEnd());
1403  mPlayPos = mRegion.t0();
1404  }
1405  else if (selectedRegion.t0() != mRegion.t0() ||
1406  selectedRegion.t1() != mRegion.t1())
1407  {
1408  mRegion = selectedRegion;
1409  mPlayPos = mRegion.t0();
1410  }
1411 
1412  if (mPlayPos > mRegion.t1())
1413  {
1414  mPlayPos = mRegion.t1();
1415  }
1416 
1417  auto &projectAudioManager = ProjectAudioManager::Get( *mProject );
1418  projectAudioManager.PlayPlayRegion(
1422  }
1423 }

References DefaultPlayOptions(), AudioIO::Get(), ProjectAudioManager::Get(), ViewInfo::Get(), mClient, mEffect, mPlaying, mPlayPos, mProject, mRegion, mSupportsRealtime, normalPlay, Effect::Preview(), SelectedRegion::setTimes(), SelectedRegion::t0(), SelectedRegion::t1(), Effect::TransferDataFromWindow(), and EffectUIClientInterface::ValidateUI().

Here is the call graph for this function:

◆ OnPlayback()

void EffectUIHost::OnPlayback ( wxCommandEvent &  evt)
private

Definition at line 1470 of file EffectUI.cpp.

1471 {
1472  evt.Skip();
1473 
1474  if (evt.GetInt() != 0)
1475  {
1476  if (evt.GetEventObject() != mProject)
1477  {
1478  mDisableTransport = true;
1479  }
1480  else
1481  {
1482  mPlaying = true;
1483  }
1484  }
1485  else
1486  {
1487  mDisableTransport = false;
1488  mPlaying = false;
1489  }
1490 
1491  if (mPlaying)
1492  {
1493  mRegion = ViewInfo::Get( *mProject ).selectedRegion;
1494  mPlayPos = mRegion.t0();
1495  }
1496 
1497  UpdateControls();
1498 }

References ViewInfo::Get(), mDisableTransport, mPlaying, mPlayPos, mProject, mRegion, ViewInfo::selectedRegion, SelectedRegion::t0(), and UpdateControls().

Referenced by InitializeRealtime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRewind()

void EffectUIHost::OnRewind ( wxCommandEvent &  evt)
private

Definition at line 1425 of file EffectUI.cpp.

1426 {
1427  if (mPlaying)
1428  {
1429  auto gAudioIO = AudioIO::Get();
1430  double seek;
1431  gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
1432 
1433  double pos = gAudioIO->GetStreamTime();
1434  if (pos - seek < mRegion.t0())
1435  {
1436  seek = pos - mRegion.t0();
1437  }
1438 
1439  gAudioIO->SeekStream(-seek);
1440  }
1441  else
1442  {
1443  mPlayPos = mRegion.t0();
1444  }
1445 }

References AudioIO::Get(), gPrefs, mPlaying, mPlayPos, mRegion, and SelectedRegion::t0().

Here is the call graph for this function:

◆ OnSaveAs()

void EffectUIHost::OnSaveAs ( wxCommandEvent &  evt)
private

Definition at line 1558 of file EffectUI.cpp.

1559 {
1560  wxTextCtrl *text;
1561  wxString name;
1562  wxDialogWrapper dlg(this, wxID_ANY, XO("Save Preset"));
1563 
1564  ShuttleGui S(&dlg, eIsCreating);
1565 
1566  S.StartPanel();
1567  {
1568  S.StartVerticalLay(1);
1569  {
1570  S.StartHorizontalLay(wxALIGN_LEFT, 0);
1571  {
1572  text = S.AddTextBox(XXO("Preset name:"), name, 30);
1573  }
1574  S.EndHorizontalLay();
1575  S.SetBorder(10);
1576  S.AddStandardButtons();
1577  }
1578  S.EndVerticalLay();
1579  }
1580  S.EndPanel();
1581 
1582  dlg.SetSize(dlg.GetSizer()->GetMinSize());
1583  dlg.Center();
1584  dlg.Fit();
1585 
1586  while (true)
1587  {
1588  int rc = dlg.ShowModal();
1589 
1590  if (rc != wxID_OK)
1591  {
1592  break;
1593  }
1594 
1595  name = text->GetValue();
1596  if (name.empty())
1597  {
1599  this,
1600  XO("You must specify a name"),
1601  XO("Save Preset") );
1602  md.Center();
1603  md.ShowModal();
1604  continue;
1605  }
1606 
1607  if ( make_iterator_range( mUserPresets ).contains( name ) )
1608  {
1610  this,
1611  XO("Preset already exists.\n\nReplace?"),
1612  XO("Save Preset"),
1613  wxYES_NO | wxCANCEL | wxICON_EXCLAMATION );
1614  md.Center();
1615  int choice = md.ShowModal();
1616  if (choice == wxID_CANCEL)
1617  {
1618  break;
1619  }
1620 
1621  if (choice == wxID_NO)
1622  {
1623  continue;
1624  }
1625  }
1626 
1628  LoadUserPresets();
1629 
1630  break;
1631  }
1632 
1633  return;
1634 }

References ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddTextBox(), eIsCreating, TranslatableString::empty(), ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndPanel(), ShuttleGuiBase::EndVerticalLay(), Effect::GetUserPresetsGroup(), LoadUserPresets(), make_iterator_range(), mEffect, mUserPresets, name, Effect::SaveUserPreset(), ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartPanel(), ShuttleGuiBase::StartVerticalLay(), XO, and XXO.

Here is the call graph for this function:

◆ OnUserPreset()

void EffectUIHost::OnUserPreset ( wxCommandEvent &  evt)
private

Definition at line 1524 of file EffectUI.cpp.

1525 {
1526  int preset = evt.GetId() - kUserPresetsID;
1527 
1529 
1530  return;
1531 }

References Effect::GetUserPresetsGroup(), kUserPresetsID, Effect::LoadUserPreset(), mEffect, and mUserPresets.

Here is the call graph for this function:

◆ Resume()

void EffectUIHost::Resume ( )
private

Definition at line 1342 of file EffectUI.cpp.

1343 {
1344  if (!mClient->ValidateUI()) {
1345  // If we're previewing we should still be able to stop playback
1346  // so don't disable transport buttons.
1347  // mEffect->EnableApply(false); // currently this would also disable transport buttons.
1348  // The preferred behaviour is currently undecided, so for now
1349  // just disallow enabling until settings are valid.
1350  mEnabled = false;
1351  mEnableCb->SetValue(mEnabled);
1352  return;
1353  }
1355 }

References RealtimeEffectManager::Get(), mClient, mEffect, mEnableCb, mEnabled, RealtimeEffectManager::RealtimeResumeOne(), and EffectUIClientInterface::ValidateUI().

Referenced by OnClose(), OnEnable(), and ~EffectUIHost().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowModal()

int EffectUIHost::ShowModal ( )
override

Definition at line 830 of file EffectUI.cpp.

831 {
832 #if defined(__WXMSW__)
833  // Swap the Close and Apply buttons
834  wxSizer *sz = mApplyBtn->GetContainingSizer();
835  wxASSERT(mApplyBtn->GetParent()); // To justify safenew
836  wxButton *apply = safenew wxButton(mApplyBtn->GetParent(), wxID_APPLY);
837  sz->Replace(mCloseBtn, apply);
838  sz->Replace(mApplyBtn, mCloseBtn);
839  sz->Layout();
840  mApplyBtn->Destroy();
841  mApplyBtn = apply;
842  mApplyBtn->SetDefault();
843  mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK, 0));
844  mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL, 0));
845 #else
846  mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK));
847  mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL));
848 #endif
849 
850  Layout();
851 
852  return wxDialogWrapper::ShowModal();
853 }

References mApplyBtn, mCloseBtn, and safenew.

◆ TransferDataFromWindow()

bool EffectUIHost::TransferDataFromWindow ( )
override

Definition at line 817 of file EffectUI.cpp.

818 {
819  if( mEffect)
821  if( mCommand)
823  return false;
824 }

References mCommand, mEffect, AudacityCommand::TransferDataFromWindow(), and Effect::TransferDataFromWindow().

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectUIHost::TransferDataToWindow ( )
override

Definition at line 808 of file EffectUI.cpp.

809 {
810  if( mEffect )
811  return mEffect->TransferDataToWindow();
812  if( mCommand )
813  return mCommand->TransferDataToWindow();
814  return false;
815 }

References mCommand, mEffect, AudacityCommand::TransferDataToWindow(), and Effect::TransferDataToWindow().

Here is the call graph for this function:

◆ UpdateControls()

void EffectUIHost::UpdateControls ( )
private

Definition at line 1701 of file EffectUI.cpp.

1702 {
1703  if (mIsBatch)
1704  {
1705  return;
1706  }
1707 
1709  {
1710  // Don't allow focus to get trapped
1711  wxWindow *focus = FindFocus();
1712  if (focus == mRewindBtn || focus == mFFwdBtn || focus == mPlayBtn || focus == mEnableCb)
1713  {
1714  mCloseBtn->SetFocus();
1715  }
1716  }
1717 
1718  mApplyBtn->Enable(!mCapturing);
1720  {
1722  }
1723 
1724  if (mSupportsRealtime)
1725  {
1726  mRewindBtn->Enable(!(mCapturing || mDisableTransport));
1727  mFFwdBtn->Enable(!(mCapturing || mDisableTransport));
1728  mEnableCb->Enable(!(mCapturing || mDisableTransport));
1729 
1730  wxBitmapButton *bb;
1731 
1732  if (mPlaying)
1733  {
1734  if (!mIsGUI)
1735  {
1736  /* i18n-hint: The access key "&P" should be the same in
1737  "Stop &Playback" and "Start &Playback" */
1738  mPlayToggleBtn->SetLabel(_("Stop &Playback"));
1739  mPlayToggleBtn->Refresh();
1740  }
1741  else
1742  {
1743  bb = (wxBitmapButton *) mPlayBtn;
1744  bb->SetBitmapLabel(mStopBM);
1745  bb->SetBitmapDisabled(mStopDisabledBM);
1746  bb->SetToolTip(_("Stop"));
1747 #if defined(__WXMAC__)
1748  bb->SetName(_("Stop &Playback"));
1749 #else
1750  bb->SetLabel(_("Stop &Playback"));
1751 #endif
1752  }
1753  }
1754  else
1755  {
1756  if (!mIsGUI)
1757  {
1758  /* i18n-hint: The access key "&P" should be the same in
1759  "Stop &Playback" and "Start &Playback" */
1760  mPlayToggleBtn->SetLabel(_("Start &Playback"));
1761  mPlayToggleBtn->Refresh();
1762  }
1763  else
1764  {
1765  bb = (wxBitmapButton *) mPlayBtn;
1766  bb->SetBitmapLabel(mPlayBM);
1767  bb->SetBitmapDisabled(mPlayDisabledBM);
1768  bb->SetToolTip(_("Play"));
1769 #if defined(__WXMAC__)
1770  bb->SetName(_("Start &Playback"));
1771 #else
1772  bb->SetLabel(_("Start &Playback"));
1773 #endif
1774  }
1775  }
1776  }
1777 }

References _, EffectTypeAnalyze, EffectTypeTool, Effect::GetType(), mApplyBtn, mCapturing, mCloseBtn, mDisableTransport, mEffect, mEnableCb, mFFwdBtn, mIsBatch, mIsGUI, mPlayBM, mPlayBtn, mPlayDisabledBM, mPlaying, mPlayToggleBtn, mRewindBtn, mStopBM, mStopDisabledBM, and mSupportsRealtime.

Referenced by Initialize(), OnCapture(), OnEnable(), and OnPlayback().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mApplyBtn

wxButton* EffectUIHost::mApplyBtn
private

Definition at line 188 of file EffectUI.h.

Referenced by Initialize(), OnApply(), ShowModal(), and UpdateControls().

◆ mCapturing

bool EffectUIHost::mCapturing
private

Definition at line 208 of file EffectUI.h.

Referenced by Initialize(), OnCapture(), and UpdateControls().

◆ mClient

EffectUIClientInterface* EffectUIHost::mClient
private

◆ mCloseBtn

wxButton* EffectUIHost::mCloseBtn
private

Definition at line 189 of file EffectUI.h.

Referenced by Initialize(), ShowModal(), and UpdateControls().

◆ mCommand

AudacityCommand* EffectUIHost::mCommand
private

◆ mDisableTransport

bool EffectUIHost::mDisableTransport
private

Definition at line 206 of file EffectUI.h.

Referenced by EffectUIHost(), Initialize(), OnCapture(), OnPlayback(), and UpdateControls().

◆ mDismissed

bool EffectUIHost::mDismissed {}
private

Definition at line 213 of file EffectUI.h.

Referenced by DoCancel(), and OnApply().

◆ mEffect

Effect* EffectUIHost::mEffect
private

◆ mEnableCb

wxCheckBox* EffectUIHost::mEnableCb
private

Definition at line 194 of file EffectUI.h.

Referenced by BuildButtonBar(), OnEnable(), Resume(), and UpdateControls().

◆ mEnabled

bool EffectUIHost::mEnabled
private

Definition at line 204 of file EffectUI.h.

Referenced by BuildButtonBar(), EffectUIHost(), OnEnable(), and Resume().

◆ mEnableToggleBtn

wxButton* EffectUIHost::mEnableToggleBtn
private

Definition at line 196 of file EffectUI.h.

◆ mFFwdBtn

wxButton* EffectUIHost::mFFwdBtn
private

Definition at line 193 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mInitialized

bool EffectUIHost::mInitialized
private

Definition at line 183 of file EffectUI.h.

Referenced by CleanupRealtime(), EffectUIHost(), and InitializeRealtime().

◆ mIsBatch

bool EffectUIHost::mIsBatch
private

Definition at line 186 of file EffectUI.h.

Referenced by BuildButtonBar(), OnApply(), and UpdateControls().

◆ mIsGUI

bool EffectUIHost::mIsGUI
private

Definition at line 185 of file EffectUI.h.

Referenced by BuildButtonBar(), Initialize(), and UpdateControls().

◆ mMenuBtn

wxButton* EffectUIHost::mMenuBtn
private

Definition at line 190 of file EffectUI.h.

Referenced by BuildButtonBar().

◆ mNeedsResume

bool EffectUIHost::mNeedsResume {}
private

Definition at line 214 of file EffectUI.h.

Referenced by OnClose(), OnEnable(), and ~EffectUIHost().

◆ mParent

wxWindow* EffectUIHost::mParent
private

Definition at line 177 of file EffectUI.h.

Referenced by EffectUIHost(), and Initialize().

◆ mPlayBM

wxBitmap EffectUIHost::mPlayBM
private

Definition at line 199 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mPlayBtn

wxButton* EffectUIHost::mPlayBtn
private

Definition at line 191 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mPlayDisabledBM

wxBitmap EffectUIHost::mPlayDisabledBM
private

Definition at line 200 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mPlaying

bool EffectUIHost::mPlaying
private

Definition at line 207 of file EffectUI.h.

Referenced by Initialize(), OnFFwd(), OnPlay(), OnPlayback(), OnRewind(), and UpdateControls().

◆ mPlayPos

double EffectUIHost::mPlayPos
private

Definition at line 211 of file EffectUI.h.

Referenced by EffectUIHost(), OnFFwd(), OnPlay(), OnPlayback(), and OnRewind().

◆ mPlayToggleBtn

wxButton* EffectUIHost::mPlayToggleBtn
private

Definition at line 197 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mProject

AudacityProject* EffectUIHost::mProject
private

Definition at line 176 of file EffectUI.h.

Referenced by EffectUIHost(), Initialize(), OnApply(), OnCapture(), OnPlay(), and OnPlayback().

◆ mRegion

SelectedRegion EffectUIHost::mRegion
private

Definition at line 210 of file EffectUI.h.

Referenced by OnFFwd(), OnPlay(), OnPlayback(), and OnRewind().

◆ mRewindBtn

wxButton* EffectUIHost::mRewindBtn
private

Definition at line 192 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mStopBM

wxBitmap EffectUIHost::mStopBM
private

Definition at line 201 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mStopDisabledBM

wxBitmap EffectUIHost::mStopDisabledBM
private

Definition at line 202 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mSupportsRealtime

bool EffectUIHost::mSupportsRealtime
private

◆ mUserPresets

RegistryPaths EffectUIHost::mUserPresets
private

Definition at line 182 of file EffectUI.h.

Referenced by LoadUserPresets(), OnDeletePreset(), OnMenu(), OnSaveAs(), and OnUserPreset().


The documentation for this class was generated from the following files:
EffectUIHost::mStopBM
wxBitmap mStopBM
Definition: EffectUI.h:201
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:156
EffectUIHost::mIsBatch
bool mIsBatch
Definition: EffectUI.h:186
EffectUIHost::mDisableTransport
bool mDisableTransport
Definition: EffectUI.h:206
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:37
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
kDeletePresetID
static const int kDeletePresetID
Definition: EffectUI.cpp:692
kImportID
static const int kImportID
Definition: EffectUI.cpp:678
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:548
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:51
ComponentInterfaceSymbol::Translation
const wxString Translation() const
Definition: ComponentInterface.h:92
kRewindID
static const int kRewindID
Definition: EffectUI.cpp:687
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:68
SelectedRegion::t1
double t1() const
Definition: SelectedRegion.h:95
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
Effect::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: Effect.cpp:1915
eHelpButton
@ eHelpButton
Definition: ShuttleGui.h:598
EffectUIHost::DoCancel
void DoCancel()
Definition: EffectUI.cpp:1213
Effect::SupportsRealtime
bool SupportsRealtime() override
Definition: Effect.cpp:234
DefaultPlayOptions
AudioIOStartStreamOptions DefaultPlayOptions(AudacityProject &project)
Definition: ProjectAudioManager.cpp:1002
Effect::GetID
virtual PluginID GetID()
Definition: Effect.cpp:1023
wxPanelWrapper
Definition: wxPanelWrapper.h:41
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:58
Effect::mUIResultID
int mUIResultID
Definition: Effect.h:477
EffectUIClientInterface::ImportPresets
virtual void ImportPresets()=0
EffectUIHost::mEffect
Effect * mEffect
Definition: EffectUI.h:178
Format
Abstract base class used in importing a file.
kFactoryPresetsID
static const int kFactoryPresetsID
Definition: EffectUI.cpp:693
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:1132
Effect::LoadUserPreset
bool LoadUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:553
EffectManager::kConfigured
@ kConfigured
Definition: EffectManager.h:53
EffectUIHost::mMenuBtn
wxButton * mMenuBtn
Definition: EffectUI.h:190
XO
#define XO(s)
Definition: Internat.h:31
SelectedRegion::setTimes
bool setTimes(double t0, double t1)
Definition: SelectedRegion.h:139
kPlayID
static const int kPlayID
Definition: EffectUI.cpp:686
NYQUISTEFFECTS_FAMILY
#define NYQUISTEFFECTS_FAMILY
Definition: Effect.h:58
eDebugButton
@ eDebugButton
Definition: ShuttleGui.h:600
Effect::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: Effect.cpp:1189
kUserPresetsID
static const int kUserPresetsID
Definition: EffectUI.cpp:691
AlwaysEnabledFlag
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:35
Effect::GetUserPresetsGroup
RegistryPath GetUserPresetsGroup(const RegistryPath &name) override
Definition: Effect.cpp:854
EffectUIHost::mInitialized
bool mInitialized
Definition: EffectUI.h:183
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:569
EffectUIHost::Resume
void Resume()
Definition: EffectUI.cpp:1342
EffectUIHost::mCommand
AudacityCommand * mCommand
Definition: EffectUI.h:179
Effect::GetPrivateConfigSubgroups
bool GetPrivateConfigSubgroups(const RegistryPath &group, RegistryPaths &paths) override
Definition: Effect.cpp:956
AudacityMessageDialog
Wrap wxMessageDialog so that caption IS translatable.
Definition: wxPanelWrapper.h:215
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:1470
eApplyButton
@ eApplyButton
Definition: ShuttleGui.h:603
EffectUIHost::mCapturing
bool mCapturing
Definition: EffectUI.h:208
kDummyID
static const int kDummyID
Definition: EffectUI.cpp:676
RealtimeEffectManager::RealtimeResumeOne
void RealtimeResumeOne(EffectClientInterface &effect)
Definition: RealtimeEffectManager.cpp:271
EffectUIHost::mPlayBtn
wxButton * mPlayBtn
Definition: EffectUI.h:191
PlayMode::normalPlay
@ normalPlay
AudacityCommand::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: AudacityCommand.h:69
kFFwdID
static const int kFFwdID
Definition: EffectUI.cpp:688
kExportID
static const int kExportID
Definition: EffectUI.cpp:679
RealtimeEffectManager::RealtimeSuspendOne
void RealtimeSuspendOne(EffectClientInterface &effect)
Definition: RealtimeEffectManager.cpp:238
kOptionsID
static const int kOptionsID
Definition: EffectUI.cpp:681
EffectUIHost::mEnableCb
wxCheckBox * mEnableCb
Definition: EffectUI.h:194
EffectUIHost::mFFwdBtn
wxButton * mFFwdBtn
Definition: EffectUI.h:193
EffectUIClientInterface::ShowOptions
virtual void ShowOptions()=0
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:199
XXO
#define XXO(s)
Definition: Internat.h:44
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:807
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:22
EffectUIHost::mStopDisabledBM
wxBitmap mStopDisabledBM
Definition: EffectUI.h:202
EffectUIHost::mDismissed
bool mDismissed
Definition: EffectUI.h:213
label
TranslatableString label
Definition: Tags.cpp:755
Effect::GetFactoryPresets
RegistryPaths GetFactoryPresets() override
Definition: Effect.cpp:585
EffectUIHost::mParent
wxWindow * mParent
Definition: EffectUI.h:177
EffectUIHost::InitializeRealtime
void InitializeRealtime()
Definition: EffectUI.cpp:1791
AudacityCommand::Apply
virtual bool Apply(const CommandContext &WXUNUSED(context))
Definition: AudacityCommand.h:72
EffectUIHost::mProject
AudacityProject * mProject
Definition: EffectUI.h:176
EffectUIHost::mRegion
SelectedRegion mRegion
Definition: EffectUI.h:210
Effect::LoadFactoryDefaults
bool LoadFactoryDefaults() override
Definition: Effect.cpp:605
RealtimeEffectManager::RealtimeAddEffect
void RealtimeAddEffect(EffectClientInterface *effect)
Definition: RealtimeEffectManager.cpp:113
kDeletePresetDummyID
static const int kDeletePresetDummyID
Definition: EffectUI.cpp:683
EffectUIHost::mClient
EffectUIClientInterface * mClient
Definition: EffectUI.h:180
Effect::GetType
EffectType GetType() override
Definition: Effect.cpp:132
AudacityCommand::GetAutomationParameters
virtual bool GetAutomationParameters(wxString &parms)
Definition: AudacityCommand.cpp:139
name
const TranslatableString name
Definition: Distortion.cpp:98
EffectTypeTool
@ EffectTypeTool
Definition: EffectInterface.h:61
Effect::ManualPage
virtual wxString ManualPage()
Definition: Effect.cpp:1171
EffectUIHost::mPlaying
bool mPlaying
Definition: EffectUI.h:207
kEnableID
static const int kEnableID
Definition: EffectUI.cpp:685
EffectPanel
Definition: EffectUI.cpp:600
EffectUIHost::mEnabled
bool mEnabled
Definition: EffectUI.h:204
Effect::RemovePrivateConfigSubgroup
bool RemovePrivateConfigSubgroup(const RegistryPath &group) override
Definition: Effect.cpp:1011
RealtimeEffectManager::RealtimeRemoveEffect
void RealtimeRemoveEffect(EffectClientInterface *effect)
Definition: RealtimeEffectManager.cpp:140
EffectUIHost::OnCapture
void OnCapture(wxCommandEvent &evt)
Definition: EffectUI.cpp:1500
Effect::mUIDebug
bool mUIDebug
Definition: Effect.h:517
EffectUIClientInterface::SetHostUI
virtual void SetHostUI(EffectUIHostInterface *host)=0
RealtimeEffectManager::Get
static RealtimeEffectManager & Get()
Definition: RealtimeEffectManager.cpp:43
EffectUIHost::mApplyBtn
wxButton * mApplyBtn
Definition: EffectUI.h:188
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:865
Effect::Preview
virtual void Preview(bool dryOnly)
Definition: Effect.cpp:2294
EffectUIHost::mIsGUI
bool mIsGUI
Definition: EffectUI.h:185
Effect::GetVendor
VendorSymbol GetVendor() override
Definition: Effect.cpp:162
EffectUIHost::mUserPresets
RegistryPaths mUserPresets
Definition: EffectUI.h:182
wxDialogWrapper
Definition: wxPanelWrapper.h:81
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:94
EffectUIHost::mPlayBM
wxBitmap mPlayBM
Definition: EffectUI.h:199
EffectUIHost::BuildButtonBar
wxPanel * BuildButtonBar(wxWindow *parent)
Definition: EffectUI.cpp:859
Effect::HelpPage
virtual wxString HelpPage()
Definition: Effect.cpp:1176
Effect::GetFamily
EffectFamilySymbol GetFamily() override
Definition: Effect.cpp:192
MenuManager::ReportIfActionNotAllowed
bool ReportIfActionNotAllowed(const TranslatableString &Name, CommandFlag &flags, CommandFlag flagsRqd)
Definition: Menus.cpp:696
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const wxString &localFileName, const wxString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:238
EffectUIClientInterface::PopulateUI
virtual bool PopulateUI(ShuttleGui &S)=0
kUserPresetsDummyID
static const int kUserPresetsDummyID
Definition: EffectUI.cpp:682
EffectUIHost::mPlayDisabledBM
wxBitmap mPlayDisabledBM
Definition: EffectUI.h:200
_
#define _(s)
Definition: Internat.h:75
EffectUIHost::CreateBitmap
wxBitmap CreateBitmap(const char *const xpm[], bool up, bool pusher)
Definition: EffectUI.cpp:1668
Effect::GetDescription
TranslatableString GetDescription() override
Definition: Effect.cpp:182
EffectTypeAnalyze
@ EffectTypeAnalyze
Definition: EffectInterface.h:60
EffectUIClientInterface::CloseUI
virtual bool CloseUI()=0
eCloseButton
@ eCloseButton
Definition: ShuttleGui.h:604
TimeSelectedFlag
const ReservedCommandFlag & TimeSelectedFlag()
Definition: CommonCommandFlags.cpp:159
EffectUIHost::mRewindBtn
wxButton * mRewindBtn
Definition: EffectUI.h:192
kDefaultsID
static const int kDefaultsID
Definition: EffectUI.cpp:680
MenuManager::Get
static MenuManager & Get(AudacityProject &project)
Definition: Menus.cpp:69
kMenuID
static const int kMenuID
Definition: EffectUI.cpp:684
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
EffectUI::DoEffect
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1859
RTL_WORKAROUND
#define RTL_WORKAROUND(pWnd)
Definition: GUISettings.h:21
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
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
EffectUIHost::mPlayPos
double mPlayPos
Definition: EffectUI.h:211
ComponentInterface::GetName
TranslatableString GetName()
Definition: PluginManager.cpp:3245
EffectUIHost::mPlayToggleBtn
wxButton * mPlayToggleBtn
Definition: EffectUI.h:197
EffectUIHost::mCloseBtn
wxButton * mCloseBtn
Definition: EffectUI.h:189
Destroy_ptr
std::unique_ptr< T, Destroyer< T > > Destroy_ptr
a convenience for using Destroyer
Definition: MemoryX.h:289
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:505
EffectUIClientInterface::IsGraphicalUI
virtual bool IsGraphicalUI()=0
safenew
#define safenew
Definition: MemoryX.h:10
EffectUIClientInterface::ExportPresets
virtual void ExportPresets()=0
EffectUIClientInterface::HasOptions
virtual bool HasOptions()=0
EffectUIHost::UpdateControls
void UpdateControls()
Definition: EffectUI.cpp:1701
EffectUIHost::mNeedsResume
bool mNeedsResume
Definition: EffectUI.h:214
EffectUIHost::CleanupRealtime
void CleanupRealtime()
Definition: EffectUI.cpp:1809
kSaveAsID
static const int kSaveAsID
Definition: EffectUI.cpp:677
EffectUIHost::LoadUserPresets
void LoadUserPresets()
Definition: EffectUI.cpp:1779
Effect::GetVersion
wxString GetVersion() override
Definition: Effect.cpp:172
AudacityCommand::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: AudacityCommand.cpp:227
EffectUIClientInterface::ValidateUI
virtual bool ValidateUI()=0
AudacityCommand::TransferDataFromWindow
virtual bool TransferDataFromWindow()
Definition: AudacityCommand.cpp:234
EffectUIHost::mSupportsRealtime
bool mSupportsRealtime
Definition: EffectUI.h:184
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:625
Effect::LoadFactoryPreset
bool LoadFactoryPreset(int id) override
Definition: Effect.cpp:595
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:38