mirror of
https://github.com/clangen/musikcube.git
synced 2025-02-06 21:40:20 +00:00
A couple small bug fixes related to the new message queue interaction.
This commit is contained in:
parent
2353f827eb
commit
d1f2d867f5
@ -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) {
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include <core/debug.h>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
#include <core/debug.h>
|
||||
|
||||
#define BYTES_PER_MEGABYTE 1048576.0f
|
||||
|
||||
ResourcesWindow::ResourcesWindow(IWindow *parent)
|
||||
|
@ -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
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user