From 3537e2fc6d9081b3da78eecd426f452b68300aa8 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 1 May 2009 10:55:51 +0000 Subject: [PATCH] preparations for adding LED bar GUI control --- linux/Makefile.am | 7 +++++- src/multicolorled.cpp | 6 ++--- src/multicolorled.h | 2 +- src/multicolorledbar.cpp | 44 +++++++++++++++++++++++++++++++++ src/multicolorledbar.h | 53 ++++++++++++++++++++++++++++++++++++++++ windows/MocQT.bat | 2 ++ windows/llcon.vcproj | 14 ++++++++++- 7 files changed, 122 insertions(+), 6 deletions(-) create mode 100755 src/multicolorledbar.cpp create mode 100755 src/multicolorledbar.h diff --git a/linux/Makefile.am b/linux/Makefile.am index c946170b..0ae5de17 100755 --- a/linux/Makefile.am +++ b/linux/Makefile.am @@ -1,6 +1,5 @@ bin_PROGRAMS = llcon - llcon_SOURCES = ../src/buffer.cpp \ ../src/main.cpp \ ../src/socket.cpp \ @@ -17,6 +16,7 @@ llcon_SOURCES = ../src/buffer.cpp \ ../src/settings.cpp \ ../src/protocol.cpp \ ../src/multicolorled.cpp \ + ../src/multicolorledbar.cpp \ ../src/audiomixerboard.cpp \ ../src/soundbase.cpp \ sound.cpp \ @@ -33,6 +33,7 @@ llcon_SOURCES = ../src/buffer.cpp \ ../src/settings.h \ ../src/protocol.h \ ../src/multicolorled.h \ + ../src/multicolorledbar.h \ ../src/audiomixerboard.h \ ../src/soundbase.h \ ../src/llconserverdlg.h \ @@ -88,6 +89,7 @@ BUILT_SOURCES=moc/moc_server.cpp \ moc/moc_channel.cpp \ moc/moc_socket.cpp \ moc/moc_multicolorled.cpp \ + moc/moc_multicolorledbar.cpp \ moc/moc_audiomixerboard.cpp \ moc/moc_util.cpp \ moc/moc_llconclientdlg.cpp \ @@ -124,6 +126,9 @@ moc/moc_socket.cpp: ../src/socket.h moc/moc_multicolorled.cpp: ../src/multicolorled.h $(QT_MOC) ../src/multicolorled.h -o moc/moc_multicolorled.cpp +moc/moc_multicolorledbar.cpp: ../src/multicolorledbar.h + $(QT_MOC) ../src/multicolorledbar.h -o moc/moc_multicolorledbar.cpp + moc/moc_audiomixerboard.cpp: ../src/audiomixerboard.h $(QT_MOC) ../src/audiomixerboard.h -o moc/moc_audiomixerboard.cpp diff --git a/src/multicolorled.cpp b/src/multicolorled.cpp index 2a69b850..056c6ae7 100755 --- a/src/multicolorled.cpp +++ b/src/multicolorled.cpp @@ -31,10 +31,10 @@ /* Implementation *************************************************************/ CMultiColorLED::CMultiColorLED ( QWidget* parent, Qt::WindowFlags f ) : QLabel ( parent, f ), - BitmCubeGreen ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreenSmall.png" ) ), - BitmCubeRed ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDRedSmall.png" ) ), BitmCubeGrey ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreySmall.png" ) ), - BitmCubeYellow ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDYellowSmall.png" ) ) + BitmCubeGreen ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreenSmall.png" ) ), + BitmCubeYellow ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDYellowSmall.png" ) ), + BitmCubeRed ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDRedSmall.png" ) ) { // init color flags Reset(); diff --git a/src/multicolorled.h b/src/multicolorled.h index e3f2fae2..e005c31f 100755 --- a/src/multicolorled.h +++ b/src/multicolorled.h @@ -65,10 +65,10 @@ protected: void UpdateColor(); + QPixmap BitmCubeGrey; QPixmap BitmCubeGreen; QPixmap BitmCubeYellow; QPixmap BitmCubeRed; - QPixmap BitmCubeGrey; QTimer TimerRedLight; QTimer TimerGreenLight; diff --git a/src/multicolorledbar.cpp b/src/multicolorledbar.cpp new file mode 100755 index 00000000..2082be52 --- /dev/null +++ b/src/multicolorledbar.cpp @@ -0,0 +1,44 @@ +/******************************************************************************\ + * Copyright (c) 2004-2009 + * + * Author(s): + * Volker Fischer + * + * Description: + * Implements a multi color LED bar + * + ****************************************************************************** + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +\******************************************************************************/ + +#include "multicolorledbar.h" + + +/* Implementation *************************************************************/ +CMultiColorLEDBar::CMultiColorLEDBar ( QWidget* parent, Qt::WindowFlags f ) + : QLabel ( parent, f ), + BitmCubeRoundGrey ( QString::fromUtf8 ( ":/png/LEDs/res/VRLEDGreySmall.png" ) ), + BitmCubeRoundGreen ( QString::fromUtf8 ( ":/png/LEDs/res/VRLEDGreySmall.png" ) ), + BitmCubeRoundYellow ( QString::fromUtf8 ( ":/png/LEDs/res/VRLEDGreySmall.png" ) ), + BitmCubeRoundRed ( QString::fromUtf8 ( ":/png/LEDs/res/VRLEDGreySmall.png" ) ), + BitmCubeEdgeGrey ( QString::fromUtf8 ( ":/png/LEDs/res/VLEDGreySmall.png" ) ), + BitmCubeEdgeGreen ( QString::fromUtf8 ( ":/png/LEDs/res/VLEDGreySmall.png" ) ), + BitmCubeEdgeYellow ( QString::fromUtf8 ( ":/png/LEDs/res/VLEDGreySmall.png" ) ), + BitmCubeEdgeRed ( QString::fromUtf8 ( ":/png/LEDs/res/VLEDGreySmall.png" ) ) +{ + +} diff --git a/src/multicolorledbar.h b/src/multicolorledbar.h new file mode 100755 index 00000000..0f603ce7 --- /dev/null +++ b/src/multicolorledbar.h @@ -0,0 +1,53 @@ +/******************************************************************************\ + * Copyright (c) 2004-2009 + * + * Author(s): + * Volker Fischer + * + ****************************************************************************** + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +\******************************************************************************/ + +#if !defined ( _MULTCOLORLEDBAR_H__FD6B49B5_87DF_48DD_E1606C2AC__INCLUDED_ ) +#define _MULTCOLORLEDBAR_H__FD6B49B5_87DF_48DD_E1606C2AC__INCLUDED_ + +#include +#include +#include +#include "global.h" + + +/* Classes ********************************************************************/ +class CMultiColorLEDBar : public QLabel +{ + Q_OBJECT + +public: + CMultiColorLEDBar ( QWidget* parent = 0, Qt::WindowFlags f = 0 ); + +protected: + QPixmap BitmCubeRoundGrey; + QPixmap BitmCubeRoundGreen; + QPixmap BitmCubeRoundYellow; + QPixmap BitmCubeRoundRed; + QPixmap BitmCubeEdgeGrey; + QPixmap BitmCubeEdgeGreen; + QPixmap BitmCubeEdgeYellow; + QPixmap BitmCubeEdgeRed; +}; + +#endif // _MULTCOLORLEDBAR_H__FD6B49B5_87DF_48DD_E1606C2AC__INCLUDED_ diff --git a/windows/MocQT.bat b/windows/MocQT.bat index 8a3f0fb2..2a762eba 100755 --- a/windows/MocQT.bat +++ b/windows/MocQT.bat @@ -6,6 +6,7 @@ rem * Volker Fischer rem * rem * Description: rem * Script for compiling the QT resources under Windows (MOCing and UICing) +rem * rem ****************************************************************************** rem * rem * This program is free software; you can redistribute it and/or modify it under @@ -28,6 +29,7 @@ rem\**************************************************************************** rem .h -------------- %qtdir%\bin\moc.exe ..\src\util.h -o moc\moc_util.cpp %qtdir%\bin\moc.exe ..\src\multicolorled.h -o moc\moc_multicolorled.cpp +%qtdir%\bin\moc.exe ..\src\multicolorledbar.h -o moc\moc_multicolorledbar.cpp %qtdir%\bin\moc.exe ..\src\audiomixerboard.h -o moc\moc_audiomixerboard.cpp %qtdir%\bin\moc.exe ..\src\llconclientdlg.h -o moc\moc_llconclientdlg.cpp %qtdir%\bin\moc.exe ..\src\clientsettingsdlg.h -o moc\moc_clientsettingsdlg.cpp diff --git a/windows/llcon.vcproj b/windows/llcon.vcproj index 81d0eae0..2d189856 100755 --- a/windows/llcon.vcproj +++ b/windows/llcon.vcproj @@ -1,7 +1,7 @@ + + @@ -758,6 +762,10 @@ /> + + @@ -974,6 +982,10 @@ RelativePath="..\src\multicolorled.h" > + +