summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
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;