poll mpd once per second, no need to do it more often
This commit is contained in:
@@ -31,7 +31,7 @@ using namespace NCurses;
|
|||||||
|
|
||||||
typedef std::pair<std::string, std::string> string_pair;
|
typedef std::pair<std::string, std::string> string_pair;
|
||||||
|
|
||||||
const int ncmpcpp_window_timeout = 500;
|
const int ncmpcpp_window_timeout = 250;
|
||||||
|
|
||||||
const std::string home_folder = getenv("HOME") ? getenv("HOME") : "";
|
const std::string home_folder = getenv("HOME") ? getenv("HOME") : "";
|
||||||
|
|
||||||
|
|||||||
@@ -106,9 +106,7 @@ void TraceMpdStatus()
|
|||||||
static timeval past, now;
|
static timeval past, now;
|
||||||
|
|
||||||
gettimeofday(&now, 0);
|
gettimeofday(&now, 0);
|
||||||
if (Mpd->Connected()
|
if (Mpd->Connected() && now.tv_sec > past.tv_sec)
|
||||||
&& ((now.tv_sec == past.tv_sec && now.tv_usec >= past.tv_usec+500000) || now.tv_sec > past.tv_sec)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Mpd->UpdateStatus();
|
Mpd->UpdateStatus();
|
||||||
gettimeofday(&past, 0);
|
gettimeofday(&past, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user