Audacity  2.2.2
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PluginRegistrationDialog Class Referencefinal
Inheritance diagram for PluginRegistrationDialog:
wxDialogWrapper wxTabTraversalWrapper< wxDialog >

Public Member Functions

 PluginRegistrationDialog (wxWindow *parent, EffectType type)
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&...args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void Populate ()
 
void PopulateOrExchange (ShuttleGui &S)
 Defines the dialog and does data exchange with it. More...
 
void RegenerateEffectsList (int iShowWhat)
 
void SetState (int i, bool toggle, bool state=true)
 
int SortCompare (ItemData *item1, ItemData *item2)
 
void OnChangedVisibility (wxCommandEvent &evt)
 
void OnSort (wxListEvent &evt)
 
void OnListChar (wxKeyEvent &evt)
 
void OnOK (wxCommandEvent &evt)
 
void OnCancel (wxCommandEvent &evt)
 
void OnSelectAll (wxCommandEvent &evt)
 
void OnClearAll (wxCommandEvent &evt)
 
void OnEnable (wxCommandEvent &evt)
 
void OnDisable (wxCommandEvent &evt)
 

Static Private Member Functions

static int wxCALLBACK SortCompare (long item1, long item2, long sortData)
 

Private Attributes

ModuleInterfacemMod
 
EffectType mType
 
int mFilter
 
wxArrayString mStates
 
ItemDataMap mItems
 
int mSortColumn
 
int mSortDirection
 
wxString mLongestPath
 
wxListCtrl * mEffects
 

Detailed Description

Definition at line 424 of file PluginManager.cpp.

Constructor & Destructor Documentation

PluginRegistrationDialog::PluginRegistrationDialog ( wxWindow *  parent,
EffectType  type 
)

Definition at line 484 of file PluginManager.cpp.

References _(), COL_Name, STATE_COUNT, STATE_Disabled, STATE_Enabled, and STATE_New.

485 : wxDialogWrapper(parent,
486  wxID_ANY,
487  _("Manage Plug-ins"),
488  wxDefaultPosition, wxDefaultSize,
489  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
490 {
491  mType = type;
492  mEffects = NULL;
493  SetName(GetTitle());
494 
495  mStates.SetCount(STATE_COUNT);
496  mStates[STATE_Enabled] = _("Enabled");
497  mStates[STATE_Disabled] = _("Disabled");
498  mStates[STATE_New] = _("New");
499 
501  mSortDirection = 1;
502 
503  Populate();
504 }
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand

Member Function Documentation

void PluginRegistrationDialog::OnCancel ( wxCommandEvent &  evt)
private

Definition at line 1055 of file PluginManager.cpp.

1056 {
1057  EndModal(wxID_CANCEL);
1058 }
void PluginRegistrationDialog::OnChangedVisibility ( wxCommandEvent &  evt)
private

Definition at line 858 of file PluginManager.cpp.

References RegenerateEffectsList().

859 {
860  // Go and show the relevant items.
861  RegenerateEffectsList(evt.GetId());
862 }
void RegenerateEffectsList(int iShowWhat)
void PluginRegistrationDialog::OnClearAll ( wxCommandEvent &  evt)
private

Definition at line 915 of file PluginManager.cpp.

References mEffects.

916 {
917  for (int i = 0, cnt = mEffects->GetItemCount(); i < cnt; i++)
918  {
919  mEffects->SetItemState(i, 0, wxLIST_STATE_SELECTED);
920  }
921 }
void PluginRegistrationDialog::OnDisable ( wxCommandEvent &  evt)
private

Definition at line 940 of file PluginManager.cpp.

References mEffects, SetState(), and STATE_Disabled.

941 {
942  std::vector<long> items;
943 
944  long i = mEffects->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
945  while (i != wxNOT_FOUND)
946  {
947  items.insert(items.begin(), i);
948  i = mEffects->GetNextItem(i, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
949  }
950 
951  for (size_t i = 0, cnt = items.size(); i < cnt; i++)
952  {
953  SetState(items[i], false, STATE_Disabled);
954  }
955 }
void SetState(int i, bool toggle, bool state=true)
void PluginRegistrationDialog::OnEnable ( wxCommandEvent &  evt)
private

Definition at line 923 of file PluginManager.cpp.

References mEffects, SetState(), and STATE_Enabled.

924 {
925  std::vector<long> items;
926 
927  long i = mEffects->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
928  while (i != wxNOT_FOUND)
929  {
930  items.insert(items.begin(), i);
931  i = mEffects->GetNextItem(i, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
932  }
933 
934  for (size_t i = 0, cnt = items.size(); i < cnt; i++)
935  {
936  SetState(items[i], false, STATE_Enabled);
937  }
938 }
void SetState(int i, bool toggle, bool state=true)
void PluginRegistrationDialog::OnListChar ( wxKeyEvent &  evt)
private

Definition at line 881 of file PluginManager.cpp.

References mEffects, and SetState().

Referenced by PopulateOrExchange().

882 {
883  switch (evt.GetKeyCode())
884  {
885  case WXK_SPACE:
886  {
887  int item = mEffects->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED);
888  if (item != wxNOT_FOUND)
889  {
890  SetState(item, true);
891  }
892  }
893  break;
894 
895  case WXK_RETURN:
896  // Don't know why wxListCtrls prevent default dialog action,
897  // but they do, so handle it.
898  EmulateButtonClickIfPresent(GetAffirmativeId());
899  break;
900 
901  default:
902  evt.Skip();
903  break;
904  }
905 }
void SetState(int i, bool toggle, bool state=true)
void PluginRegistrationDialog::OnOK ( wxCommandEvent &  evt)
private

Definition at line 957 of file PluginManager.cpp.

References _(), AudacityMessageBox(), Cancelled, ModuleManager::Get(), PluginManager::Get(), mItems, mLongestPath, PluginManager::mPlugins, ItemData::path, pdlgHideStopButton, PluginTypeStub, ItemData::plugs, ModuleManager::RegisterEffectPlugin(), PluginManager::Save(), ItemData::state, STATE_Enabled, STATE_New, ProgressDialog::Update(), and ItemData::valid.

958 {
961 
962  int enableCount = 0;
963  for (ItemDataMap::iterator iter = mItems.begin(); iter != mItems.end(); ++iter)
964  {
965  ItemData & item = iter->second;
966  wxString path = item.path;
967 
968  if (item.state == STATE_Enabled && item.plugs[0]->GetPluginType() == PluginTypeStub)
969  {
970  enableCount++;
971  }
972  }
973 
974  wxString last3 = mLongestPath + wxT("\n") +
975  mLongestPath + wxT("\n") +
976  mLongestPath + wxT("\n");
977 
978  wxString msg;
979 
980  msg.Printf(_("Enabling effects or commands:\n\n%s"), last3);
981 
982  // Make sure the progress dialog is deleted before we call EndModal() or
983  // we will leave the project window in an unusable state on OSX.
984  // See bug #1192.
985  {
986  ProgressDialog progress(GetTitle(), msg, pdlgHideStopButton);
987  progress.CenterOnParent();
988 
989  int i = 0;
990  for (ItemDataMap::iterator iter = mItems.begin(); iter != mItems.end(); ++iter)
991  {
992  ItemData & item = iter->second;
993  wxString path = item.path;
994 
995  if (item.state == STATE_Enabled && item.plugs[0]->GetPluginType() == PluginTypeStub)
996  {
997  last3 = last3.AfterFirst(wxT('\n')) + item.path + wxT("\n");
998  auto status = progress.Update(++i, enableCount, wxString::Format(_("Enabling effect or command:\n\n%s"), last3));
999  if (status == ProgressResult::Cancelled)
1000  {
1001  break;
1002  }
1003 
1004  wxString errMsgs;
1005 
1006  // Try to register the plugin via each provider until one succeeds
1007  for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
1008  {
1009  wxString errMsg;
1010  if (mm.RegisterEffectPlugin(item.plugs[j]->GetProviderID(), path,
1011  errMsg))
1012  {
1013  for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
1014  {
1015  pm.mPlugins.erase(item.plugs[j]->GetProviderID() + wxT("_") + path);
1016  }
1017  break;
1018  }
1019  else
1020  {
1021  if (errMsgs.empty())
1022  errMsgs += '\n';
1023  errMsgs += errMsg;
1024  }
1025  }
1026  if (!errMsgs.empty())
1027  AudacityMessageBox( wxString::Format(
1028  _("Effect or Command at %s failed to register:\n%s"),
1029  path, errMsgs
1030  ) );
1031  }
1032  else if (item.state == STATE_New)
1033  {
1034  for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
1035  {
1036  item.plugs[j]->SetValid(false);
1037  }
1038  }
1039  else if (item.state != STATE_New)
1040  {
1041  for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
1042  {
1043  item.plugs[j]->SetEnabled(item.state == STATE_Enabled);
1044  item.plugs[j]->SetValid(item.valid);
1045  }
1046  }
1047  }
1048 
1049  pm.Save();
1050  }
1051 
1052  EndModal(wxID_OK);
1053 }
ProgressDialog Class.
static ModuleManager & Get()
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
std::vector< PluginDescriptor * > plugs
wxString path
PluginMap mPlugins
PluginManager maintains a list of all plug ins. That covers modules, effects, generators, analysis-effects, commands. It also has functions for shared and private configs - which need to move out.
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
bool RegisterEffectPlugin(const PluginID &provider, const wxString &path, wxString &errMsg)
static PluginManager & Get()
void PluginRegistrationDialog::OnSelectAll ( wxCommandEvent &  evt)
private

Definition at line 907 of file PluginManager.cpp.

References mEffects.

908 {
909  for (int i = 0, cnt = mEffects->GetItemCount(); i < cnt; i++)
910  {
911  mEffects->SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
912  }
913 }
void PluginRegistrationDialog::OnSort ( wxListEvent &  evt)
private

Definition at line 864 of file PluginManager.cpp.

References mEffects, mSortColumn, mSortDirection, and SortCompare().

865 {
866  int col = evt.GetColumn();
867 
868  if (col != mSortColumn)
869  {
870  mSortDirection = 1;
871  }
872  else
873  {
874  mSortDirection *= -1;
875  }
876 
877  mSortColumn = col;
878  mEffects->SortItems(SortCompare, (wxUIntPtr) this);
879 }
static int wxCALLBACK SortCompare(long item1, long item2, long sortData)
void PluginRegistrationDialog::Populate ( )
private

Definition at line 506 of file PluginManager.cpp.

References eIsCreating, and PopulateOrExchange().

507 {
508  //------------------------- Main section --------------------
509  ShuttleGui S(this, eIsCreating);
511  // ----------------------- End of main section --------------
512 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
void PopulateOrExchange(ShuttleGui &S)
Defines the dialog and does data exchange with it.
void PluginRegistrationDialog::PopulateOrExchange ( ShuttleGui S)
private

Defines the dialog and does data exchange with it.

Definition at line 515 of file PluginManager.cpp.

References _(), ShuttleGuiBase::AddButton(), ShuttleGuiBase::AddListControlReportMode(), ShuttleGuiBase::AddPrompt(), ShuttleGuiBase::AddRadioButton(), ShuttleGuiBase::AddRadioButtonToGroup(), ShuttleGui::AddSpace(), ShuttleGui::AddStandardButtons(), COL_Name, COL_Path, COL_State, eCancelButton, ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndVerticalLay(), eOkButton, PluginManager::Get(), PluginDescriptor::GetPath(), PluginDescriptor::GetPluginType(), PluginDescriptor::GetSymbol(), ShuttleGui::Id(), ID_ClearAll, ID_Disable, ID_Enable, ID_List, ID_SelectAll, ID_ShowAll, ID_ShowDisabled, ID_ShowEnabled, ID_ShowNew, PluginDescriptor::IsEnabled(), PluginDescriptor::IsValid(), mEffects, mItems, mLongestPath, PluginManager::mPlugins, mStates, ItemData::name, OnListChar(), ItemData::path, PluginTypeEffect, PluginTypeStub, ItemData::plugs, RegenerateEffectsList(), safenew, ShuttleGuiBase::SetStyle(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartVerticalLay(), ItemData::state, STATE_Disabled, STATE_Enabled, STATE_New, IdentInterfaceSymbol::Translation(), and ItemData::valid.

Referenced by Populate().

516 {
517  S.StartVerticalLay(true);
518  {
519  /*i18n-hint: The dialog shows a list of plugins with check-boxes
520  beside each one.*/
521 // S.StartStatic(_("Effects"), true);
522  S.StartVerticalLay();
523  {
524  S.StartHorizontalLay(wxEXPAND, 0);
525  {
526  S.StartHorizontalLay(wxALIGN_LEFT, 0);
527  {
528  S.AddPrompt(_("Select effects, click the Enable or Disable button, then click OK."));
529  }
530  S.EndHorizontalLay();
531 
532  S.StartHorizontalLay(wxCENTER, 1);
533  {
534  S.AddSpace(1);
535  }
536  S.EndHorizontalLay();
537 
538  S.StartHorizontalLay(wxALIGN_NOT | wxALIGN_LEFT, 0);
539  {
540  wxRadioButton* rb;
541  /* i18n-hint: This is before radio buttons selecting which effects to show */
542  S.AddPrompt(_("Show:"));
543  /* i18n-hint: Radio button to show all effects */
544  rb = S.Id(ID_ShowAll).AddRadioButton(_("&All"));
545 #if wxUSE_ACCESSIBILITY
546  // so that name can be set on a standard control
547  rb->SetAccessible(safenew WindowAccessible(rb));
548 #endif
549  rb->SetName(_("Show all"));
550  /* i18n-hint: Radio button to show just the currently disabled effects */
551  rb = S.Id(ID_ShowDisabled).AddRadioButtonToGroup(_("D&isabled"));
552 #if wxUSE_ACCESSIBILITY
553  // so that name can be set on a standard control
554  rb->SetAccessible(safenew WindowAccessible(rb));
555 #endif
556  rb->SetName(_("Show disabled"));
557  /* i18n-hint: Radio button to show just the currently enabled effects */
558  rb = S.Id(ID_ShowEnabled).AddRadioButtonToGroup(_("E&nabled"));
559 #if wxUSE_ACCESSIBILITY
560  // so that name can be set on a standard control
561  rb->SetAccessible(safenew WindowAccessible(rb));
562 #endif
563  rb->SetName(_("Show enabled"));
564  /* i18n-hint: Radio button to show just the newly discovered effects */
565  rb = S.Id(ID_ShowNew).AddRadioButtonToGroup(_("Ne&w"));
566 #if wxUSE_ACCESSIBILITY
567  // so that name can be set on a standard control
568  rb->SetAccessible(safenew WindowAccessible(rb));
569 #endif
570  rb->SetName(_("Show new"));
571  }
572  S.EndHorizontalLay();
573  }
574  S.EndHorizontalLay();
575 
576  S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES );
578  mEffects->Bind(wxEVT_KEY_DOWN,
580  this);
581 #if wxUSE_ACCESSIBILITY
582  mEffects->SetAccessible(mAx = safenew CheckListAx(mEffects));
583 #endif
584  mEffects->InsertColumn(COL_Name, _("Name"));
585  mEffects->InsertColumn(COL_State, _("State"));
586  mEffects->InsertColumn(COL_Path, _("Path"));
587 
588  S.StartHorizontalLay(wxALIGN_LEFT | wxEXPAND, 0);
589  {
590  S.Id(ID_SelectAll).AddButton(_("&Select All"));
591  S.Id(ID_ClearAll).AddButton(_("C&lear All"));
592 
593  S.StartHorizontalLay(wxALIGN_CENTER);
594  {
595  S.AddSpace(1);
596  }
597  S.EndHorizontalLay();
598 
599  S.Id(ID_Enable).AddButton(_("&Enable"));
600  S.Id(ID_Disable).AddButton(_("&Disable"));
601  }
602  S.EndHorizontalLay();
603  }
604 // S.EndStatic();
605  S.EndVerticalLay();
606 
608  }
609  S.EndVerticalLay();
610 
611  std::vector<int> colWidths;
612  for (int i = 0, cnt = mEffects->GetColumnCount(); i < cnt; i++)
613  {
614  colWidths.push_back(0);
615  }
616 
617  for (int i = 0, cnt = mStates.GetCount(); i < cnt; i++)
618  {
619  int x;
620  mEffects->GetTextExtent(mStates[i], &x, NULL);
621  colWidths[COL_State] = wxMax(colWidths[COL_State], x + 4); // 2 pixel margin on each side
622  }
623 
625  for (PluginMap::iterator iter = pm.mPlugins.begin(); iter != pm.mPlugins.end(); ++iter)
626  {
627  PluginDescriptor & plug = iter->second;
628 
629  PluginType plugType = plug.GetPluginType();
630  if (plugType != PluginTypeEffect && plugType != PluginTypeStub)
631  {
632  continue;
633  }
634 
635  const wxString &path = plug.GetPath();
636  ItemData & item = mItems[path]; // will create NEW entry
637  item.plugs.push_back(&plug);
638  item.path = path;
639  item.state = plug.IsEnabled() ? STATE_Enabled : STATE_Disabled;
640  item.valid = plug.IsValid();
641 
642  if (plugType == PluginTypeEffect)
643  {
644  item.name = plug.GetSymbol().Translation();
645  }
646  // This is not right and will not work when other plugin types are added.
647  // But it's presumed that the plugin manager dialog will be fully developed
648  // by then.
649  else if (plugType == PluginTypeStub)
650  {
651  wxFileName fname = path;
652  item.name = fname.GetName().Trim(false).Trim(true);
653  if (!item.valid)
654  {
655  item.state = STATE_New;
656  }
657  }
658 
659  int x;
660  mEffects->GetTextExtent(item.name, &x, NULL);
661  colWidths[COL_Name] = wxMax(colWidths[COL_Name], x);
662 
663  mEffects->GetTextExtent(item.path, &x, NULL);
664  if (x > colWidths[COL_Path])
665  {
666  mLongestPath = item.path;
667  }
668  colWidths[COL_Path] = wxMax(colWidths[COL_Path], x);
669  }
670 
671  wxRect r = wxGetClientDisplayRect();
672 
673  int maxW = 0;
674  for (int i = 0, cnt = mEffects->GetColumnCount(); i < cnt; i++)
675  {
676  int w = colWidths[i] + /* fudge */ 10;
677  mEffects->SetColumnWidth(i, w);
678  maxW += w;
679  }
680 
681  // Keep dialog from getting too wide
682  int w = r.GetWidth() - (GetClientSize().GetWidth() - mEffects->GetSize().GetWidth());
683  mEffects->SetSizeHints(wxSize(wxMin(maxW, w), 200), wxSize(w, -1));
684 
686 
687  Layout();
688  Fit();
689 
690  wxSize sz = GetSize();
691  sz.SetWidth(wxMin(sz.GetWidth(), r.GetWidth()));
692  sz.SetHeight(wxMin(sz.GetHeight(), r.GetHeight()));
693  SetMinSize(sz);
694 
695  // Parent window is usually not there yet, so centre on screen rather than on parent.
696  CenterOnScreen();
697 
698  if (mEffects->GetItemCount() > 0)
699  {
700  // Make sure first item is selected/focused.
701  mEffects->SetFocus();
702  mEffects->SetItemState(0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED);
703 #if wxUSE_ACCESSIBILITY
704  mAx->SetSelected(0);
705 #endif
706  }
707 
708 }
PluginType
Definition: PluginManager.h:32
void RegenerateEffectsList(int iShowWhat)
std::vector< PluginDescriptor * > plugs
#define safenew
Definition: Audacity.h:230
const wxString & Translation() const
void EndHorizontalLay()
const wxString & GetPath() const
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
void EndVerticalLay()
wxString path
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
wxListCtrl * AddListControlReportMode()
Definition: ShuttleGui.cpp:689
PluginMap mPlugins
ShuttleGui & Id(int id)
void SetStyle(int Style)
Definition: ShuttleGui.h:287
void OnListChar(wxKeyEvent &evt)
const IdentInterfaceSymbol & GetSymbol() const
PluginManager maintains a list of all plug ins. That covers modules, effects, generators, analysis-effects, commands. It also has functions for shared and private configs - which need to move out.
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxString name
wxRadioButton * AddRadioButtonToGroup(const wxString &Prompt)
Definition: ShuttleGui.cpp:484
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxButton *extra=NULL)
PluginType GetPluginType() const
bool IsValid() const
wxSizerItem * AddSpace(int width, int height)
static PluginManager & Get()
bool IsEnabled() const
wxButton * AddButton(const wxString &Text, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:341
wxRadioButton * AddRadioButton(const wxString &Prompt)
Definition: ShuttleGui.cpp:468
void StartVerticalLay(int iProp=1)
void PluginRegistrationDialog::RegenerateEffectsList ( int  iShowWhat)
private

Definition at line 710 of file PluginManager.cpp.

References COL_Path, COL_State, ID_ShowAll, ID_ShowDisabled, ID_ShowEnabled, ID_ShowNew, mEffects, mFilter, mItems, mStates, ItemData::name, ItemData::path, SortCompare(), ItemData::state, STATE_Disabled, STATE_Enabled, and STATE_New.

Referenced by OnChangedVisibility(), and PopulateOrExchange().

711 {
712  mFilter = filter;
713 
714  mEffects->DeleteAllItems();
715 
716  int i = 0;
717  for (ItemDataMap::iterator iter = mItems.begin(); iter != mItems.end(); ++iter)
718  {
719  ItemData & item = iter->second;
720  bool add = false;
721 
722  switch (mFilter)
723  {
724  case ID_ShowAll:
725  add = true;
726  break;
727  case ID_ShowNew:
728  if (item.state == STATE_New)
729  {
730  add = true;
731  }
732  break;
733  case ID_ShowEnabled:
734  if (item.state == STATE_Enabled)
735  {
736  add = true;
737  }
738  break;
739  case ID_ShowDisabled:
740  if (item.state == STATE_Disabled)
741  {
742  add = true;
743  }
744  break;
745  }
746 
747  if (add)
748  {
749  mEffects->InsertItem(i, item.name);
750  mEffects->SetItem(i, COL_State, mStates[item.state]);
751  mEffects->SetItem(i, COL_Path, item.path);
752  mEffects->SetItemPtrData(i, (wxUIntPtr) &item);
753 
754  ++i;
755  }
756  }
757 
758  mEffects->SortItems(SortCompare, (wxUIntPtr) this);
759 
760  if (mEffects->GetItemCount() > 0)
761  {
762  // Make sure first item is selected/focused.
763 // mEffects->SetFocus();
764  mEffects->SetItemState(0, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
765 #if wxUSE_ACCESSIBILITY
766  mAx->SetSelected(0, false);
767 #endif
768  }
769 }
wxString path
static int wxCALLBACK SortCompare(long item1, long item2, long sortData)
wxString name
void PluginRegistrationDialog::SetState ( int  i,
bool  toggle,
bool  state = true 
)
private

Definition at line 771 of file PluginManager.cpp.

References COL_State, ID_ShowDisabled, ID_ShowEnabled, ID_ShowNew, if(), mEffects, mFilter, mStates, ItemData::state, STATE_Disabled, STATE_Enabled, STATE_New, and ItemData::valid.

Referenced by OnDisable(), OnEnable(), and OnListChar().

772 {
773  wxListItem li;
774 
775  li.m_mask = wxLIST_MASK_DATA;
776  li.m_itemId = i;
777 
778  mEffects->GetItem(li);
779 
780  ItemData *item = (ItemData *) li.m_data;
781 
782  // If changing the state of a "New" (stub) entry, then we mark it as valid
783  // since it will either be registered if "Enabled" or ignored if "Disabled".
784  if (item->state == STATE_New)
785  {
786  item->valid = true;
787  }
788 
789  if (toggle)
790  {
792  }
793  else
794  {
795  item->state = state;
796  }
797 
798  if (mFilter == ID_ShowNew && item->state != STATE_New)
799  {
800  mEffects->DeleteItem(i);
801  }
802  else if (mFilter == ID_ShowDisabled && item->state != STATE_Disabled)
803  {
804  mEffects->DeleteItem(i);
805  }
806  else if (mFilter == ID_ShowEnabled && item->state != STATE_Enabled)
807  {
808  mEffects->DeleteItem(i);
809  }
810  else
811  {
812  mEffects->SetItem(i, COL_State, mStates[item->state]);
813 #if wxUSE_ACCESSIBILITY
814  mAx->SetSelected(i);
815 #endif
816  }
817 }
if(pTrack &&pTrack->GetDisplay()!=WaveTrack::Spectrum)
int wxCALLBACK PluginRegistrationDialog::SortCompare ( long  item1,
long  item2,
long  sortData 
)
staticprivate

Definition at line 819 of file PluginManager.cpp.

References SortCompare().

Referenced by OnSort(), RegenerateEffectsList(), and SortCompare().

820 {
822  ItemData *i1 = (ItemData *) item1;
823  ItemData *i2 = (ItemData *) item2;
824 
825  return dlg->SortCompare(i1, i2);
826 }
static int wxCALLBACK SortCompare(long item1, long item2, long sortData)
int PluginRegistrationDialog::SortCompare ( ItemData item1,
ItemData item2 
)
private

Definition at line 828 of file PluginManager.cpp.

References COL_Name, COL_Path, COL_State, mSortColumn, mSortDirection, mStates, ItemData::name, ItemData::path, and ItemData::state.

829 {
830  wxString *str1;
831  wxString *str2;
832 
833  switch (mSortColumn)
834  {
835  case COL_Name:
836  str1 = &item1->name;
837  str2 = &item2->name;
838  break;
839  case COL_State:
840  str1 = &mStates[item1->state];
841  str2 = &mStates[item2->state];
842  break;
843  case COL_Path:
844  str1 = &item1->path;
845  str2 = &item2->path;
846  break;
847  default:
848  return 0;
849  }
850 
851 #if defined(__WXMAC__)
852  return str2->Cmp(*str1) * mSortDirection;
853 #else
854  return str1->Cmp(*str2) * mSortDirection;
855 #endif
856 }
wxString path
wxString name

Member Data Documentation

wxListCtrl* PluginRegistrationDialog::mEffects
private
int PluginRegistrationDialog::mFilter
private

Definition at line 452 of file PluginManager.cpp.

Referenced by RegenerateEffectsList(), and SetState().

ItemDataMap PluginRegistrationDialog::mItems
private

Definition at line 455 of file PluginManager.cpp.

Referenced by OnOK(), PopulateOrExchange(), and RegenerateEffectsList().

wxString PluginRegistrationDialog::mLongestPath
private

Definition at line 460 of file PluginManager.cpp.

Referenced by OnOK(), and PopulateOrExchange().

ModuleInterface* PluginRegistrationDialog::mMod
private

Definition at line 450 of file PluginManager.cpp.

int PluginRegistrationDialog::mSortColumn
private

Definition at line 457 of file PluginManager.cpp.

Referenced by OnSort(), and SortCompare().

int PluginRegistrationDialog::mSortDirection
private

Definition at line 458 of file PluginManager.cpp.

Referenced by OnSort(), and SortCompare().

wxArrayString PluginRegistrationDialog::mStates
private
EffectType PluginRegistrationDialog::mType
private

Definition at line 451 of file PluginManager.cpp.


The documentation for this class was generated from the following file: