MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / actionOnMenuAudioSampleRate

Method actionOnMenuAudioSampleRate

src/AppFrame.cpp:1626–1657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624}
1625
1626bool AppFrame::actionOnMenuAudioSampleRate(wxCommandEvent& event) {
1627
1628 if (event.GetId() >= wxID_AUDIO_BANDWIDTH_BASE) {
1629
1630 int evId = event.GetId();
1631
1632 auto outputDevices = wxGetApp().getDemodMgr().getOutputDevices();
1633
1634 int i = 0;
1635 for (auto & outputDevice : outputDevices) {
1636 int menu_id = wxID_AUDIO_BANDWIDTH_BASE + wxID_AUDIO_DEVICE_MULTIPLIER * outputDevice.first;
1637
1638 int j = 0;
1639 for (auto srate = outputDevice.second.sampleRates.begin(); srate != outputDevice.second.sampleRates.end();
1640 srate++) {
1641
1642 if (evId == menu_id + j) {
1643 //audioSampleRateMenuItems[menu_id+j];
1644 //std::cout << "Would set audio sample rate on device " << mdevices_i->second.name << " (" << mdevices_i->first << ") to " << (*srate) << "Hz" << std::endl;
1645 AudioThread::setDeviceSampleRate(outputDevice.first, *srate);
1646
1647 return true;
1648 }
1649
1650 j++;
1651 }
1652 i++;
1653 }
1654 }
1655
1656 return false;
1657}
1658
1659bool AppFrame::actionOnMenuLoadSave(wxCommandEvent& event) {
1660

Callers

nothing calls this directly

Calls 1

getOutputDevicesMethod · 0.80

Tested by

no test coverage detected