1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 15:23:48 +01:00

Use standard library style members of wxArrayString (and wxString) ...

... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
This commit is contained in:
Paul Licameli
2019-02-11 19:10:48 -05:00
parent 5daa67dfe6
commit 2db49dc1f0
115 changed files with 728 additions and 728 deletions

View File

@@ -104,8 +104,8 @@ void MidiIOPrefs::GetNamesAndLabels() {
if (info->output || info->input) { //should always happen
wxString name = wxSafeConvertMB2WX(info->interf);
if (mHostNames.Index(name) == wxNOT_FOUND) {
mHostNames.Add(name);
mHostLabels.Add(name);
mHostNames.push_back(name);
mHostLabels.push_back(name);
}
}
}
@@ -181,8 +181,8 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e))
{
wxString itemAtIndex;
int index = mHost->GetCurrentSelection();
if (index >= 0 && index < (int)mHostNames.Count())
itemAtIndex = mHostNames.Item(index);
if (index >= 0 && index < (int)mHostNames.size())
itemAtIndex = mHostNames[index];
int nDevices = Pm_CountDevices();
if (nDevices == 0) {
@@ -193,7 +193,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e))
mPlay->Clear();
#ifdef EXPERIMENTAL_MIDI_IN
mRecord->Clear();
mRecord->clear();
#endif
wxArrayString playnames;
@@ -208,7 +208,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e))
interf,
name);
if (info->output) {
playnames.Add(name);
playnames.push_back(name);
index = mPlay->Append(name, (void *) info);
if (device == mPlayDevice) {
mPlay->SetSelection(index);
@@ -216,7 +216,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e))
}
#ifdef EXPERIMENTAL_MIDI_IN
if (info->input) {
recordnames.Add(name);
recordnames.push_back(name);
index = mRecord->Append(name, (void *) info);
if (device == mRecordDevice) {
mRecord->SetSelection(index);
@@ -227,12 +227,12 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e))
}
if (mPlay->GetCount() == 0) {
playnames.Add(_("No devices found"));
playnames.push_back(_("No devices found"));
mPlay->Append(playnames[0], (void *) NULL);
}
#ifdef EXPERIMENTAL_MIDI_IN
if (mRecord->GetCount() == 0) {
recordnames.Add(_("No devices found"));
if (mRecord->size() == 0) {
recordnames.push_back(_("No devices found"));
mRecord->Append(recordnames[0], (void *) NULL);
}
#endif
@@ -240,7 +240,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e))
mPlay->SetSelection(0);
}
#ifdef EXPERIMENTAL_MIDI_IN
if (mRecord->GetCount() && mRecord->GetSelection() == wxNOT_FOUND) {
if (mRecord->size() && mRecord->GetSelection() == wxNOT_FOUND) {
mRecord->SetSelection(0);
}
#endif