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 120 of file EffectUI.h.

Constructor & Destructor Documentation

◆ EffectUIHost() [1/2]

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

Definition at line 722 of file EffectUI.cpp.

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

◆ EffectUIHost() [2/2]

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

Definition at line 756 of file EffectUI.cpp.

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

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 793 of file EffectUI.cpp.

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

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 862 of file EffectUI.cpp.

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

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 1818 of file EffectUI.cpp.

1819 {
1821  {
1823 
1824  mInitialized = false;
1825  }
1826 }

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 1677 of file EffectUI.cpp.

1678 {
1679  wxMemoryDC dc;
1680  wxBitmap pic(xpm);
1681 
1682  wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6, 24);
1683  dc.SelectObject(mod);
1684 
1685 #if defined(__WXGTK__)
1686  wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND);
1687 #else
1688  wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
1689 #endif
1690 
1691  dc.SetBackground(wxBrush(newColour));
1692  dc.Clear();
1693 
1694  int offset = 3;
1695  if (pusher)
1696  {
1697  if (!up)
1698  {
1699  offset += 1;
1700  }
1701  }
1702 
1703  dc.DrawBitmap(pic, offset, offset, true);
1704 
1705  dc.SelectObject(wxNullBitmap);
1706 
1707  return mod;
1708 }

Referenced by BuildButtonBar().

Here is the caller graph for this function:

◆ DoCancel()

void EffectUIHost::DoCancel ( )
private

Definition at line 1216 of file EffectUI.cpp.

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

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 1001 of file EffectUI.cpp.

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

References BuildButtonBar(), eApplyButton, eCloseButton, eDebugButton, eHelpButton, eIsCreating, Identifier::empty(), entries, 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 1800 of file EffectUI.cpp.

1801 {
1803  {
1805 
1806  wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
1808  this);
1809 
1810  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
1812  this);
1813 
1814  mInitialized = true;
1815  }
1816 }

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 1788 of file EffectUI.cpp.

1789 {
1790  mUserPresets.clear();
1791 
1792  if( mEffect )
1794 
1795  std::sort( mUserPresets.begin(), mUserPresets.end() );
1796 
1797  return;
1798 }

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 1135 of file EffectUI.cpp.

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

References AlwaysEnabledFlag, AudacityCommand::Apply(), EffectUI::DoEffect(), EffectTypeGenerate, EffectTypeTool, ViewInfo::Get(), MenuManager::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 1231 of file EffectUI.cpp.

1232 {
1233  DoCancel();
1234  Close();
1235 }

References DoCancel().

Here is the call graph for this function:

◆ OnCapture()

void EffectUIHost::OnCapture ( wxCommandEvent &  evt)
private

Definition at line 1509 of file EffectUI.cpp.

1510 {
1511  evt.Skip();
1512 
1513  if (evt.GetInt() != 0)
1514  {
1515  if (evt.GetEventObject() != mProject)
1516  {
1517  mDisableTransport = true;
1518  }
1519  else
1520  {
1521  mCapturing = true;
1522  }
1523  }
1524  else
1525  {
1526  mDisableTransport = false;
1527  mCapturing = false;
1528  }
1529 
1530  UpdateControls();
1531 }

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 1119 of file EffectUI.cpp.

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

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 1251 of file EffectUI.cpp.

1252 {
1253  OnApply(evt);
1254  if( mEffect )
1255  mEffect->mUIResultID = evt.GetId();
1256 }

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

Here is the call graph for this function:

◆ OnDefaults()

void EffectUIHost::OnDefaults ( wxCommandEvent &  evt)
private

Definition at line 1670 of file EffectUI.cpp.

1671 {
1673 
1674  return;
1675 }

References Effect::LoadFactoryDefaults(), and mEffect.

Here is the call graph for this function:

◆ OnDeletePreset()

void EffectUIHost::OnDeletePreset ( wxCommandEvent &  evt)
private

Definition at line 1549 of file EffectUI.cpp.

1550 {
1551  auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
1552 
1553  int res = AudacityMessageBox(
1554  XO("Are you sure you want to delete \"%s\"?").Format( preset ),
1555  XO("Delete Preset"),
1556  wxICON_QUESTION | wxYES_NO);
1557  if (res == wxYES)
1558  {
1560  }
1561 
1562  LoadUserPresets();
1563 
1564  return;
1565 }

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 1366 of file EffectUI.cpp.

1367 {
1368  mEnabled = mEnableCb->GetValue();
1369 
1370  if (mEnabled) {
1371  Resume();
1372  mNeedsResume = false;
1373  }
1374  else
1375  {
1377  mNeedsResume = true;
1378  }
1379 
1380  UpdateControls();
1381 }

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 1107 of file EffectUI.cpp.

1108 {
1109  // Ignore it
1110 }

◆ OnExport()

void EffectUIHost::OnExport ( wxCommandEvent &  evt)
private

Definition at line 1654 of file EffectUI.cpp.

1655 {
1656  // may throw
1657  // exceptions are handled in AudacityApp::OnExceptionInMainLoop
1659 
1660  return;
1661 }

References EffectUIClientInterface::ExportPresets(), and mClient.

Here is the call graph for this function:

◆ OnFactoryPreset()

void EffectUIHost::OnFactoryPreset ( wxCommandEvent &  evt)
private

Definition at line 1542 of file EffectUI.cpp.

1543 {
1545 
1546  return;
1547 }

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

Here is the call graph for this function:

◆ OnFFwd()

void EffectUIHost::OnFFwd ( wxCommandEvent &  evt)
private

Definition at line 1456 of file EffectUI.cpp.

1457 {
1458  if (mPlaying)
1459  {
1460  double seek;
1461  gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
1462 
1463  auto gAudioIO = AudioIO::Get();
1464  double pos = gAudioIO->GetStreamTime();
1465  if (mRegion.t0() < mRegion.t1() && pos + seek > mRegion.t1())
1466  {
1467  seek = mRegion.t1() - pos;
1468  }
1469 
1470  gAudioIO->SeekStream(seek);
1471  }
1472  else
1473  {
1474  // It allows to play past end of selection...probably useless
1475  mPlayPos = mRegion.t1();
1476  }
1477 }

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 1237 of file EffectUI.cpp.

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

References Identifier::empty(), 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 1645 of file EffectUI.cpp.

1646 {
1648 
1649  LoadUserPresets();
1650 
1651  return;
1652 }

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

Here is the call graph for this function:

◆ OnInitDialog()

void EffectUIHost::OnInitDialog ( wxInitDialogEvent &  evt)
private

Definition at line 1084 of file EffectUI.cpp.

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

◆ OnMenu()

void EffectUIHost::OnMenu ( wxCommandEvent &  evt)
private

Definition at line 1258 of file EffectUI.cpp.

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

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, BasicMenu::Handle::Popup(), ComponentInterfaceSymbol::Translation(), and TranslatableString::Translation().

Here is the call graph for this function:

◆ OnOptions()

void EffectUIHost::OnOptions ( wxCommandEvent &  evt)
private

Definition at line 1663 of file EffectUI.cpp.

1664 {
1665  mClient->ShowOptions();
1666 
1667  return;
1668 }

References mClient, and EffectUIClientInterface::ShowOptions().

Here is the call graph for this function:

◆ OnPaint()

void EffectUIHost::OnPaint ( wxPaintEvent &  evt)
private

Definition at line 1112 of file EffectUI.cpp.

1113 {
1114  wxPaintDC dc(this);
1115 
1116  dc.Clear();
1117 }

◆ OnPlay()

void EffectUIHost::OnPlay ( wxCommandEvent &  evt)
private

Definition at line 1383 of file EffectUI.cpp.

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

References DefaultPlayOptions(), AudioIO::Get(), ViewInfo::Get(), ProjectAudioManager::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 1479 of file EffectUI.cpp.

1480 {
1481  evt.Skip();
1482 
1483  if (evt.GetInt() != 0)
1484  {
1485  if (evt.GetEventObject() != mProject)
1486  {
1487  mDisableTransport = true;
1488  }
1489  else
1490  {
1491  mPlaying = true;
1492  }
1493  }
1494  else
1495  {
1496  mDisableTransport = false;
1497  mPlaying = false;
1498  }
1499 
1500  if (mPlaying)
1501  {
1502  mRegion = ViewInfo::Get( *mProject ).selectedRegion;
1503  mPlayPos = mRegion.t0();
1504  }
1505 
1506  UpdateControls();
1507 }

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 1434 of file EffectUI.cpp.

1435 {
1436  if (mPlaying)
1437  {
1438  auto gAudioIO = AudioIO::Get();
1439  double seek;
1440  gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
1441 
1442  double pos = gAudioIO->GetStreamTime();
1443  if (pos - seek < mRegion.t0())
1444  {
1445  seek = pos - mRegion.t0();
1446  }
1447 
1448  gAudioIO->SeekStream(-seek);
1449  }
1450  else
1451  {
1452  mPlayPos = mRegion.t0();
1453  }
1454 }

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 1567 of file EffectUI.cpp.

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

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 1533 of file EffectUI.cpp.

1534 {
1535  int preset = evt.GetId() - kUserPresetsID;
1536 
1538 
1539  return;
1540 }

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 1351 of file EffectUI.cpp.

1352 {
1353  if (!mClient->ValidateUI()) {
1354  // If we're previewing we should still be able to stop playback
1355  // so don't disable transport buttons.
1356  // mEffect->EnableApply(false); // currently this would also disable transport buttons.
1357  // The preferred behaviour is currently undecided, so for now
1358  // just disallow enabling until settings are valid.
1359  mEnabled = false;
1360  mEnableCb->SetValue(mEnabled);
1361  return;
1362  }
1364 }

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 833 of file EffectUI.cpp.

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

References mApplyBtn, mCloseBtn, and safenew.

◆ TransferDataFromWindow()

bool EffectUIHost::TransferDataFromWindow ( )
override

Definition at line 820 of file EffectUI.cpp.

821 {
822  if( mEffect)
824  if( mCommand)
826  return false;
827 }

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

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectUIHost::TransferDataToWindow ( )
override

Definition at line 811 of file EffectUI.cpp.

812 {
813  if( mEffect )
814  return mEffect->TransferDataToWindow();
815  if( mCommand )
816  return mCommand->TransferDataToWindow();
817  return false;
818 }

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

Here is the call graph for this function:

◆ UpdateControls()

void EffectUIHost::UpdateControls ( )
private

Definition at line 1710 of file EffectUI.cpp.

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

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 191 of file EffectUI.h.

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

◆ mCapturing

bool EffectUIHost::mCapturing
private

Definition at line 211 of file EffectUI.h.

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

◆ mClient

EffectUIClientInterface* EffectUIHost::mClient
private

◆ mCloseBtn

wxButton* EffectUIHost::mCloseBtn
private

Definition at line 192 of file EffectUI.h.

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

◆ mCommand

AudacityCommand* EffectUIHost::mCommand
private

◆ mDisableTransport

bool EffectUIHost::mDisableTransport
private

Definition at line 209 of file EffectUI.h.

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

◆ mDismissed

bool EffectUIHost::mDismissed {}
private

Definition at line 216 of file EffectUI.h.

Referenced by DoCancel(), and OnApply().

◆ mEffect

Effect* EffectUIHost::mEffect
private

◆ mEnableCb

wxCheckBox* EffectUIHost::mEnableCb
private

Definition at line 197 of file EffectUI.h.

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

◆ mEnabled

bool EffectUIHost::mEnabled
private

Definition at line 207 of file EffectUI.h.

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

◆ mEnableToggleBtn

wxButton* EffectUIHost::mEnableToggleBtn
private

Definition at line 199 of file EffectUI.h.

◆ mFFwdBtn

wxButton* EffectUIHost::mFFwdBtn
private

Definition at line 196 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mInitialized

bool EffectUIHost::mInitialized
private

Definition at line 186 of file EffectUI.h.

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

◆ mIsBatch

bool EffectUIHost::mIsBatch
private

Definition at line 189 of file EffectUI.h.

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

◆ mIsGUI

bool EffectUIHost::mIsGUI
private

Definition at line 188 of file EffectUI.h.

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

◆ mMenuBtn

wxButton* EffectUIHost::mMenuBtn
private

Definition at line 193 of file EffectUI.h.

Referenced by BuildButtonBar().

◆ mNeedsResume

bool EffectUIHost::mNeedsResume {}
private

Definition at line 217 of file EffectUI.h.

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

◆ mParent

wxWindow* EffectUIHost::mParent
private

Definition at line 180 of file EffectUI.h.

Referenced by EffectUIHost(), and Initialize().

◆ mPlayBM

wxBitmap EffectUIHost::mPlayBM
private

Definition at line 202 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mPlayBtn

wxButton* EffectUIHost::mPlayBtn
private

Definition at line 194 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mPlayDisabledBM

wxBitmap EffectUIHost::mPlayDisabledBM
private

Definition at line 203 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mPlaying

bool EffectUIHost::mPlaying
private

Definition at line 210 of file EffectUI.h.

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

◆ mPlayPos

double EffectUIHost::mPlayPos
private

Definition at line 214 of file EffectUI.h.

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

◆ mPlayToggleBtn

wxButton* EffectUIHost::mPlayToggleBtn
private

Definition at line 200 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mProject

AudacityProject* EffectUIHost::mProject
private

Definition at line 179 of file EffectUI.h.

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

◆ mRegion

SelectedRegion EffectUIHost::mRegion
private

Definition at line 213 of file EffectUI.h.

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

◆ mRewindBtn

wxButton* EffectUIHost::mRewindBtn
private

Definition at line 195 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mStopBM

wxBitmap EffectUIHost::mStopBM
private

Definition at line 204 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mStopDisabledBM

wxBitmap EffectUIHost::mStopDisabledBM
private

Definition at line 205 of file EffectUI.h.

Referenced by BuildButtonBar(), and UpdateControls().

◆ mSupportsRealtime

bool EffectUIHost::mSupportsRealtime
private

◆ mUserPresets

RegistryPaths EffectUIHost::mUserPresets
private

Definition at line 185 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:204
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:241
EffectUIHost::mIsBatch
bool mIsBatch
Definition: EffectUI.h:189
EffectUIHost::mDisableTransport
bool mDisableTransport
Definition: EffectUI.h:209
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
kDeletePresetID
static const int kDeletePresetID
Definition: EffectUI.cpp:695
kImportID
static const int kImportID
Definition: EffectUI.cpp:681
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:551
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:55
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
ComponentInterfaceSymbol::Translation
const wxString Translation() const
Definition: ComponentInterfaceSymbol.h:58
Effect::ManualPage
virtual ManualPageID ManualPage()
Definition: Effect.cpp:1172
kRewindID
static const int kRewindID
Definition: EffectUI.cpp:690
entries
static ProjectFileIORegistry::AttributeReaderEntries entries
Definition: ProjectSettings.cpp:210
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
SelectedRegion::t1
double t1() const
Definition: SelectedRegion.h:92
Effect::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: Effect.cpp:1916
eHelpButton
@ eHelpButton
Definition: ShuttleGui.h:604
EffectUIHost::DoCancel
void DoCancel()
Definition: EffectUI.cpp:1216
Effect::SupportsRealtime
bool SupportsRealtime() override
Definition: Effect.cpp:235
Effect::GetID
virtual PluginID GetID()
Definition: Effect.cpp:1024
wxPanelWrapper
Definition: wxPanelWrapper.h:41
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:58
Effect::mUIResultID
int mUIResultID
Definition: Effect.h:479
EffectUIClientInterface::ImportPresets
virtual void ImportPresets()=0
EffectUIHost::mEffect
Effect * mEffect
Definition: EffectUI.h:181
Format
Abstract base class used in importing a file.
kFactoryPresetsID
static const int kFactoryPresetsID
Definition: EffectUI.cpp:696
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:1135
Effect::LoadUserPreset
bool LoadUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:554
EffectManager::kConfigured
@ kConfigured
Definition: EffectManager.h:53
EffectUIHost::mMenuBtn
wxButton * mMenuBtn
Definition: EffectUI.h:193
XO
#define XO(s)
Definition: Internat.h:31
SelectedRegion::setTimes
bool setTimes(double t0, double t1)
Definition: SelectedRegion.h:136
kPlayID
static const int kPlayID
Definition: EffectUI.cpp:689
NYQUISTEFFECTS_FAMILY
#define NYQUISTEFFECTS_FAMILY
Definition: Effect.h:60
eDebugButton
@ eDebugButton
Definition: ShuttleGui.h:606
Effect::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: Effect.cpp:1190
kUserPresetsID
static const int kUserPresetsID
Definition: EffectUI.cpp:694
AlwaysEnabledFlag
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:35
Effect::GetUserPresetsGroup
RegistryPath GetUserPresetsGroup(const RegistryPath &name) override
Definition: Effect.cpp:855
EffectUIHost::mInitialized
bool mInitialized
Definition: EffectUI.h:186
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:570
EffectUIHost::Resume
void Resume()
Definition: EffectUI.cpp:1351
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
Effect::GetPrivateConfigSubgroups
bool GetPrivateConfigSubgroups(const RegistryPath &group, RegistryPaths &paths) override
Definition: Effect.cpp:957
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:1921
EffectUIHost::OnPlayback
void OnPlayback(wxCommandEvent &evt)
Definition: EffectUI.cpp:1479
eApplyButton
@ eApplyButton
Definition: ShuttleGui.h:609
EffectUIHost::mCapturing
bool mCapturing
Definition: EffectUI.h:211
wxWidgetsWindowPlacement
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.
Definition: wxWidgetsWindowPlacement.h:22
kDummyID
static const int kDummyID
Definition: EffectUI.cpp:679
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
kFFwdID
static const int kFFwdID
Definition: EffectUI.cpp:691
kExportID
static const int kExportID
Definition: EffectUI.cpp:682
RealtimeEffectManager::RealtimeSuspendOne
void RealtimeSuspendOne(EffectClientInterface &effect)
Definition: RealtimeEffectManager.cpp:238
kOptionsID
static const int kOptionsID
Definition: EffectUI.cpp:684
EffectUIHost::mEnableCb
wxCheckBox * mEnableCb
Definition: EffectUI.h:197
EffectUIHost::mFFwdBtn
wxButton * mFFwdBtn
Definition: EffectUI.h:196
EffectUIClientInterface::ShowOptions
virtual void ShowOptions()=0
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:229
XXO
#define XXO(s)
Definition: Internat.h:44
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:817
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:34
EffectUIHost::mStopDisabledBM
wxBitmap mStopDisabledBM
Definition: EffectUI.h:205
EffectUIHost::mDismissed
bool mDismissed
Definition: EffectUI.h:216
label
TranslatableString label
Definition: Tags.cpp:756
Effect::GetFactoryPresets
RegistryPaths GetFactoryPresets() override
Definition: Effect.cpp:586
EffectUIHost::mParent
wxWindow * mParent
Definition: EffectUI.h:180
EffectUIHost::InitializeRealtime
void InitializeRealtime()
Definition: EffectUI.cpp:1800
AudacityCommand::Apply
virtual bool Apply(const CommandContext &WXUNUSED(context))
Definition: AudacityCommand.h:72
EffectUIHost::mProject
AudacityProject * mProject
Definition: EffectUI.h:179
EffectUIHost::mRegion
SelectedRegion mRegion
Definition: EffectUI.h:213
Effect::LoadFactoryDefaults
bool LoadFactoryDefaults() override
Definition: Effect.cpp:606
RealtimeEffectManager::RealtimeAddEffect
void RealtimeAddEffect(EffectClientInterface *effect)
Definition: RealtimeEffectManager.cpp:113
kDeletePresetDummyID
static const int kDeletePresetDummyID
Definition: EffectUI.cpp:686
EffectUIHost::mClient
EffectUIClientInterface * mClient
Definition: EffectUI.h:183
Effect::GetType
EffectType GetType() override
Definition: Effect.cpp:133
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
EffectUIHost::mPlaying
bool mPlaying
Definition: EffectUI.h:210
kEnableID
static const int kEnableID
Definition: EffectUI.cpp:688
EffectPanel
Definition: EffectUI.cpp:602
EffectUIHost::mEnabled
bool mEnabled
Definition: EffectUI.h:207
Effect::RemovePrivateConfigSubgroup
bool RemovePrivateConfigSubgroup(const RegistryPath &group) override
Definition: Effect.cpp:1012
RealtimeEffectManager::RealtimeRemoveEffect
void RealtimeRemoveEffect(EffectClientInterface *effect)
Definition: RealtimeEffectManager.cpp:140
DefaultPlayOptions
AudioIOStartStreamOptions DefaultPlayOptions(AudacityProject &project, bool looped)
Definition: ProjectAudioManager.cpp:1162
EffectUIHost::OnCapture
void OnCapture(wxCommandEvent &evt)
Definition: EffectUI.cpp:1509
Effect::mUIDebug
bool mUIDebug
Definition: Effect.h:519
EffectUIClientInterface::SetHostUI
virtual void SetHostUI(EffectUIHostInterface *host)=0
RealtimeEffectManager::Get
static RealtimeEffectManager & Get()
Definition: RealtimeEffectManager.cpp:43
EffectUIHost::mApplyBtn
wxButton * mApplyBtn
Definition: EffectUI.h:191
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:866
Effect::Preview
virtual void Preview(bool dryOnly)
Definition: Effect.cpp:2295
EffectUIHost::mIsGUI
bool mIsGUI
Definition: EffectUI.h:188
Effect::GetVendor
VendorSymbol GetVendor() override
Definition: Effect.cpp:163
EffectUIHost::mUserPresets
RegistryPaths mUserPresets
Definition: EffectUI.h:185
wxDialogWrapper
Definition: wxPanelWrapper.h:81
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:91
EffectUIHost::mPlayBM
wxBitmap mPlayBM
Definition: EffectUI.h:202
EffectUIHost::BuildButtonBar
wxPanel * BuildButtonBar(wxWindow *parent)
Definition: EffectUI.cpp:862
Effect::GetFamily
EffectFamilySymbol GetFamily() override
Definition: Effect.cpp:193
MenuManager::ReportIfActionNotAllowed
bool ReportIfActionNotAllowed(const TranslatableString &Name, CommandFlag &flags, CommandFlag flagsRqd)
Definition: Menus.cpp:697
EffectUIClientInterface::PopulateUI
virtual bool PopulateUI(ShuttleGui &S)=0
kUserPresetsDummyID
static const int kUserPresetsDummyID
Definition: EffectUI.cpp:685
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:1677
Effect::GetDescription
TranslatableString GetDescription() override
Definition: Effect.cpp:183
EffectTypeAnalyze
@ EffectTypeAnalyze
Definition: EffectInterface.h:60
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:683
Effect::HelpPage
virtual FilePath HelpPage()
Definition: Effect.cpp:1177
MenuManager::Get
static MenuManager & Get(AudacityProject &project)
Definition: Menus.cpp:70
kMenuID
static const int kMenuID
Definition: EffectUI.cpp:687
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:1868
RTL_WORKAROUND
#define RTL_WORKAROUND(pWnd)
Definition: GUISettings.h:16
EffectUIClientInterface::CanExportPresets
virtual bool CanExportPresets()=0
NotifyingSelectedRegion::isPoint
bool isPoint() const
Definition: ViewInfo.h:52
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:214
ComponentInterface::GetName
TranslatableString GetName()
Definition: PluginManager.cpp:2083
EffectUIHost::mPlayToggleBtn
wxButton * mPlayToggleBtn
Definition: EffectUI.h:200
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:141
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:1710
EffectUIHost::mNeedsResume
bool mNeedsResume
Definition: EffectUI.h:217
BasicMenu::Handle::Popup
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
Definition: BasicMenu.cpp:207
EffectUIHost::CleanupRealtime
void CleanupRealtime()
Definition: EffectUI.cpp:1818
kSaveAsID
static const int kSaveAsID
Definition: EffectUI.cpp:680
EffectUIHost::LoadUserPresets
void LoadUserPresets()
Definition: EffectUI.cpp:1788
Effect::GetVersion
wxString GetVersion() override
Definition: Effect.cpp:173
AudacityCommand::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: AudacityCommand.cpp:227
Identifier::empty
bool empty() const
Definition: Identifier.h:61
EffectUIClientInterface::ValidateUI
virtual bool ValidateUI()=0
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
Effect::LoadFactoryPreset
bool LoadFactoryPreset(int id) override
Definition: Effect.cpp:596
BasicMenu::Handle
Definition: BasicMenu.h:26
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:35