diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cc | 66 | ||||
-rw-r--r-- | src/mainwindow.h | 8 |
2 files changed, 49 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*/ diff --git a/src/mainwindow.h b/src/mainwindow.h index 8f75aeb..617ac6b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -77,6 +77,9 @@ Optagelsen standses ved tryk på den røde cirkel med gul streg over." /** * Images */ +#define PIXMAP_MUTE PIXMAPS"/mute.png" +#define PIXMAP_UNMUTE PIXMAPS"/unmute.png" + #define PIXMAP_RECORD PIXMAPS"/record.png" #define PIXMAP_STOP PIXMAPS"/stop.png" @@ -108,6 +111,7 @@ public slots: void redraw_edge(); void taskbar_update(); void about_clicked(); + void mute_clicked(); private: void clear(); @@ -131,6 +135,8 @@ private: QImage *img_record; QImage *img_stop; QImage *img_logo; + QImage *img_mute; + QImage *img_unmute; QImage *img_dummy; @@ -155,6 +161,7 @@ private: QPushButton *btn_rec; QPushButton *btn_shoot; QPushButton *btn_freeze; + QPushButton *btn_mute; QPushButton *btn_about; @@ -164,6 +171,7 @@ private: bool recording; bool frozen; + bool muted; // Configuration values float unit; |