mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
refactor(pulseaudio): remove wait timeout, fix indents
This commit is contained in:
parent
6e8b9dea29
commit
1792090d66
3 changed files with 10 additions and 12 deletions
|
@ -33,7 +33,7 @@ class pulseaudio {
|
||||||
|
|
||||||
const string& get_name();
|
const string& get_name();
|
||||||
|
|
||||||
bool wait(int timeout = -1);
|
bool wait();
|
||||||
int process_events();
|
int process_events();
|
||||||
|
|
||||||
int get_volume();
|
int get_volume();
|
||||||
|
|
|
@ -94,11 +94,9 @@ const string& pulseaudio::get_name() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wait for events (timeout in ms)
|
* Wait for events
|
||||||
*/
|
*/
|
||||||
bool pulseaudio::wait(int timeout) {
|
bool pulseaudio::wait() {
|
||||||
// TODO wait for specified timeout
|
|
||||||
(void) timeout;
|
|
||||||
return m_events.size() > 0;
|
return m_events.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace modules {
|
||||||
bool pulseaudio_module::has_event() {
|
bool pulseaudio_module::has_event() {
|
||||||
// Poll for mixer and control events
|
// Poll for mixer and control events
|
||||||
try {
|
try {
|
||||||
if (m_pulseaudio->wait(25))
|
if (m_pulseaudio->wait())
|
||||||
return true;
|
return true;
|
||||||
} catch (const pulseaudio_error& e) {
|
} catch (const pulseaudio_error& e) {
|
||||||
m_log.err("%s: %s", name(), e.what());
|
m_log.err("%s: %s", name(), e.what());
|
||||||
|
@ -146,7 +146,7 @@ namespace modules {
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (m_pulseaudio->wait(0)) {
|
if (m_pulseaudio->wait()) {
|
||||||
m_pulseaudio->process_events();
|
m_pulseaudio->process_events();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue