mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 00:50:52 +02:00
Simplified Audacity (using ! prefix) now works for effects and analyse items too.
This commit is contained in:
parent
7ddd4ed2ab
commit
db56cbd363
@ -537,42 +537,54 @@ void CommandManager::AddItemList(wxString name, wxArrayString labels,
|
|||||||
if( mHidingLevel > 0 )
|
if( mHidingLevel > 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CurrentMenu()->GetMenuItemCount() + labels.GetCount() < MAX_MENU_LEN)
|
unsigned int effLen = labels.GetCount();
|
||||||
plugins = false;
|
unsigned int nVisibleEffects=0;
|
||||||
|
|
||||||
if (!plugins) {
|
|
||||||
for(i=0; i<labels.GetCount(); i++) {
|
|
||||||
int ID = NewIdentifier(name, labels[i], CurrentMenu(), callback,
|
|
||||||
true, i, labels.GetCount());
|
|
||||||
CurrentMenu()->Append(ID, labels[i]);
|
|
||||||
}
|
|
||||||
mbSeparatorAllowed = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString label;
|
wxString label;
|
||||||
unsigned int effLen = labels.GetCount();
|
int tmpmax;
|
||||||
int listnum = 1;
|
|
||||||
int tmpmax = MAX_SUBMENU_LEN < effLen? MAX_SUBMENU_LEN: effLen;
|
|
||||||
|
|
||||||
//The first submenu starts at 1.
|
|
||||||
BeginSubMenu(wxString::Format(_("Plugins 1 to %i"), tmpmax));
|
|
||||||
|
|
||||||
|
// Count the visible effects.
|
||||||
for(i=0; i<effLen; i++) {
|
for(i=0; i<effLen; i++) {
|
||||||
|
// ItemShouldBeHidden removes the ! so do it to a temporary.
|
||||||
|
label = labels[i];
|
||||||
|
if (!ItemShouldBeHidden(label)) {
|
||||||
|
nVisibleEffects++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CurrentMenu()->GetMenuItemCount() + nVisibleEffects < MAX_MENU_LEN)
|
||||||
|
plugins = false;
|
||||||
|
|
||||||
|
// j counts the visible menu items, i counts the actual menu items.
|
||||||
|
// These numbers are the same unless we are using a simplified interface
|
||||||
|
// by hiding effects with a ! before them when translated.
|
||||||
|
int j=0;
|
||||||
|
for(i=0; i<effLen; i++) {
|
||||||
|
if (!ItemShouldBeHidden(labels[i])) {
|
||||||
|
|
||||||
|
// ---- Start of code for Plugin sub-menus. Only relevant on wxGTK.
|
||||||
|
// If plugins, and at start of a sublist....
|
||||||
|
if( plugins && ((j % MAX_SUBMENU_LEN) == 0 )) {
|
||||||
|
// End previous sub-menu, if there was one.
|
||||||
|
if( j>0 )
|
||||||
|
EndSubMenu();
|
||||||
|
|
||||||
|
// Start new sub-menu
|
||||||
|
// tmpmax is number of last plugin for this sub-menu
|
||||||
|
tmpmax = wxMax(j + MAX_SUBMENU_LEN, (int)nVisibleEffects);
|
||||||
|
// Submenu titles are 1 to 15, 15 to 30, etc.
|
||||||
|
BeginSubMenu(wxString::Format(_("Plugins %i to %i"),j+1,tmpmax));
|
||||||
|
}
|
||||||
|
// ---- End of code for Plugin sub-menus.
|
||||||
|
|
||||||
|
j++;
|
||||||
int ID = NewIdentifier(name, labels[i], CurrentMenu(), callback,
|
int ID = NewIdentifier(name, labels[i], CurrentMenu(), callback,
|
||||||
true, i, effLen);
|
true, i, effLen);
|
||||||
|
|
||||||
CurrentMenu()->Append(ID, labels[i]);
|
CurrentMenu()->Append(ID, labels[i]);
|
||||||
|
mbSeparatorAllowed = true;
|
||||||
if(((i+1) % MAX_SUBMENU_LEN) == 0 && i != (effLen - 1)) {
|
|
||||||
EndSubMenu();
|
|
||||||
listnum++;
|
|
||||||
|
|
||||||
//This label the plugins by number in the submenu title (1 to 15, 15 to 30, etc.)
|
|
||||||
tmpmax = i + MAX_SUBMENU_LEN < effLen? 1 + i + MAX_SUBMENU_LEN: effLen;
|
|
||||||
BeginSubMenu(wxString::Format(_("Plugins %i to %i"),i+2,tmpmax));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( plugins && (nVisibleEffects>0 ))
|
||||||
EndSubMenu();
|
EndSubMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,8 @@ wxString Effect::StripAmpersand(const wxString& str)
|
|||||||
{
|
{
|
||||||
wxString strippedStr = str;
|
wxString strippedStr = str;
|
||||||
strippedStr.Replace(wxT("&"), wxT(""));
|
strippedStr.Replace(wxT("&"), wxT(""));
|
||||||
|
// ! is used for hiding effects, and should not affect sort order.
|
||||||
|
strippedStr.Replace(wxT("!"), wxT(""));
|
||||||
return strippedStr;
|
return strippedStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user