summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-05-21 14:49:34 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-05-21 14:49:34 +0200
commiteda4e58427a74f8ea969b3062327b6ea6309d310 (patch)
tree3ebf64810df1d1fe1f040db27a164c63c0bd3962 /src/mainwindow.cc
parent47bda1b593220afcd17df66fe38b6683b8500a4b (diff)
Reanable recording indicator.
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index c8c427b..9d1c190 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -49,6 +49,9 @@
#include <config.h>
//"miav-grab.h"
+// Control fade speed of record bar.
+#define SPEED 0.07f
+
//#define WITH_DV
MainWindow::MainWindow(QApplication *_qApp, QWidget* parent, const char* name )
: QWidget( parent, Qt::FramelessWindowHint )
@@ -65,7 +68,7 @@ MainWindow::MainWindow(QApplication *_qApp, QWidget* parent, const char* name )
unit = ((float)resolution_w / config->readFloat("screensize")) / INCH_IN_CM;
- printf("Unit: %f\n", unit);
+ //printf("Unit: %f\n", unit);
move(0,0);
resize(resolution_w, resolution_h);
@@ -214,16 +217,18 @@ void MainWindow::createGui()
g1->margin() * 5 -
g0->margin() * 3;
- img_recedge = new QLabel(this);
- //img_recedge->setBackgroundColor(QColor(160,160,160));
+ img_recedge = new RecEdge();
img_recedge->setFixedSize(output_width, output_height);
img_live = new VideoWidget(img_recedge, camera);
+ img_recedge->setInnerWidget(img_live);
+
img_live->setFixedSize(output_width - 20, output_height - 20);
img_live->move(10,10);
//g1->addWidget ( img_recedge, 0, 0, 0, 3, Qt::AlignHCenter);
g1->addWidget ( img_recedge, 0, 0, 1, 4, Qt::AlignHCenter);
// QObject::connect( img_live, SIGNAL(clicked()), this, SLOT(live_clicked()) );
+ img_recedge->setIdle(true);
// CPR/NAME LABEL + CPR button
lbl_cpr = createLabel("", output_width - (int)(BUTTON_WIDTH * unit), BUTTON_HEIGHT);
@@ -393,17 +398,11 @@ void MainWindow::taskbar_update()
lbl_recordtime->setText(msg);
}
-#define GREY 160
-#define SPEED 0.07f
void MainWindow::redraw_edge()
{
- /* // TODO
rec_edge_counter += SPEED;
float val = fabs(sin(rec_edge_counter));
- img_recedge->setBackgroundColor(QColor((int) ((255 - GREY) * val + GREY),
- (int) (GREY - (GREY * val)),
- (int) (GREY - (GREY * val))));
- */
+ img_recedge->setLevel(val);
}
void MainWindow::message(char *msg)
@@ -508,7 +507,7 @@ void MainWindow::rec_clicked()
recording = 0;
camera->stop(SAVE);
timer->stop();
- //img_recedge->setBackgroundColor(QColor(160,160,160)); // TODO
+ img_recedge->setIdle(true);
btn_rec->setIcon(QPixmap(PIXMAP_RECORD));
break;
@@ -517,7 +516,7 @@ void MainWindow::rec_clicked()
recording = 0;
camera->stop(DELETE);
timer->stop();
- //img_recedge->setBackgroundColor(QColor(160,160,160));// TODO
+ img_recedge->setIdle(true);
btn_rec->setIcon(QPixmap(PIXMAP_RECORD));
break;
@@ -526,7 +525,7 @@ void MainWindow::rec_clicked()
recording = 0;
camera->stop(LATER);
timer->stop();
- //img_recedge->setBackgroundColor(QColor(160,160,160));// TODO
+ img_recedge->setIdle(true);
btn_rec->setIcon(QPixmap(PIXMAP_RECORD));
break;