mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-29 15:12:34 +02:00
2021-02-25 Fred Gleason <fredg@paravelsystems.com>
* Fixed regressions in metering code that caused visual artifacts. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
776e3ca842
commit
7ed04f1392
@ -21200,3 +21200,7 @@
|
|||||||
groups.
|
groups.
|
||||||
2021-02-25 Fred Gleason <fredg@paravelsystems.com>
|
2021-02-25 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Fixed various regressions in rdadmin(1).
|
* Fixed various regressions in rdadmin(1).
|
||||||
|
2021-02-25 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed a regression in 'RDCae' that broke audio play-out.
|
||||||
|
2021-02-25 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed regressions in metering code that caused visual artifacts.
|
||||||
|
@ -157,7 +157,7 @@ bool RDCae::loadPlay(int card,QString name,int *stream,int *handle)
|
|||||||
{
|
{
|
||||||
int count=0;
|
int count=0;
|
||||||
|
|
||||||
SendCommand("LP "+QString().sprintf(" %d ",card)+name);
|
SendCommand("LP "+QString().sprintf(" %d ",card)+name+"!");
|
||||||
|
|
||||||
//
|
//
|
||||||
// This is really warty, but needed to make the method 'synchronous'
|
// This is really warty, but needed to make the method 'synchronous'
|
||||||
|
@ -909,7 +909,7 @@ void RDEditAudio::xFullIn()
|
|||||||
(1.0-edit_factor_x/edit_max_factor_x)));
|
(1.0-edit_factor_x/edit_max_factor_x)));
|
||||||
CenterDisplay();
|
CenterDisplay();
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -928,7 +928,7 @@ void RDEditAudio::xUp()
|
|||||||
}
|
}
|
||||||
CenterDisplay();
|
CenterDisplay();
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -947,7 +947,7 @@ void RDEditAudio::xDown()
|
|||||||
}
|
}
|
||||||
CenterDisplay();
|
CenterDisplay();
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -959,7 +959,7 @@ void RDEditAudio::xFullOut()
|
|||||||
edit_hscroll->setRange(0,0);
|
edit_hscroll->setRange(0,0);
|
||||||
CenterDisplay();
|
CenterDisplay();
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -969,7 +969,7 @@ void RDEditAudio::yUp()
|
|||||||
if(edit_gain>-21) {
|
if(edit_gain>-21) {
|
||||||
edit_gain-=3;
|
edit_gain-=3;
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -979,7 +979,7 @@ void RDEditAudio::yDown()
|
|||||||
if(edit_gain<0) {
|
if(edit_gain<0) {
|
||||||
edit_gain+=3;
|
edit_gain+=3;
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1007,7 +1007,7 @@ void RDEditAudio::gotoEndData()
|
|||||||
void RDEditAudio::hscrollData(int value)
|
void RDEditAudio::hscrollData(int value)
|
||||||
{
|
{
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1489,7 +1489,7 @@ void RDEditAudio::gainChangedData()
|
|||||||
setText(QString().sprintf("%4.1f ",
|
setText(QString().sprintf("%4.1f ",
|
||||||
(double)edit_gain_control->value()/100.0)+tr("dB"));
|
(double)edit_gain_control->value()/100.0)+tr("dB"));
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1529,7 +1529,7 @@ void RDEditAudio::gainTimerData()
|
|||||||
setText(QString().sprintf("%4.1f ",
|
setText(QString().sprintf("%4.1f ",
|
||||||
(double)edit_gain_control->value()/100.0)+tr("dB"));
|
(double)edit_gain_control->value()/100.0)+tr("dB"));
|
||||||
DrawMaps();
|
DrawMaps();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// This implements a widget that represents a stereo audio level meter,
|
// This implements a widget that represents a stereo audio level meter,
|
||||||
// complete with labels and scale.
|
// complete with labels and scale.
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU Library General Public License
|
// it under the terms of the GNU Library General Public License
|
||||||
@ -19,10 +19,12 @@
|
|||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "rdplaymeter.h"
|
#include "rdplaymeter.h"
|
||||||
|
|
||||||
RDPlayMeter::RDPlayMeter(RDSegMeter::Orientation orient,QWidget *parent)
|
RDPlayMeter::RDPlayMeter(RDSegMeter::Orientation orient,QWidget *parent)
|
||||||
: RDWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
meter_label=QString("");
|
meter_label=QString("");
|
||||||
orientation=orient;
|
orientation=orient;
|
||||||
@ -30,6 +32,13 @@ RDPlayMeter::RDPlayMeter(RDSegMeter::Orientation orient,QWidget *parent)
|
|||||||
meter=new RDSegMeter(orientation,this);
|
meter=new RDSegMeter(orientation,this);
|
||||||
meter->setSegmentSize(5);
|
meter->setSegmentSize(5);
|
||||||
meter->setSegmentGap(1);
|
meter->setSegmentGap(1);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set Colors
|
||||||
|
//
|
||||||
|
QPalette p=palette();
|
||||||
|
p.setColor(QPalette::Window,Qt::black);
|
||||||
|
setPalette(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,26 +130,29 @@ void RDPlayMeter::setGeometry(int x,int y,int w,int h)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch(orientation) {
|
switch(orientation) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
meter->setGeometry(2,2,w-4-h,h-4);
|
meter->setGeometry(2,2,w-4-h,h-4);
|
||||||
label_font=QFont(font().family(),height()-2,QFont::Bold);
|
label_font=QFont("helvetica",height()-2,QFont::Bold);
|
||||||
label_font.setPixelSize(height()-2);
|
label_font.setPixelSize(height()-2);
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Right:
|
|
||||||
meter->setGeometry(2+h,2,w-4-h,h-4);
|
case RDSegMeter::Right:
|
||||||
label_font=QFont(font().family(),height()-2,QFont::Bold);
|
meter->setGeometry(2+h,2,w-4-h,h-4);
|
||||||
label_font.setPixelSize(height()-2);
|
label_font=QFont("helvetica",height()-2,QFont::Bold);
|
||||||
break;
|
label_font.setPixelSize(height()-2);
|
||||||
case RDSegMeter::Up:
|
break;
|
||||||
meter->setGeometry(2,2,w-4,h-4-w);
|
|
||||||
label_font=QFont(font().family(),width()-2,QFont::Bold);
|
case RDSegMeter::Up:
|
||||||
label_font.setPixelSize(width()-2);
|
meter->setGeometry(2,2,w-4,h-4-w);
|
||||||
break;
|
label_font=QFont("helvetica",width()-2,QFont::Bold);
|
||||||
case RDSegMeter::Down:
|
label_font.setPixelSize(width()-2);
|
||||||
meter->setGeometry(2,2+width(),w-4,h-4-w);
|
break;
|
||||||
label_font=QFont(font().family(),width()-2,QFont::Bold);
|
|
||||||
label_font.setPixelSize(width()-2);
|
case RDSegMeter::Down:
|
||||||
break;
|
meter->setGeometry(2,2+width(),w-4,h-4-w);
|
||||||
|
label_font=QFont("helvetica",width()-2,QFont::Bold);
|
||||||
|
label_font.setPixelSize(width()-2);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
makeFont();
|
makeFont();
|
||||||
}
|
}
|
||||||
@ -201,7 +213,7 @@ void RDPlayMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
// Setup
|
// Setup
|
||||||
//
|
//
|
||||||
QPainter *p=new QPainter(this);
|
QPainter *p=new QPainter(this);
|
||||||
p->fillRect(0,0,width(),height(),Qt::black);
|
p->fillRect(0,0,size().width(),size().height(),Qt::black);
|
||||||
p->setFont(label_font);
|
p->setFont(label_font);
|
||||||
p->setPen(Qt::white);
|
p->setPen(Qt::white);
|
||||||
if(!meter_label.isEmpty()) {
|
if(!meter_label.isEmpty()) {
|
||||||
@ -224,35 +236,39 @@ void RDPlayMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
p->end();
|
p->end();
|
||||||
|
delete p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void RDPlayMeter::makeFont()
|
void RDPlayMeter::makeFont()
|
||||||
{
|
{
|
||||||
switch(orientation) {
|
switch(orientation) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
label_font=QFont(font().family(),height()-2,QFont::Bold);
|
label_font=QFont("helvetica",height()-2,QFont::Bold);
|
||||||
label_font.setPixelSize(height()-2);
|
label_font.setPixelSize(height()-2);
|
||||||
meter_label_x=(height()-QFontMetrics(label_font).width(meter_label))/2;
|
meter_label_x=(height()-QFontMetrics(label_font).
|
||||||
|
width(meter_label))/2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
label_font=QFont(font().family(),height()-2,QFont::Bold);
|
label_font=QFont("helvetica",height()-2,QFont::Bold);
|
||||||
label_font.setPixelSize(height()-2);
|
label_font.setPixelSize(height()-2);
|
||||||
meter_label_x=(height()-QFontMetrics(label_font).width(meter_label))/2;
|
meter_label_x=(height()-QFontMetrics(label_font).
|
||||||
|
width(meter_label))/2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Up:
|
||||||
label_font=QFont(font().family(),width()-2,QFont::Bold);
|
label_font=QFont("helvetica",width()-2,QFont::Bold);
|
||||||
label_font.setPixelSize(width()-2);
|
label_font.setPixelSize(width()-2);
|
||||||
meter_label_x=(width()-QFontMetrics(label_font).width(meter_label))/2;
|
meter_label_x=(width()-QFontMetrics(label_font).
|
||||||
|
width(meter_label))/2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDSegMeter::Down:
|
case RDSegMeter::Down:
|
||||||
label_font=QFont(font().family(),width()-2,QFont::Bold);
|
label_font=QFont("helvetica",width()-2,QFont::Bold);
|
||||||
label_font.setPixelSize(width()-2);
|
label_font.setPixelSize(width()-2);
|
||||||
meter_label_x=(width()-QFontMetrics(label_font).width(meter_label))/2;
|
meter_label_x=(width()-QFontMetrics(label_font).
|
||||||
|
width(meter_label))/2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// A playback audio meter widget.
|
// A playback audio meter widget.
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU Library General Public License
|
// it under the terms of the GNU Library General Public License
|
||||||
@ -21,10 +21,12 @@
|
|||||||
#ifndef RDPLAYMETER_H
|
#ifndef RDPLAYMETER_H
|
||||||
#define RDPLAYMETER_H
|
#define RDPLAYMETER_H
|
||||||
|
|
||||||
#include <rdsegmeter.h>
|
#include <QWidget>
|
||||||
#include <rdwidget.h>
|
|
||||||
|
|
||||||
class RDPlayMeter : public RDWidget
|
#include <rdsegmeter.h>
|
||||||
|
|
||||||
|
|
||||||
|
class RDPlayMeter : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -17,6 +17,18 @@
|
|||||||
// License along with this program; if not, write to the Free Software
|
// License along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
//
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QColor>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QPixmap>
|
||||||
|
#include <QPaintEvent>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <QSlider>
|
||||||
|
#include <QSizePolicy>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "rdsegmeter.h"
|
#include "rdsegmeter.h"
|
||||||
|
|
||||||
@ -24,9 +36,6 @@ RDSegMeter::RDSegMeter(RDSegMeter::Orientation o,QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
orient=o;
|
orient=o;
|
||||||
QPalette pal=palette();
|
|
||||||
pal.setColor(QPalette::Background,Qt::black);
|
|
||||||
setPalette(pal);
|
|
||||||
dark_low_color=QColor(DEFAULT_DARK_LOW_COLOR);
|
dark_low_color=QColor(DEFAULT_DARK_LOW_COLOR);
|
||||||
dark_high_color=QColor(DEFAULT_DARK_HIGH_COLOR);
|
dark_high_color=QColor(DEFAULT_DARK_HIGH_COLOR);
|
||||||
dark_clip_color=QColor(DEFAULT_DARK_CLIP_COLOR);
|
dark_clip_color=QColor(DEFAULT_DARK_CLIP_COLOR);
|
||||||
@ -64,7 +73,7 @@ void RDSegMeter::setRange(int min,int max)
|
|||||||
{
|
{
|
||||||
range_min=min;
|
range_min=min;
|
||||||
range_max=max;
|
range_max=max;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -72,7 +81,7 @@ void RDSegMeter::setDarkLowColor(QColor color)
|
|||||||
{
|
{
|
||||||
if(dark_low_color!=color) {
|
if(dark_low_color!=color) {
|
||||||
dark_low_color=color;
|
dark_low_color=color;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +90,7 @@ void RDSegMeter::setDarkHighColor(QColor color)
|
|||||||
{
|
{
|
||||||
if(dark_high_color!=color) {
|
if(dark_high_color!=color) {
|
||||||
dark_high_color=color;
|
dark_high_color=color;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +99,7 @@ void RDSegMeter::setDarkClipColor(QColor color)
|
|||||||
{
|
{
|
||||||
if(dark_clip_color!=color) {
|
if(dark_clip_color!=color) {
|
||||||
dark_clip_color=color;
|
dark_clip_color=color;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +108,7 @@ void RDSegMeter::setLowColor(QColor color)
|
|||||||
{
|
{
|
||||||
if(low_color!=color) {
|
if(low_color!=color) {
|
||||||
low_color=color;
|
low_color=color;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +117,7 @@ void RDSegMeter::setHighColor(QColor color)
|
|||||||
{
|
{
|
||||||
if(high_color!=color) {
|
if(high_color!=color) {
|
||||||
high_color=color;
|
high_color=color;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +126,7 @@ void RDSegMeter::setClipColor(QColor color)
|
|||||||
{
|
{
|
||||||
if(clip_color!=color) {
|
if(clip_color!=color) {
|
||||||
clip_color=color;
|
clip_color=color;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +135,7 @@ void RDSegMeter::setHighThreshold(int level)
|
|||||||
{
|
{
|
||||||
if(high_threshold!=level) {
|
if(high_threshold!=level) {
|
||||||
high_threshold=level;
|
high_threshold=level;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +144,7 @@ void RDSegMeter::setClipThreshold(int level)
|
|||||||
{
|
{
|
||||||
if(clip_threshold!=level) {
|
if(clip_threshold!=level) {
|
||||||
clip_threshold=level;
|
clip_threshold=level;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,16 +159,16 @@ void RDSegMeter::setMode(RDSegMeter::Mode mode)
|
|||||||
{
|
{
|
||||||
seg_mode=mode;
|
seg_mode=mode;
|
||||||
switch(seg_mode) {
|
switch(seg_mode) {
|
||||||
case RDSegMeter::Independent:
|
case RDSegMeter::Independent:
|
||||||
if(peak_timer->isActive()) {
|
if(peak_timer->isActive()) {
|
||||||
peak_timer->stop();
|
peak_timer->stop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Peak:
|
case RDSegMeter::Peak:
|
||||||
if(!peak_timer->isActive()) {
|
if(!peak_timer->isActive()) {
|
||||||
peak_timer->start(PEAK_HOLD_TIME);
|
peak_timer->start(PEAK_HOLD_TIME);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +177,7 @@ void RDSegMeter::setSolidBar(int level)
|
|||||||
{
|
{
|
||||||
if((seg_mode==RDSegMeter::Independent)&&(solid_bar!=level)) {
|
if((seg_mode==RDSegMeter::Independent)&&(solid_bar!=level)) {
|
||||||
solid_bar=level;
|
solid_bar=level;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,7 +186,7 @@ void RDSegMeter::setFloatingBar(int level)
|
|||||||
{
|
{
|
||||||
if((seg_mode==RDSegMeter::Independent)&&(solid_bar!=level)) {
|
if((seg_mode==RDSegMeter::Independent)&&(solid_bar!=level)) {
|
||||||
floating_bar=level;
|
floating_bar=level;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +202,7 @@ void RDSegMeter::setPeakBar(int level)
|
|||||||
if(solid_bar<range_min) {
|
if(solid_bar<range_min) {
|
||||||
floating_bar=solid_bar;
|
floating_bar=solid_bar;
|
||||||
}
|
}
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +211,7 @@ void RDSegMeter::setSegmentSize(int size)
|
|||||||
{
|
{
|
||||||
if(seg_size!=size) {
|
if(seg_size!=size) {
|
||||||
seg_size=size;
|
seg_size=size;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +220,6 @@ void RDSegMeter::setSegmentGap(int gap)
|
|||||||
{
|
{
|
||||||
if(seg_gap!=gap) {
|
if(seg_gap!=gap) {
|
||||||
seg_gap=gap;
|
seg_gap=gap;
|
||||||
repaint();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,10 +237,10 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
// Setup
|
// Setup
|
||||||
//
|
//
|
||||||
QPixmap pix(this->size());
|
QPixmap pix(this->size());
|
||||||
pix.fill(this,0,0);
|
|
||||||
|
|
||||||
int seg_total=seg_size+seg_gap;
|
int seg_total=seg_size+seg_gap;
|
||||||
QPainter *p=new QPainter(&pix);
|
QPainter *p=new QPainter(&pix);
|
||||||
|
p->fillRect(0,0,width(),height(),Qt::black);
|
||||||
|
|
||||||
low_region=0;
|
low_region=0;
|
||||||
high_region=0;
|
high_region=0;
|
||||||
clip_region=0;
|
clip_region=0;
|
||||||
@ -243,14 +251,14 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
// Set Orientation
|
// Set Orientation
|
||||||
//
|
//
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Up:
|
||||||
p->translate(width(),height());
|
p->translate(width(),height());
|
||||||
p->rotate(180);
|
p->rotate(180);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -263,26 +271,27 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
op_pt=solid_bar;
|
op_pt=solid_bar;
|
||||||
}
|
}
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
low_region=(int)((double)(op_pt-range_min)/
|
low_region=(int)((double)(op_pt-range_min)/
|
||||||
(double)(range_max-range_min)*width()/seg_total);
|
(double)(range_max-range_min)*width()/seg_total);
|
||||||
if(op_pt>range_min) {
|
if(op_pt>range_min) {
|
||||||
for(int i=0;i<low_region;i++) {
|
for(int i=0;i<low_region;i++) {
|
||||||
p->fillRect(i*seg_total,0,seg_size,height(),low_color);
|
p->fillRect(i*seg_total,0,seg_size,height(),low_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Down:
|
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Down:
|
||||||
low_region=(int)((double)(op_pt-range_min)/
|
case RDSegMeter::Up:
|
||||||
(double)(range_max-range_min)*height()/seg_total);
|
low_region=(int)((double)(op_pt-range_min)/
|
||||||
if(op_pt>range_min) {
|
(double)(range_max-range_min)*height()/seg_total);
|
||||||
for(int i=0;i<low_region;i++) {
|
if(op_pt>range_min) {
|
||||||
p->fillRect(0,i*seg_total,width(),seg_size,low_color);
|
for(int i=0;i<low_region;i++) {
|
||||||
}
|
p->fillRect(0,i*seg_total,width(),seg_size,low_color);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -295,26 +304,27 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
op_pt=solid_bar;
|
op_pt=solid_bar;
|
||||||
}
|
}
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
high_region=(int)((double)(op_pt-high_threshold)/
|
high_region=(int)((double)(op_pt-high_threshold)/
|
||||||
(double)(range_max-range_min)*width()/seg_total);
|
(double)(range_max-range_min)*width()/seg_total);
|
||||||
if(op_pt>high_threshold) {
|
if(op_pt>high_threshold) {
|
||||||
for(int i=low_region;i<low_region+high_region;i++) {
|
for(int i=low_region;i<low_region+high_region;i++) {
|
||||||
p->fillRect(i*seg_total,0,seg_size,height(),high_color);
|
p->fillRect(i*seg_total,0,seg_size,height(),high_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Down:
|
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Down:
|
||||||
high_region=(int)((double)(op_pt-high_threshold)/
|
case RDSegMeter::Up:
|
||||||
(double)(range_max-range_min)*height()/seg_total);
|
high_region=(int)((double)(op_pt-high_threshold)/
|
||||||
if(op_pt>high_threshold) {
|
(double)(range_max-range_min)*height()/seg_total);
|
||||||
for(int i=low_region;i<low_region+high_region;i++) {
|
if(op_pt>high_threshold) {
|
||||||
p->fillRect(0,i*seg_total,width(),seg_size,high_color);
|
for(int i=low_region;i<low_region+high_region;i++) {
|
||||||
}
|
p->fillRect(0,i*seg_total,width(),seg_size,high_color);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -327,54 +337,56 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
op_pt=solid_bar;
|
op_pt=solid_bar;
|
||||||
}
|
}
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
clip_region=(int)((double)(op_pt-clip_threshold)/
|
clip_region=(int)((double)(op_pt-clip_threshold)/
|
||||||
(double)(range_max-range_min)*width()/seg_total);
|
(double)(range_max-range_min)*width()/seg_total);
|
||||||
if(op_pt>clip_threshold) {
|
if(op_pt>clip_threshold) {
|
||||||
for(int i=low_region+high_region;
|
for(int i=low_region+high_region;
|
||||||
i<low_region+high_region+clip_region;i++) {
|
i<low_region+high_region+clip_region;i++) {
|
||||||
p->fillRect(i*seg_total,0,seg_size,height(),clip_color);
|
p->fillRect(i*seg_total,0,seg_size,height(),clip_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Down:
|
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Down:
|
||||||
clip_region=(int)((double)(op_pt-range_min)/
|
case RDSegMeter::Up:
|
||||||
(double)(range_max-range_min)*height()/seg_total);
|
clip_region=(int)((double)(op_pt-range_min)/
|
||||||
if(op_pt>clip_threshold) {
|
(double)(range_max-range_min)*height()/seg_total);
|
||||||
for(int i=low_region+high_region;
|
if(op_pt>clip_threshold) {
|
||||||
i<low_region+high_region+clip_region;i++) {
|
for(int i=low_region+high_region;
|
||||||
p->fillRect(0,i*seg_total,width(),seg_size,clip_color);
|
i<low_region+high_region+clip_region;i++) {
|
||||||
}
|
p->fillRect(0,i*seg_total,width(),seg_size,clip_color);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// The dark low range
|
// The dark low range
|
||||||
//
|
//
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
dark_low_region=(int)((double)(high_threshold-range_min)/
|
dark_low_region=(int)((double)(high_threshold-range_min)/
|
||||||
(double)(range_max-range_min)*width()/seg_total);
|
(double)(range_max-range_min)*width()/seg_total);
|
||||||
if(op_pt<high_threshold) {
|
if(op_pt<high_threshold) {
|
||||||
for(int i=low_region;i<dark_low_region;i++) {
|
for(int i=low_region;i<dark_low_region;i++) {
|
||||||
p->fillRect(i*seg_total,0,seg_size,height(),dark_low_color);
|
p->fillRect(i*seg_total,0,seg_size,height(),dark_low_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Down:
|
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Down:
|
||||||
dark_low_region=(int)((double)(high_threshold-range_min)/
|
case RDSegMeter::Up:
|
||||||
(double)(range_max-range_min)*height()/seg_total);
|
dark_low_region=(int)((double)(high_threshold-range_min)/
|
||||||
if(op_pt<high_threshold) {
|
(double)(range_max-range_min)*height()/seg_total);
|
||||||
for(int i=low_region;i<dark_low_region;i++) {
|
if(op_pt<high_threshold) {
|
||||||
p->fillRect(0,i*seg_total,width(),seg_size,dark_low_color);
|
for(int i=low_region;i<dark_low_region;i++) {
|
||||||
}
|
p->fillRect(0,i*seg_total,width(),seg_size,dark_low_color);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -387,27 +399,28 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
op_pt=dark_low_region;
|
op_pt=dark_low_region;
|
||||||
}
|
}
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
dark_high_region=(int)((double)(clip_threshold-range_min)/
|
dark_high_region=(int)((double)(clip_threshold-range_min)/
|
||||||
(double)(range_max-range_min)*width()/seg_total);
|
(double)(range_max-range_min)*width()/seg_total);
|
||||||
if(solid_bar<clip_threshold) {
|
if(solid_bar<clip_threshold) {
|
||||||
for(int i=op_pt;
|
for(int i=op_pt;
|
||||||
i<dark_high_region;i++) {
|
i<dark_high_region;i++) {
|
||||||
p->fillRect(i*seg_total,0,seg_size,height(),dark_high_color);
|
p->fillRect(i*seg_total,0,seg_size,height(),dark_high_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Down:
|
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Down:
|
||||||
dark_high_region=(int)((double)(clip_threshold-range_min)/
|
case RDSegMeter::Up:
|
||||||
(double)(range_max-range_min)*height()/seg_total);
|
dark_high_region=(int)((double)(clip_threshold-range_min)/
|
||||||
if(solid_bar<clip_threshold) {
|
(double)(range_max-range_min)*height()/seg_total);
|
||||||
for(int i=op_pt;i<dark_high_region;i++) {
|
if(solid_bar<clip_threshold) {
|
||||||
p->fillRect(0,i*seg_total,width(),seg_size,dark_high_color);
|
for(int i=op_pt;i<dark_high_region;i++) {
|
||||||
}
|
p->fillRect(0,i*seg_total,width(),seg_size,dark_high_color);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -420,27 +433,28 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
op_pt=dark_high_region;
|
op_pt=dark_high_region;
|
||||||
}
|
}
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
dark_clip_region=(int)((double)(range_max-range_min)/
|
dark_clip_region=(int)((double)(range_max-range_min)/
|
||||||
(double)(range_max-range_min)*width()/seg_total);
|
(double)(range_max-range_min)*width()/seg_total);
|
||||||
if(solid_bar<range_max) {
|
if(solid_bar<range_max) {
|
||||||
for(int i=op_pt;i<dark_clip_region;i++) {
|
for(int i=op_pt;i<dark_clip_region;i++) {
|
||||||
p->fillRect(i*seg_total,0,seg_size,height(),dark_clip_color);
|
p->fillRect(i*seg_total,0,seg_size,height(),dark_clip_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RDSegMeter::Down:
|
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Down:
|
||||||
dark_clip_region=(int)((double)(range_max-range_min)/
|
case RDSegMeter::Up:
|
||||||
(double)(range_max-range_min)*height()/seg_total);
|
dark_clip_region=(int)((double)(range_max-range_min)/
|
||||||
if(solid_bar<range_max) {
|
(double)(range_max-range_min)*height()/seg_total);
|
||||||
for(int i=op_pt;
|
if(solid_bar<range_max) {
|
||||||
i<dark_clip_region;i++) {
|
for(int i=op_pt;
|
||||||
p->fillRect(0,i*seg_total,width(),seg_size,dark_clip_color);
|
i<dark_clip_region;i++) {
|
||||||
}
|
p->fillRect(0,i*seg_total,width(),seg_size,dark_clip_color);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -457,21 +471,21 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
float_color=clip_color;
|
float_color=clip_color;
|
||||||
}
|
}
|
||||||
switch(orient) {
|
switch(orient) {
|
||||||
case RDSegMeter::Left:
|
case RDSegMeter::Left:
|
||||||
case RDSegMeter::Right:
|
case RDSegMeter::Right:
|
||||||
float_region=(int)((double)(floating_bar-range_min)/
|
float_region=(int)((double)(floating_bar-range_min)/
|
||||||
(double)(range_max-range_min)*width());
|
(double)(range_max-range_min)*width());
|
||||||
float_region=seg_total*(float_region/seg_total);
|
float_region=seg_total*(float_region/seg_total);
|
||||||
p->fillRect(float_region,0,seg_size,height(),float_color);
|
p->fillRect(float_region,0,seg_size,height(),float_color);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDSegMeter::Down:
|
case RDSegMeter::Down:
|
||||||
case RDSegMeter::Up:
|
case RDSegMeter::Up:
|
||||||
float_region=(int)((double)(floating_bar-range_min)/
|
float_region=(int)((double)(floating_bar-range_min)/
|
||||||
(double)(range_max-range_min)*height());
|
(double)(range_max-range_min)*height());
|
||||||
float_region=seg_total*(float_region/seg_total);
|
float_region=seg_total*(float_region/seg_total);
|
||||||
p->fillRect(0,float_region,width(),seg_size,float_color);
|
p->fillRect(0,float_region,width(),seg_size,float_color);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,8 +500,5 @@ void RDSegMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
void RDSegMeter::peakData()
|
void RDSegMeter::peakData()
|
||||||
{
|
{
|
||||||
floating_bar=solid_bar;
|
floating_bar=solid_bar;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,11 +17,15 @@
|
|||||||
// License along with this program; if not, write to the Free Software
|
// License along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
//
|
//
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef RDSEGMETER_H
|
#ifndef RDSEGMETER_H
|
||||||
#define RDSEGMETER_H
|
#define RDSEGMETER_H
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QPaintEvent>
|
||||||
|
#include <QSizePolicy>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
@ -40,7 +44,6 @@
|
|||||||
*/
|
*/
|
||||||
#define PEAK_HOLD_TIME 750
|
#define PEAK_HOLD_TIME 750
|
||||||
|
|
||||||
|
|
||||||
class RDSegMeter : public QWidget
|
class RDSegMeter : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// This implements a widget that represents a stereo audio level meter,
|
// This implements a widget that represents a stereo audio level meter,
|
||||||
// complete with labels and scale.
|
// complete with labels and scale.
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2003,2016 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU Library General Public License
|
// it under the terms of the GNU Library General Public License
|
||||||
@ -19,24 +19,10 @@
|
|||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <qwidget.h>
|
|
||||||
#include <qstring.h>
|
|
||||||
#include <qfont.h>
|
|
||||||
#include <qfontmetrics.h>
|
|
||||||
#include <qcolor.h>
|
|
||||||
#include <qpainter.h>
|
|
||||||
#include <qpushbutton.h>
|
|
||||||
#include <qsize.h>
|
|
||||||
//Added by qt3to4:
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <qslider.h>
|
|
||||||
#include <qsizepolicy.h>
|
|
||||||
#include <qmessagebox.h>
|
|
||||||
|
|
||||||
#include <rdsegmeter.h>
|
#include "rdsegmeter.h"
|
||||||
#include <rdstereometer.h>
|
#include "rdstereometer.h"
|
||||||
|
|
||||||
RDStereoMeter::RDStereoMeter(QWidget *parent)
|
RDStereoMeter::RDStereoMeter(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
@ -46,9 +32,6 @@ RDStereoMeter::RDStereoMeter(QWidget *parent)
|
|||||||
clip_light_on=false;
|
clip_light_on=false;
|
||||||
label_x=0;
|
label_x=0;
|
||||||
meter_label=QString("");
|
meter_label=QString("");
|
||||||
QPalette pal=palette();
|
|
||||||
pal.setColor(QPalette::Background,Qt::black);
|
|
||||||
setPalette(pal);
|
|
||||||
left_meter=new RDSegMeter(RDSegMeter::Right,this);
|
left_meter=new RDSegMeter(RDSegMeter::Right,this);
|
||||||
left_meter->setGeometry(25,10,300,10);
|
left_meter->setGeometry(25,10,300,10);
|
||||||
left_meter->setRange(-4600,-800);
|
left_meter->setRange(-4600,-800);
|
||||||
@ -76,6 +59,13 @@ RDStereoMeter::RDStereoMeter(QWidget *parent)
|
|||||||
meter_label_font.setPixelSize(18);
|
meter_label_font.setPixelSize(18);
|
||||||
meter_scale_font=QFont("System",12,QFont::Bold);
|
meter_scale_font=QFont("System",12,QFont::Bold);
|
||||||
meter_scale_font.setPixelSize(12);
|
meter_scale_font.setPixelSize(12);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set Colors
|
||||||
|
//
|
||||||
|
QPalette p=palette();
|
||||||
|
p.setColor(QPalette::Window,Qt::black);
|
||||||
|
setPalette(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -286,21 +276,21 @@ void RDStereoMeter::paintEvent(QPaintEvent *paintEvent)
|
|||||||
// Setup
|
// Setup
|
||||||
//
|
//
|
||||||
QPixmap pix(this->size());
|
QPixmap pix(this->size());
|
||||||
pix.fill(this,0,0);
|
|
||||||
QPainter *p=new QPainter(&pix);
|
QPainter *p=new QPainter(&pix);
|
||||||
|
p->fillRect(0,0,width(),height(),Qt::black);
|
||||||
p->setBrush(QColor(Qt::white));
|
p->setBrush(QColor(Qt::white));
|
||||||
p->setPen(QColor(Qt::white));
|
p->setPen(QColor(Qt::white));
|
||||||
p->setFont(meter_scale_font);
|
p->setFont(meter_scale_font);
|
||||||
p->drawText(10,20,tr("L"));
|
p->drawText(10,20,tr("L"));
|
||||||
p->drawText(10,50,tr("R"));
|
p->drawText(10,50,tr("R"));
|
||||||
p->drawText(12,35,"-30");
|
p->drawText(38,35,"-35");
|
||||||
p->drawText(48,35,"-25");
|
p->drawText(77,35,"-30");
|
||||||
p->drawText(88,35,"-20");
|
p->drawText(116,35,"-25");
|
||||||
p->drawText(126,35,"-15");
|
p->drawText(153,35,"-20");
|
||||||
p->drawText(167,35,"-10");
|
p->drawText(191,35,"-15");
|
||||||
p->drawText(207,35,"-5");
|
p->drawText(229,35,"-10");
|
||||||
p->drawText(255,35,"0");
|
p->drawText(267,35,"-5");
|
||||||
p->drawText(314,35,"+8");
|
p->drawText(317,35,"0");
|
||||||
if(meter_label!=QString("")) {
|
if(meter_label!=QString("")) {
|
||||||
p->setFont(meter_label_font);
|
p->setFont(meter_label_font);
|
||||||
p->drawText(label_x,72,meter_label);
|
p->drawText(label_x,72,meter_label);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// A Stereo Audio Meter Widget
|
// A Stereo Audio Meter Widget
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002,2016 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU Library General Public License
|
// it under the terms of the GNU Library General Public License
|
||||||
@ -17,19 +17,14 @@
|
|||||||
// License along with this program; if not, write to the Free Software
|
// License along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
//
|
//
|
||||||
|
//
|
||||||
|
|
||||||
#ifndef RDSTEREOMETER_H
|
#ifndef RDSTEREOMETER_H
|
||||||
#define RDSTEREOMETER_H
|
#define RDSTEREOMETER_H
|
||||||
|
|
||||||
#include <qwidget.h>
|
#include <QtGui/QtGui>
|
||||||
#include <qcolor.h>
|
|
||||||
#include <qpainter.h>
|
#include "rdsegmeter.h"
|
||||||
#include <qsize.h>
|
|
||||||
#include <qsizepolicy.h>
|
|
||||||
#include <qstring.h>
|
|
||||||
//Added by qt3to4:
|
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <rdsegmeter.h>
|
|
||||||
|
|
||||||
#define CLIP_LIGHT_COLOR Qt::red
|
#define CLIP_LIGHT_COLOR Qt::red
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ void PieCounter::start(int offset)
|
|||||||
{
|
{
|
||||||
pie_time=pie_length-offset;
|
pie_time=pie_length-offset;
|
||||||
pie_running=true;
|
pie_running=true;
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PieCounter::setLogline(RDLogLine *logline)
|
void PieCounter::setLogline(RDLogLine *logline)
|
||||||
@ -173,7 +173,7 @@ void PieCounter::stop()
|
|||||||
pie_running=false;
|
pie_running=false;
|
||||||
pie_time_label->hide();
|
pie_time_label->hide();
|
||||||
pie_talk_label->hide();
|
pie_talk_label->hide();
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ void PieCounter::tickCounter()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pie_time_label->setText(QString().sprintf(":%02d",(1000+pie_time)/1000));
|
pie_time_label->setText(QString().sprintf(":%02d",(1000+pie_time)/1000));
|
||||||
repaint();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user