MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / loadRemaining

Method loadRemaining

src/data/model/DeviceListModel.cpp:37–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37bool DeviceListModel::loadRemaining(PresetRuleTableModel* ruleModel)
38{
39 auto devices = service->outputDevices();
40 // Find all devices with at least one unused route
41 for(int i = devices.size() - 1; i >= 0; i--)
42 {
43 // Find all unused routes
44 QList<Route> routes = devices.at(i).output_routes;
45 routes.append(RouteListModel::makeDefaultRoute());
46 for(int j = routes.size() - 1; j >= 0; j--)
47 {
48 if(ruleModel->containsDeviceAndRouteId(QString::fromStdString(devices.at(i).name),
49 QString::fromStdString(routes.at(j).name)))
50 {
51 routes.erase(routes.begin() + j);
52 }
53 }
54
55 if(routes.empty()) {
56 devices.erase(devices.begin() + i);
57 }
58 }
59
60 if(devices.empty())
61 {
62 return false;
63 }
64
65 load(devices);
66 return true;
67}
68
69void DeviceListModel::load(const QVector<IOutputDevice> &_devices)
70{

Callers

nothing calls this directly

Calls 8

appendMethod · 0.80
eraseMethod · 0.80
outputDevicesMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45
beginMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected