From b4a850ed6ca1d3889ed9c5fb821d1a0e86cfd5be Mon Sep 17 00:00:00 2001 From: jsiegle <jsiegle@mit.edu> Date: Tue, 14 Feb 2012 17:31:25 -0500 Subject: [PATCH] Minor updates to ControlPanel --- Builds/Linux/build/windowState.xml | 2 +- Source/UI/ControlPanel.cpp | 35 ++++++++++++++++++++---------- Source/UI/ControlPanel.h | 6 +++++ 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/Builds/Linux/build/windowState.xml b/Builds/Linux/build/windowState.xml index a29e8e413..0ef953c39 100644 --- a/Builds/Linux/build/windowState.xml +++ b/Builds/Linux/build/windowState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <MAINWINDOW> - <BOUNDS x="1601" y="52" w="1696" h="1041" fullscreen="0"/> + <BOUNDS x="484" y="308" w="899" h="753" fullscreen="0"/> </MAINWINDOW> diff --git a/Source/UI/ControlPanel.cpp b/Source/UI/ControlPanel.cpp index 84ff8a8cf..0117328e9 100644 --- a/Source/UI/ControlPanel.cpp +++ b/Source/UI/ControlPanel.cpp @@ -74,8 +74,10 @@ RecordButton::~RecordButton() CPUMeter::CPUMeter() : Label(T("CPU Meter"),"0.0"), cpu(0.0f), lastCpu(0.0f) { - //startTimer(100); - //repaint(); + MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false); + Typeface::Ptr typeface = new CustomTypeface(mis); + font = Font(typeface); + font.setHeight(12); } CPUMeter::~CPUMeter() @@ -97,16 +99,19 @@ void CPUMeter::paint(Graphics& g) g.setColour(Colours::black); g.drawRect(0,0,getWidth(),getHeight(),1); + g.setFont(font); + g.drawSingleLineText("CPU",65,12); + } DiskSpaceMeter::DiskSpaceMeter() { - //graph = g; - //updateDiskSpace(graph->getRecordNode()->getFreeSpace()); - //repaint(); - //startTimer(10000); // refresh every 10 seconds + MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false); + Typeface::Ptr typeface = new CustomTypeface(mis); + font = Font(typeface); + font.setHeight(12); } @@ -124,11 +129,14 @@ void DiskSpaceMeter::paint(Graphics& g) g.fillAll(Colours::grey); - g.setColour(Colours::pink); + g.setColour(Colours::lightgrey); g.fillRect(0.0f,0.0f,getWidth()*diskFree,float(getHeight())); g.setColour(Colours::black); g.drawRect(0,0,getWidth(),getHeight(),1); + + g.setFont(font); + g.drawSingleLineText("DF",75,12); } @@ -205,7 +213,10 @@ void Clock::drawTime() s = floor((totalRecordTime - m*60000)/1000); } else { - glColor4f(1.0, 1.0, 1.0, 1.0); + if (isRunning) + glColor4f(1.0, 1.0, 0.0, 1.0); + else + glColor4f(1.0, 1.0, 1.0, 1.0); m = floor(totalTime/60000); s = floor((totalTime - m*60000)/1000); } @@ -326,19 +337,19 @@ void ControlPanel::resized() int h = getHeight(); if (playButton != 0) - playButton->setBounds(w-h*8,5,h-5,h-10); + playButton->setBounds(w-h*9,5,h-5,h-10); if (recordButton != 0) - recordButton->setBounds(w-h*7,5,h-5,h-10); + recordButton->setBounds(w-h*8,5,h-5,h-10); if (masterClock != 0) masterClock->setBounds(w-h*6,0,h*6,h); if (cpuMeter != 0) - cpuMeter->setBounds(20,h/4,h*4,h/2); + cpuMeter->setBounds(8,h/4,h*3,h/2); if (diskMeter != 0) - diskMeter->setBounds(150,h/4,h*4,h/2); + diskMeter->setBounds(16+h*3,h/4,h*3,h/2); if (audioEditor != 0) audioEditor->setBounds(w-h*12,5,h*5,h-10); diff --git a/Source/UI/ControlPanel.h b/Source/UI/ControlPanel.h index 17c7eb44d..bddaa1993 100644 --- a/Source/UI/ControlPanel.h +++ b/Source/UI/ControlPanel.h @@ -68,6 +68,9 @@ class CPUMeter : public Label//, public Timer //Component void paint (Graphics& g); private: + + Font font; + float cpu; float lastCpu; @@ -86,6 +89,9 @@ public: void paint (Graphics& g); private: + + Font font; + float diskFree; ProcessorGraph* graph; //void timerCallback() {repaint();} -- GitLab