Changeset View
Changeset View
Standalone View
Standalone View
src/streamrestore.cpp
Show All 36 Lines | |||||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | void StreamRestore::update(const pa_ext_stream_restore_info *info) | 39 | void StreamRestore::update(const pa_ext_stream_restore_info *info) | ||
40 | { | 40 | { | ||
41 | m_cache.valid = false; | 41 | m_cache.valid = false; | ||
42 | const QString infoName = QString::fromUtf8(info->name); | 42 | const QString infoName = QString::fromUtf8(info->name); | ||
43 | if (m_name != infoName) { | 43 | if (m_name != infoName) { | ||
44 | m_name = infoName; | 44 | m_name = infoName; | ||
45 | emit nameChanged(); | 45 | Q_EMIT nameChanged(); | ||
46 | } | 46 | } | ||
47 | const QString infoDevice = QString::fromUtf8(info->device); | 47 | const QString infoDevice = QString::fromUtf8(info->device); | ||
48 | if (m_device != infoDevice) { | 48 | if (m_device != infoDevice) { | ||
49 | m_device = infoDevice; | 49 | m_device = infoDevice; | ||
50 | emit deviceChanged(); | 50 | Q_EMIT deviceChanged(); | ||
51 | } | 51 | } | ||
52 | if (m_muted != info->mute) { | 52 | if (m_muted != info->mute) { | ||
53 | m_muted = info->mute; | 53 | m_muted = info->mute; | ||
54 | emit mutedChanged(); | 54 | Q_EMIT mutedChanged(); | ||
55 | } | 55 | } | ||
56 | if (memcmp(&m_volume, &info->volume, sizeof(pa_cvolume)) != 0) { | 56 | if (memcmp(&m_volume, &info->volume, sizeof(pa_cvolume)) != 0) { | ||
57 | m_volume = info->volume; | 57 | m_volume = info->volume; | ||
58 | emit volumeChanged(); | 58 | Q_EMIT volumeChanged(); | ||
59 | emit channelVolumesChanged(); | 59 | Q_EMIT channelVolumesChanged(); | ||
60 | } | 60 | } | ||
61 | if (memcmp(&m_channelMap, &info->channel_map, sizeof(pa_channel_map)) != 0) { | 61 | if (memcmp(&m_channelMap, &info->channel_map, sizeof(pa_channel_map)) != 0) { | ||
62 | m_channels.clear(); | 62 | m_channels.clear(); | ||
63 | m_channels.reserve(info->channel_map.channels); | 63 | m_channels.reserve(info->channel_map.channels); | ||
64 | for (int i = 0; i < info->channel_map.channels; ++i) { | 64 | for (int i = 0; i < info->channel_map.channels; ++i) { | ||
65 | m_channels << QString::fromUtf8(pa_channel_position_to_pretty_string(info->channel_map.map[i])); | 65 | m_channels << QString::fromUtf8(pa_channel_position_to_pretty_string(info->channel_map.map[i])); | ||
66 | } | 66 | } | ||
67 | m_channelMap = info->channel_map; | 67 | m_channelMap = info->channel_map; | ||
68 | emit channelsChanged(); | 68 | Q_EMIT channelsChanged(); | ||
69 | } | 69 | } | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | QString StreamRestore::name() const | 72 | QString StreamRestore::name() const | ||
73 | { | 73 | { | ||
74 | return m_name; | 74 | return m_name; | ||
75 | } | 75 | } | ||
76 | 76 | | |||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |