1 /***************************************************************************
2 complexparameter.cpp - description
5 copyright : (C) 2008 by Marco Gittler
6 email : g.marco@freenet.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
21 #include "complexparameter.h"
22 #include "effectslist.h"
24 #include <QHeaderView>
27 ComplexParameter::ComplexParameter(QWidget *parent)
30 //ui.effectlist->horizontalHeader()->setVisible(false);
31 //ui.effectlist->verticalHeader()->setVisible(false);
36 ui.buttonLeftRight->setIcon(KIcon("go-next"));//better icons needed
37 ui.buttonLeftRight->setToolTip(i18n("Allow horizontal moves"));
38 ui.buttonUpDown->setIcon(KIcon("go-up"));
39 ui.buttonUpDown->setToolTip(i18n("Allow vertical moves"));
40 ui.buttonShowInTimeline->setIcon(KIcon("kmplayer"));
41 ui.buttonShowInTimeline->setToolTip(i18n("Show keyframes in timeline"));
42 ui.buttonHelp->setIcon(KIcon("help-about"));
43 ui.buttonHelp->setToolTip(i18n("Parameter info"));
44 ui.buttonNewPoints->setIcon(KIcon("xedit"));
45 ui.buttonNewPoints->setToolTip(i18n("Add keyframe"));
47 connect(ui.buttonLeftRight, SIGNAL(clicked()), this , SLOT(slotSetMoveX()));
48 connect(ui.buttonUpDown, SIGNAL(clicked()), this , SLOT(slotSetMoveY()));
49 connect(ui.buttonShowInTimeline, SIGNAL(clicked()), this , SLOT(slotShowInTimeline()));
50 connect(ui.buttonNewPoints, SIGNAL(clicked()), this , SLOT(slotSetNew()));
51 connect(ui.buttonHelp, SIGNAL(clicked()), this , SLOT(slotSetHelp()));
52 connect(ui.parameterList, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slotParameterChanged(const QString&)));
53 //connect (ui.effectlist, SIGNAL (itemSelectionChanged() ) , this, SLOT ( itemSelectionChanged()));
54 connect(this, SIGNAL(transferParamDesc(const QDomElement&, const QString&, int , int)), ui.kplotwidget, SLOT(setPointLists(const QDomElement&, const QString&, int , int)));
55 connect(ui.kplotwidget, SIGNAL(parameterChanged(QDomElement)), this , SLOT(slotUpdateEffectParams(QDomElement)));
56 connect(ui.kplotwidget, SIGNAL(parameterList(QStringList)), this , SLOT(slotUpdateParameterList(QStringList)));
57 /*ÜeffectLists["audio"]=audioEffectList;
58 effectLists["video"]=videoEffectList;
59 effectLists["custom"]=customEffectList;*/
60 setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
68 void ComplexParameter::slotSetMoveX() {
69 ui.kplotwidget->setMoveX(!ui.kplotwidget->isMoveX());
73 void ComplexParameter::slotSetMoveY() {
74 ui.kplotwidget->setMoveY(!ui.kplotwidget->isMoveY());
78 void ComplexParameter::slotSetNew() {
79 ui.kplotwidget->setNewPoints(!ui.kplotwidget->isNewPoints());
83 void ComplexParameter::slotSetHelp() {
84 ui.infoBox->setVisible(!ui.infoBox->isVisible());
85 ui.buttonHelp->setDown(ui.infoBox->isVisible());
88 void ComplexParameter::slotShowInTimeline() {
90 ui.kplotwidget->setMoveTimeLine(!ui.kplotwidget->isMoveTimeline());
95 void ComplexParameter::updateButtonStatus() {
96 ui.buttonLeftRight->setDown(ui.kplotwidget->isMoveX());
97 ui.buttonUpDown->setDown(ui.kplotwidget->isMoveY());
99 ui.buttonShowInTimeline->setEnabled(ui.kplotwidget->isMoveX() || ui.kplotwidget->isMoveY());
100 ui.buttonShowInTimeline->setDown(ui.kplotwidget->isMoveTimeline());
102 ui.buttonNewPoints->setEnabled(ui.parameterList->currentText() != "all");
103 ui.buttonNewPoints->setDown(ui.kplotwidget->isNewPoints());
106 void ComplexParameter::slotParameterChanged(const QString& text) {
108 //ui.buttonNewPoints->setEnabled(text!="all");
109 ui.kplotwidget->replot(text);
110 updateButtonStatus();
113 void ComplexParameter::setupParam(const QDomElement& d, const QString& paramName, int from, int to) {
115 ui.kplotwidget->setPointLists(d, paramName, from, to);
118 void ComplexParameter::itemSelectionChanged() {
119 //kDebug() << "drop";
122 void ComplexParameter::slotUpdateEffectParams(QDomElement e) {
124 emit parameterChanged();
127 QDomElement ComplexParameter::getParamDesc() {
131 void ComplexParameter::slotUpdateParameterList(QStringList l) {
133 ui.parameterList->clear();
134 ui.parameterList->addItem("all");
135 ui.parameterList->addItems(l);
138 #include "complexparameter.moc"