summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc66
1 files changed, 41 insertions, 25 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index e709fe8..555d3ab 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -82,6 +82,8 @@ MainWindow::MainWindow(QApplication *qApp, QWidget* parent, const char* name )
img_clear = loadButtonIcon( PIXMAP_CLEAR );
img_snapshot = loadButtonIcon( PIXMAP_SNAPSHOT );
img_logo = loadButtonIcon( PIXMAP_LOGO_SMALL, 1 );
+ img_mute = loadButtonIcon( PIXMAP_MUTE );
+ img_unmute = loadButtonIcon( PIXMAP_UNMUTE );
img_dummy = loadImage( PIXMAP_DUMMY );
@@ -106,6 +108,7 @@ MainWindow::MainWindow(QApplication *qApp, QWidget* parent, const char* name )
recording = false;
frozen = false;
+ muted = false;
info->log("MIaV is ready.");
@@ -157,29 +160,29 @@ void MainWindow::createGui()
{
// Layout widgets
- /* _________________________________________________
- *(0) __________________________ | ______________ |
- * | | | | | | | | |
- * |(1) | | | |(2) | |
- * | | | | | | | | |
- * | | | | | | | | |
- * | | | | | | |______________| |
- * | | | | | | | | |
- * | | | | | | | | |
- * | | | | | | | | |
- * | |________|________|________| | | | |
- * | | | | | | |______________| |
- * | |________|________|________| | | | |
- * | | | | | | | | |
- * | |________|________|________| | | | |
- * | | | | | | | | |
- * | |________|________|________| | |______________| |
- * |______________________________|__________________|
- * |______________________________|__________________|
+ /* __________________________________________________
+ *(0) ___________________________ | ______________ |
+ * | | | | | | | | | |
+ * |(1) | | | | |(2) | |
+ * | | | | | | | | | |
+ * | | | | | | | | | |
+ * | | | | | | | |______________| |
+ * | | | | | | | | | |
+ * | | | | | | | | | |
+ * | | | | | | | | | |
+ * | |______|______|______|______| | | | |
+ * | | | | | | | |______________| |
+ * | |______|______|______|______| | | | |
+ * | | | | | | | | | |
+ * | |______|______|______|______| | | | |
+ * | | | | | | | | | |
+ * | |______|______|______|______| | |______________| |
+ * |_______________________________|__________________|
+ * |_______________________________|__________________|
*/
QGridLayout *g0 = new QGridLayout(this, 2, 2, 0, -1);
- QGridLayout *g1 = new QGridLayout(3, 4, -1);
+ QGridLayout *g1 = new QGridLayout(4, 4, -1);
g0->addLayout(g1, 0, 0);
QGroupBox *gb = new QGroupBox(this);
@@ -211,22 +214,22 @@ void MainWindow::createGui()
img_live = new VideoWidget(img_recedge, camera);
img_live->setFixedSize(output_width - 20, output_height - 20);
img_live->move(10,10);
- g1->addMultiCellWidget ( img_recedge, 0, 0, 0, 2, Qt::AlignHCenter);
+ g1->addMultiCellWidget ( img_recedge, 0, 0, 0, 3, Qt::AlignHCenter);
// QObject::connect( img_live, SIGNAL(clicked()), this, SLOT(live_clicked()) );
// CPR/NAME LABEL + CPR button
lbl_cpr = createLabel("", output_width - (int)(BUTTON_WIDTH * unit), BUTTON_HEIGHT);
- g1->addMultiCellWidget ( lbl_cpr, 1, 1, 0, 1);
+ g1->addMultiCellWidget ( lbl_cpr, 1, 1, 0, 2);
btn_cpr = createButton("");
btn_cpr->setFocus();
btn_cpr->setPixmap(*img_cpr);
QObject::connect( btn_cpr, SIGNAL(clicked()), this, SLOT(cpr_clicked()) );
// Will also be connected in the MGUI code
- g1->addWidget(btn_cpr, 1, 2);
+ g1->addWidget(btn_cpr, 1, 3);
lbl_name = createLabel("", output_width, (int)(BUTTON_HEIGHT * 0.8f));
- g1->addMultiCellWidget ( lbl_name, 2, 2, 0, 2);
+ g1->addMultiCellWidget ( lbl_name, 2, 2, 0, 3);
/*
btn_clear = createButton("");
btn_clear->setPixmap(*img_clear);
@@ -250,6 +253,11 @@ void MainWindow::createGui()
QObject::connect( btn_freeze, SIGNAL(clicked()), this, SLOT(freeze_clicked()) );
g1->addWidget(btn_freeze, 3, 2);
+ btn_mute = createButton("");
+ btn_mute->setPixmap(*img_mute);
+ QObject::connect( btn_mute, SIGNAL(clicked()), this, SLOT(mute_clicked()) );
+ g1->addWidget(btn_mute, 3, 3);
+
// History widgets
int w = (int)((float)BUTTON_WIDTH * unit);
int h = (int)(576.0f / (720.0f / ((float)BUTTON_WIDTH * unit)));
@@ -316,7 +324,8 @@ QLabel *MainWindow::createLabel(char *caption, int width, int height)
{
QLabel *lbl = new QLabel(caption, this);
lbl->setFont( QFont( "Sans Serif",
- (height>1)?(int)(unit * height / 2):(int)(unit * height / 3),
+ //(height>1)?(int)(unit * height / 2):(int)(unit * height / 2),
+ (int)(unit * height / 2),
(height>1)?QFont::Bold:QFont::Normal ) );
lbl->setFixedHeight((int)(unit * height));
return lbl;
@@ -540,4 +549,11 @@ void MainWindow::freeze_clicked()
}
}
+void MainWindow::mute_clicked()
+{
+ muted = !muted;
+ if(muted) btn_mute->setPixmap(*img_unmute);
+ else btn_mute->setPixmap(*img_mute);
+}
+
#endif /*USE_GUI*/