| 298 | } |
| 299 | |
| 300 | List<Voice::SpeakerPtr> Voice::sortedSpeakers(bool onlyPlaying) { |
| 301 | List<SpeakerPtr> result; |
| 302 | |
| 303 | auto sorter = [](SpeakerPtr const& a, SpeakerPtr const& b) -> bool { |
| 304 | if (a->lastPlayTime != b->lastPlayTime) |
| 305 | return a->lastPlayTime < b->lastPlayTime; |
| 306 | else |
| 307 | return a->speakerId < b->speakerId; |
| 308 | }; |
| 309 | |
| 310 | for (auto& p : m_speakers) { |
| 311 | if (!onlyPlaying || p.second->playing) |
| 312 | result.insertSorted(p.second, sorter); |
| 313 | } |
| 314 | |
| 315 | return result; |
| 316 | } |
| 317 | |
| 318 | void Voice::clearSpeakers() { |
| 319 | auto it = m_speakers.begin(); |
no test coverage detected