summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opierec/vumeter.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opierec/vumeter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/vumeter.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/noncore/multimedia/opierec/vumeter.cpp b/noncore/multimedia/opierec/vumeter.cpp
index c28dbe4..6a3f7c2 100644
--- a/noncore/multimedia/opierec/vumeter.cpp
+++ b/noncore/multimedia/opierec/vumeter.cpp
@@ -3,4 +3,5 @@
3///// copyright : (C) 1999 by Martin Lorenz 3///// copyright : (C) 1999 by Martin Lorenz
4////// email : lorenz@ch.tum.de 4////// email : lorenz@ch.tum.de
5// also copyright 2005 lpotter@trolltech.com
5 6
6#include "vumeter.h" 7#include "vumeter.h"
@@ -11,7 +12,4 @@
11#include <qdrawutl.h> 12#include <qdrawutl.h>
12 13
13#include <opie2/odebug.h>
14using namespace Opie::Core;
15
16#include <math.h> 14#include <math.h>
17 15
@@ -19,5 +17,5 @@ VUMeter::VUMeter(QWidget *parent, const char *name, const int tr)
19 : QWidget( parent, name ) 17 : QWidget( parent, name )
20{ 18{
21 int tracks = tr; 19 tracks = tr;
22 int i; 20 int i;
23 21
@@ -28,4 +26,6 @@ VUMeter::VUMeter(QWidget *parent, const char *name, const int tr)
28 } 26 }
29 27
28 colorScheme = 0;
29
30 readConf(); 30 readConf();
31 31
@@ -40,5 +40,4 @@ VUMeter::VUMeter(QWidget *parent, const char *name, const int tr)
40 int i16 = (j); 40 int i16 = (j);
41 color[i] = QColor(( 15 - i16) * 16, 255, 255, QColor::Hsv); 41 color[i] = QColor(( 15 - i16) * 16, 255, 255, QColor::Hsv);
42// owarn << color[i].name() << oendl;
43 j--; 42 j--;
44 } 43 }
@@ -53,9 +52,8 @@ VUMeter::VUMeter(QWidget *parent, const char *name, const int tr)
53 52
54VUMeter::~VUMeter(){ 53VUMeter::~VUMeter(){
55 writeConf(); 54// writeConf();
56} 55}
57 56
58void VUMeter::update(){ 57void VUMeter::update(){
59// qWarning("vumeter update");
60 vuTimer->start(para.update, FALSE); 58 vuTimer->start(para.update, FALSE);
61 if (para.onOff) { 59 if (para.onOff) {
@@ -70,14 +68,13 @@ void VUMeter::update(){
70void VUMeter::slotOn() { 68void VUMeter::slotOn() {
71 connect(vuTimer, SIGNAL(timeout()), this , SLOT(timeSlot())); 69 connect(vuTimer, SIGNAL(timeout()), this , SLOT(timeSlot()));
72 para.onOff=true; 70 para.onOff = true;
73} 71}
74 72
75void VUMeter::slotOff() { 73void VUMeter::slotOff() {
76 disconnect(vuTimer, SIGNAL(timeout()), this , SLOT(timeSlot())); 74 disconnect(vuTimer, SIGNAL(timeout()), this , SLOT(timeSlot()));
77 para.onOff=false; 75 para.onOff = false;
78} 76}
79 77
80void VUMeter::slotProps() { 78void VUMeter::slotProps() {
81 qDebug("VU-Dialog");
82} 79}
83 80
@@ -99,7 +96,7 @@ void VUMeter::resizeEvent(QResizeEvent* event) {
99 96
100void VUMeter::resize() { 97void VUMeter::resize() {
101 qWarning("resize VUMeter painting"); 98// qWarning("resize VUMeter painting");
102 if(buffer == 0) 99 if(buffer == 0)
103 qDebug("Dude NULL pixmap buffer!"); 100 qWarning("Dude NULL pixmap buffer!");
104 101
105 buffer->fill(black); 102 buffer->fill(black);
@@ -122,4 +119,5 @@ void VUMeter::resize() {
122 font = painter.font(); font.setPointSize( 2 * dy - 2); 119 font = painter.font(); font.setPointSize( 2 * dy - 2);
123 painter.setFont(font); 120 painter.setFont(font);
121
124 for(i = 0; i < tracks + 2; i++) { 122 for(i = 0; i < tracks + 2; i++) {
125 painter.setPen(green); painter.setBrush(green); 123 painter.setPen(green); painter.setBrush(green);
@@ -132,4 +130,5 @@ void VUMeter::resize() {
132 painter.drawText(textOffset + ox + dx * i, oy + dy * (para.leds) - 2, sx, 2 * dy, AlignCenter, str); 130 painter.drawText(textOffset + ox + dx * i, oy + dy * (para.leds) - 2, sx, 2 * dy, AlignCenter, str);
133 } 131 }
132
134 painter.end(); 133 painter.end();
135 paint(); 134 paint();
@@ -139,6 +138,4 @@ void VUMeter::resize() {
139void VUMeter::timeSlot() { 138void VUMeter::timeSlot() {
140 int i; 139 int i;
141// getting stuck here
142// qDebug("calling paint() from timeSlot()\n");
143 paint(); 140 paint();
144 for(i = 0; i < tracks + 2; i++) { 141 for(i = 0; i < tracks + 2; i++) {
@@ -181,6 +178,4 @@ void VUMeter::paint() {
181void VUMeter::setPeak(int a[]) { 178void VUMeter::setPeak(int a[]) {
182 int i; 179 int i;
183 //qDebug("set peak int");
184// cerr<<"setting peak\n";
185 for(i = 0; i < tracks + 2; i++) { 180 for(i = 0; i < tracks + 2; i++) {
186 if (a[i] > i_peak[i]) i_peak[i] = a[i]; 181 if (a[i] > i_peak[i]) i_peak[i] = a[i];