# HG changeset patch # User benoitrigolleau # Date 1181743649 0 # Node ID a5d941805d4565930bf0403dd96407423d926b80 # Parent 9e1a46a72cded64408137b111400adcb4201e4e0 widgets for the audio filter list diff -r 9e1a46a72cde -r a5d941805d45 widgets/AudioFilterViewerWidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/AudioFilterViewerWidget.cpp Wed Jun 13 14:07:29 2007 +0000 @@ -0,0 +1,92 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* +Sound Access +EASAIER client application. +Silogic 2007. Benoit Rigolleau. + +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. See the file +COPYING included with this distribution for more information. +*/ + +//#include "data/model/LayerItemModel.h" +#include "AudioFilterViewerWidget.h" +#include + +AudioFilterViewerWidget::AudioFilterViewerWidget(QWidget *parent) : QFrame(parent){ + /* Init all variables*/ + m_pushButtonCONFIG = new QPushButton; + m_pushButtonUP = new QPushButton; + m_pushButtonDOWN = new QPushButton; + m_pushButtonREMOVE = new QPushButton; + m_pushButtonNEW = new QPushButton; + + m_layoutACTION = new QHBoxLayout; + m_layoutMAIN = new QVBoxLayout; + + m_widgetLIST = new ItemContainer(); + + /* set the correct widget parameters*/ + m_pushButtonCONFIG->setMaximumSize(20,20); + m_pushButtonCONFIG->setIcon(QIcon(":icons/layerViewer_btn_config.png")); + m_pushButtonUP->setMaximumSize(20,20); + m_pushButtonUP->setIcon(QIcon(":icons/layerViewer_btn_up.png")); + m_pushButtonDOWN->setMaximumSize(20,20); + m_pushButtonDOWN->setIcon(QIcon(":icons/layerViewer_btn_down.png")); + m_pushButtonREMOVE->setMaximumSize(20,20); + m_pushButtonREMOVE->setIcon(QIcon(":icons/layerViewer_btn_remove.png")); + m_pushButtonNEW->setMaximumSize(20,20); + m_pushButtonNEW->setIcon(QIcon(":icons/layerViewer_btn_new.png")); + + //the action one: + m_layoutACTION->addWidget(m_pushButtonCONFIG); + m_layoutACTION->addStretch(); + m_layoutACTION->addWidget(m_pushButtonUP); + m_layoutACTION->addWidget(m_pushButtonDOWN); + m_layoutACTION->addWidget(m_pushButtonNEW); + m_layoutACTION->addSpacing(10); + m_layoutACTION->addWidget(m_pushButtonREMOVE); + + //the main one: + m_layoutMAIN->addWidget(m_widgetLIST); + m_layoutMAIN->addLayout(m_layoutACTION); + + /* connect pushButtons*/ + connect(m_pushButtonUP,SIGNAL(clicked()),m_widgetLIST,SLOT(upCurrentItem())); + connect(m_pushButtonDOWN,SIGNAL(clicked()),m_widgetLIST,SLOT(downCurrentItem())); + connect(m_pushButtonCONFIG,SIGNAL(clicked()),m_widgetLIST,SLOT(openConfigBoxForCurrentItem())); + connect(m_pushButtonREMOVE,SIGNAL(clicked()),this,SLOT(removeSelectedItemRequested())); + + /*connect the list of items */ + connect(m_widgetLIST,SIGNAL(currentChanged(int)),this,SLOT(newItemSelected(int))); + + + /*add the main layout in this widget*/ + this->setLayout(m_layoutMAIN); + this->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + this->setLineWidth(2); +} + +void AudioFilterViewerWidget::addItem(ItemAudioFilterList *item){ + m_widgetLIST->addItem(item); +} + +void AudioFilterViewerWidget::removeAllItems(){ + m_widgetLIST->removeAllItems(); +} + +void AudioFilterViewerWidget::setCurrentIndex(int i){ + +} + +/************** SLOTS ********/ +void AudioFilterViewerWidget::newItemSelected(int i){ + emit currentChanged(i); +} + +void AudioFilterViewerWidget::removeSelectedItemRequested(){ + +} \ No newline at end of file diff -r 9e1a46a72cde -r a5d941805d45 widgets/AudioFilterViewerWidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/AudioFilterViewerWidget.h Wed Jun 13 14:07:29 2007 +0000 @@ -0,0 +1,58 @@ + +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* +Sound Access +EASAIER client application. +Silogic 2007. Benoit Rigolleau. + +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. See the file +COPYING included with this distribution for more information. +*/ + +#ifndef _AUDIO_FILTER_VIEWER_WIDGET_H +#define _AUDIO_FILTER_WIDGET_H + +#include "ItemContainer.h" +#include "ItemAudioFilterList.h" +#include +#include +#include +#include + + + +class AudioFilterViewerWidget : public QFrame{ + Q_OBJECT + +public: + AudioFilterViewerWidget(QWidget *parent=0); + void addItem(ItemAudioFilterList *item); + void removeAllItems(); + void setCurrentIndex(int i); +signals : + void currentChanged(int i); + +private: + QPushButton *m_pushButtonCONFIG; + QPushButton *m_pushButtonUP; + QPushButton *m_pushButtonDOWN; + QPushButton *m_pushButtonREMOVE; + QPushButton *m_pushButtonNEW; + + QHBoxLayout *m_layoutACTION; + QVBoxLayout *m_layoutMAIN; + + ItemContainer *m_widgetLIST; + +protected slots: + void newItemSelected(int i); + virtual void removeSelectedItemRequested(); + +}; + +#endif + diff -r 9e1a46a72cde -r a5d941805d45 widgets/EasaierStyle.cpp --- a/widgets/EasaierStyle.cpp Wed Jun 13 13:55:31 2007 +0000 +++ b/widgets/EasaierStyle.cpp Wed Jun 13 14:07:29 2007 +0000 @@ -22,7 +22,7 @@ palette.setBrush(QPalette::Disabled, QPalette::Link, QColor(QRgb(0xff0000ee))); palette.setBrush(QPalette::Disabled, QPalette::LinkVisited, QColor(QRgb(0xff52188b))); palette.setBrush(QPalette::Active, QPalette::WindowText, QColor(QRgb(0xff000000))); - palette.setBrush(QPalette::Active, QPalette::Button, QColor(QRgb(0xffdddfe4))); //dddfe4 + palette.setBrush(QPalette::Active, QPalette::Button, QColor(QRgb(0xffdddfe4))); palette.setBrush(QPalette::Active, QPalette::Light, QColor(QRgb(0xffffffff))); palette.setBrush(QPalette::Active, QPalette::Midlight, QColor(QRgb(0xffffffff))); palette.setBrush(QPalette::Active, QPalette::Dark, QColor(QRgb(0xff555555))); diff -r 9e1a46a72cde -r a5d941805d45 widgets/ItemAudioFilterList.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/ItemAudioFilterList.cpp Wed Jun 13 14:07:29 2007 +0000 @@ -0,0 +1,125 @@ + +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sound Access + EASAIER client application. + Silogic 2007. Benoit Rigolleau. + + 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. See the file + COPYING included with this distribution for more information. +*/ + +#include "ItemAudioFilterList.h" + +#include "data/model/LayerItemModel.h" +#include "layer/Layer.h" +#include "base/PlayParameters.h" + +#include + +#include +#include + + +ItemAudioFilterList::ItemAudioFilterList(QWidget *parent) : GenericItemList(parent){ + setAcceptDrops(true); + + /* Init all variables*/ + m_labelIcon = new QLabel; + m_labelName = new QLabel; + m_checkBoxPlay = new QCheckBox; + m_layoutMain = new QHBoxLayout; + + /* set the correct widget parameters*/ + m_labelIcon->setMaximumSize(25,25); + //labelIcon->setPixmap(QIcon(":icons/layerViewer_btn_config.png").pixmap(20)); + + m_labelName->setMaximumHeight(25); + //labelName->setText("ljdh lksdf hl"); + + m_checkBoxPlay->setMaximumSize(30,30); + + m_layoutMain->setSpacing(5); + m_layoutMain->setMargin(0); + + this->setMaximumHeight(30); + this->setMinimumHeight(30); + this->setFrameStyle(QFrame::Panel | QFrame::Raised); + this->setLineWidth(1); + + /* build the interface*/ + m_layoutMain->addWidget(m_checkBoxPlay); + m_layoutMain->addWidget(m_labelIcon); + m_layoutMain->addWidget(m_labelName); + + /*add the main layout in this widget*/ + this->setLayout(m_layoutMain); + + connect(this, SIGNAL(doubleClicked()), this, SLOT(openPropertyBox())); +} + +void ItemAudioFilterList::setIcon(QString &icon){ + m_labelIcon->setPixmap(QIcon(icon).pixmap(25)); +} + +void ItemAudioFilterList::setName(QString &name){ + m_labelName->setText(name); +} + + +void ItemAudioFilterList::changeCheckBoxPlayState(bool state){ + m_checkBoxPlay->setChecked(state); +} + +void ItemAudioFilterList::setPropertyBox(PropertyBox *box){ + m_propertyBox = box; + if(m_propertyBox!=0){ + + m_container = m_propertyBox->container(); + + + updateCheckboxs(); + connect(m_propertyBox, SIGNAL(showLayer(bool)), this, SLOT(showLayer(bool))); + } + + //connect(); +} + +void ItemAudioFilterList::configAction(){ + if(m_propertyBox!=0){ + m_propertyBox->close(); + m_propertyBox->show(); + } +} + + +/*********SLOTS ************/ +void ItemAudioFilterList::openPropertyBox(){ + ItemAudioFilterList::configAction(); +} + +void ItemAudioFilterList::updateCheckboxs(){ + + PlayParameters *params = m_container->getPlayParameters(); + + if(params){ + m_checkBoxPlay->setEnabled(true); + m_checkBoxPlay->setChecked(!params->isPlayMuted()); + + connect(params, SIGNAL(playAudibleChanged(bool)),m_checkBoxPlay, SLOT(setState(bool))); + connect(m_checkBoxPlay, SIGNAL(stateChanged(int)),params, SLOT(setPlayAudible(int))); + }else{ + m_checkBoxPlay->setEnabled(false); + } +} + + + + + + + diff -r 9e1a46a72cde -r a5d941805d45 widgets/ItemAudioFilterList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/ItemAudioFilterList.h Wed Jun 13 14:07:29 2007 +0000 @@ -0,0 +1,52 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sound Access + EASAIER client application. + Silogic 2007. Benoit Rigolleau. + + 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. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef _ITEM_AUDIO_FILTER_LIST_H +#define _ITEM_AUDIO_FILTER_LIST_H + +#include "GenericItemList.h" +#include "PropertyBox.h" + +#include +#include +#include +#include + + +class ItemAudioFilterList : public GenericItemList{ + Q_OBJECT + +public: + ItemAudioFilterList(QWidget *parent=0); + void setIcon(QString &icon); + void setName(QString &name); + void changeCheckBoxPlayState(bool state); + void setPropertyBox(PropertyBox *box); + virtual void configAction(); + +private: + QLabel *m_labelIcon; + QLabel *m_labelName; + QCheckBox *m_checkBoxPlay; + QHBoxLayout *m_layoutMain; + PropertyBox *m_propertyBox; + PropertyContainer *m_container; + +private slots : + void openPropertyBox(); + void updateCheckboxs(); + +}; + +#endif diff -r 9e1a46a72cde -r a5d941805d45 widgets/svwidgets.vcproj --- a/widgets/svwidgets.vcproj Wed Jun 13 13:55:31 2007 +0000 +++ b/widgets/svwidgets.vcproj Wed Jun 13 14:07:29 2007 +0000 @@ -182,6 +182,10 @@ > + + @@ -210,6 +214,10 @@ > + + @@ -374,6 +382,32 @@ + + + + + + + + + + + + + + + + + + @@ -1219,6 +1283,10 @@ > + + diff -r 9e1a46a72cde -r a5d941805d45 widgets/widgets.pro --- a/widgets/widgets.pro Wed Jun 13 13:55:31 2007 +0000 +++ b/widgets/widgets.pro Wed Jun 13 14:07:29 2007 +0000 @@ -44,6 +44,8 @@ ConnectionSettings.h \ ConnectionStatus.h \ MultiPaneLayerContainer.h \ + AudioFilterViewerWidget.h \ + ItemAudioFilterList.h \ EasaierStyle.h \ GenericItemList.h \ LayerViewerWidget.h \ @@ -78,7 +80,8 @@ WidgetGallery.cpp \ ConnectionSettings.cpp \ ConnectionStatus.cpp \ - MultiPaneLayerContainer.cpp \ + AudioFilterViewerWidget.cpp \ + ItemAudioFilterList.cpp \ EasaierStyle.cpp \ GenericItemList.cpp \ LayerViewerWidget.cpp \