[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/plugins LV2/LV2PluginPropertiesDia...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/plugins LV2/LV2PluginPropertiesDia... |
Date: |
Fri, 25 May 2007 00:07:56 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/05/25 00:07:56
Modified files:
src/plugins/LV2: LV2PluginPropertiesDialog.cpp
LV2PluginPropertiesDialog.h
src/plugins : PluginSlider.cpp PluginSlider.h
Log message:
round float value to nearest int if control hint is int control
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.cpp?cvsroot=traverso&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.h?cvsroot=traverso&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/PluginSlider.cpp?cvsroot=traverso&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/PluginSlider.h?cvsroot=traverso&r1=1.4&r2=1.5
Patches:
Index: LV2/LV2PluginPropertiesDialog.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- LV2/LV2PluginPropertiesDialog.cpp 24 May 2007 23:43:59 -0000 1.8
+++ LV2/LV2PluginPropertiesDialog.cpp 25 May 2007 00:07:55 -0000 1.9
@@ -44,10 +44,12 @@
QWidget* optionsWidget = new QWidget(this);
QHBoxLayout* optionsLayout = new QHBoxLayout;
optionsWidget->setLayout(optionsLayout);
- QPushButton* bypassButton = new QPushButton(tr("Bypass"),
optionsWidget);
+ m_bypassButton = new QPushButton(tr("Bypass"), optionsWidget);
+ m_bypassButton->setCheckable(true);
+ m_bypassButton->setChecked(plugin->is_bypassed());
QPushButton* closeButton = new QPushButton(tr("Close"), optionsWidget);
QPushButton* resetButton = new QPushButton(tr("Reset"), optionsWidget);
- optionsLayout->addWidget(bypassButton);
+ optionsLayout->addWidget(m_bypassButton);
optionsLayout->addWidget(resetButton);
optionsLayout->addStretch(10);
optionsLayout->addWidget(closeButton);
@@ -107,12 +109,13 @@
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
connect(resetButton, SIGNAL(clicked()), this,
SLOT(reset_button_clicked()));
- connect(bypassButton, SIGNAL(clicked()), this,
SLOT(bypass_button_clicked()));
+ connect(m_bypassButton, SIGNAL(clicked()), this,
SLOT(bypass_button_clicked()));
}
void LV2PluginPropertiesDialog::bypass_button_clicked()
{
m_plugin->toggle_bypass();
+ m_bypassButton->setChecked(m_plugin->is_bypassed());
}
void LV2PluginPropertiesDialog::reset_button_clicked()
Index: LV2/LV2PluginPropertiesDialog.h
===================================================================
RCS file:
/sources/traverso/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- LV2/LV2PluginPropertiesDialog.h 24 May 2007 23:44:00 -0000 1.5
+++ LV2/LV2PluginPropertiesDialog.h 25 May 2007 00:07:55 -0000 1.6
@@ -27,6 +27,7 @@
class LV2Plugin;
class PluginSlider;
+class QPushButton;
class LV2PluginPropertiesDialog : public QDialog
{
@@ -40,6 +41,7 @@
private:
LV2Plugin* m_plugin;
QList<PluginSlider*> m_sliders;
+ QPushButton* m_bypassButton;
private slots:
void bypass_button_clicked();
Index: PluginSlider.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/PluginSlider.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- PluginSlider.cpp 24 May 2007 23:44:00 -0000 1.6
+++ PluginSlider.cpp 25 May 2007 00:07:56 -0000 1.7
@@ -58,7 +58,8 @@
if (m_xpos <= 1) m_xpos = 2;
painter.setBrush(background);
- painter.drawRect(0, 0, width() - 0.5, height() - 0.5);
+ QRectF rect(0.0, 0.0, width() - 0.5, height() - 0.5);
+ painter.drawRect(rect);
painter.fillRect(1, 1, m_xpos - 2, height() - 2, QBrush(color));
if (m_port->get_hint() == PluginPort::INT_CONTROL) {
painter.drawText(0, 0, width(), height(), Qt::AlignCenter,
QString::number((int)m_value));
@@ -100,8 +101,12 @@
m_value = (relativePos * range) + m_min;
+ // in case of INT_CONTROL, round float to nearest int value.
+ if (m_port->get_hint() == PluginPort::INT_CONTROL) {
+ m_value = float(int(0.5 + m_value));
+ }
+
emit sliderValueChanged(m_value);
- emit sliderValueChangedDouble((double)m_value);
update();
}
@@ -150,7 +155,6 @@
{
m_value = m_port->get_default_value();
update_slider_position();
- update();
}
//eof
Index: PluginSlider.h
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/PluginSlider.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- PluginSlider.h 24 May 2007 23:44:00 -0000 1.4
+++ PluginSlider.h 25 May 2007 00:07:56 -0000 1.5
@@ -64,8 +64,6 @@
signals:
void sliderValueChanged(float value);
- void sliderValueChangedDouble(double value);
-
};
#endif