diff --git a/src/musikbox/MainLayout.cpp b/src/musikbox/MainLayout.cpp index 2487657e1..063860e4d 100755 --- a/src/musikbox/MainLayout.cpp +++ b/src/musikbox/MainLayout.cpp @@ -6,7 +6,7 @@ #include "IWindowMessage.h" #define MESSAGE_TYPE_UPDATE 1001 -#define UPDATE_INTERVAL_MS 500 +#define UPDATE_INTERVAL_MS 1000 MainLayout::MainLayout(Transport& transport, LibraryPtr library) : LayoutBase() { @@ -21,6 +21,8 @@ MainLayout::MainLayout(Transport& transport, LibraryPtr library) this->AddWindow(this->output); this->AddWindow(this->resources); this->AddWindow(this->transport); + + Post(MESSAGE_TYPE_UPDATE, 0, 0, UPDATE_INTERVAL_MS); } MainLayout::~MainLayout() { @@ -61,7 +63,6 @@ void MainLayout::Layout() { void MainLayout::Show() { LayoutBase::Show(); this->UpdateWindows(); - Post(MESSAGE_TYPE_UPDATE, 0, 0, UPDATE_INTERVAL_MS); } void MainLayout::ProcessMessage(IWindowMessage &message) { diff --git a/src/musikbox/ResourcesWindow.cpp b/src/musikbox/ResourcesWindow.cpp index f96c9cdd4..4f857de1d 100755 --- a/src/musikbox/ResourcesWindow.cpp +++ b/src/musikbox/ResourcesWindow.cpp @@ -8,6 +8,8 @@ #include #include +#include + #define BYTES_PER_MEGABYTE 1048576.0f ResourcesWindow::ResourcesWindow(IWindow *parent) diff --git a/src/musikbox/SystemInfo.cpp b/src/musikbox/SystemInfo.cpp index f75239b37..2c633c5d4 100755 --- a/src/musikbox/SystemInfo.cpp +++ b/src/musikbox/SystemInfo.cpp @@ -78,7 +78,7 @@ double SystemInfo::GetCpuUsage() { WindowsSystemInfo::WindowsSystemInfo() { PdhOpenQuery(NULL, NULL, &cpuQuery); PdhAddCounter(cpuQuery, "\\Processor(_Total)\\% Processor Time", NULL, &cpuTotal); - //PdhCollectQueryData(cpuQuery); + PdhCollectQueryData(cpuQuery); SYSTEM_INFO sysInfo; FILETIME ftime, fsys, fuser; @@ -145,6 +145,6 @@ double WindowsSystemInfo::GetCpuUsage() { lastUserCpu = user; lastSysCpu = sys; - return percent * 100; + return (percent * 100.0f); } #endif \ No newline at end of file diff --git a/src/musikbox/Window.cpp b/src/musikbox/Window.cpp index 9abd4a5c5..49c5b90d5 100755 --- a/src/musikbox/Window.cpp +++ b/src/musikbox/Window.cpp @@ -218,6 +218,24 @@ void Window::Show() { this->isVisible = true; } +void Window::Hide() { + if (this->frame) { + wclear(this->frame); + wclear(this->content); + this->Repaint(); + + delwin(this->content); + + if (this->content != this->frame) { + delwin(this->frame); + } + + this->frame = this->content = NULL; + } + + this->isVisible = false; +} + void Window::SetFrameVisible(bool enabled) { if (enabled != this->drawFrame) { this->drawFrame = enabled; @@ -260,21 +278,3 @@ void Window::Focus() { void Window::Blur() { } - -void Window::Hide() { - if (this->frame) { - wclear(this->frame); - wclear(this->content); - this->Repaint(); - - delwin(this->content); - - if (this->content != this->frame) { - delwin(this->frame); - } - - this->frame = this->content = NULL; - } - - this->isVisible = false; -}