Changeset View
Changeset View
Standalone View
Standalone View
src/card.cpp
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 47 | for (auto **it = info->profiles2; it && *it != nullptr; ++it) { | |||
---|---|---|---|---|---|
50 | m_profiles.append(profile); | 50 | m_profiles.append(profile); | ||
51 | if (info->active_profile2 == *it) { | 51 | if (info->active_profile2 == *it) { | ||
52 | m_activeProfileIndex = m_profiles.length() - 1; | 52 | m_activeProfileIndex = m_profiles.length() - 1; | ||
53 | } | 53 | } | ||
54 | } | 54 | } | ||
55 | emit profilesChanged(); | 55 | emit profilesChanged(); | ||
56 | emit activeProfileIndexChanged(); | 56 | emit activeProfileIndexChanged(); | ||
57 | 57 | | |||
58 | m_availableProfiles.clear(); | ||||
59 | for (QObject * profile: qAsConst(m_profiles)) { | ||||
60 | if (static_cast<Profile*>(profile)->availability() == Port::Available) { | ||||
61 | m_availableProfiles.append(profile); | ||||
62 | } | ||||
63 | } | ||||
64 | emit availableProfilesChanged(); | ||||
65 | | ||||
58 | qDeleteAll(m_ports); | 66 | qDeleteAll(m_ports); | ||
59 | m_ports.clear(); | 67 | m_ports.clear(); | ||
60 | for (auto **it = info->ports; it && *it != nullptr; ++it) { | 68 | for (auto **it = info->ports; it && *it != nullptr; ++it) { | ||
61 | CardPort *port = new CardPort(this); | 69 | CardPort *port = new CardPort(this); | ||
62 | port->update(*it); | 70 | port->update(*it); | ||
63 | m_ports.append(port); | 71 | m_ports.append(port); | ||
64 | } | 72 | } | ||
65 | emit portsChanged(); | 73 | emit portsChanged(); | ||
Show All 20 Lines | 92 | { | |||
86 | context()->setCardProfile(index(), profile->name()); | 94 | context()->setCardProfile(index(), profile->name()); | ||
87 | } | 95 | } | ||
88 | 96 | | |||
89 | QList<QObject *> Card::ports() const | 97 | QList<QObject *> Card::ports() const | ||
90 | { | 98 | { | ||
91 | return m_ports; | 99 | return m_ports; | ||
92 | } | 100 | } | ||
93 | 101 | | |||
102 | QList<QObject *> Card::availableProfiles() const | ||||
103 | { | ||||
104 | return m_availableProfiles; | ||||
105 | } | ||||
106 | | ||||
94 | } // QPulseAudio | 107 | } // QPulseAudio |