Fixed build and adjusted idle timeout for OSX

This commit is contained in:
Casey Langen 2016-06-04 12:49:20 -07:00
parent 548c18de36
commit 8b14719bbc
3 changed files with 14 additions and 5 deletions

View File

@ -45,10 +45,15 @@
#include <windows.h>
#include <tchar.h>
#define sleep_ms(x) Sleep(x)
typedef unsigned __int64 UINT64;
#define STDCALL(fp) (__stdcall* fp)()
#else
#include <cassert>
#include <unistd.h>
#define sleep_ms(x) usleep(x * 1000)
typedef unsigned long long UINT64;
typedef long long __int64;

View File

@ -6,7 +6,6 @@ set (BOX_SRCS
./app/layout/LibraryLayout.cpp
./app/layout/NowPlayingLayout.cpp
./app/query/CategoryListViewQuery.cpp
./app/query/SingleTrackQuery.cpp
./app/query/CategoryTrackListQuery.cpp
./app/query/NowPlayingTrackListQuery.cpp
./app/service/PlaybackService.cpp

View File

@ -46,15 +46,17 @@
#include <app/service/PlaybackService.h>
#include <boost/locale.hpp>
#include <boost/thread.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
#include <thread>
#include <core/plugin/PluginFactory.h>
#include <core/library/LibraryFactory.h>
#include <boost/chrono.hpp>
#include <cstdio>
#ifdef WIN32
@ -65,8 +67,8 @@
#define IDLE_TIMEOUT_MS 0
#define REDRAW_DEBOUNCE_MS 100
#else
#define IDLE_TIMEOUT_MS 100
#define REDRAW_DEBOUNCE_MS 200
#define IDLE_TIMEOUT_MS 75
#define REDRAW_DEBOUNCE_MS 100
#endif
using namespace musik::core;
@ -273,7 +275,10 @@ int main(int argc, char* argv[])
curs_set(0);
}
if (ch != -1) { /* -1 = idle timeout */
if (ch == ERR) {
std::this_thread::yield();
}
else { /* -1 = idle timeout */
std::string kn = readKeyPress((int) ch);
if (ch == '\t') { /* tab */