m_startPix(QPixmap()),
m_endPix(QPixmap()),
m_hasThumbs(false),
- startThumbTimer(NULL),
- endThumbTimer(NULL),
+ m_startThumbTimer(NULL),
+ m_endThumbTimer(NULL),
m_selectedEffect(-1),
m_timeLine(0),
m_startThumbRequested(false),
m_endThumbRequested(false),
m_hover(false),
m_speed(speed),
- framePixelWidth(0)
+ m_framePixelWidth(0)
{
setZValue(1);
setRect(0, 0, (info.endPos - info.startPos).frames(fps) - 0.02, (double)(KdenliveSettings::trackheight() - 2));
m_cropStart = info.cropStart;
m_maxDuration = clip->maxDuration();
setAcceptDrops(true);
- audioThumbReady = clip->audioThumbCreated();
+ m_audioThumbReady = clip->audioThumbCreated();
/*
m_cropStart = xml.attribute("in", 0).toInt();
if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW || m_clipType == PLAYLIST) {
setBrush(QColor(141, 166, 215));
m_hasThumbs = true;
- startThumbTimer = new QTimer(this);
- startThumbTimer->setSingleShot(true);
- connect(startThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetStartThumb()));
- endThumbTimer = new QTimer(this);
- endThumbTimer->setSingleShot(true);
- connect(endThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetEndThumb()));
+ m_startThumbTimer = new QTimer(this);
+ m_startThumbTimer->setSingleShot(true);
+ connect(m_startThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetStartThumb()));
+ m_endThumbTimer = new QTimer(this);
+ m_endThumbTimer->setSingleShot(true);
+ connect(m_endThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetEndThumb()));
connect(this, SIGNAL(getThumb(int, int)), clip->thumbProducer(), SLOT(extractImage(int, int)));
//connect(this, SIGNAL(getThumb(int, int)), clip->thumbProducer(), SLOT(getVideoThumbs(int, int)));
ClipItem::~ClipItem()
{
- delete startThumbTimer;
- delete endThumbTimer;
+ delete m_startThumbTimer;
+ delete m_endThumbTimer;
delete m_timeLine;
}
m_startPix = QPixmap();
m_endPix = QPixmap();
slotFetchThumbs();
- audioThumbCachePic.clear();
+ m_audioThumbCachePic.clear();
}
void ClipItem::slotGotAudioData()
{
- audioThumbReady = true;
+ m_audioThumbReady = true;
if (m_clipType == AV && !isAudioOnly()) {
QRectF r = boundingRect();
r.setTop(r.top() + r.height() / 2 - 1);
}
// draw audio thumbnails
- if (KdenliveSettings::audiothumbnails() && m_speed == 1.0 && !isVideoOnly() && ((m_clipType == AV && (exposed.bottom() > (itemHeight / 2) || isAudioOnly())) || m_clipType == AUDIO) && audioThumbReady) {
+ if (KdenliveSettings::audiothumbnails() && m_speed == 1.0 && !isVideoOnly() && ((m_clipType == AV && (exposed.bottom() > (itemHeight / 2) || isAudioOnly())) || m_clipType == AUDIO) && m_audioThumbReady) {
double startpixel = exposed.left();
if (startpixel < 0)
} else mappedRect = mapped;
int channels = baseClip()->getProperty("channels").toInt();
- if (scale != framePixelWidth)
- audioThumbCachePic.clear();
+ if (scale != m_framePixelWidth)
+ m_audioThumbCachePic.clear();
double cropLeft = m_cropStart.frames(m_fps);
const int clipStart = mappedRect.x();
const int mappedStartPixel = painter->matrix().map(QPointF(startpixel + cropLeft, 0)).x() - clipStart;
}
for (int startCache = mappedStartPixel - (mappedStartPixel) % 100; startCache < mappedEndPixel; startCache += 100) {
- if (audioThumbCachePic.contains(startCache) && !audioThumbCachePic[startCache].isNull())
- painter->drawPixmap(clipStart + startCache - cropLeft, mappedRect.y(), audioThumbCachePic[startCache]);
+ if (m_audioThumbCachePic.contains(startCache) && !m_audioThumbCachePic[startCache].isNull())
+ painter->drawPixmap(clipStart + startCache - cropLeft, mappedRect.y(), m_audioThumbCachePic[startCache]);
}
}
for (int startCache = startpixel - startpixel % 100;startCache < endpixel;startCache += 100) {
//kDebug() << "creating " << startCache;
//if (framePixelWidth!=pixelForOneFrame ||
- if (framePixelWidth == pixelForOneFrame && audioThumbCachePic.contains(startCache))
+ if (m_framePixelWidth == pixelForOneFrame && m_audioThumbCachePic.contains(startCache))
continue;
- if (audioThumbCachePic[startCache].isNull() || framePixelWidth != pixelForOneFrame) {
- audioThumbCachePic[startCache] = QPixmap(100, (int)(re.height()));
- audioThumbCachePic[startCache].fill(QColor(180, 180, 200, 140));
+ if (m_audioThumbCachePic[startCache].isNull() || m_framePixelWidth != pixelForOneFrame) {
+ m_audioThumbCachePic[startCache] = QPixmap(100, (int)(re.height()));
+ m_audioThumbCachePic[startCache].fill(QColor(180, 180, 200, 140));
}
bool fullAreaDraw = pixelForOneFrame < 10;
QMap<int, QPainterPath > positiveChannelPaths;
QMap<int, QPainterPath > negativeChannelPaths;
- QPainter pixpainter(&audioThumbCachePic[startCache]);
+ QPainter pixpainter(&m_audioThumbCachePic[startCache]);
QPen audiopen;
audiopen.setWidth(0);
pixpainter.setPen(audiopen);
return;
}
- int channelHeight = audioThumbCachePic[startCache].height() / channels;
+ int channelHeight = m_audioThumbCachePic[startCache].height() / channels;
for (int i = 0;i < channels;i++) {
int sample = (int)((frame - (int)(frame)) * 20); // AUDIO_FRAME_SIZE
if (frame < 0 || sample < 0 || sample > 19)
continue;
- QMap<int, QByteArray> frame_channel_data = baseClip()->audioFrameChache[(int)frame];
+ QMap<int, QByteArray> frame_channel_data = baseClip()->m_audioFrameCache[(int)frame];
for (int channel = 0;channel < channels && frame_channel_data[channel].size() > 0;channel++) {
}
}
//audioThumbWasDrawn=true;
- framePixelWidth = pixelForOneFrame;
+ m_framePixelWidth = pixelForOneFrame;
//}
}
checkEffectsKeyframesPos(previous, cropStart().frames(m_fps), true);
if (m_hasThumbs && KdenliveSettings::videothumbnails()) {
/*connect(m_clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));*/
- startThumbTimer->start(150);
+ m_startThumbTimer->start(150);
}
}
}
if (updateKeyFrames) checkEffectsKeyframesPos(previous, (cropStart() + duration()).frames(m_fps), false);
if (m_hasThumbs && KdenliveSettings::videothumbnails()) {
/*connect(m_clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));*/
- endThumbTimer->start(150);
+ m_endThumbTimer->start(150);
}
}
}
m_audioOnly = force;
if (m_audioOnly) setBrush(QColor(141, 215, 166));
else setBrush(QColor(141, 166, 215));
- audioThumbCachePic.clear();
+ m_audioThumbCachePic.clear();
}
bool ClipItem::isAudioOnly() const
QPixmap m_startPix;
QPixmap m_endPix;
bool m_hasThumbs;
- QTimer *startThumbTimer;
- QTimer *endThumbTimer;
+ QTimer *m_startThumbTimer;
+ QTimer *m_endThumbTimer;
int m_selectedEffect;
QTimeLine *m_timeLine;
EffectsList m_effectList;
QList <Transition*> m_transitionsList;
- QMap<int, QPixmap> audioThumbCachePic;
- bool audioThumbReady;
- double framePixelWidth;
+ QMap<int, QPixmap> m_audioThumbCachePic;
+ bool m_audioThumbReady;
+ double m_framePixelWidth;
/** Called when clip start is resized, adjust keyframes values */
void checkEffectsKeyframesPos(const int previous, const int current, bool fromStart);
QPixmap m_videoPix;
ComplexParameter::ComplexParameter(QWidget *parent) :
QWidget(parent)
{
- ui.setupUi(this);
- //ui.effectlist->horizontalHeader()->setVisible(false);
- //ui.effectlist->verticalHeader()->setVisible(false);
-
-
- ui.buttonLeftRight->setIcon(KIcon("go-next"));//better icons needed
- ui.buttonLeftRight->setToolTip(i18n("Allow horizontal moves"));
- ui.buttonUpDown->setIcon(KIcon("go-up"));
- ui.buttonUpDown->setToolTip(i18n("Allow vertical moves"));
- ui.buttonShowInTimeline->setIcon(KIcon("kmplayer"));
- ui.buttonShowInTimeline->setToolTip(i18n("Show keyframes in timeline"));
- ui.buttonHelp->setIcon(KIcon("help-about"));
- ui.buttonHelp->setToolTip(i18n("Parameter info"));
- ui.buttonNewPoints->setIcon(KIcon("document-new"));
- ui.buttonNewPoints->setToolTip(i18n("Add keyframe"));
-
- connect(ui.buttonLeftRight, SIGNAL(clicked()), this , SLOT(slotSetMoveX()));
- connect(ui.buttonUpDown, SIGNAL(clicked()), this , SLOT(slotSetMoveY()));
- connect(ui.buttonShowInTimeline, SIGNAL(clicked()), this , SLOT(slotShowInTimeline()));
- connect(ui.buttonNewPoints, SIGNAL(clicked()), this , SLOT(slotSetNew()));
- connect(ui.buttonHelp, SIGNAL(clicked()), this , SLOT(slotSetHelp()));
- connect(ui.parameterList, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slotParameterChanged(const QString&)));
- //connect (ui.effectlist, SIGNAL (itemSelectionChanged() ) , this, SLOT ( itemSelectionChanged()));
- connect(this, SIGNAL(transferParamDesc(const QDomElement&, const QString&, int , int)), ui.kplotwidget, SLOT(setPointLists(const QDomElement&, const QString&, int , int)));
- connect(ui.kplotwidget, SIGNAL(parameterChanged(QDomElement)), this , SLOT(slotUpdateEffectParams(QDomElement)));
- connect(ui.kplotwidget, SIGNAL(parameterList(QStringList)), this , SLOT(slotUpdateParameterList(QStringList)));
+ m_ui.setupUi(this);
+ //m_ui.effectlist->horizontalHeader()->setVisible(false);
+ //m_ui.effectlist->verticalHeader()->setVisible(false);
+
+
+ m_ui.buttonLeftRight->setIcon(KIcon("go-next"));//better icons needed
+ m_ui.buttonLeftRight->setToolTip(i18n("Allow horizontal moves"));
+ m_ui.buttonUpDown->setIcon(KIcon("go-up"));
+ m_ui.buttonUpDown->setToolTip(i18n("Allow vertical moves"));
+ m_ui.buttonShowInTimeline->setIcon(KIcon("kmplayer"));
+ m_ui.buttonShowInTimeline->setToolTip(i18n("Show keyframes in timeline"));
+ m_ui.buttonHelp->setIcon(KIcon("help-about"));
+ m_ui.buttonHelp->setToolTip(i18n("Parameter info"));
+ m_ui.buttonNewPoints->setIcon(KIcon("document-new"));
+ m_ui.buttonNewPoints->setToolTip(i18n("Add keyframe"));
+
+ connect(m_ui.buttonLeftRight, SIGNAL(clicked()), this , SLOT(slotSetMoveX()));
+ connect(m_ui.buttonUpDown, SIGNAL(clicked()), this , SLOT(slotSetMoveY()));
+ connect(m_ui.buttonShowInTimeline, SIGNAL(clicked()), this , SLOT(slotShowInTimeline()));
+ connect(m_ui.buttonNewPoints, SIGNAL(clicked()), this , SLOT(slotSetNew()));
+ connect(m_ui.buttonHelp, SIGNAL(clicked()), this , SLOT(slotSetHelp()));
+ connect(m_ui.parameterList, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slotParameterChanged(const QString&)));
+ //connect (m_ui.effectlist, SIGNAL (itemSelectionChanged() ) , this, SLOT ( itemSelectionChanged()));
+ connect(this, SIGNAL(transferParamDesc(const QDomElement&, const QString&, int , int)), m_ui.kplotwidget, SLOT(setPointLists(const QDomElement&, const QString&, int , int)));
+ connect(m_ui.kplotwidget, SIGNAL(parameterChanged(QDomElement)), this , SLOT(slotUpdateEffectParams(QDomElement)));
+ connect(m_ui.kplotwidget, SIGNAL(parameterList(QStringList)), this , SLOT(slotUpdateParameterList(QStringList)));
/*ÃœeffectLists["audio"]=audioEffectList;
effectLists["video"]=videoEffectList;
effectLists["custom"]=customEffectList;*/
setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
- ui.infoBox->hide();
+ m_ui.infoBox->hide();
updateButtonStatus();
}
void ComplexParameter::slotSetMoveX()
{
- ui.kplotwidget->setMoveX(!ui.kplotwidget->isMoveX());
+ m_ui.kplotwidget->setMoveX(!m_ui.kplotwidget->isMoveX());
updateButtonStatus();
}
void ComplexParameter::slotSetMoveY()
{
- ui.kplotwidget->setMoveY(!ui.kplotwidget->isMoveY());
+ m_ui.kplotwidget->setMoveY(!m_ui.kplotwidget->isMoveY());
updateButtonStatus();
}
void ComplexParameter::slotSetNew()
{
- ui.kplotwidget->setNewPoints(!ui.kplotwidget->isNewPoints());
+ m_ui.kplotwidget->setNewPoints(!m_ui.kplotwidget->isNewPoints());
updateButtonStatus();
}
void ComplexParameter::slotSetHelp()
{
- ui.infoBox->setVisible(!ui.infoBox->isVisible());
- ui.buttonHelp->setDown(ui.infoBox->isVisible());
+ m_ui.infoBox->setVisible(!m_ui.infoBox->isVisible());
+ m_ui.buttonHelp->setDown(m_ui.infoBox->isVisible());
}
void ComplexParameter::slotShowInTimeline()
{
- ui.kplotwidget->setMoveTimeLine(!ui.kplotwidget->isMoveTimeline());
+ m_ui.kplotwidget->setMoveTimeLine(!m_ui.kplotwidget->isMoveTimeline());
updateButtonStatus();
}
void ComplexParameter::updateButtonStatus()
{
- ui.buttonLeftRight->setDown(ui.kplotwidget->isMoveX());
- ui.buttonUpDown->setDown(ui.kplotwidget->isMoveY());
+ m_ui.buttonLeftRight->setDown(m_ui.kplotwidget->isMoveX());
+ m_ui.buttonUpDown->setDown(m_ui.kplotwidget->isMoveY());
- ui.buttonShowInTimeline->setEnabled(ui.kplotwidget->isMoveX() || ui.kplotwidget->isMoveY());
- ui.buttonShowInTimeline->setDown(ui.kplotwidget->isMoveTimeline());
+ m_ui.buttonShowInTimeline->setEnabled(m_ui.kplotwidget->isMoveX() || m_ui.kplotwidget->isMoveY());
+ m_ui.buttonShowInTimeline->setDown(m_ui.kplotwidget->isMoveTimeline());
- ui.buttonNewPoints->setEnabled(ui.parameterList->currentText() != "all");
- ui.buttonNewPoints->setDown(ui.kplotwidget->isNewPoints());
+ m_ui.buttonNewPoints->setEnabled(m_ui.parameterList->currentText() != "all");
+ m_ui.buttonNewPoints->setDown(m_ui.kplotwidget->isNewPoints());
}
void ComplexParameter::slotParameterChanged(const QString& text)
{
- //ui.buttonNewPoints->setEnabled(text!="all");
- ui.kplotwidget->replot(text);
+ //m_ui.buttonNewPoints->setEnabled(text!="all");
+ m_ui.kplotwidget->replot(text);
updateButtonStatus();
}
void ComplexParameter::setupParam(const QDomElement& d, const QString& paramName, int from, int to)
{
- param = d;
- ui.kplotwidget->setPointLists(d, paramName, from, to);
+ m_param = d;
+ m_ui.kplotwidget->setPointLists(d, paramName, from, to);
}
void ComplexParameter::itemSelectionChanged()
void ComplexParameter::slotUpdateEffectParams(QDomElement e)
{
- param = e;
+ m_param = e;
emit parameterChanged();
}
QDomElement ComplexParameter::getParamDesc()
{
- return param;
+ return m_param;
}
void ComplexParameter::slotUpdateParameterList(QStringList l)
{
kDebug() << l ;
- ui.parameterList->clear();
- ui.parameterList->addItem("all");
- ui.parameterList->addItems(l);
+ m_ui.parameterList->clear();
+ m_ui.parameterList->addItem("all");
+ m_ui.parameterList->addItems(l);
}
#include "complexparameter.moc"
ComplexParameter(QWidget *parent = 0);
QDomElement getParamDesc();
private:
- Ui::KeyframeWidget_UI ui;
+ Ui::KeyframeWidget_UI m_ui;
void setupListView();
void updateButtonStatus();
- QDomElement param;
+ QDomElement m_param;
public slots:
void slotSetMoveX();
void slotSetMoveY();
DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QString &id, bool placeHolder) :
QObject(),
- audioFrameChache(),
+ m_audioFrameCache(),
m_refcount(0),
m_baseTrackProducers(),
m_audioTrackProducers(),
{
if (m_thumbProd) m_thumbProd->stopAudioThumbs();
if (m_audioTimer != NULL) m_audioTimer->stop();
- audioFrameChache.clear();
+ m_audioFrameCache.clear();
m_audioThumbCreated = false;
}
void DocClipBase::updateAudioThumbnail(QMap<int, QMap<int, QByteArray> > data)
{
//kDebug() << "CLIPBASE RECIEDVEDÂ AUDIOÂ DATA*********************************************";
- audioFrameChache = data;
+ m_audioFrameCache = data;
m_audioThumbCreated = true;
emit gotAudioData();
}
/** Cache for every audio Frame with 10 Bytes */
/** format is frame -> channel ->bytes */
- QMap<int, QMap<int, QByteArray> > audioFrameChache;
+ QMap<int, QMap<int, QByteArray> > m_audioFrameCache;
/** Free cache data */
void slotClearAudioCache();
EffectsListView::EffectsListView(QWidget *parent) :
QWidget(parent)
{
- ui.setupUi(this);
+ m_ui.setupUi(this);
QMenu *menu = new QMenu(this);
m_effectsList = new EffectsListWidget(menu);
- QVBoxLayout *lyr = new QVBoxLayout(ui.effectlistframe);
+ QVBoxLayout *lyr = new QVBoxLayout(m_ui.effectlistframe);
lyr->addWidget(m_effectsList);
lyr->setContentsMargins(0, 0, 0, 0);
- ui.search_effect->setListWidget(m_effectsList);
- ui.buttonInfo->setIcon(KIcon("help-about"));
+ m_ui.search_effect->setListWidget(m_effectsList);
+ m_ui.buttonInfo->setIcon(KIcon("help-about"));
if (KdenliveSettings::showeffectinfo()) {
- ui.buttonInfo->setDown(true);
- } else ui.infopanel->hide();
+ m_ui.buttonInfo->setDown(true);
+ } else m_ui.infopanel->hide();
menu->addAction(KIcon("edit-delete"), i18n("Delete effect"), this, SLOT(slotRemoveEffect()));
- connect(ui.type_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(filterList(int)));
- connect(ui.buttonInfo, SIGNAL(clicked()), this, SLOT(showInfoPanel()));
+ connect(m_ui.type_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(filterList(int)));
+ connect(m_ui.buttonInfo, SIGNAL(clicked()), this, SLOT(showInfoPanel()));
connect(m_effectsList, SIGNAL(itemSelectionChanged()), this, SLOT(slotUpdateInfo()));
connect(m_effectsList, SIGNAL(doubleClicked(QListWidgetItem *, const QPoint &)), this, SLOT(slotEffectSelected()));
void EffectsListView::showInfoPanel()
{
- if (ui.infopanel->isVisible()) {
- ui.infopanel->setVisible(false);
- ui.buttonInfo->setDown(false);
+ if (m_ui.infopanel->isVisible()) {
+ m_ui.infopanel->setVisible(false);
+ m_ui.buttonInfo->setDown(false);
KdenliveSettings::setShoweffectinfo(false);
} else {
- ui.infopanel->setVisible(true);
- ui.buttonInfo->setDown(true);
+ m_ui.infopanel->setVisible(true);
+ m_ui.buttonInfo->setDown(true);
KdenliveSettings::setShoweffectinfo(true);
}
}
void EffectsListView::slotUpdateInfo()
{
- ui.infopanel->setText(m_effectsList->currentInfo());
+ m_ui.infopanel->setText(m_effectsList->currentInfo());
}
KListWidget *EffectsListView::listView()
//void slotAddEffect(GenTime pos, int track, QString name);
private:
- Ui::EffectList_UI ui;
+ Ui::EffectList_UI m_ui;
EffectsListWidget *m_effectsList;
private slots:
vbox1->addWidget(area);
area->setWidget(wid);
area->setWidgetResizable(true);
- vbox = new QVBoxLayout(wid);
- vbox->setContentsMargins(0, 0, 0, 0);
- vbox->setSpacing(0);
+ m_vbox = new QVBoxLayout(wid);
+ m_vbox->setContentsMargins(0, 0, 0, 0);
+ m_vbox->setSpacing(0);
wid->show();
}
void EffectStackEdit::updateParameter(const QString &name, const QString &value)
{
- params.setAttribute(name, value);
+ m_params.setAttribute(name, value);
}
void EffectStackEdit::transferParamDesc(const QDomElement& d, int in, int out)
{
kDebug() << "in";
- params = d;
+ m_params = d;
m_in = in;
m_out = out;
clearAllItems();
- if (params.isNull()) return;
+ if (m_params.isNull()) return;
QDomDocument doc;
- doc.appendChild(doc.importNode(params, true));
+ doc.appendChild(doc.importNode(m_params, true));
//kDebug() << "IMPORTED TRANS: " << doc.toString();
- QDomNodeList namenode = params.elementsByTagName("parameter");
- QDomElement e = params.toElement();
+ QDomNodeList namenode = m_params.elementsByTagName("parameter");
+ QDomElement e = m_params.toElement();
const int minFrame = e.attribute("start").toInt();
const int maxFrame = e.attribute("end").toInt();
connect(lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT(collectAllParameters()));
lsval->title->setTitle(paramName);
- valueItems[paramName] = lsval;
- uiItems.append(lsval);
+ m_valueItems[paramName] = lsval;
+ m_uiItems.append(lsval);
} else if (type == "bool") {
Boolval *bval = new Boolval;
bval->setupUi(toFillin);
connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(collectAllParameters()));
bval->checkBox->setText(paramName);
- valueItems[paramName] = bval;
- uiItems.append(bval);
+ m_valueItems[paramName] = bval;
+ m_uiItems.append(bval);
} else if (type == "complex") {
/*QStringList names=nodeAtts.namedItem("name").nodeValue().split(';');
QStringList max=nodeAtts.namedItem("max").nodeValue().split(';');
ComplexParameter *pl = new ComplexParameter;
connect(pl, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
pl->setupParam(d, pa.attribute("name"), 0, 100);
- vbox->addWidget(pl);
- valueItems[paramName+"complex"] = pl;
- items.append(pl);
+ m_vbox->addWidget(pl);
+ m_valueItems[paramName+"complex"] = pl;
+ m_items.append(pl);
} else if (type == "geometry") {
Geometryval *geo = new Geometryval(m_profile);
connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
connect(geo, SIGNAL(seekToPos(int)), this, SLOT(slotSeekToPos(int)));
geo->setupParam(pa, minFrame, maxFrame);
- vbox->addWidget(geo);
- valueItems[paramName+"geometry"] = geo;
- items.append(geo);
+ m_vbox->addWidget(geo);
+ m_valueItems[paramName+"geometry"] = geo;
+ m_items.append(geo);
} else if (type == "color") {
Colorval *cval = new Colorval;
cval->setupUi(toFillin);
connect(cval->kcolorbutton, SIGNAL(clicked()) , this, SLOT(collectAllParameters()));
cval->label->setText(paramName);
- valueItems[paramName] = cval;
- uiItems.append(cval);
+ m_valueItems[paramName] = cval;
+ m_uiItems.append(cval);
} else if (type == "position") {
Positionval *pval = new Positionval;
pval->setupUi(toFillin);
pval->krestrictedline->setText(m_timecode.getTimecodeFromFrames(pos));
connect(pval->krestrictedline, SIGNAL(editingFinished()), this, SLOT(collectAllParameters()));
pval->label->setText(paramName);
- valueItems[paramName + "position"] = pval;
- uiItems.append(pval);
+ m_valueItems[paramName + "position"] = pval;
+ m_uiItems.append(pval);
} else if (type == "wipe") {
Wipeval *wpval = new Wipeval;
wpval->setupUi(toFillin);
connect(wpval->start_transp, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
connect(wpval->end_transp, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
//wpval->title->setTitle(na.toElement().text());
- valueItems[paramName] = wpval;
- uiItems.append(wpval);
+ m_valueItems[paramName] = wpval;
+ m_uiItems.append(wpval);
} else {
delete toFillin;
toFillin = NULL;
}
if (toFillin) {
- items.append(toFillin);
- vbox->addWidget(toFillin);
+ m_items.append(toFillin);
+ m_vbox->addWidget(toFillin);
}
}
- vbox->addStretch();
+ m_vbox->addStretch();
}
void EffectStackEdit::slotSeekToPos(int pos)
void EffectStackEdit::collectAllParameters()
{
- QDomElement oldparam = params.cloneNode().toElement();
- QDomNodeList namenode = params.elementsByTagName("parameter");
+ QDomElement oldparam = m_params.cloneNode().toElement();
+ QDomNodeList namenode = m_params.elementsByTagName("parameter");
for (int i = 0;i < namenode.count() ;i++) {
QDomNode pa = namenode.item(i);
QString setValue;
if (type == "double" || type == "constant") {
- QSlider* slider = ((Constval*)valueItems[paramName])->horizontalSlider;
+ QSlider* slider = ((Constval*)m_valueItems[paramName])->horizontalSlider;
setValue = QString::number(slider->value());
} else if (type == "list") {
- KComboBox *box = ((Listval*)valueItems[paramName])->list;
+ KComboBox *box = ((Listval*)m_valueItems[paramName])->list;
setValue = box->itemData(box->currentIndex()).toString();
} else if (type == "bool") {
- QCheckBox *box = ((Boolval*)valueItems[paramName])->checkBox;
+ QCheckBox *box = ((Boolval*)m_valueItems[paramName])->checkBox;
setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
} else if (type == "color") {
- KColorButton *color = ((Colorval*)valueItems[paramName])->kcolorbutton;
+ KColorButton *color = ((Colorval*)m_valueItems[paramName])->kcolorbutton;
setValue = color->color().name();
} else if (type == "complex") {
- ComplexParameter *complex = ((ComplexParameter*)valueItems[paramName+"complex"]);
+ ComplexParameter *complex = ((ComplexParameter*)m_valueItems[paramName+"complex"]);
namenode.item(i) = complex->getParamDesc();
} else if (type == "geometry") {
- Geometryval *geom = ((Geometryval*)valueItems[paramName+"geometry"]);
+ Geometryval *geom = ((Geometryval*)m_valueItems[paramName+"geometry"]);
namenode.item(i) = geom->getParamDesc();
} else if (type == "position") {
- KRestrictedLine *line = ((Positionval*)valueItems[paramName+"position"])->krestrictedline;
+ KRestrictedLine *line = ((Positionval*)m_valueItems[paramName+"position"])->krestrictedline;
int pos = m_timecode.getFrameCount(line->text(), KdenliveSettings::project_fps());
- if (params.attribute("id") == "fadein" || params.attribute("id") == "fade_from_black") {
+ if (m_params.attribute("id") == "fadein" || m_params.attribute("id") == "fade_from_black") {
pos += m_in;
if (pos > m_out) {
pos = m_out;
line->setText(m_timecode.getTimecodeFromFrames(pos));
}
- } else if (params.attribute("id") == "fadeout" || params.attribute("id") == "fade_to_black") {
+ } else if (m_params.attribute("id") == "fadeout" || m_params.attribute("id") == "fade_to_black") {
pos = m_out - (pos - m_in);
if (pos > m_out - m_in) {
pos = m_out - m_in;
}
setValue = QString::number(pos);
} else if (type == "wipe") {
- Wipeval *wp = (Wipeval*)valueItems[paramName];
+ Wipeval *wp = (Wipeval*)m_valueItems[paramName];
wipeInfo info;
if (wp->start_left->isChecked()) info.start = LEFT;
else if (wp->start_right->isChecked()) info.start = RIGHT;
pa.attributes().namedItem("value").setNodeValue(setValue);
}
}
- emit parameterChanged(oldparam, params);
+ emit parameterChanged(oldparam, m_params);
}
void EffectStackEdit::createSliderItem(const QString& name, int val , int min, int max)
ctval->horizontalSlider->setPageStep((int)(max - min) / 10);
ctval->horizontalSlider->setValue(val);
ctval->label->setText(name);
- valueItems[name] = ctval;
- uiItems.append(ctval);
+ m_valueItems[name] = ctval;
+ m_uiItems.append(ctval);
connect(ctval->horizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(collectAllParameters()));
- items.append(toFillin);
- vbox->addWidget(toFillin);
+ m_items.append(toFillin);
+ m_vbox->addWidget(toFillin);
}
void EffectStackEdit::slotSliderMoved(int)
void EffectStackEdit::clearAllItems()
{
- qDeleteAll(items);
- qDeleteAll(uiItems);
- uiItems.clear();
- items.clear();
- valueItems.clear();
- QLayoutItem *item = vbox->itemAt(0);
+ qDeleteAll(m_items);
+ qDeleteAll(m_uiItems);
+ m_uiItems.clear();
+ m_items.clear();
+ m_valueItems.clear();
+ QLayoutItem *item = m_vbox->itemAt(0);
while (item) {
- vbox->removeItem(item);
+ m_vbox->removeItem(item);
delete item;
- item = vbox->itemAt(0);
+ item = m_vbox->itemAt(0);
}
}
private:
void clearAllItems();
- QVBoxLayout *vbox;
- QList<QWidget*> items;
- QList<UiItem*> uiItems;
- QDomElement params;
- QMap<QString, void*> valueItems;
+ QVBoxLayout *m_vbox;
+ QList<QWidget*> m_items;
+ QList<UiItem*> m_uiItems;
+ QDomElement m_params;
+ QMap<QString, void*> m_valueItems;
void createSliderItem(const QString& name, int val , int min, int max);
wipeInfo getWipeInfo(QString value);
QString getWipeString(wipeInfo info);
void slotSliderMoved(int);
/** \brief Called whenever(?) some parameter is changed in the gui.
*
- * Transfers all Dynamic gui parameter settings into params(??) */
+ * Transfers all Dynamic gui parameter settings into m_params(??) */
void collectAllParameters();
private slots:
EffectStackView::EffectStackView(QWidget *parent) :
QWidget(parent)
{
- ui.setupUi(this);
- effectedit = new EffectStackEdit(ui.frame);
- //ui.effectlist->horizontalHeader()->setVisible(false);
- //ui.effectlist->verticalHeader()->setVisible(false);
- clipref = NULL;
-
- ui.buttonNew->setIcon(KIcon("document-new"));
- ui.buttonNew->setToolTip(i18n("Add new effect"));
- ui.buttonUp->setIcon(KIcon("go-up"));
- ui.buttonUp->setToolTip(i18n("Move effect up"));
- ui.buttonDown->setIcon(KIcon("go-down"));
- ui.buttonDown->setToolTip(i18n("Move effect down"));
- ui.buttonDel->setIcon(KIcon("trash-empty"));
- ui.buttonDel->setToolTip(i18n("Delete effect"));
- ui.buttonSave->setIcon(KIcon("document-save"));
- ui.buttonSave->setToolTip(i18n("Save effect"));
- ui.buttonReset->setIcon(KIcon("view-refresh"));
- ui.buttonReset->setToolTip(i18n("Reset effect"));
-
-
- ui.effectlist->setDragDropMode(QAbstractItemView::NoDragDrop);//use internal if drop is recognised right
-
- connect(ui.effectlist, SIGNAL(itemSelectionChanged()), this , SLOT(slotItemSelectionChanged()));
- connect(ui.effectlist, SIGNAL(itemChanged(QListWidgetItem *)), this , SLOT(slotItemChanged(QListWidgetItem *)));
- connect(ui.buttonUp, SIGNAL(clicked()), this, SLOT(slotItemUp()));
- connect(ui.buttonDown, SIGNAL(clicked()), this, SLOT(slotItemDown()));
- connect(ui.buttonDel, SIGNAL(clicked()), this, SLOT(slotItemDel()));
- connect(ui.buttonSave, SIGNAL(clicked()), this, SLOT(slotSaveEffect()));
- connect(ui.buttonReset, SIGNAL(clicked()), this, SLOT(slotResetEffect()));
- connect(this, SIGNAL(transferParamDesc(const QDomElement&, int , int)), effectedit , SLOT(transferParamDesc(const QDomElement&, int , int)));
- connect(effectedit, SIGNAL(parameterChanged(const QDomElement&, const QDomElement&)), this , SLOT(slotUpdateEffectParams(const QDomElement&, const QDomElement&)));
- effectLists["audio"] = &MainWindow::audioEffects;
- effectLists["video"] = &MainWindow::videoEffects;
- effectLists["custom"] = &MainWindow::customEffects;
- ui.splitter->setStretchFactor(1, 10);
- ui.splitter->setStretchFactor(0, 1);
+ m_ui.setupUi(this);
+ m_effectedit = new EffectStackEdit(m_ui.frame);
+ //m_ui.effectlist->horizontalHeader()->setVisible(false);
+ //m_ui.effectlist->verticalHeader()->setVisible(false);
+ m_clipref = NULL;
+
+ m_ui.buttonNew->setIcon(KIcon("document-new"));
+ m_ui.buttonNew->setToolTip(i18n("Add new effect"));
+ m_ui.buttonUp->setIcon(KIcon("go-up"));
+ m_ui.buttonUp->setToolTip(i18n("Move effect up"));
+ m_ui.buttonDown->setIcon(KIcon("go-down"));
+ m_ui.buttonDown->setToolTip(i18n("Move effect down"));
+ m_ui.buttonDel->setIcon(KIcon("trash-empty"));
+ m_ui.buttonDel->setToolTip(i18n("Delete effect"));
+ m_ui.buttonSave->setIcon(KIcon("document-save"));
+ m_ui.buttonSave->setToolTip(i18n("Save effect"));
+ m_ui.buttonReset->setIcon(KIcon("view-refresh"));
+ m_ui.buttonReset->setToolTip(i18n("Reset effect"));
+
+
+ m_ui.effectlist->setDragDropMode(QAbstractItemView::NoDragDrop);//use internal if drop is recognised right
+
+ connect(m_ui.effectlist, SIGNAL(itemSelectionChanged()), this , SLOT(slotItemSelectionChanged()));
+ connect(m_ui.effectlist, SIGNAL(itemChanged(QListWidgetItem *)), this , SLOT(slotItemChanged(QListWidgetItem *)));
+ connect(m_ui.buttonUp, SIGNAL(clicked()), this, SLOT(slotItemUp()));
+ connect(m_ui.buttonDown, SIGNAL(clicked()), this, SLOT(slotItemDown()));
+ connect(m_ui.buttonDel, SIGNAL(clicked()), this, SLOT(slotItemDel()));
+ connect(m_ui.buttonSave, SIGNAL(clicked()), this, SLOT(slotSaveEffect()));
+ connect(m_ui.buttonReset, SIGNAL(clicked()), this, SLOT(slotResetEffect()));
+ connect(this, SIGNAL(transferParamDesc(const QDomElement&, int , int)), m_effectedit , SLOT(transferParamDesc(const QDomElement&, int , int)));
+ connect(m_effectedit, SIGNAL(parameterChanged(const QDomElement&, const QDomElement&)), this , SLOT(slotUpdateEffectParams(const QDomElement&, const QDomElement&)));
+ m_effectLists["audio"] = &MainWindow::audioEffects;
+ m_effectLists["video"] = &MainWindow::videoEffects;
+ m_effectLists["custom"] = &MainWindow::customEffects;
+ m_ui.splitter->setStretchFactor(1, 10);
+ m_ui.splitter->setStretchFactor(0, 1);
setEnabled(false);
}
void EffectStackView::setMenu(QMenu *menu)
{
- ui.buttonNew->setMenu(menu);
+ m_ui.buttonNew->setMenu(menu);
}
void EffectStackView::updateProjectFormat(MltVideoProfile profile, Timecode t)
{
- effectedit->updateProjectFormat(profile, t);
+ m_effectedit->updateProjectFormat(profile, t);
}
void EffectStackView::slotSaveEffect()
path = path + name + ".xml";
if (QFile::exists(path)) if (KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it?")) == KMessageBox::No) return;
- int i = ui.effectlist->currentRow();
+ int i = m_ui.effectlist->currentRow();
QDomDocument doc;
- QDomElement effect = clipref->effectAt(i).cloneNode().toElement();
+ QDomElement effect = m_clipref->effectAt(i).cloneNode().toElement();
doc.appendChild(doc.importNode(effect, true));
effect = doc.firstChild().toElement();
effect.removeAttribute("kdenlive_ix");
void EffectStackView::slotUpdateEffectParams(const QDomElement& old, const QDomElement& e)
{
- if (clipref)
- emit updateClipEffect(clipref, old, e, ui.effectlist->currentRow());
+ if (m_clipref)
+ emit updateClipEffect(m_clipref, old, e, m_ui.effectlist->currentRow());
}
void EffectStackView::slotClipItemSelected(ClipItem* c, int ix)
{
- if (c && c == clipref) {
- if (ix == -1) ix = ui.effectlist->currentRow();
+ if (c && c == m_clipref) {
+ if (ix == -1) ix = m_ui.effectlist->currentRow();
} else {
- clipref = c;
+ m_clipref = c;
if (c) ix = c->selectedEffectIndex();
else ix = 0;
}
- if (clipref == NULL) {
- ui.effectlist->clear();
- effectedit->transferParamDesc(QDomElement(), 0, 0);
+ if (m_clipref == NULL) {
+ m_ui.effectlist->clear();
+ m_effectedit->transferParamDesc(QDomElement(), 0, 0);
setEnabled(false);
return;
}
{
bool disable = true;
if (item->checkState() == Qt::Checked) disable = false;
- ui.buttonReset->setEnabled(!disable);
- int activeRow = ui.effectlist->currentRow();
+ m_ui.buttonReset->setEnabled(!disable);
+ int activeRow = m_ui.effectlist->currentRow();
if (activeRow >= 0) {
- emit changeEffectState(clipref, activeRow, disable);
+ emit changeEffectState(m_clipref, activeRow, disable);
}
}
void EffectStackView::setupListView(int ix)
{
- ui.effectlist->clear();
+ m_ui.effectlist->clear();
// Issue 238: Add icons for effect type in effectstack.
KIcon videoIcon("kdenlive-show-video");
KIcon audioIcon("kdenlive-show-audio");
QListWidgetItem* item;
- for (int i = 0;i < clipref->effectsCount();i++) {
- QDomElement d = clipref->effectAt(i);
+ for (int i = 0;i < m_clipref->effectsCount();i++) {
+ QDomElement d = m_clipref->effectAt(i);
QDomNode namenode = d.elementsByTagName("name").item(0);
if (!namenode.isNull()) {
// Logic more or less copied from initeffects.cpp
QString type = d.attribute("type", QString());
if ("audio" == type) {
- item = new QListWidgetItem(audioIcon, i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist);
+ item = new QListWidgetItem(audioIcon, i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
} else if ("custom" == type) {
- item = new QListWidgetItem(i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist);
+ item = new QListWidgetItem(i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
} else {
- item = new QListWidgetItem(videoIcon, i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist);
+ item = new QListWidgetItem(videoIcon, i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
}
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
if (d.attribute("disabled") == "1") item->setCheckState(Qt::Unchecked);
else item->setCheckState(Qt::Checked);
}
}
- if (clipref->effectsCount() == 0) {
+ if (m_clipref->effectsCount() == 0) {
emit transferParamDesc(QDomElement(), 0, 0);
- ui.buttonDel->setEnabled(false);
- ui.buttonSave->setEnabled(false);
- ui.buttonReset->setEnabled(false);
- ui.buttonUp->setEnabled(false);
- ui.buttonDown->setEnabled(false);
+ m_ui.buttonDel->setEnabled(false);
+ m_ui.buttonSave->setEnabled(false);
+ m_ui.buttonReset->setEnabled(false);
+ m_ui.buttonUp->setEnabled(false);
+ m_ui.buttonDown->setEnabled(false);
} else {
if (ix < 0) ix = 0;
- if (ix > ui.effectlist->count() - 1) ix = ui.effectlist->count() - 1;
- ui.effectlist->setCurrentRow(ix);
- ui.buttonDel->setEnabled(true);
- ui.buttonSave->setEnabled(true);
- ui.buttonReset->setEnabled(true);
- ui.buttonUp->setEnabled(ix > 0);
- ui.buttonDown->setEnabled(ix < clipref->effectsCount() - 1);
+ if (ix > m_ui.effectlist->count() - 1) ix = m_ui.effectlist->count() - 1;
+ m_ui.effectlist->setCurrentRow(ix);
+ m_ui.buttonDel->setEnabled(true);
+ m_ui.buttonSave->setEnabled(true);
+ m_ui.buttonReset->setEnabled(true);
+ m_ui.buttonUp->setEnabled(ix > 0);
+ m_ui.buttonDown->setEnabled(ix < m_clipref->effectsCount() - 1);
}
}
void EffectStackView::slotItemSelectionChanged()
{
- bool hasItem = ui.effectlist->currentItem();
- int activeRow = ui.effectlist->currentRow();
+ bool hasItem = m_ui.effectlist->currentItem();
+ int activeRow = m_ui.effectlist->currentRow();
bool isChecked = false;
- if (hasItem && ui.effectlist->currentItem()->checkState() == Qt::Checked) isChecked = true;
- if (hasItem && ui.effectlist->currentItem()->isSelected()) {
- emit transferParamDesc(clipref->effectAt(activeRow), clipref->cropStart().frames(KdenliveSettings::project_fps()), clipref->cropDuration().frames(KdenliveSettings::project_fps()));//minx max frame
+ if (hasItem && m_ui.effectlist->currentItem()->checkState() == Qt::Checked) isChecked = true;
+ if (hasItem && m_ui.effectlist->currentItem()->isSelected()) {
+ emit transferParamDesc(m_clipref->effectAt(activeRow), m_clipref->cropStart().frames(KdenliveSettings::project_fps()), m_clipref->cropDuration().frames(KdenliveSettings::project_fps()));//minx max frame
}
- if (clipref) clipref->setSelectedEffect(activeRow);
- ui.buttonDel->setEnabled(hasItem);
- ui.buttonSave->setEnabled(hasItem);
- ui.buttonReset->setEnabled(hasItem && isChecked);
- ui.buttonUp->setEnabled(activeRow > 0);
- ui.buttonDown->setEnabled((activeRow < ui.effectlist->count() - 1) && hasItem);
+ if (m_clipref) m_clipref->setSelectedEffect(activeRow);
+ m_ui.buttonDel->setEnabled(hasItem);
+ m_ui.buttonSave->setEnabled(hasItem);
+ m_ui.buttonReset->setEnabled(hasItem && isChecked);
+ m_ui.buttonUp->setEnabled(activeRow > 0);
+ m_ui.buttonDown->setEnabled((activeRow < m_ui.effectlist->count() - 1) && hasItem);
}
void EffectStackView::slotItemUp()
{
- int activeRow = ui.effectlist->currentRow();
+ int activeRow = m_ui.effectlist->currentRow();
if (activeRow <= 0) return;
- emit changeEffectPosition(clipref, activeRow + 1, activeRow);
+ emit changeEffectPosition(m_clipref, activeRow + 1, activeRow);
}
void EffectStackView::slotItemDown()
{
- int activeRow = ui.effectlist->currentRow();
- if (activeRow >= ui.effectlist->count() - 1) return;
- emit changeEffectPosition(clipref, activeRow + 1, activeRow + 2);
+ int activeRow = m_ui.effectlist->currentRow();
+ if (activeRow >= m_ui.effectlist->count() - 1) return;
+ emit changeEffectPosition(m_clipref, activeRow + 1, activeRow + 2);
}
void EffectStackView::slotItemDel()
{
- int activeRow = ui.effectlist->currentRow();
+ int activeRow = m_ui.effectlist->currentRow();
if (activeRow >= 0) {
- emit removeEffect(clipref, clipref->effectAt(activeRow));
+ emit removeEffect(m_clipref, m_clipref->effectAt(activeRow));
}
}
void EffectStackView::slotResetEffect()
{
- int activeRow = ui.effectlist->currentRow();
+ int activeRow = m_ui.effectlist->currentRow();
if (activeRow < 0) return;
- QDomElement old = clipref->effectAt(activeRow).cloneNode().toElement();
+ QDomElement old = m_clipref->effectAt(activeRow).cloneNode().toElement();
QDomElement dom;
- QString effectName = ui.effectlist->currentItem()->text();
- foreach(const QString &type, effectLists.keys()) {
- EffectsList *list = effectLists[type];
+ QString effectName = m_ui.effectlist->currentItem()->text();
+ foreach(const QString &type, m_effectLists.keys()) {
+ EffectsList *list = m_effectLists[type];
if (list->effectNames().contains(effectName)) {
dom = list->getEffectByName(effectName);
break;
}
if (!dom.isNull()) {
dom.setAttribute("kdenlive_ix", old.attribute("kdenlive_ix"));
- emit transferParamDesc(dom, clipref->cropStart().frames(KdenliveSettings::project_fps()), clipref->cropDuration().frames(KdenliveSettings::project_fps()));//minx max frame
- emit updateClipEffect(clipref, old, dom, activeRow);
+ emit transferParamDesc(dom, m_clipref->cropStart().frames(KdenliveSettings::project_fps()), m_clipref->cropDuration().frames(KdenliveSettings::project_fps()));//minx max frame
+ emit updateClipEffect(m_clipref, old, dom, activeRow);
}
}
void EffectStackView::raiseWindow(QWidget* dock)
{
- if (clipref && dock)
+ if (m_clipref && dock)
dock->raise();
}
void EffectStackView::clear()
{
- ui.effectlist->clear();
- ui.buttonDel->setEnabled(false);
- ui.buttonSave->setEnabled(false);
- ui.buttonReset->setEnabled(false);
- ui.buttonUp->setEnabled(false);
- ui.buttonDown->setEnabled(false);
- effectedit->transferParamDesc(QDomElement(), 0, 0);
+ m_ui.effectlist->clear();
+ m_ui.buttonDel->setEnabled(false);
+ m_ui.buttonSave->setEnabled(false);
+ m_ui.buttonReset->setEnabled(false);
+ m_ui.buttonUp->setEnabled(false);
+ m_ui.buttonDown->setEnabled(false);
+ m_effectedit->transferParamDesc(QDomElement(), 0, 0);
}
#include "effectstackview.moc"
void updateProjectFormat(MltVideoProfile profile, Timecode t);
private:
- Ui::EffectStack_UI ui;
- ClipItem* clipref;
- QMap<QString, EffectsList*> effectLists;
- EffectStackEdit* effectedit;
+ Ui::EffectStack_UI m_ui;
+ ClipItem* m_clipref;
+ QMap<QString, EffectsList*> m_effectLists;
+ EffectStackEdit* m_effectedit;
void setupListView(int ix);
//void updateButtonStatus();
Geometryval::Geometryval(const MltVideoProfile profile, QWidget* parent) :
QWidget(parent),
m_profile(profile),
- paramRect(NULL),
+ m_paramRect(NULL),
m_geom(NULL),
m_path(NULL),
m_fixedMode(false)
{
- ui.setupUi(this);
- QVBoxLayout* vbox = new QVBoxLayout(ui.widget);
+ m_ui.setupUi(this);
+ QVBoxLayout* vbox = new QVBoxLayout(m_ui.widget);
QGraphicsView *view = new QGraphicsView(this);
view->setBackgroundBrush(QBrush(Qt::black));
vbox->addWidget(view);
vbox->setContentsMargins(0, 0, 0, 0);
- QVBoxLayout* vbox2 = new QVBoxLayout(ui.keyframeWidget);
+ QVBoxLayout* vbox2 = new QVBoxLayout(m_ui.keyframeWidget);
m_helper = new KeyframeHelper(this);
vbox2->addWidget(m_helper);
vbox2->setContentsMargins(0, 0, 0, 0);
connect(m_helper, SIGNAL(positionChanged(int)), this, SLOT(slotPositionChanged(int)));
- scene = new GraphicsSceneRectMove(this);
- scene->setTool(TITLE_SELECT);
- view->setScene(scene);
+ m_scene = new GraphicsSceneRectMove(this);
+ m_scene->setTool(TITLE_SELECT);
+ view->setScene(m_scene);
QGraphicsRectItem *m_frameBorder = new QGraphicsRectItem(QRectF(0, 0, profile.width, profile.height));
m_frameBorder->setZValue(-1100);
m_frameBorder->setBrush(QColor(255, 255, 0, 30));
m_frameBorder->setPen(QPen(QBrush(QColor(255, 255, 255, 255)), 1.0, Qt::DashLine));
- scene->addItem(m_frameBorder);
+ m_scene->addItem(m_frameBorder);
- ui.buttonNext->setIcon(KIcon("media-skip-forward"));
- ui.buttonNext->setToolTip(i18n("Go to next keyframe"));
- ui.buttonPrevious->setIcon(KIcon("media-skip-backward"));
- ui.buttonPrevious->setToolTip(i18n("Go to previous keyframe"));
- ui.buttonAdd->setIcon(KIcon("document-new"));
- ui.buttonAdd->setToolTip(i18n("Add keyframe"));
- ui.buttonDelete->setIcon(KIcon("edit-delete"));
- ui.buttonDelete->setToolTip(i18n("Delete keyframe"));
+ m_ui.buttonNext->setIcon(KIcon("media-skip-forward"));
+ m_ui.buttonNext->setToolTip(i18n("Go to next keyframe"));
+ m_ui.buttonPrevious->setIcon(KIcon("media-skip-backward"));
+ m_ui.buttonPrevious->setToolTip(i18n("Go to previous keyframe"));
+ m_ui.buttonAdd->setIcon(KIcon("document-new"));
+ m_ui.buttonAdd->setToolTip(i18n("Add keyframe"));
+ m_ui.buttonDelete->setIcon(KIcon("edit-delete"));
+ m_ui.buttonDelete->setToolTip(i18n("Delete keyframe"));
QMenu *configMenu = new QMenu(i18n("Misc..."), this);
- ui.buttonMenu->setIcon(KIcon("system-run"));
- ui.buttonMenu->setMenu(configMenu);
- ui.buttonMenu->setPopupMode(QToolButton::QToolButton::InstantPopup);
+ m_ui.buttonMenu->setIcon(KIcon("system-run"));
+ m_ui.buttonMenu->setMenu(configMenu);
+ m_ui.buttonMenu->setPopupMode(QToolButton::QToolButton::InstantPopup);
m_scaleMenu = new QMenu(i18n("Resize..."), this);
const double sc = 100.0 / profile.height * 0.8;
QRectF srect = view->sceneRect();
view->setSceneRect(srect.x(), -srect.height() / 3 + 10, srect.width(), srect.height() + srect.height() / 3 * 2 - 10);
- scene->setZoom(sc);
+ m_scene->setZoom(sc);
view->centerOn(m_frameBorder);
- connect(ui.buttonNext , SIGNAL(clicked()) , this , SLOT(slotNextFrame()));
- connect(ui.buttonPrevious , SIGNAL(clicked()) , this , SLOT(slotPreviousFrame()));
- connect(ui.buttonDelete , SIGNAL(clicked()) , this , SLOT(slotDeleteFrame()));
- connect(ui.buttonAdd , SIGNAL(clicked()) , this , SLOT(slotAddFrame()));
- connect(scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateTransitionProperties()));
+ connect(m_ui.buttonNext , SIGNAL(clicked()) , this , SLOT(slotNextFrame()));
+ connect(m_ui.buttonPrevious , SIGNAL(clicked()) , this , SLOT(slotPreviousFrame()));
+ connect(m_ui.buttonDelete , SIGNAL(clicked()) , this , SLOT(slotDeleteFrame()));
+ connect(m_ui.buttonAdd , SIGNAL(clicked()) , this , SLOT(slotAddFrame()));
+ connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateTransitionProperties()));
}
void Geometryval::slotAlignCenter()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setPos((m_profile.width - paramRect->rect().width()) / 2, (m_profile.height - paramRect->rect().height()) / 2);
+ m_paramRect->setPos((m_profile.width - m_paramRect->rect().width()) / 2, (m_profile.height - m_paramRect->rect().height()) / 2);
slotUpdateTransitionProperties();
}
void Geometryval::slotAlignHCenter()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setPos((m_profile.width - paramRect->rect().width()) / 2, paramRect->pos().y());
+ m_paramRect->setPos((m_profile.width - m_paramRect->rect().width()) / 2, m_paramRect->pos().y());
slotUpdateTransitionProperties();
}
void Geometryval::slotAlignVCenter()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setPos(paramRect->pos().x(), (m_profile.height - paramRect->rect().height()) / 2);
+ m_paramRect->setPos(m_paramRect->pos().x(), (m_profile.height - m_paramRect->rect().height()) / 2);
slotUpdateTransitionProperties();
}
void Geometryval::slotAlignTop()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setPos(paramRect->pos().x(), 0);
+ m_paramRect->setPos(m_paramRect->pos().x(), 0);
slotUpdateTransitionProperties();
}
void Geometryval::slotAlignBottom()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setPos(paramRect->pos().x(), m_profile.height - paramRect->rect().height());
+ m_paramRect->setPos(m_paramRect->pos().x(), m_profile.height - m_paramRect->rect().height());
slotUpdateTransitionProperties();
}
void Geometryval::slotAlignLeft()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setPos(0, paramRect->pos().y());
+ m_paramRect->setPos(0, m_paramRect->pos().y());
slotUpdateTransitionProperties();
}
void Geometryval::slotAlignRight()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setPos(m_profile.width - paramRect->rect().width(), paramRect->pos().y());
+ m_paramRect->setPos(m_profile.width - m_paramRect->rect().width(), m_paramRect->pos().y());
slotUpdateTransitionProperties();
}
void Geometryval::slotResize50()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setRect(0, 0, m_profile.width / 2, m_profile.height / 2);
+ m_paramRect->setRect(0, 0, m_profile.width / 2, m_profile.height / 2);
slotUpdateTransitionProperties();
}
void Geometryval::slotResize100()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setRect(0, 0, m_profile.width, m_profile.height);
+ m_paramRect->setRect(0, 0, m_profile.width, m_profile.height);
slotUpdateTransitionProperties();
}
void Geometryval::slotResize200()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor
return;
}
- paramRect->setRect(0, 0, m_profile.width * 2, m_profile.height * 2);
+ m_paramRect->setRect(0, 0, m_profile.width * 2, m_profile.height * 2);
slotUpdateTransitionProperties();
}
void Geometryval::slotTransparencyChanged(int transp)
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
return;
}
item.mix(transp);
- paramRect->setBrush(QColor(255, 0, 0, transp));
+ m_paramRect->setBrush(QColor(255, 0, 0, transp));
m_geom->insert(item);
emit parameterChanged();
}
void Geometryval::slotPositionChanged(int pos, bool seek)
{
if (seek && KdenliveSettings::transitionfollowcursor()) emit seekToPos(pos);
- ui.spinPos->setValue(pos);
+ m_ui.spinPos->setValue(pos);
m_helper->setValue(pos);
Mlt::GeometryItem item;
int error = m_geom->fetch(&item, pos);
if (error || item.key() == false) {
// no keyframe under cursor, adjust buttons
- ui.buttonAdd->setEnabled(true);
- ui.buttonDelete->setEnabled(false);
- ui.widget->setEnabled(false);
- ui.spinTransp->setEnabled(false);
+ m_ui.buttonAdd->setEnabled(true);
+ m_ui.buttonDelete->setEnabled(false);
+ m_ui.widget->setEnabled(false);
+ m_ui.spinTransp->setEnabled(false);
m_scaleMenu->setEnabled(false);
m_alignMenu->setEnabled(false);
} else {
- ui.buttonAdd->setEnabled(false);
- ui.buttonDelete->setEnabled(true);
- ui.widget->setEnabled(true);
- ui.spinTransp->setEnabled(true);
+ m_ui.buttonAdd->setEnabled(false);
+ m_ui.buttonDelete->setEnabled(true);
+ m_ui.widget->setEnabled(true);
+ m_ui.spinTransp->setEnabled(true);
m_scaleMenu->setEnabled(true);
m_alignMenu->setEnabled(true);
}
- paramRect->setPos(item.x(), item.y());
- paramRect->setRect(0, 0, item.w(), item.h());
- ui.spinTransp->setValue(item.mix());
- paramRect->setBrush(QColor(255, 0, 0, item.mix()));
+ m_paramRect->setPos(item.x(), item.y());
+ m_paramRect->setRect(0, 0, item.w(), item.h());
+ m_ui.spinTransp->setValue(item.mix());
+ m_paramRect->setBrush(QColor(255, 0, 0, item.mix()));
}
void Geometryval::slotDeleteFrame()
{
// check there is more than one keyframe
Mlt::GeometryItem item;
- const int pos = ui.spinPos->value();
+ const int pos = m_ui.spinPos->value();
int error = m_geom->next_key(&item, pos + 1);
if (error) {
error = m_geom->prev_key(&item, pos - 1);
if (error || item.frame() == pos) return;
}
- m_geom->remove(ui.spinPos->value());
- ui.buttonAdd->setEnabled(true);
- ui.buttonDelete->setEnabled(false);
- ui.widget->setEnabled(false);
- ui.spinTransp->setEnabled(false);
+ m_geom->remove(m_ui.spinPos->value());
+ m_ui.buttonAdd->setEnabled(true);
+ m_ui.buttonDelete->setEnabled(false);
+ m_ui.widget->setEnabled(false);
+ m_ui.spinTransp->setEnabled(false);
m_scaleMenu->setEnabled(false);
m_alignMenu->setEnabled(false);
m_helper->update();
void Geometryval::slotAddFrame()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
item.frame(pos);
- item.x(paramRect->pos().x());
- item.y(paramRect->pos().y());
- item.w(paramRect->rect().width());
- item.h(paramRect->rect().height());
- item.mix(ui.spinTransp->value());
+ item.x(m_paramRect->pos().x());
+ item.y(m_paramRect->pos().y());
+ item.w(m_paramRect->rect().width());
+ item.h(m_paramRect->rect().height());
+ item.mix(m_ui.spinTransp->value());
m_geom->insert(item);
- ui.buttonAdd->setEnabled(false);
- ui.buttonDelete->setEnabled(true);
- ui.widget->setEnabled(true);
- ui.spinTransp->setEnabled(true);
+ m_ui.buttonAdd->setEnabled(false);
+ m_ui.buttonDelete->setEnabled(true);
+ m_ui.widget->setEnabled(true);
+ m_ui.spinTransp->setEnabled(true);
m_scaleMenu->setEnabled(true);
m_alignMenu->setEnabled(true);
m_helper->update();
kDebug() << "// SEEK TO NEXT KFR: " << error;
if (error) {
// Go to end
- ui.spinPos->setValue(ui.spinPos->maximum());
+ m_ui.spinPos->setValue(m_ui.spinPos->maximum());
return;
}
int pos = item.frame();
- ui.spinPos->setValue(pos);
+ m_ui.spinPos->setValue(pos);
}
void Geometryval::slotPreviousFrame()
kDebug() << "// SEEK TO NEXT KFR: " << error;
if (error) return;
int pos = item.frame();
- ui.spinPos->setValue(pos);
+ m_ui.spinPos->setValue(pos);
}
QDomElement Geometryval::getParamDesc()
{
- param.setAttribute("value", m_geom->serialise());
- kDebug() << " / / UPDATING TRANSITION VALUE: " << param.attribute("value");
- return param;
+ m_param.setAttribute("value", m_geom->serialise());
+ kDebug() << " / / UPDATING TRANSITION VALUE: " << m_param.attribute("value");
+ return m_param;
}
void Geometryval::setupParam(const QDomElement& par, int minFrame, int maxFrame)
{
- param = par;
+ m_param = par;
QString val = par.attribute("value");
if (par.attribute("fixed") == "1") {
m_fixedMode = true;
- ui.buttonPrevious->setHidden(true);
- ui.buttonNext->setHidden(true);
- ui.buttonDelete->setHidden(true);
- ui.buttonAdd->setHidden(true);
- ui.spinTransp->setMaximum(500);
- ui.label_pos->setHidden(true);
+ m_ui.buttonPrevious->setHidden(true);
+ m_ui.buttonNext->setHidden(true);
+ m_ui.buttonDelete->setHidden(true);
+ m_ui.buttonAdd->setHidden(true);
+ m_ui.spinTransp->setMaximum(500);
+ m_ui.label_pos->setHidden(true);
m_helper->setHidden(true);
- ui.spinPos->setHidden(true);
+ m_ui.spinPos->setHidden(true);
}
char *tmp = (char *) qstrdup(val.toUtf8().data());
if (m_geom) m_geom->parse(tmp, maxFrame - minFrame, m_profile.width, m_profile.height);
/*QDomDocument doc;
doc.appendChild(doc.importNode(par, true));
kDebug() << "IMPORTED TRANS: " << doc.toString();*/
- ui.spinPos->setMaximum(maxFrame - minFrame - 1);
+ m_ui.spinPos->setMaximum(maxFrame - minFrame - 1);
if (m_path == NULL) {
m_path = new QGraphicsPathItem();
m_path->setPen(QPen(Qt::red));
- scene->addItem(m_path);
+ m_scene->addItem(m_path);
}
updateTransitionPath();
}
Mlt::GeometryItem item;
m_geom->fetch(&item, 0);
- delete paramRect;
- paramRect = new QGraphicsRectItem(QRectF(0, 0, item.w(), item.h()));
- paramRect->setPos(item.x(), item.y());
- paramRect->setZValue(0);
+ delete m_paramRect;
+ m_paramRect = new QGraphicsRectItem(QRectF(0, 0, item.w(), item.h()));
+ m_paramRect->setPos(item.x(), item.y());
+ m_paramRect->setZValue(0);
- paramRect->setPen(QPen(QBrush(QColor(255, 0, 0, 255)), 1.0));
- scene->addItem(paramRect);
+ m_paramRect->setPen(QPen(QBrush(QColor(255, 0, 0, 255)), 1.0));
+ m_scene->addItem(m_paramRect);
slotPositionChanged(0, false);
if (!m_fixedMode) {
- connect(ui.spinPos, SIGNAL(valueChanged(int)), this , SLOT(slotPositionChanged(int)));
+ connect(m_ui.spinPos, SIGNAL(valueChanged(int)), this , SLOT(slotPositionChanged(int)));
}
- connect(ui.spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int)));
+ connect(m_ui.spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int)));
}
void Geometryval::updateTransitionPath()
void Geometryval::slotUpdateTransitionProperties()
{
- int pos = ui.spinPos->value();
+ int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
int error = m_geom->next_key(&item, pos);
if (error || item.frame() != pos) {
// no keyframe under cursor
return;
}
- item.x(paramRect->pos().x());
- item.y(paramRect->pos().y());
- item.w(paramRect->rect().width());
- item.h(paramRect->rect().height());
+ item.x(m_paramRect->pos().x());
+ item.y(m_paramRect->pos().y());
+ item.w(m_paramRect->rect().width());
+ item.h(m_paramRect->rect().height());
m_geom->insert(item);
updateTransitionPath();
emit parameterChanged();
QDomElement getParamDesc();
private:
- Ui::Geometryval ui;
+ Ui::Geometryval m_ui;
MltVideoProfile m_profile;
//QGraphicsScene* scene;
- GraphicsSceneRectMove *scene;
- QDomElement param;
- QGraphicsRectItem *paramRect;
+ GraphicsSceneRectMove *m_scene;
+ QDomElement m_param;
+ QGraphicsRectItem *m_paramRect;
Mlt::Geometry *m_geom;
KeyframeHelper *m_helper;
QGraphicsPathItem *m_path;
GraphicsSceneRectMove::GraphicsSceneRectMove(QObject *parent) :
QGraphicsScene(parent),
m_selectedItem(NULL),
- resizeMode(NoResize),
+ m_resizeMode(NoResize),
m_tool(TITLE_RECTANGLE)
{
//grabMouse();
- zoom = 1.0;
+ m_zoom = 1.0;
setBackgroundBrush(QBrush(Qt::transparent));
}
{
QPointF p = e->scenePos();
p += QPoint(-2, -2);
- resizeMode = NoResize;
+ m_resizeMode = NoResize;
m_selectedItem = NULL;
QGraphicsItem* g = items(QRectF(p , QSizeF(4, 4)).toRect()).at(0);
if (g) {
m_clickPoint = e->screenPos();
QPointF p = e->scenePos();
p += QPoint(-2, -2);
- resizeMode = NoResize;
+ m_resizeMode = NoResize;
const QList <QGraphicsItem *> list = items(QRectF(p , QSizeF(4, 4)).toRect());
QGraphicsItem *item = NULL;
bool hasSelected = false;
} else r = m_selectedItem->boundingRect();
r.translate(item->scenePos());
- if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
- resizeMode = TopLeft;
- } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
- resizeMode = BottomLeft;
- } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
- resizeMode = TopRight;
- } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
- resizeMode = BottomRight;
- } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3 / zoom) {
- resizeMode = Left;
- } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3 / zoom) {
- resizeMode = Right;
- } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3 / zoom) {
- resizeMode = Up;
- } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3 / zoom) {
- resizeMode = Down;
+ if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
+ m_resizeMode = TopLeft;
+ } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
+ m_resizeMode = BottomLeft;
+ } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
+ m_resizeMode = TopRight;
+ } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
+ m_resizeMode = BottomRight;
+ } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3 / m_zoom) {
+ m_resizeMode = Left;
+ } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3 / m_zoom) {
+ m_resizeMode = Right;
+ } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3 / m_zoom) {
+ m_resizeMode = Up;
+ } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3 / m_zoom) {
+ m_resizeMode = Down;
} else setCursor(Qt::ClosedHandCursor);
}
}
QGraphicsScene::mousePressEvent(e);
}
- kDebug() << "////// MOUSEÂ CLICK, RESIZEÂ MODE: " << resizeMode;
+ kDebug() << "////// MOUSEÂ CLICK, RESIZEÂ MODE: " << m_resizeMode;
}
QPointF newpoint = e->scenePos();
//newpoint -= m_selectedItem->scenePos();
- switch (resizeMode) {
+ switch (m_resizeMode) {
case TopLeft:
newrect.setBottomRight(newrect.bottomRight() + m_selectedItem->pos() - newpoint);
m_selectedItem->setPos(newpoint);
m_selectedItem->moveBy(diff.x(), diff.y());
break;
}
- if (m_selectedItem->type() == 3 && resizeMode != NoResize) {
+ if (m_selectedItem->type() == 3 && m_resizeMode != NoResize) {
QGraphicsRectItem *gi = (QGraphicsRectItem*)m_selectedItem;
gi->setRect(newrect);
}
} else if (m_tool == TITLE_SELECT) {
QPointF p = e->scenePos();
p += QPoint(-2, -2);
- resizeMode = NoResize;
+ m_resizeMode = NoResize;
bool itemFound = false;
foreach(const QGraphicsItem* g, items(QRectF(p , QSizeF(4, 4)).toRect())) {
if ((g->type() == 13 || g->type() == 7) && g->zValue() > -1000) {
QRectF r = ((const QGraphicsRectItem*)g)->rect();
r.translate(g->scenePos());
itemFound = true;
- if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
+ if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
setCursor(QCursor(Qt::SizeFDiagCursor));
- } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
+ } else if ((r.toRect().bottomLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
setCursor(QCursor(Qt::SizeBDiagCursor));
- } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
+ } else if ((r.toRect().topRight() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
setCursor(QCursor(Qt::SizeBDiagCursor));
- } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
+ } else if ((r.toRect().bottomRight() - e->scenePos().toPoint()).manhattanLength() < 6 / m_zoom) {
setCursor(QCursor(Qt::SizeFDiagCursor));
- } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3 / zoom) {
+ } else if (qAbs(r.toRect().left() - e->scenePos().toPoint().x()) < 3 / m_zoom) {
setCursor(Qt::SizeHorCursor);
- } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3 / zoom) {
+ } else if (qAbs(r.toRect().right() - e->scenePos().toPoint().x()) < 3 / m_zoom) {
setCursor(Qt::SizeHorCursor);
- } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3 / zoom) {
+ } else if (qAbs(r.toRect().top() - e->scenePos().toPoint().y()) < 3 / m_zoom) {
setCursor(Qt::SizeVerCursor);
- } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3 / zoom) {
+ } else if (qAbs(r.toRect().bottom() - e->scenePos().toPoint().y()) < 3 / m_zoom) {
setCursor(Qt::SizeVerCursor);
} else setCursor(Qt::OpenHandCursor);
break;
emit newRect((QGraphicsRectItem *) m_selectedItem);
m_selectedItem->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
m_selectedItem->setPos(m_sceneClickPoint);
- resizeMode = BottomRight;
+ m_resizeMode = BottomRight;
QGraphicsScene::mouseMoveEvent(e);
}
}
void GraphicsSceneRectMove::setScale(double s)
{
- if (zoom < 1.0 / 7.0 && s < 1.0) return;
- else if (zoom > 10.0 / 7.9 && s > 1.0) return;
+ if (m_zoom < 1.0 / 7.0 && s < 1.0) return;
+ else if (m_zoom > 10.0 / 7.9 && s > 1.0) return;
QList<QGraphicsView*> viewlist = views();
if (viewlist.size() > 0) {
viewlist[0]->scale(s, s);
- zoom = zoom * s;
+ m_zoom = m_zoom * s;
}
//kDebug()<<"////////// ZOOM: "<<zoom;
}
if (viewlist.size() > 0) {
viewlist[0]->resetTransform();
viewlist[0]->scale(s, s);
- zoom = s;
+ m_zoom = s;
}
//kDebug()<<"////////// ZOOM: "<<zoom;
private:
void setCursor(QCursor);
- double zoom;
+ double m_zoom;
QGraphicsItem* m_selectedItem;
- resizeModes resizeMode;
+ resizeModes m_resizeMode;
QPointF m_sceneClickPoint;
TITLETOOL m_tool;
QPoint m_clickPoint;
m_type(info.type)
{
setFixedHeight(KdenliveSettings::trackheight());
- view.setupUi(this);
- view.track_number->setText(QString::number(m_index));
- view.buttonVideo->setChecked(!info.isBlind);
- view.buttonVideo->setToolTip(i18n("Hide track"));
- view.buttonAudio->setChecked(!info.isMute);
- view.buttonAudio->setToolTip(i18n("Mute track"));
- view.buttonLock->setChecked(info.isLocked);
- view.buttonLock->setToolTip(i18n("Lock track"));
+ m_view.setupUi(this);
+ m_view.track_number->setText(QString::number(m_index));
+ m_view.buttonVideo->setChecked(!info.isBlind);
+ m_view.buttonVideo->setToolTip(i18n("Hide track"));
+ m_view.buttonAudio->setChecked(!info.isMute);
+ m_view.buttonAudio->setToolTip(i18n("Mute track"));
+ m_view.buttonLock->setChecked(info.isLocked);
+ m_view.buttonLock->setToolTip(i18n("Lock track"));
if (m_type == VIDEOTRACK) {
- view.frame->setBackgroundRole(QPalette::AlternateBase);
- view.frame->setAutoFillBackground(true);
- if (!info.isBlind) view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
- else view.buttonVideo->setIcon(KIcon("kdenlive-hide-video"));
+ m_view.frame->setBackgroundRole(QPalette::AlternateBase);
+ m_view.frame->setAutoFillBackground(true);
+ if (!info.isBlind) m_view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
+ else m_view.buttonVideo->setIcon(KIcon("kdenlive-hide-video"));
} else {
- view.buttonVideo->setHidden(true);
+ m_view.buttonVideo->setHidden(true);
}
- if (!info.isMute) view.buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
- else view.buttonAudio->setIcon(KIcon("kdenlive-hide-audio"));
+ if (!info.isMute) m_view.buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
+ else m_view.buttonAudio->setIcon(KIcon("kdenlive-hide-audio"));
- if (!info.isLocked) view.buttonLock->setIcon(KIcon("kdenlive-unlock"));
- else view.buttonLock->setIcon(KIcon("kdenlive-lock"));
+ if (!info.isLocked) m_view.buttonLock->setIcon(KIcon("kdenlive-unlock"));
+ else m_view.buttonLock->setIcon(KIcon("kdenlive-lock"));
- connect(view.buttonVideo, SIGNAL(clicked()), this, SLOT(switchVideo()));
- connect(view.buttonAudio, SIGNAL(clicked()), this, SLOT(switchAudio()));
- connect(view.buttonLock, SIGNAL(clicked()), this, SLOT(switchLock()));
+ connect(m_view.buttonVideo, SIGNAL(clicked()), this, SLOT(switchVideo()));
+ connect(m_view.buttonAudio, SIGNAL(clicked()), this, SLOT(switchAudio()));
+ connect(m_view.buttonLock, SIGNAL(clicked()), this, SLOT(switchLock()));
m_contextMenu = new QMenu(this);
void HeaderTrack::switchVideo()
{
- if (view.buttonVideo->isChecked()) {
- view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
+ if (m_view.buttonVideo->isChecked()) {
+ m_view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
} else {
- view.buttonVideo->setIcon(KIcon("kdenlive-hide-video"));
+ m_view.buttonVideo->setIcon(KIcon("kdenlive-hide-video"));
}
emit switchTrackVideo(m_index);
}
void HeaderTrack::switchAudio()
{
- if (view.buttonAudio->isChecked()) {
- view.buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
+ if (m_view.buttonAudio->isChecked()) {
+ m_view.buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
} else {
- view.buttonAudio->setIcon(KIcon("kdenlive-hide-audio"));
+ m_view.buttonAudio->setIcon(KIcon("kdenlive-hide-audio"));
}
emit switchTrackAudio(m_index);
}
void HeaderTrack::switchLock(bool emitSignal)
{
- if (view.buttonLock->isChecked()) {
- view.buttonLock->setIcon(KIcon("kdenlive-lock"));
+ if (m_view.buttonLock->isChecked()) {
+ m_view.buttonLock->setIcon(KIcon("kdenlive-lock"));
} else {
- view.buttonLock->setIcon(KIcon("kdenlive-unlock"));
+ m_view.buttonLock->setIcon(KIcon("kdenlive-unlock"));
}
if (emitSignal) emit switchTrackLock(m_index);
}
void HeaderTrack::setLock(bool lock)
{
- view.buttonLock->setChecked(lock);
+ m_view.buttonLock->setChecked(lock);
switchLock(false);
}
private:
int m_index;
TRACKTYPE m_type;
- Ui::TrackHeader_UI view;
+ Ui::TrackHeader_UI m_view;
QMenu *m_contextMenu;
private slots:
QWidget *p1 = new QWidget;
m_configMisc.setupUi(p1);
- page1 = addPage(p1, i18n("Misc"), "configure");
+ m_page1 = addPage(p1, i18n("Misc"), "configure");
// Hide multi tab option until Kdenlive really supports it
m_configMisc.kcfg_activatetabs->setVisible(false);
QWidget *p3 = new QWidget;
m_configDisplay.setupUi(p3);
- page3 = addPage(p3, i18n("Display"), "video-display");
+ m_page3 = addPage(p3, i18n("Display"), "video-display");
QWidget *p2 = new QWidget;
m_configEnv.setupUi(p2);
m_configEnv.projecturl->lineEdit()->setObjectName("kcfg_defaultprojectfolder");
m_configEnv.capturefolderurl->setMode(KFile::Directory);
m_configEnv.capturefolderurl->lineEdit()->setObjectName("kcfg_capturefolder");
- page2 = addPage(p2, i18n("Environment"), "terminal");
+ m_page2 = addPage(p2, i18n("Environment"), "terminal");
QWidget *p4 = new QWidget;
m_configCapture.setupUi(p4);
- page4 = addPage(p4, i18n("Capture"), "audio-card");
+ m_page4 = addPage(p4, i18n("Capture"), "audio-card");
m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture());
QWidget *p5 = new QWidget;
m_configShuttle.kcfg_enableshuttle->hide();
m_configShuttle.kcfg_enableshuttle->setDisabled(true);
#endif /* NO_JOGSHUTTLE */
- page5 = addPage(p5, i18n("JogShuttle"), "input-mouse");
+ m_page5 = addPage(p5, i18n("JogShuttle"), "input-mouse");
QWidget *p6 = new QWidget;
m_configSdl.setupUi(p6);
- page6 = addPage(p6, i18n("Playback"), "audio-card");
+ m_page6 = addPage(p6, i18n("Playback"), "audio-card");
QStringList actions;
actions << i18n("Do nothing");
{
switch (page) {
case 1:
- setCurrentPage(page1);
+ setCurrentPage(m_page1);
break;
case 2:
- setCurrentPage(page2);
+ setCurrentPage(m_page2);
break;
case 3:
- setCurrentPage(page3);
+ setCurrentPage(m_page3);
break;
case 4:
- setCurrentPage(page4);
+ setCurrentPage(m_page4);
m_configCapture.tabWidget->setCurrentIndex(option);
break;
case 5:
- setCurrentPage(page5);
+ setCurrentPage(m_page5);
break;
}
void slotCheckAlsaDriver();
private:
- KPageWidgetItem *page1;
- KPageWidgetItem *page2;
- KPageWidgetItem *page3;
- KPageWidgetItem *page4;
- KPageWidgetItem *page5;
- KPageWidgetItem *page6;
+ KPageWidgetItem *m_page1;
+ KPageWidgetItem *m_page2;
+ KPageWidgetItem *m_page3;
+ KPageWidgetItem *m_page4;
+ KPageWidgetItem *m_page5;
+ KPageWidgetItem *m_page6;
Ui::ConfigEnv_UI m_configEnv;
Ui::ConfigMisc_UI m_configMisc;
Ui::ConfigDisplay_UI m_configDisplay;
KThumb::KThumb(ClipManager *clipManager, KUrl url, const QString &id, const QString &hash, QObject * parent, const char */*name*/) :
QObject(parent),
- audioThumbProducer(),
+ m_audioThumbProducer(),
m_url(url),
m_thumbFile(),
m_dar(1),
m_id(id)
{
m_thumbFile = clipManager->projectFolder() + "/thumbs/" + hash + ".thumb";
- connect(&audioThumbProducer, SIGNAL(audioThumbProgress(const int)), this, SLOT(slotAudioThumbProgress(const int)));
- connect(&audioThumbProducer, SIGNAL(audioThumbOver()), this, SLOT(slotAudioThumbOver()));
+ connect(&m_audioThumbProducer, SIGNAL(audioThumbProgress(const int)), this, SLOT(slotAudioThumbProgress(const int)));
+ connect(&m_audioThumbProducer, SIGNAL(audioThumbOver()), this, SLOT(slotAudioThumbOver()));
}
KThumb::~KThumb()
{
- if (audioThumbProducer.isRunning()) {
- audioThumbProducer.stop_me = true;
- audioThumbProducer.wait();
+ if (m_audioThumbProducer.isRunning()) {
+ m_audioThumbProducer.stop_me = true;
+ m_audioThumbProducer.wait();
slotAudioThumbOver();
}
}
*/
void KThumb::stopAudioThumbs()
{
- if (audioThumbProducer.isRunning()) {
- audioThumbProducer.stop_me = true;
+ if (m_audioThumbProducer.isRunning()) {
+ m_audioThumbProducer.stop_me = true;
slotAudioThumbOver();
}
}
slotAudioThumbOver();
return;
}
- if ((audioThumbProducer.isRunning() && audioThumbProducer.isWorking())) {
+ if ((m_audioThumbProducer.isRunning() && m_audioThumbProducer.isWorking())) {
return;
}
emit audioThumbReady(storeIn);
slotAudioThumbOver();
} else {
- if (audioThumbProducer.isRunning()) return;
- audioThumbProducer.init(m_url, m_thumbFile, frame, frameLength, m_frequency, m_channels, arrayWidth);
- audioThumbProducer.start(QThread::LowestPriority);
+ if (m_audioThumbProducer.isRunning()) return;
+ m_audioThumbProducer.init(m_url, m_thumbFile, frame, frameLength, m_frequency, m_channels, arrayWidth);
+ m_audioThumbProducer.start(QThread::LowestPriority);
kDebug() << "STARTING GENERATE THMB FOR: " << m_url << " ................................";
}
}
void slotAudioThumbOver();
private:
- MyThread audioThumbProducer;
+ MyThread m_audioThumbProducer;
KUrl m_url;
QString m_thumbFile;
double m_dar;
m_monitorManager = new MonitorManager();
- projectListDock = new QDockWidget(i18n("Project Tree"), this);
- projectListDock->setObjectName("project_tree");
+ m_projectListDock = new QDockWidget(i18n("Project Tree"), this);
+ m_projectListDock->setObjectName("project_tree");
m_projectList = new ProjectList(this);
- projectListDock->setWidget(m_projectList);
- addDockWidget(Qt::TopDockWidgetArea, projectListDock);
+ m_projectListDock->setWidget(m_projectList);
+ addDockWidget(Qt::TopDockWidgetArea, m_projectListDock);
- effectListDock = new QDockWidget(i18n("Effect List"), this);
- effectListDock->setObjectName("effect_list");
+ m_effectListDock = new QDockWidget(i18n("Effect List"), this);
+ m_effectListDock->setObjectName("effect_list");
m_effectList = new EffectsListView();
//m_effectList = new KListWidget(this);
- effectListDock->setWidget(m_effectList);
- addDockWidget(Qt::TopDockWidgetArea, effectListDock);
+ m_effectListDock->setWidget(m_effectList);
+ addDockWidget(Qt::TopDockWidgetArea, m_effectListDock);
- effectStackDock = new QDockWidget(i18n("Effect Stack"), this);
- effectStackDock->setObjectName("effect_stack");
- effectStack = new EffectStackView(this);
- effectStackDock->setWidget(effectStack);
- addDockWidget(Qt::TopDockWidgetArea, effectStackDock);
+ m_effectStackDock = new QDockWidget(i18n("Effect Stack"), this);
+ m_effectStackDock->setObjectName("effect_stack");
+ m_effectStack = new EffectStackView(this);
+ m_effectStackDock->setWidget(m_effectStack);
+ addDockWidget(Qt::TopDockWidgetArea, m_effectStackDock);
- transitionConfigDock = new QDockWidget(i18n("Transition"), this);
- transitionConfigDock->setObjectName("transition");
- transitionConfig = new TransitionSettings(this);
- transitionConfigDock->setWidget(transitionConfig);
- addDockWidget(Qt::TopDockWidgetArea, transitionConfigDock);
+ m_transitionConfigDock = new QDockWidget(i18n("Transition"), this);
+ m_transitionConfigDock->setObjectName("transition");
+ m_transitionConfig = new TransitionSettings(this);
+ m_transitionConfigDock->setWidget(m_transitionConfig);
+ addDockWidget(Qt::TopDockWidgetArea, m_transitionConfigDock);
KdenliveSettings::setCurrent_profile(KdenliveSettings::default_profile());
m_fileOpenRecent = KStandardAction::openRecent(this, SLOT(openFile(const KUrl &)),
actionCollection());
readOptions();
- clipMonitorDock = new QDockWidget(i18n("Clip Monitor"), this);
- clipMonitorDock->setObjectName("clip_monitor");
+ m_clipMonitorDock = new QDockWidget(i18n("Clip Monitor"), this);
+ m_clipMonitorDock->setObjectName("clip_monitor");
m_clipMonitor = new Monitor("clip", m_monitorManager, this);
- clipMonitorDock->setWidget(m_clipMonitor);
- addDockWidget(Qt::TopDockWidgetArea, clipMonitorDock);
+ m_clipMonitorDock->setWidget(m_clipMonitor);
+ addDockWidget(Qt::TopDockWidgetArea, m_clipMonitorDock);
//m_clipMonitor->stop();
- projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
- projectMonitorDock->setObjectName("project_monitor");
+ m_projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
+ m_projectMonitorDock->setObjectName("project_monitor");
m_projectMonitor = new Monitor("project", m_monitorManager, this);
- projectMonitorDock->setWidget(m_projectMonitor);
- addDockWidget(Qt::TopDockWidgetArea, projectMonitorDock);
+ m_projectMonitorDock->setWidget(m_projectMonitor);
+ addDockWidget(Qt::TopDockWidgetArea, m_projectMonitorDock);
- recMonitorDock = new QDockWidget(i18n("Record Monitor"), this);
- recMonitorDock->setObjectName("record_monitor");
+ m_recMonitorDock = new QDockWidget(i18n("Record Monitor"), this);
+ m_recMonitorDock->setObjectName("record_monitor");
m_recMonitor = new RecMonitor("record", this);
- recMonitorDock->setWidget(m_recMonitor);
- addDockWidget(Qt::TopDockWidgetArea, recMonitorDock);
+ m_recMonitorDock->setWidget(m_recMonitor);
+ addDockWidget(Qt::TopDockWidgetArea, m_recMonitorDock);
connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
connect(m_recMonitor, SIGNAL(showConfigDialog(int, int)), this, SLOT(slotPreferences(int, int)));
- undoViewDock = new QDockWidget(i18n("Undo History"), this);
- undoViewDock->setObjectName("undo_history");
+ m_undoViewDock = new QDockWidget(i18n("Undo History"), this);
+ m_undoViewDock->setObjectName("undo_history");
m_undoView = new QUndoView(this);
m_undoView->setCleanIcon(KIcon("edit-clear"));
m_undoView->setEmptyLabel(i18n("Clean"));
- undoViewDock->setWidget(m_undoView);
+ m_undoViewDock->setWidget(m_undoView);
m_undoView->setGroup(m_commandStack);
- addDockWidget(Qt::TopDockWidgetArea, undoViewDock);
+ addDockWidget(Qt::TopDockWidgetArea, m_undoViewDock);
//overviewDock = new QDockWidget(i18n("Project Overview"), this);
//overviewDock->setObjectName("project_overview");
setupActions();
//tabifyDockWidget(projectListDock, effectListDock);
- tabifyDockWidget(projectListDock, effectStackDock);
- tabifyDockWidget(projectListDock, transitionConfigDock);
+ tabifyDockWidget(m_projectListDock, m_effectStackDock);
+ tabifyDockWidget(m_projectListDock, m_transitionConfigDock);
//tabifyDockWidget(projectListDock, undoViewDock);
- tabifyDockWidget(clipMonitorDock, projectMonitorDock);
- tabifyDockWidget(clipMonitorDock, recMonitorDock);
+ tabifyDockWidget(m_clipMonitorDock, m_projectMonitorDock);
+ tabifyDockWidget(m_clipMonitorDock, m_recMonitorDock);
setCentralWidget(m_timelineArea);
newEffect->addMenu(videoEffectsMenu);
newEffect->addMenu(audioEffectsMenu);
newEffect->addMenu(m_customEffectsMenu);
- effectStack->setMenu(newEffect);
+ m_effectStack->setMenu(newEffect);
QMenu *viewMenu = static_cast<QMenu*>(factory()->container("dockwindows", this));
m_timelineContextTransitionMenu->addAction(actionCollection()->action("auto_transition"));
- connect(projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(refreshMonitor(bool)));
- connect(clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(refreshMonitor(bool)));
+ connect(m_projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(refreshMonitor(bool)));
+ connect(m_clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(refreshMonitor(bool)));
//connect(m_monitorManager, SIGNAL(connectMonitors()), this, SLOT(slotConnectMonitors()));
connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), this, SLOT(slotRaiseMonitor(bool)));
connect(m_effectList, SIGNAL(addEffect(QDomElement)), this, SLOT(slotAddEffect(QDomElement)));
#ifndef NO_JOGSHUTTLE
activateShuttleDevice();
#endif /* NO_JOGSHUTTLE */
- projectListDock->raise();
+ m_projectListDock->raise();
}
void MainWindow::queryQuit()
void MainWindow::slotRaiseMonitor(bool clipMonitor)
{
- if (clipMonitor) clipMonitorDock->raise();
- else projectMonitorDock->raise();
+ if (clipMonitor) m_clipMonitorDock->raise();
+ else m_projectMonitorDock->raise();
}
void MainWindow::slotSetClipDuration(const QString &id, int duration)
void MainWindow::slotAdjustClipMonitor()
{
- clipMonitorDock->updateGeometry();
- clipMonitorDock->adjustSize();
+ m_clipMonitorDock->updateGeometry();
+ m_clipMonitorDock->adjustSize();
m_clipMonitor->resetSize();
}
void MainWindow::slotAdjustProjectMonitor()
{
- projectMonitorDock->updateGeometry();
- projectMonitorDock->adjustSize();
+ m_projectMonitorDock->updateGeometry();
+ m_projectMonitorDock->adjustSize();
m_projectMonitor->resetSize();
}
m_timecodeFormat->addItem(i18n("hh:mm:ss::ff"));
m_timecodeFormat->addItem(i18n("Frames"));
- statusProgressBar = new QProgressBar(this);
- statusProgressBar->setMinimum(0);
- statusProgressBar->setMaximum(100);
- statusProgressBar->setMaximumWidth(150);
- statusProgressBar->setVisible(false);
+ m_statusProgressBar = new QProgressBar(this);
+ m_statusProgressBar->setMinimum(0);
+ m_statusProgressBar->setMaximum(100);
+ m_statusProgressBar->setMaximumWidth(150);
+ m_statusProgressBar->setVisible(false);
QWidget *w = new QWidget;
m_messageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
statusBar()->addWidget(m_messageLabel, 10);
- statusBar()->addWidget(statusProgressBar, 0);
+ statusBar()->addWidget(m_statusProgressBar, 0);
statusBar()->addPermanentWidget(w);
statusBar()->insertPermanentFixedItem("00:00:00:00", ID_TIMELINE_POS);
statusBar()->addPermanentWidget(m_timecodeFormat);
delete w;
if (m_timelineArea->count() == 0) {
m_activeDocument = NULL;
- effectStack->clear();
- transitionConfig->slotTransitionItemSelected(NULL, false);
+ m_effectStack->clear();
+ m_transitionConfig->slotTransitionItemSelected(NULL, false);
}
}
disconnect(m_activeDocument, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(deleteTimelineClip(const QString &)), m_activeTimeline, SLOT(slotDeleteClip(const QString &)));
- disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
+ disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), this, SLOT(slotActivateEffectStackView()));
- disconnect(m_activeTimeline, SIGNAL(transitionItemSelected(Transition*, bool)), transitionConfig, SLOT(slotTransitionItemSelected(Transition*, bool)));
+ disconnect(m_activeTimeline, SIGNAL(transitionItemSelected(Transition*, bool)), m_transitionConfig, SLOT(slotTransitionItemSelected(Transition*, bool)));
disconnect(m_activeTimeline, SIGNAL(transitionItemSelected(Transition*, bool)), this, SLOT(slotActivateTransitionView(Transition *)));
disconnect(m_zoomSlider, SIGNAL(valueChanged(int)), m_activeTimeline, SLOT(slotChangeZoom(int)));
disconnect(m_activeTimeline->projectView(), SIGNAL(displayMessage(const QString&, MessageType)), m_messageLabel, SLOT(setMessage(const QString&, MessageType)));
disconnect(m_activeTimeline, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int)));
disconnect(m_activeTimeline, SIGNAL(changeTrack(int)), this, SLOT(slotChangeTrack(int)));
disconnect(m_activeDocument, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
- disconnect(effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement, int)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement, int)));
- disconnect(effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
- disconnect(effectStack, SIGNAL(changeEffectState(ClipItem*, int, bool)), m_activeTimeline->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, bool)));
- disconnect(effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int)), m_activeTimeline->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int)));
- disconnect(effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
- disconnect(effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
- disconnect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), m_activeTimeline->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
- disconnect(transitionConfig, SIGNAL(seekTimeline(int)), m_activeTimeline->projectView() , SLOT(setCursorPos(int)));
+ disconnect(m_effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement, int)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement, int)));
+ disconnect(m_effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
+ disconnect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, bool)), m_activeTimeline->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, bool)));
+ disconnect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int)), m_activeTimeline->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int)));
+ disconnect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
+ disconnect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
+ disconnect(m_transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), m_activeTimeline->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
+ disconnect(m_transitionConfig, SIGNAL(seekTimeline(int)), m_activeTimeline->projectView() , SLOT(setCursorPos(int)));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
disconnect(m_activeTimeline, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs()));
- effectStack->clear();
+ m_effectStack->clear();
}
//m_activeDocument->setRenderer(NULL);
disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
KdenliveSettings::setProject_fps(doc->fps());
m_monitorManager->resetProfiles(doc->timecode());
m_projectList->setDocument(doc);
- transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), trackView->tracksNumber());
- effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
+ m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), trackView->tracksNumber());
+ m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
connect(m_projectList, SIGNAL(clipNameChanged(const QString, const QString)), trackView->projectView(), SLOT(clipNameChanged(const QString, const QString)));
connect(doc, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated()));
- connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
+ connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), this, SLOT(slotActivateEffectStackView()));
- connect(trackView, SIGNAL(transitionItemSelected(Transition*, bool)), transitionConfig, SLOT(slotTransitionItemSelected(Transition*, bool)));
+ connect(trackView, SIGNAL(transitionItemSelected(Transition*, bool)), m_transitionConfig, SLOT(slotTransitionItemSelected(Transition*, bool)));
connect(trackView, SIGNAL(transitionItemSelected(Transition*, bool)), this, SLOT(slotActivateTransitionView(Transition *)));
m_zoomSlider->setValue(doc->zoom());
connect(m_zoomSlider, SIGNAL(valueChanged(int)), trackView, SLOT(slotChangeZoom(int)));
connect(trackView->projectView(), SIGNAL(showClipFrame(DocClipBase *, const int)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, const int)));
- connect(effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement, int)), trackView->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement, int)));
- connect(effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), trackView->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
- connect(effectStack, SIGNAL(changeEffectState(ClipItem*, int, bool)), trackView->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, bool)));
- connect(effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int)), trackView->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int)));
- connect(effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
- connect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
- connect(transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
- connect(effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
+ connect(m_effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement, int)), trackView->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement, int)));
+ connect(m_effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), trackView->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
+ connect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, bool)), trackView->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, bool)));
+ connect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int)), trackView->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int)));
+ connect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
+ connect(m_transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
+ connect(m_transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
+ connect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
void MainWindow::slotDeleteTimelineClip()
{
- if (QApplication::focusWidget()->parentWidget()->parentWidget() == projectListDock) m_projectList->slotRemoveClip();
+ if (QApplication::focusWidget()->parentWidget()->parentWidget() == m_projectListDock) m_projectList->slotRemoveClip();
else if (m_activeTimeline) {
m_activeTimeline->projectView()->deleteSelectedClips();
}
void MainWindow::slotGotProgressInfo(const QString &message, int progress)
{
- statusProgressBar->setValue(progress);
+ m_statusProgressBar->setValue(progress);
if (progress >= 0) {
if (!message.isEmpty()) m_messageLabel->setMessage(message, InformationMessage);//statusLabel->setText(message);
- statusProgressBar->setVisible(true);
+ m_statusProgressBar->setVisible(true);
} else {
m_messageLabel->setMessage(QString(), DefaultMessage);
- statusProgressBar->setVisible(false);
+ m_statusProgressBar->setVisible(false);
}
}
}
void MainWindow::slotActivateEffectStackView()
{
- effectStack->raiseWindow(effectStackDock);
+ m_effectStack->raiseWindow(m_effectStackDock);
}
void MainWindow::slotActivateTransitionView(Transition *t)
{
- if (t) transitionConfig->raiseWindow(transitionConfigDock);
+ if (t) m_transitionConfig->raiseWindow(m_transitionConfigDock);
}
void MainWindow::slotSnapRewind()
private:
KTabWidget* m_timelineArea;
- QProgressBar *statusProgressBar;
+ QProgressBar *m_statusProgressBar;
void setupActions();
KdenliveDoc *m_activeDocument;
TrackView *m_activeTimeline;
MonitorManager *m_monitorManager;
- QDockWidget *projectListDock;
+ QDockWidget *m_projectListDock;
ProjectList *m_projectList;
- QDockWidget *effectListDock;
+ QDockWidget *m_effectListDock;
EffectsListView *m_effectList;
//KListWidget *m_effectList;
- QDockWidget *effectStackDock;
- EffectStackView *effectStack;
+ QDockWidget *m_effectStackDock;
+ EffectStackView *m_effectStack;
- QDockWidget *transitionConfigDock;
- TransitionSettings *transitionConfig;
+ QDockWidget *m_transitionConfigDock;
+ TransitionSettings *m_transitionConfig;
- QDockWidget *clipMonitorDock;
+ QDockWidget *m_clipMonitorDock;
Monitor *m_clipMonitor;
- QDockWidget *projectMonitorDock;
+ QDockWidget *m_projectMonitorDock;
Monitor *m_projectMonitor;
- QDockWidget *recMonitorDock;
+ QDockWidget *m_recMonitorDock;
RecMonitor *m_recMonitor;
- QDockWidget *undoViewDock;
+ QDockWidget *m_undoViewDock;
QUndoView *m_undoView;
QUndoGroup *m_commandStack;
m_dragStarted(false),
m_overlay(NULL)
{
- ui.setupUi(this);
+ m_ui.setupUi(this);
m_scale = 1;
m_ruler = new SmallRuler();
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_ruler);
- ui.ruler_frame->setLayout(layout);
+ m_ui.ruler_frame->setLayout(layout);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setMinimumHeight(200);
QToolBar *toolbar = new QToolBar(name, this);
connect(m_timePos, SIGNAL(editingFinished()), this, SLOT(slotSeek()));
layout2->addWidget(toolbar);
- ui.button_frame->setLayout(layout2);
+ m_ui.button_frame->setLayout(layout2);
const int toolHeight = toolbar->height();
- ui.button_frame->setMinimumHeight(toolHeight);
+ m_ui.button_frame->setMinimumHeight(toolHeight);
//m_ruler->setPixelPerMark(3);
- QVBoxLayout *rendererBox = new QVBoxLayout(ui.video_frame);
+ QVBoxLayout *rendererBox = new QVBoxLayout(m_ui.video_frame);
rendererBox->setContentsMargins(0, 0, 0, 0);
- m_monitorRefresh = new MonitorRefresh(ui.video_frame);
+ m_monitorRefresh = new MonitorRefresh(m_ui.video_frame);
rendererBox->addWidget(m_monitorRefresh);
render = new Render(m_name, (int) m_monitorRefresh->winId(), -1, this);
m_monitorRefresh->setRenderer(render);
m_configMenu->addSeparator();
m_configMenu->addAction(KIcon("transform-scale"), i18n("Resize (100%)"), this, SLOT(slotSetSizeOneToOne()));
m_configMenu->addAction(KIcon("transform-scale"), i18n("Resize (50%)"), this, SLOT(slotSetSizeOneToTwo()));
- //render->createVideoXWindow(ui.video_frame->winId(), -1);
+ //render->createVideoXWindow(m_ui.video_frame->winId(), -1);
m_length = 0;
if (name != "clip") {
connect(m_ruler, SIGNAL(zoneChanged(QPoint)), this, SLOT(setClipZone(QPoint)));
}
m_monitorRefresh->show();
- kDebug() << "/////// BUILDING MONITOR, ID: " << ui.video_frame->winId();
+ kDebug() << "/////// BUILDING MONITOR, ID: " << m_ui.video_frame->winId();
}
Monitor::~Monitor()
height = height * 0.8;
}
kDebug() << "// MONITOR; set SIZE: " << width << ", " << height;
- ui.video_frame->setFixedSize(width, height);
+ m_ui.video_frame->setFixedSize(width, height);
updateGeometry();
adjustSize();
- //ui.video_frame->setMinimumSize(0, 0);
+ //m_ui.video_frame->setMinimumSize(0, 0);
emit adjustMonitorSize();
}
height = height * 0.8;
}
kDebug() << "// MONITOR; set SIZE: " << width << ", " << height;
- ui.video_frame->setFixedSize(width, height);
+ m_ui.video_frame->setFixedSize(width, height);
updateGeometry();
adjustSize();
- //ui.video_frame->setMinimumSize(0, 0);
+ //m_ui.video_frame->setMinimumSize(0, 0);
emit adjustMonitorSize();
}
void Monitor::resetSize()
{
- ui.video_frame->setMinimumSize(0, 0);
+ m_ui.video_frame->setMinimumSize(0, 0);
}
DocClipBase *Monitor::activeClip()
void Monitor::mousePressEvent(QMouseEvent * event)
{
if (event->button() != Qt::RightButton) {
- if (ui.video_frame->underMouse()) {
+ if (m_ui.video_frame->underMouse()) {
m_dragStarted = true;
m_DragStartPosition = event->pos();
}
void Monitor::mouseReleaseEvent(QMouseEvent * event)
{
if (m_dragStarted) {
- if (ui.video_frame->underMouse()) {
+ if (m_ui.video_frame->underMouse()) {
slotPlay();
} else QWidget::mouseReleaseEvent(event);
m_dragStarted = false;
void Monitor::initMonitor()
{
- kDebug() << "/////// INITING MONITOR, ID: " << ui.video_frame->winId();
+ kDebug() << "/////// INITING MONITOR, ID: " << m_ui.video_frame->winId();
}
// virtual
// virtual void paintEvent(QPaintEvent * event);
private:
- Ui::Monitor_UI ui;
+ Ui::Monitor_UI m_ui;
MonitorManager *m_monitorManager;
MonitorRefresh *m_monitorRefresh;
QString m_name;
setRightPadding(10);
setTopPadding(10);
setBottomPadding(20);
- movepoint = NULL;
- colors << Qt::white << Qt::red << Qt::green << Qt::blue << Qt::magenta << Qt::gray << Qt::cyan;
- maxy = 0;
+ m_movepoint = NULL;
+ m_colors << Qt::white << Qt::red << Qt::green << Qt::blue << Qt::magenta << Qt::gray << Qt::cyan;
m_moveX = false;
m_moveY = true;
m_moveTimeline = true;
m_newPoints = false;
- activeIndexPlot = -1;
+ m_activeIndexPlot = -1;
}
/*
<name>Lines</name>
//QListIterator <QPair <QString, QMap< int , QVariant > > > nameit(params);
m_paramName = paramName;
- itemParameter = d;
+ m_itemParameter = d;
QDomNodeList namenode = d.elementsByTagName("parameter");
- max_y = 0;
- min_y = 0;
+ m_max_y = 0;
+ m_min_y = 0;
removeAllPlotObjects();
- stretchFactors.clear();
- parameterNameList.clear();
- plotobjects.clear();
+ m_stretchFactors.clear();
+ m_parameterNameList.clear();
+ m_plotobjects.clear();
QString dat;
QTextStream stre(&dat);
QDomElement pa = namenode.item(i).toElement();
QDomNode na = pa.firstChildElement("name");
- parameterNameList << pa.attribute("namedesc").split(";");
- emit parameterList(parameterNameList);
+ m_parameterNameList << pa.attribute("namedesc").split(";");
+ emit parameterList(m_parameterNameList);
//max_y=pa.attributes().namedItem("max").nodeValue().toInt();
//int val=pa.attributes().namedItem("value").nodeValue().toInt();
QStringList maxv = pa.attribute("max").split(";");
QStringList minv = pa.attribute("min").split(";");
for (int i = 0;i < maxv.size() && i < minv.size();i++) {
- if (max_y < maxv[i].toInt()) max_y = maxv[i].toInt();
- if (min_y > minv[i].toInt()) min_y = minv[i].toInt();
+ if (m_max_y < maxv[i].toInt()) m_max_y = maxv[i].toInt();
+ if (m_min_y > minv[i].toInt()) m_min_y = minv[i].toInt();
}
- for (int i = 0;i < parameterNameList.count();i++) {
- KPlotObject *plot = new KPlotObject(colors[plotobjects.size()%colors.size()]);
+ for (int i = 0;i < m_parameterNameList.count();i++) {
+ KPlotObject *plot = new KPlotObject(m_colors[m_plotobjects.size()%m_colors.size()]);
plot->setShowLines(true);
- if (!stretchFactors.contains(i) && i < maxv.size()) {
+ if (!m_stretchFactors.contains(i) && i < maxv.size()) {
if (maxv[i].toInt() != 0)
- stretchFactors[i] = max_y / maxv[i].toInt();
+ m_stretchFactors[i] = m_max_y / maxv[i].toInt();
else
- stretchFactors[i] = 1.0;
+ m_stretchFactors[i] = 1.0;
}
- if (i < defaults.size() && defaults[i].toDouble() > max_y)
- defaults[i] = max_y;
+ if (i < defaults.size() && defaults[i].toDouble() > m_max_y)
+ defaults[i] = m_max_y;
int def = 0;
if (i < defaults.size())
- def = (int)(defaults[i].toInt() * stretchFactors[i]);
+ def = (int)(defaults[i].toInt() * m_stretchFactors[i]);
QString name = "";
- if (i < parameterNameList.size())
- name = parameterNameList[i];
+ if (i < m_parameterNameList.size())
+ name = m_parameterNameList[i];
plot->addPoint(startframe, def, name);
//add keyframes here
plot->addPoint(endframe, def);
- plotobjects.append(plot);
+ m_plotobjects.append(plot);
}
/*TODO keyframes
}*/
}
- maxx = endframe;
- maxy = max_y;
- setLimits(-1, endframe + 1, min_y - 10, maxy + 10);
+ setLimits(-1, endframe + 1, m_min_y - 10, m_max_y + 10);
- addPlotObjects(plotobjects);
+ addPlotObjects(m_plotobjects);
}
void ParameterPlotter::createParametersNew()
{
QList<KPlotObject*> plotobjs = plotObjects();
- if (plotobjs.size() != parameterNameList.size()) {
+ if (plotobjs.size() != m_parameterNameList.size()) {
kDebug() << "ERROR size not equal";
}
- QDomNodeList namenode = itemParameter.elementsByTagName("parameter");
+ QDomNodeList namenode = m_itemParameter.elementsByTagName("parameter");
QString paramlist;
QTextStream txtstr(¶mlist);
QDomNode pa = namenode.item(0);
}
pa.attributes().namedItem("value").setNodeValue(paramlist);
pa.attributes().namedItem("start").setNodeValue(paramlist);
- emit parameterChanged(itemParameter);
+ emit parameterChanged(m_itemParameter);
}
void ParameterPlotter::mouseMoveEvent(QMouseEvent * event)
{
- if (movepoint != NULL) {
+ if (m_movepoint != NULL) {
QList<KPlotPoint*> list = pointsUnderPoint(event->pos() - QPoint(leftPadding(), topPadding())) ;
int i = 0;
foreach(KPlotObject *o, plotObjects()) {
QList<KPlotPoint*> points = o->points();
for (int p = 0;p < points.size();p++) {
- if (points[p] == movepoint && (activeIndexPlot == -1 || activeIndexPlot == i)) {
- QPoint delta = event->pos() - oldmousepoint;
- double newy = movepoint->y() - delta.y() * dataRect().height() / pixRect().height();
- if (m_moveY && newy > min_y && newy < max_y)
- movepoint->setY(newy);
+ if (points[p] == m_movepoint && (m_activeIndexPlot == -1 || m_activeIndexPlot == i)) {
+ QPoint delta = event->pos() - m_oldmousepoint;
+ double newy = m_movepoint->y() - delta.y() * dataRect().height() / pixRect().height();
+ if (m_moveY && newy > m_min_y && newy < m_max_y)
+ m_movepoint->setY(newy);
if (p > 0 && p < points.size() - 1) {
- double newx = movepoint->x() + delta.x() * dataRect().width() / pixRect().width();
+ double newx = m_movepoint->x() + delta.x() * dataRect().width() / pixRect().width();
if (newx > points[p-1]->x() && newx < points[p+1]->x() && m_moveX)
- movepoint->setX(movepoint->x() + delta.x()*dataRect().width() / pixRect().width());
+ m_movepoint->setX(m_movepoint->x() + delta.x()*dataRect().width() / pixRect().width());
}
if (m_moveTimeline && (m_moveX || m_moveY))
emit updateFrame(0);
replacePlotObject(i, o);
- oldmousepoint = event->pos();
+ m_oldmousepoint = event->pos();
}
}
i++;
//removeAllPlotObjects();
int i = 0;
bool drawAll = name.isEmpty() || name == "all";
- activeIndexPlot = -1;
+ m_activeIndexPlot = -1;
foreach(KPlotObject* p, plotObjects()) {
QString selectedName = "none";
- if (i < parameterNameList.size())
- selectedName = parameterNameList[i];
+ if (i < m_parameterNameList.size())
+ selectedName = m_parameterNameList[i];
p->setShowPoints(drawAll || selectedName == name);
p->setShowLines(drawAll || selectedName == name);
QPen pen = (drawAll || selectedName == name ? QPen(Qt::SolidLine) : QPen(Qt::NoPen));
pen.setColor(p->linePen().color());
p->setLabelPen(pen);
if (selectedName == name)
- activeIndexPlot = i;
+ m_activeIndexPlot = i;
replacePlotObject(i++, p);
}
}
QList<KPlotPoint*> list = pointsUnderPoint(inPlot) ;
if (event->button() == Qt::LeftButton) {
if (list.size() > 0) {
- movepoint = list[0];
- oldmousepoint = event->pos();
+ m_movepoint = list[0];
+ m_oldmousepoint = event->pos();
} else {
- if (m_newPoints && activeIndexPlot >= 0) {
+ if (m_newPoints && m_activeIndexPlot >= 0) {
//setup new points
- KPlotObject* p = plotObjects()[activeIndexPlot];
+ KPlotObject* p = plotObjects()[m_activeIndexPlot];
QList<KPlotPoint*> points = p->points();
QList<QPointF> newpoints;
foreach(const QPointF qf, newpoints) {
p->addPoint(qf);
}
- replacePlotObject(activeIndexPlot, p);
+ replacePlotObject(m_activeIndexPlot, p);
}
- movepoint = NULL;
+ m_movepoint = NULL;
}
} else if (event->button() == Qt::LeftButton) {
//menu for deleting or exact setup of point
bool isNewPoints();
void replot(const QString& name = "");
private:
- KPlotPoint* movepoint;
- int activeIndexPlot;
+ KPlotPoint* m_movepoint;
+ int m_activeIndexPlot;
bool m_moveX, m_moveY, m_moveTimeline, m_newPoints;
- QPoint oldmousepoint;
- int maxx, maxy;
- QStringList parameterNameList;
+ QPoint m_oldmousepoint;
+ QStringList m_parameterNameList;
void createParametersNew();
- QList<KPlotObject*> plotobjects;
- QMap<int, double> stretchFactors;
- QList<QColor> colors;
- QDomElement itemParameter;
- int max_y, min_y;
+ QList<KPlotObject*> m_plotobjects;
+ QMap<int, double> m_stretchFactors;
+ QList<QColor> m_colors;
+ QDomElement m_itemParameter;
+ int m_max_y, m_min_y;
QString m_paramName;
protected:
void mouseMoveEvent(QMouseEvent * event);
m_thumbnailQueue()
{
- listView = new ProjectListView(this);;
+ m_listView = new ProjectListView(this);;
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
// setup toolbar
- searchView = new KTreeWidgetSearchLine(this);
+ KTreeWidgetSearchLine *searchView = new KTreeWidgetSearchLine(this);
m_toolbar = new QToolBar("projectToolBar", this);
m_toolbar->addWidget(searchView);
m_toolbar->addWidget(m_addButton);
layout->addWidget(m_toolbar);
- layout->addWidget(listView);
+ layout->addWidget(m_listView);
setLayout(layout);
//m_toolbar->setEnabled(false);
- searchView->setTreeWidget(listView);
- connect(listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
- connect(listView, SIGNAL(focusMonitor()), this, SLOT(slotClipSelected()));
- connect(listView, SIGNAL(pauseMonitor()), this, SLOT(slotPauseMonitor()));
- connect(listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
- connect(listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
- connect(listView, SIGNAL(addClip(const QList <QUrl>, const QString &)), this, SLOT(slotAddClip(const QList <QUrl>, const QString &)));
- connect(listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
- connect(listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *)));
+ connect(m_listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
+ connect(m_listView, SIGNAL(focusMonitor()), this, SLOT(slotClipSelected()));
+ connect(m_listView, SIGNAL(pauseMonitor()), this, SLOT(slotPauseMonitor()));
+ connect(m_listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
+ connect(m_listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
+ connect(m_listView, SIGNAL(addClip(const QList <QUrl>, const QString &)), this, SLOT(slotAddClip(const QList <QUrl>, const QString &)));
+ connect(m_listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
+ connect(m_listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *)));
- ItemDelegate *listViewDelegate = new ItemDelegate(listView);
- listView->setItemDelegate(listViewDelegate);
+ ItemDelegate *listViewDelegate = new ItemDelegate(m_listView);
+ m_listView->setItemDelegate(listViewDelegate);
if (KdenliveSettings::activate_nepomuk()) {
Nepomuk::ResourceManager::instance()->init();
QByteArray ProjectList::headerInfo()
{
- return listView->header()->saveState();
+ return m_listView->header()->saveState();
}
void ProjectList::setHeaderInfo(const QByteArray &state)
{
- listView->header()->restoreState(state);
+ m_listView->header()->restoreState(state);
}
void ProjectList::slotEditClip()
{
- ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
if (!(item->flags() & Qt::ItemIsDragEnabled)) return;
if (item && !item->isGroup()) {
emit clipSelected(item->referencedClip());
void ProjectList::slotOpenClip()
{
- ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
if (item && !item->isGroup()) {
if (item->clipType() == IMAGE) {
if (KdenliveSettings::defaultimageapp().isEmpty()) KMessageBox::sorry(this, i18n("Please set a default application to open images in the Settings dialog"));
void ProjectList::slotReloadClip()
{
- ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
if (item && !item->isGroup()) {
if (item->clipType() == IMAGE) {
item->referencedClip()->producer()->set("force_reload", 1);
void ProjectList::setRenderer(Render *projectRender)
{
m_render = projectRender;
- listView->setIconSize(QSize(40 * m_render->dar(), 40));
+ m_listView->setIconSize(QSize(40 * m_render->dar(), 40));
}
void ProjectList::slotClipSelected()
{
- if (listView->currentItem()) {
- ProjectItem *clip = static_cast <ProjectItem*>(listView->currentItem());
+ if (m_listView->currentItem()) {
+ ProjectItem *clip = static_cast <ProjectItem*>(m_listView->currentItem());
if (!clip->isGroup()) {
m_selectedItem = clip;
emit clipSelected(clip->referencedClip());
if (!clip) return;
if (!clip->isGroup()) clip->setProperties(properties);
if (properties.contains("name")) {
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
clip->setText(1, properties.value("name"));
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
emit clipNameChanged(clip->clipId(), properties.value("name"));
}
if (properties.contains("description")) {
CLIPTYPE type = clip->clipType();
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
clip->setText(2, properties.value("description"));
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
if (KdenliveSettings::activate_nepomuk() && (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST)) {
// Use Nepomuk system to store clip description
Nepomuk::Resource f(clip->clipUrl().path());
void ProjectList::slotRemoveClip()
{
- if (!listView->currentItem()) return;
+ if (!m_listView->currentItem()) return;
QList <QString> ids;
QMap <QString, QString> folderids;
- QList<QTreeWidgetItem *> selected = listView->selectedItems();
+ QList<QTreeWidgetItem *> selected = m_listView->selectedItems();
ProjectItem *item;
for (int i = 0; i < selected.count(); i++) {
item = static_cast <ProjectItem *>(selected.at(i));
}
if (!ids.isEmpty()) m_doc->deleteProjectClip(ids);
if (!folderids.isEmpty()) deleteProjectFolder(folderids);
- if (listView->topLevelItemCount() == 0) {
+ if (m_listView->topLevelItemCount() == 0) {
m_editAction->setEnabled(false);
m_deleteAction->setEnabled(false);
m_openAction->setEnabled(false);
void ProjectList::selectItemById(const QString &clipId)
{
ProjectItem *item = getItemById(clipId);
- if (item) listView->setCurrentItem(item);
+ if (item) m_listView->setCurrentItem(item);
}
} else {
if (edit) {
ProjectItem *item = getFolderItemById(clipId);
- QTreeWidgetItemIterator it(listView);
+ QTreeWidgetItemIterator it(m_listView);
if (item) {
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
item->setGroupName(foldername);
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
m_doc->clipManager()->addFolder(clipId, foldername);
const int children = item->childCount();
for (int i = 0; i < children; i++) {
} else {
QStringList text;
text << QString() << foldername;
- listView->blockSignals(true);
- (void) new ProjectItem(listView, text, clipId);
+ m_listView->blockSignals(true);
+ (void) new ProjectItem(m_listView, text, clipId);
m_doc->clipManager()->addFolder(clipId, foldername);
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
}
}
}
void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
{
- if (getProperties) listView->setEnabled(false);
- listView->blockSignals(true);
+ if (getProperties) m_listView->setEnabled(false);
+ m_listView->blockSignals(true);
const QString parent = clip->getProperty("groupid");
kDebug() << "Adding clip with groupid: " << parent;
ProjectItem *item = NULL;
//kDebug() << "Adding clip to new group: " << groupName;
if (groupName.isEmpty()) groupName = i18n("Folder");
text << QString() << groupName;
- parentitem = new ProjectItem(listView, text, parent);
+ parentitem = new ProjectItem(m_listView, text, parent);
} else {
//kDebug() << "Adding clip to existing group: " << parentitem->groupName();
}
if (parentitem) item = new ProjectItem(parentitem, clip);
}
- if (item == NULL) item = new ProjectItem(listView, clip);
+ if (item == NULL) item = new ProjectItem(m_listView, clip);
KUrl url = clip->fileURL();
if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
if (!annotation.isEmpty()) item->setText(2, annotation);
item->setText(3, QString::number(f.rating()));
}
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
}
void ProjectList::slotResetProjectList()
{
- listView->clear();
+ m_listView->clear();
emit clipSelected(NULL);
m_thumbnailQueue.clear();
m_infoQueue.clear();
{
kDebug() << " PRG LISTÂ REQUEST CLP INFO: " << id;
m_infoQueue.insert(id, xml);
- listView->setEnabled(false);
+ m_listView->setEnabled(false);
if (m_infoQueue.count() == 1) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
}
void ProjectList::slotProcessNextClipInQueue()
{
if (m_infoQueue.isEmpty()) {
- listView->setEnabled(true);
+ m_listView->setEnabled(true);
return;
}
QMap<QString, QDomElement>::const_iterator i = m_infoQueue.constBegin();
m_infoQueue.remove(i.key());
emit getFileProperties(dom, id, true);
}
- if (m_infoQueue.isEmpty()) listView->setEnabled(true);
+ if (m_infoQueue.isEmpty()) m_listView->setEnabled(true);
}
void ProjectList::slotUpdateClip(const QString &id)
{
ProjectItem *item = getItemById(id);
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
if (item) item->setData(1, UsageRole, QString::number(item->numReferences()));
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
}
void ProjectList::updateAllClips()
{
- QTreeWidgetItemIterator it(listView);
+ QTreeWidgetItemIterator it(m_listView);
while (*it) {
ProjectItem *item = static_cast <ProjectItem *>(*it);
if (!item->isGroup()) {
QString cachedPixmap = m_doc->projectFolder().path() + "/thumbs/" + item->getClipHash() + ".png";
if (QFile::exists(cachedPixmap)) {
//kDebug()<<"// USING CACHED PIX: "<<cachedPixmap;
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
item->setIcon(0, QPixmap(cachedPixmap));
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
} else requestClipThumbnail(item->clipId());
if (item->data(1, DurationRole).toString().isEmpty()) {
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
item->changeDuration(item->referencedClip()->producer()->get_playtime());
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
}
}
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
item->setData(1, UsageRole, QString::number(item->numReferences()));
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
qApp->processEvents();
}
++it;
QString groupId;
if (group.isEmpty()) {
- ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
if (item && !item->isGroup()) {
while (item->parent()) {
item = static_cast <ProjectItem*>(item->parent());
m_doc->deleteProjectClip(ids);
}
if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
- else listView->setEnabled(true);
+ else m_listView->setEnabled(true);
}
void ProjectList::slotAddColorClip()
QString group;
QString groupId;
- ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
if (item && !item->isGroup()) {
while (item->parent()) {
item = static_cast <ProjectItem*>(item->parent());
QString group;
QString groupId;
- ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
if (item && !item->isGroup()) {
while (item->parent()) {
item = static_cast <ProjectItem*>(item->parent());
{
QString group;
QString groupId;
- ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
if (item && !item->isGroup()) {
while (item->parent()) {
item = static_cast <ProjectItem*>(item->parent());
void ProjectList::setDocument(KdenliveDoc *doc)
{
- listView->blockSignals(true);
- listView->clear();
+ m_listView->blockSignals(true);
+ m_listView->clear();
emit clipSelected(NULL);
m_thumbnailQueue.clear();
m_infoQueue.clear();
QMapIterator<QString, QString> f(flist);
while (f.hasNext()) {
f.next();
- (void) new ProjectItem(listView, QStringList() << QString() << f.value(), f.key());
+ (void) new ProjectItem(m_listView, QStringList() << QString() << f.value(), f.key());
}
QList <DocClipBase*> list = doc->clipManager()->documentClipList();
m_timecode = doc->timecode();
m_commandStack = doc->commandStack();
m_doc = doc;
- QTreeWidgetItem *first = listView->topLevelItem(0);
- if (first) listView->setCurrentItem(first);
- listView->blockSignals(false);
+ QTreeWidgetItem *first = m_listView->topLevelItem(0);
+ if (first) m_listView->setCurrentItem(first);
+ m_listView->blockSignals(false);
m_toolbar->setEnabled(true);
}
QDomElement prods = doc.createElement("producerlist");
doc.appendChild(prods);
kDebug() << "//////////// PRO LISTÂ BUILD PRDSLIST ";
- QTreeWidgetItemIterator it(listView);
+ QTreeWidgetItemIterator it(m_listView);
while (*it) {
if (!((ProjectItem *)(*it))->isGroup())
prods.appendChild(doc.importNode(((ProjectItem *)(*it))->toXml(), true));
QPixmap pix;
if (clip->clipType() == AUDIO) pix = KIcon("audio-x-generic").pixmap(QSize(width, height));
else pix = item->referencedClip()->thumbProducer()->extractImage(item->referencedClip()->getClipThumbFrame(), width, height);
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
item->setIcon(0, pix);
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
m_doc->cachePixmap(item->getClipHash(), pix);
if (update) emit projectModified();
if (!m_thumbnailQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextThumbnail()));
{
ProjectItem *item = getItemById(clipId);
if (item && producer) {
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
item->setProperties(properties, metadata);
Q_ASSERT_X(item->referencedClip(), "void ProjectList::slotReplyGetFileProperties", QString("Item with groupName %1 does not have a clip associated").arg(item->groupName()).toLatin1());
if (replace) item->referencedClip()->setProducer(producer);
emit receivedClipDuration(clipId, item->clipMaxDuration());
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
} else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
- else listView->setEnabled(true);
+ else m_listView->setEnabled(true);
}
void ProjectList::slotReplyGetImage(const QString &clipId, const QPixmap &pix)
{
ProjectItem *item = getItemById(clipId);
if (item) {
- listView->blockSignals(true);
+ m_listView->blockSignals(true);
item->setIcon(0, pix);
m_doc->cachePixmap(item->getClipHash(), pix);
- listView->blockSignals(false);
+ m_listView->blockSignals(false);
}
}
ProjectItem *ProjectList::getItemById(const QString &id)
{
ProjectItem *item;
- QTreeWidgetItemIterator it(listView);
+ QTreeWidgetItemIterator it(m_listView);
while (*it) {
item = static_cast<ProjectItem *>(*it);
if (item->clipId() == id && item->clipType() != FOLDER)
ProjectItem *ProjectList::getFolderItemById(const QString &id)
{
ProjectItem *item;
- QTreeWidgetItemIterator it(listView);
+ QTreeWidgetItemIterator it(m_listView);
while (*it) {
item = static_cast<ProjectItem *>(*it);
if (item->clipId() == id && item->clipType() == FOLDER)
{
ProjectItem *clip = getItemById(ix);
if (clip) {
- listView->setCurrentItem(clip);
- listView->scrollToItem(clip);
+ m_listView->setCurrentItem(clip);
+ m_listView->scrollToItem(clip);
m_editAction->setEnabled(true);
m_deleteAction->setEnabled(true);
m_reloadAction->setEnabled(true);
void slotReloadClip();
private:
- ProjectListView *listView;
- KTreeWidgetSearchLine *searchView;
+ ProjectListView *m_listView;
Render *m_render;
Timecode m_timecode;
double m_fps;
}
}
- buttonOk = m_view.buttonBox->button(QDialogButtonBox::Ok);
+ m_buttonOk = m_view.buttonBox->button(QDialogButtonBox::Ok);
//buttonOk->setEnabled(false);
m_view.audio_thumbs->setChecked(KdenliveSettings::audiothumbnails());
m_view.video_thumbs->setChecked(KdenliveSettings::videothumbnails());
void ProjectSettings::slotUpdateButton(const QString &path)
{
- if (path.isEmpty()) buttonOk->setEnabled(false);
- else buttonOk->setEnabled(true);
+ if (path.isEmpty()) m_buttonOk->setEnabled(false);
+ else m_buttonOk->setEnabled(true);
}
QString ProjectSettings::selectedProfile() const
private:
Ui::ProjectSettings_UI m_view;
- QPushButton *buttonOk;
+ QPushButton *m_buttonOk;
};
m_didCapture(false),
m_isPlaying(false)
{
- ui.setupUi(this);
+ m_ui.setupUi(this);
- ui.video_frame->setAttribute(Qt::WA_PaintOnScreen);
- ui.device_selector->setCurrentIndex(KdenliveSettings::defaultcapture());
- connect(ui.device_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(slotVideoDeviceChanged(int)));
+ m_ui.video_frame->setAttribute(Qt::WA_PaintOnScreen);
+ m_ui.device_selector->setCurrentIndex(KdenliveSettings::defaultcapture());
+ connect(m_ui.device_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(slotVideoDeviceChanged(int)));
configAction->setCheckable(false);
layout->addWidget(toolbar);
- ui.control_frame_firewire->setLayout(layout);
+ m_ui.control_frame_firewire->setLayout(layout);
- slotVideoDeviceChanged(ui.device_selector->currentIndex());
- displayProcess = new QProcess;
- captureProcess = new QProcess;
+ slotVideoDeviceChanged(m_ui.device_selector->currentIndex());
+ m_displayProcess = new QProcess;
+ m_captureProcess = new QProcess;
- connect(captureProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(slotProcessStatus(QProcess::ProcessState)));
+ connect(m_captureProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(slotProcessStatus(QProcess::ProcessState)));
QStringList env = QProcess::systemEnvironment();
- env << "SDL_WINDOWID=" + QString::number(ui.video_frame->winId());
+ env << "SDL_WINDOWID=" + QString::number(m_ui.video_frame->winId());
QString videoDriver = KdenliveSettings::videodrivername();
if (!videoDriver.isEmpty()) {
}
setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 1);
- displayProcess->setEnvironment(env);
+ m_displayProcess->setEnvironment(env);
if (KdenliveSettings::video4capture().isEmpty()) {
QString captureCommand;
KdenliveSettings::setVideo4capture(captureCommand);
}
- kDebug() << "/////// BUILDING MONITOR, ID: " << ui.video_frame->winId();
+ kDebug() << "/////// BUILDING MONITOR, ID: " << m_ui.video_frame->winId();
}
RecMonitor::~RecMonitor()
{
- delete captureProcess;
- delete displayProcess;
+ delete m_captureProcess;
+ delete m_displayProcess;
}
QString RecMonitor::name() const
void RecMonitor::slotConfigure()
{
- emit showConfigDialog(4, ui.device_selector->currentIndex());
+ emit showConfigDialog(4, m_ui.device_selector->currentIndex());
}
void RecMonitor::slotUpdateCaptureFolder()
{
- if (captureProcess) captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
- slotVideoDeviceChanged(ui.device_selector->currentIndex());
+ if (m_captureProcess) m_captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
+ slotVideoDeviceChanged(m_ui.device_selector->currentIndex());
}
void RecMonitor::slotVideoDeviceChanged(int ix)
m_playAction->setEnabled(false);
if (KdenliveSettings::rmd_path().isEmpty()) {
QString rmdpath = KStandardDirs::findExe("recordmydesktop");
- if (rmdpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Recordmydesktop utility not found,\n please install it for screen grabs")));
+ if (rmdpath.isEmpty()) m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Recordmydesktop utility not found,\n please install it for screen grabs")));
else KdenliveSettings::setRmd_path(rmdpath);
}
- if (!KdenliveSettings::rmd_path().isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
- //ui.video_frame->setText(i18n("Press record button\nto start screen capture"));
+ if (!KdenliveSettings::rmd_path().isEmpty()) m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
+ //m_ui.video_frame->setText(i18n("Press record button\nto start screen capture"));
break;
case VIDEO4LINUX:
m_discAction->setEnabled(false);
m_playAction->setEnabled(false);
m_rewAction->setEnabled(false);
m_fwdAction->setEnabled(false);
- //ui.video_frame->setText(i18n("Plug your camcorder and\npress connect button\nto initialize connection"));
+ //m_ui.video_frame->setText(i18n("Plug your camcorder and\npress connect button\nto initialize connection"));
if (KdenliveSettings::dvgrab_path().isEmpty()) {
QString dvgrabpath = KStandardDirs::findExe("dvgrab");
- if (dvgrabpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("dvgrab utility not found,\n please install it for firewire capture")));
+ if (dvgrabpath.isEmpty()) m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("dvgrab utility not found,\n please install it for firewire capture")));
else KdenliveSettings::setDvgrab_path(dvgrabpath);
}
- if (!KdenliveSettings::dvgrab_path().isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
+ if (!KdenliveSettings::dvgrab_path().isEmpty()) m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
break;
}
}
QPixmap RecMonitor::mergeSideBySide(const QPixmap& pix, const QString txt)
{
QPainter p;
- QRect r = p.fontMetrics().boundingRect(QRect(0, 0, ui.video_frame->width(), ui.video_frame->height()), Qt::AlignLeft, txt);
+ QRect r = p.fontMetrics().boundingRect(QRect(0, 0, m_ui.video_frame->width(), m_ui.video_frame->height()), Qt::AlignLeft, txt);
int strWidth = r.width();
int strHeight = r.height();
int pixWidth = pix.width();
if (!KIO::NetAccess::exists(KUrl(KdenliveSettings::video4vdevice()), KIO::NetAccess::SourceSide , this)) {
m_playAction->setEnabled(false);
m_recAction->setEnabled(false);
- ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice())));
- //ui.video_frame->setText(i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice()));
- } else //ui.video_frame->setText(i18n("Press play or record button\nto start video capture"));
- ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Press play or record button\nto start video capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
+ m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice())));
+ //m_ui.video_frame->setText(i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice()));
+ } else //m_ui.video_frame->setText(i18n("Press play or record button\nto start video capture"));
+ m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Press play or record button\nto start video capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
}
void RecMonitor::slotDisconnect()
{
- if (captureProcess->state() == QProcess::NotRunning) {
+ if (m_captureProcess->state() == QProcess::NotRunning) {
m_captureTime = KDateTime::currentLocalDateTime();
kDebug() << "CURRENT TIME: " << m_captureTime.toString();
m_didCapture = false;
m_rewAction->setEnabled(true);
m_fwdAction->setEnabled(true);
} else {
- captureProcess->write("q", 1);
- QTimer::singleShot(1000, captureProcess, SLOT(kill()));
+ m_captureProcess->write("q", 1);
+ QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
if (m_didCapture) manageCapturedFiles();
m_didCapture = false;
}
void RecMonitor::slotRewind()
{
- captureProcess->write("a", 1);
+ m_captureProcess->write("a", 1);
}
void RecMonitor::slotForward()
{
- captureProcess->write("z", 1);
+ m_captureProcess->write("z", 1);
}
void RecMonitor::slotStopCapture()
{
// stop capture
- switch (ui.device_selector->currentIndex()) {
+ switch (m_ui.device_selector->currentIndex()) {
case FIREWIRE:
- captureProcess->write("\e", 2);
+ m_captureProcess->write("\e", 2);
m_playAction->setIcon(m_playIcon);
m_isPlaying = false;
break;
case VIDEO4LINUX:
- captureProcess->write("q\n", 3);
- QTimer::singleShot(1000, captureProcess, SLOT(kill()));
+ m_captureProcess->write("q\n", 3);
+ QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
break;
case SCREENGRAB:
- captureProcess->write("q\n", 3);
- QTimer::singleShot(1000, captureProcess, SLOT(kill()));
+ m_captureProcess->write("q\n", 3);
+ QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
break;
default:
break;
captureArgs<<"--format"<<"hdv"<<"-i"<<"capture"<<"-";
QStringList displayArgs;
- displayArgs<<"-f"<<"mpegts"<<"-x"<<QString::number(ui.video_frame->width())<<"-y"<<QString::number(ui.video_frame->height())<<"-";
+ displayArgs<<"-f"<<"mpegts"<<"-x"<<QString::number(m_ui.video_frame->width())<<"-y"<<QString::number(m_ui.video_frame->height())<<"-";
captureProcess->setStandardOutputProcess(displayProcess);
- ui.video_frame->setScaledContents(false);
+ m_ui.video_frame->setScaledContents(false);
captureProcess->start("dvgrab",captureArgs);
displayProcess->start("ffplay", displayArgs);*/
- if (captureProcess->state() != QProcess::NotRunning) {
- if (ui.device_selector->currentIndex() == FIREWIRE) {
+ if (m_captureProcess->state() != QProcess::NotRunning) {
+ if (m_ui.device_selector->currentIndex() == FIREWIRE) {
if (m_isPlaying) {
- captureProcess->write("k", 1);
+ m_captureProcess->write("k", 1);
//captureProcess->write("\e", 2);
m_playAction->setIcon(m_playIcon);
m_isPlaying = false;
} else {
- captureProcess->write("p", 1);
+ m_captureProcess->write("p", 1);
m_playAction->setIcon(m_pauseIcon);
m_isPlaying = true;
}
m_displayArgs.clear();
m_isPlaying = false;
- switch (ui.device_selector->currentIndex()) {
+ switch (m_ui.device_selector->currentIndex()) {
case FIREWIRE:
switch (KdenliveSettings::firewireformat()) {
case 0:
if (KdenliveSettings::firewireautosplit()) m_captureArgs << "--autosplit";
if (KdenliveSettings::firewiretimestamp()) m_captureArgs << "--timestamp";
m_captureArgs << "-i" << "capture" << "-";
- m_displayArgs << "-x" << QString::number(ui.video_frame->width()) << "-y" << QString::number(ui.video_frame->height()) << "-";
+ m_displayArgs << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
- captureProcess->setStandardOutputProcess(displayProcess);
- captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
+ m_captureProcess->setStandardOutputProcess(m_displayProcess);
+ m_captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
kDebug() << "Capture: Running dvgrab " << m_captureArgs.join(" ");
- captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
- if (play) captureProcess->write(" ", 1);
+ m_captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
+ if (play) m_captureProcess->write(" ", 1);
m_discAction->setEnabled(true);
break;
case VIDEO4LINUX:
m_captureArgs << KdenliveSettings::video4capture().simplified().split(' ') << KdenliveSettings::video4encoding().simplified().split(' ') << "-f" << "mpegts" << "-vcodec" << "mpeg4" << "-acodec" << "mp2" << "-";
- m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(ui.video_frame->width()) << "-y" << QString::number(ui.video_frame->height()) << "-";
- captureProcess->setStandardOutputProcess(displayProcess);
+ m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
+ m_captureProcess->setStandardOutputProcess(m_displayProcess);
kDebug() << "Capture: Running ffmpeg " << m_captureArgs.join(" ");
- captureProcess->start("ffmpeg", m_captureArgs);
+ m_captureProcess->start("ffmpeg", m_captureArgs);
break;
default:
break;
}
- if (ui.device_selector->currentIndex() != SCREENGRAB) {
+ if (m_ui.device_selector->currentIndex() != SCREENGRAB) {
kDebug() << "Capture: Running ffplay " << m_displayArgs.join(" ");
- displayProcess->start("ffplay", m_displayArgs);
- ui.video_frame->setText(i18n("Initialising..."));
+ m_displayProcess->start("ffplay", m_displayArgs);
+ m_ui.video_frame->setText(i18n("Initialising..."));
} else {
// do something when starting screen grab
}
void RecMonitor::slotRecord()
{
- if (captureProcess->state() == QProcess::NotRunning && ui.device_selector->currentIndex() == FIREWIRE) {
+ if (m_captureProcess->state() == QProcess::NotRunning && m_ui.device_selector->currentIndex() == FIREWIRE) {
slotStartCapture();
}
if (m_isCapturing) {
- switch (ui.device_selector->currentIndex()) {
+ switch (m_ui.device_selector->currentIndex()) {
case FIREWIRE:
- captureProcess->write("\e", 2);
+ m_captureProcess->write("\e", 2);
m_playAction->setIcon(m_playIcon);
m_isCapturing = false;
m_isPlaying = false;
m_recAction->setChecked(false);
break;
case VIDEO4LINUX:
- captureProcess->terminate();
+ m_captureProcess->terminate();
slotStopCapture();
//m_isCapturing = false;
QTimer::singleShot(1000, this, SLOT(slotStartCapture()));
break;
case SCREENGRAB:
//captureProcess->write("q\n", 3);
- captureProcess->terminate();
- ui.video_frame->setText(i18n("Encoding captured video..."));
+ m_captureProcess->terminate();
+ m_ui.video_frame->setText(i18n("Encoding captured video..."));
// in case ffmpeg doesn't exit with the 'q' command, kill it one second later
//QTimer::singleShot(1000, captureProcess, SLOT(kill()));
break;
}
return;
- } else if (ui.device_selector->currentIndex() == FIREWIRE) {
+ } else if (m_ui.device_selector->currentIndex() == FIREWIRE) {
m_isCapturing = true;
m_didCapture = true;
- captureProcess->write("c\n", 3);
+ m_captureProcess->write("c\n", 3);
return;
}
- if (captureProcess->state() == QProcess::NotRunning) {
+ if (m_captureProcess->state() == QProcess::NotRunning) {
m_recAction->setChecked(true);
QString extension = "mp4";
- if (ui.device_selector->currentIndex() == SCREENGRAB) extension = "ogv"; //KdenliveSettings::screengrabextension();
+ if (m_ui.device_selector->currentIndex() == SCREENGRAB) extension = "ogv"; //KdenliveSettings::screengrabextension();
QString path = KdenliveSettings::capturefolder() + "/capture0000." + extension;
int i = 1;
while (QFile::exists(path)) {
m_displayArgs.clear();
QString args;
- switch (ui.device_selector->currentIndex()) {
+ switch (m_ui.device_selector->currentIndex()) {
case FIREWIRE:
m_captureArgs << "--format" << "hdv" << "-i" << "capture" << "-";
- m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(ui.video_frame->width()) << "-y" << QString::number(ui.video_frame->height()) << "-";
- captureProcess->setStandardOutputProcess(displayProcess);
+ m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
+ m_captureProcess->setStandardOutputProcess(m_displayProcess);
kDebug() << "Capture: Running dvgrab " << m_captureArgs.join(" ");
- captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
+ m_captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
break;
case VIDEO4LINUX:
m_captureArgs << KdenliveSettings::video4capture().simplified().split(' ') << KdenliveSettings::video4encoding().simplified().split(' ') << "-vcodec" << "mpeg4" << "-acodec" << "mp2" << "-y" << m_captureFile.path() << "-f" << "mpegts" << "-vcodec" << "mpeg4" << "-acodec" << "mp2" << "-";
- m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(ui.video_frame->width()) << "-y" << QString::number(ui.video_frame->height()) << "-";
- captureProcess->setStandardOutputProcess(displayProcess);
+ m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
+ m_captureProcess->setStandardOutputProcess(m_displayProcess);
kDebug() << "Capture: Running ffmpeg " << m_captureArgs.join(" ");
- captureProcess->start("ffmpeg", m_captureArgs);
+ m_captureProcess->start("ffmpeg", m_captureArgs);
break;
case SCREENGRAB:
switch (KdenliveSettings::rmd_capture_type()) {
if (KdenliveSettings::rmd_fullshots()) m_captureArgs << "--full-shots";
m_captureArgs << "-workdir" << KdenliveSettings::currenttmpfolder();
m_captureArgs << "-fps" << QString::number(KdenliveSettings::rmd_fps()) << "-o" << m_captureFile.path();
- captureProcess->start(KdenliveSettings::rmd_path(), m_captureArgs);
+ m_captureProcess->start(KdenliveSettings::rmd_path(), m_captureArgs);
kDebug() << "// RecordMyDesktop params: " << m_captureArgs;
break;
default:
}
- if (ui.device_selector->currentIndex() != SCREENGRAB) {
+ if (m_ui.device_selector->currentIndex() != SCREENGRAB) {
m_isCapturing = true;
kDebug() << "Capture: Running ffplay " << m_displayArgs.join(" ");
- displayProcess->start("ffplay", m_displayArgs);
- ui.video_frame->setText(i18n("Initialising..."));
+ m_displayProcess->start("ffplay", m_displayArgs);
+ m_ui.video_frame->setText(i18n("Initialising..."));
}
} else {
// stop capture
- displayProcess->kill();
+ m_displayProcess->kill();
//captureProcess->kill();
QTimer::singleShot(1000, this, SLOT(slotRecord()));
}
}
m_captureArgs << args.simplified().split(' ') << KdenliveSettings::screengrabencoding().simplified().split(' ') << m_captureFile.path();
m_isCapturing = true;
- ui.video_frame->setText(i18n("Capturing..."));
+ m_ui.video_frame->setText(i18n("Capturing..."));
if (KdenliveSettings::screengrabenableaudio() && !KdenliveSettings::useosscapture()) {
QStringList alsaArgs = KdenliveSettings::screengrabalsacapture().simplified().split(' ');
alsaProcess->setStandardOutputProcess(captureProcess);
void RecMonitor::slotProcessStatus(QProcess::ProcessState status)
{
if (status == QProcess::NotRunning) {
- displayProcess->kill();
- if (m_isCapturing && ui.device_selector->currentIndex() != FIREWIRE)
- if (ui.autoaddbox->isChecked() && QFile::exists(m_captureFile.path())) emit addProjectClip(m_captureFile);
- if (ui.device_selector->currentIndex() == FIREWIRE) {
+ m_displayProcess->kill();
+ if (m_isCapturing && m_ui.device_selector->currentIndex() != FIREWIRE)
+ if (m_ui.autoaddbox->isChecked() && QFile::exists(m_captureFile.path())) emit addProjectClip(m_captureFile);
+ if (m_ui.device_selector->currentIndex() == FIREWIRE) {
m_discAction->setIcon(KIcon("network-connect"));
m_discAction->setText(i18n("Connect"));
m_playAction->setEnabled(false);
m_playAction->setIcon(m_playIcon);
m_recAction->setChecked(false);
m_stopAction->setEnabled(false);
- ui.device_selector->setEnabled(true);
- if (captureProcess && captureProcess->exitStatus() == QProcess::CrashExit) {
- ui.video_frame->setText(i18n("Capture crashed, please check your parameters"));
+ m_ui.device_selector->setEnabled(true);
+ if (m_captureProcess && m_captureProcess->exitStatus() == QProcess::CrashExit) {
+ m_ui.video_frame->setText(i18n("Capture crashed, please check your parameters"));
} else {
- if (ui.device_selector->currentIndex() != SCREENGRAB) ui.video_frame->setText(i18n("Not connected"));
- else ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
+ if (m_ui.device_selector->currentIndex() != SCREENGRAB) m_ui.video_frame->setText(i18n("Not connected"));
+ else m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
}
m_isCapturing = false;
} else {
- if (ui.device_selector->currentIndex() != SCREENGRAB) m_stopAction->setEnabled(true);
- ui.device_selector->setEnabled(false);
+ if (m_ui.device_selector->currentIndex() != SCREENGRAB) m_stopAction->setEnabled(true);
+ m_ui.device_selector->setEnabled(false);
}
}
virtual void mousePressEvent(QMouseEvent * event);
private:
- Ui::RecMonitor_UI ui;
+ Ui::RecMonitor_UI m_ui;
QString m_name;
bool m_isActive;
KDateTime m_captureTime;
KIcon m_playIcon;
KIcon m_pauseIcon;
- QProcess *captureProcess;
- QProcess *displayProcess;
+ QProcess *m_captureProcess;
+ QProcess *m_displayProcess;
bool m_isCapturing;
/** did the user capture something ? */
bool m_didCapture;
m_winid(winid)
{
kDebug() << "////////// USINGÂ PROFILE: " << (char*)KdenliveSettings::current_profile().toUtf8().data();
- refreshTimer = new QTimer(this);
- connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
+ m_refreshTimer = new QTimer(this);
+ connect(m_refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
/*if (rendererName == "project") m_monitorId = 10000;
else m_monitorId = 10001;*/
- osdTimer = new QTimer(this);
- connect(osdTimer, SIGNAL(timeout()), this, SLOT(slotOsdTimeout()));
+ m_osdTimer = new QTimer(this);
+ connect(m_osdTimer, SIGNAL(timeout()), this, SLOT(slotOsdTimeout()));
buildConsumer();
void Render::closeMlt()
{
- delete osdTimer;
- delete refreshTimer;
+ delete m_osdTimer;
+ delete m_refreshTimer;
delete m_mltConsumer;
delete m_mltProducer;
delete m_blackClip;
if (m_mltProducer->attach(*m_osdInfo) == 1) kDebug()<<"////// error attaching filter";
}*/
refresh();
- osdTimer->setSingleShot(2500);
+ m_osdTimer->setSingleShot(2500);
}
void Render::slotOsdTimeout()
void Render::askForRefresh()
{
// Use a Timer so that we don't refresh too much
- refreshTimer->start(200);
+ m_refreshTimer->start(200);
}
void Render::doRefresh()
{
if (!m_mltProducer || m_isBlocked)
return;
- refreshTimer->stop();
+ m_refreshTimer->stop();
if (m_mltConsumer) {
m_mltConsumer->set("refresh", 1);
}
Mlt::Producer *m_blackClip;
QString m_activeProfile;
- QTimer *refreshTimer;
- QTimer *osdTimer;
+ QTimer *m_refreshTimer;
+ QTimer *m_osdTimer;
/** A human-readable description of this renderer. */
int m_winid;
TitleDocument::TitleDocument()
{
- scene = NULL;
+ m_scene = NULL;
}
void TitleDocument::setScene(QGraphicsScene* _scene)
{
- scene = _scene;
+ m_scene = _scene;
}
QDomDocument TitleDocument::xml(QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv)
QDomElement main = doc.createElement("kdenlivetitle");
doc.appendChild(main);
- foreach(QGraphicsItem* item, scene->items()) {
+ foreach(QGraphicsItem* item, m_scene->items()) {
QDomElement e = doc.createElement("item");
QDomElement content = doc.createElement("content");
QFont font;
QColor TitleDocument::getBackgroundColor()
{
QColor color(0, 0, 0, 0);
- if (scene) {
- QList<QGraphicsItem *> items = scene->items();
+ if (m_scene) {
+ QList<QGraphicsItem *> items = m_scene->items();
for (int i = 0; i < items.size(); i++) {
if (items.at(i)->zValue() == -1100) {
color = ((QGraphicsRectItem *)items.at(i))->brush().color();
bool TitleDocument::saveDocument(const KUrl& url, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv)
{
- if (!scene)
+ if (!m_scene)
return false;
QDomDocument doc = xml(startv, endv);
{
QString tmpfile;
QDomDocument doc;
- if (!scene)
+ if (!m_scene)
return -1;
if (KIO::NetAccess::download(url, tmpfile, 0)) {
font.setPixelSize(QFontInfo(f2).pixelSize());
} else font.setPixelSize(txtProperties.namedItem("font-pixel-size").nodeValue().toInt());
QColor col(stringToColor(txtProperties.namedItem("font-color").nodeValue()));
- QGraphicsTextItem *txt = scene->addText(items.item(i).namedItem("content").firstChild().nodeValue(), font);
+ QGraphicsTextItem *txt = m_scene->addText(items.item(i).namedItem("content").firstChild().nodeValue(), font);
txt->setDefaultTextColor(col);
txt->setTextInteractionFlags(Qt::NoTextInteraction);
gitem = txt;
QString br_str = items.item(i).namedItem("content").attributes().namedItem("brushcolor").nodeValue();
QString pen_str = items.item(i).namedItem("content").attributes().namedItem("pencolor").nodeValue();
double penwidth = items.item(i).namedItem("content").attributes().namedItem("penwidth").nodeValue().toDouble();
- QGraphicsRectItem *rec = scene->addRect(stringToRect(rect), QPen(QBrush(stringToColor(pen_str)), penwidth), QBrush(stringToColor(br_str)));
+ QGraphicsRectItem *rec = m_scene->addRect(stringToRect(rect), QPen(QBrush(stringToColor(pen_str)), penwidth), QBrush(stringToColor(br_str)));
gitem = rec;
} else if (items.item(i).attributes().namedItem("type").nodeValue() == "QGraphicsPixmapItem") {
QString url = items.item(i).namedItem("content").attributes().namedItem("url").nodeValue();
QPixmap pix(url);
- QGraphicsPixmapItem *rec = scene->addPixmap(pix);
+ QGraphicsPixmapItem *rec = m_scene->addPixmap(pix);
rec->setData(Qt::UserRole, url);
gitem = rec;
} else if (items.item(i).attributes().namedItem("type").nodeValue() == "QGraphicsSvgItem") {
QString url = items.item(i).namedItem("content").attributes().namedItem("url").nodeValue();
QGraphicsSvgItem *rec = new QGraphicsSvgItem(url);
- scene->addItem(rec);
+ m_scene->addItem(rec);
rec->setData(Qt::UserRole, url);
gitem = rec;
}
kDebug() << items.item(i).attributes().namedItem("color").nodeValue();
QColor color = QColor(stringToColor(items.item(i).attributes().namedItem("color").nodeValue()));
//color.setAlpha(items.item(i).attributes().namedItem("alpha").nodeValue().toInt());
- QList<QGraphicsItem *> items = scene->items();
+ QList<QGraphicsItem *> items = m_scene->items();
for (int i = 0; i < items.size(); i++) {
if (items.at(i)->zValue() == -1100) {
((QGraphicsRectItem *)items.at(i))->setBrush(QBrush(color));
class TitleDocument
{
- QGraphicsScene* scene;
+ QGraphicsScene* m_scene;
public:
TitleDocument();
void setScene(QGraphicsScene* scene);
TitleWidget::TitleWidget(KUrl url, QString projectPath, Render *render, QWidget *parent) :
QDialog(parent),
Ui::TitleWidget_UI(),
- startViewport(NULL),
- endViewport(NULL),
+ m_startViewport(NULL),
+ m_endViewport(NULL),
m_render(render),
m_count(0),
m_projectPath(projectPath)
kDebug() << "// TITLE WIDGWT: " << graphicsView->viewport()->width() << "x" << graphicsView->viewport()->height();
toolBox->setItemEnabled(2, false);
if (!url.isEmpty()) {
- m_count = m_titledocument.loadDocument(url, startViewport, endViewport) + 1;
+ m_count = m_titledocument.loadDocument(url, m_startViewport, m_endViewport) + 1;
slotSelectTool();
} else {
slotRectTool();
delete m_frameBorder;
delete m_frameImage;
- delete startViewport;
- delete endViewport;
+ delete m_startViewport;
+ delete m_endViewport;
delete m_scene;
}
void TitleWidget::initViewports()
{
- startViewport = new QGraphicsPolygonItem(QPolygonF(QRectF(0, 0, 0, 0)));
- endViewport = new QGraphicsPolygonItem(QPolygonF(QRectF(0, 0, 0, 0)));
+ m_startViewport = new QGraphicsPolygonItem(QPolygonF(QRectF(0, 0, 0, 0)));
+ m_endViewport = new QGraphicsPolygonItem(QPolygonF(QRectF(0, 0, 0, 0)));
QPen startpen(Qt::DotLine);
QPen endpen(Qt::DashDotLine);
startpen.setColor(QColor(100, 200, 100, 140));
endpen.setColor(QColor(200, 100, 100, 140));
- startViewport->setPen(startpen);
- endViewport->setPen(endpen);
+ m_startViewport->setPen(startpen);
+ m_endViewport->setPen(endpen);
startViewportSize->setValue(40);
endViewportSize->setValue(40);
- startViewport->setZValue(-1000);
- endViewport->setZValue(-1000);
+ m_startViewport->setZValue(-1000);
+ m_endViewport->setZValue(-1000);
- startViewport->setFlags(/*QGraphicsItem::ItemIsMovable|*/QGraphicsItem::ItemIsSelectable);
- endViewport->setFlags(/*QGraphicsItem::ItemIsMovable|*/QGraphicsItem::ItemIsSelectable);
+ m_startViewport->setFlags(/*QGraphicsItem::ItemIsMovable|*/QGraphicsItem::ItemIsSelectable);
+ m_endViewport->setFlags(/*QGraphicsItem::ItemIsMovable|*/QGraphicsItem::ItemIsSelectable);
- graphicsView->scene()->addItem(startViewport);
- graphicsView->scene()->addItem(endViewport);
+ graphicsView->scene()->addItem(m_startViewport);
+ graphicsView->scene()->addItem(m_endViewport);
}
void TitleWidget::slotUpdateZoom(int pos)
frame_properties->setEnabled(false);
}
zValue->setValue((int)l[0]->zValue());
- itemzoom->setValue((int)(transformations[l[0]].scalex * 100));
- itemrotate->setValue((int)(transformations[l[0]].rotate));
+ itemzoom->setValue((int)(m_transformations[l[0]].scalex * 100));
+ itemrotate->setValue((int)(m_transformations[l[0]].rotate));
value_x->blockSignals(false);
value_y->blockSignals(false);
value_w->blockSignals(false);
{
QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
if (l.size() == 1) {
- Transform x = transformations[l[0]];
+ Transform x = m_transformations[l[0]];
x.scalex = (double)val / 100.0;
x.scaley = (double)val / 100.0;
QTransform qtrans;
qtrans.scale(x.scalex, x.scaley);
qtrans.rotate(x.rotate);
l[0]->setTransform(qtrans);
- transformations[l[0]] = x;
+ m_transformations[l[0]] = x;
}
}
{
QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
if (l.size() == 1) {
- Transform x = transformations[l[0]];
+ Transform x = m_transformations[l[0]];
x.rotate = (double)val;
QTransform qtrans;
qtrans.scale(x.scalex, x.scaley);
qtrans.rotate(x.rotate);
l[0]->setTransform(qtrans);
- transformations[l[0]] = x;
+ m_transformations[l[0]] = x;
}
}
sp.adjust(-sv_size, -sv_size / aspect_ratio, sv_size, sv_size / aspect_ratio);
ep.adjust(-ev_size, -ev_size / aspect_ratio, ev_size, ev_size / aspect_ratio);
- startViewport->setPos(startViewportX->value(), startViewportY->value());
- endViewport->setPos(endViewportX->value(), endViewportY->value());
+ m_startViewport->setPos(startViewportX->value(), startViewportY->value());
+ m_endViewport->setPos(endViewportX->value(), endViewportY->value());
- startViewport->setPolygon(QPolygonF(sp));
- endViewport->setPolygon(QPolygonF(ep));
+ m_startViewport->setPolygon(QPolygonF(sp));
+ m_endViewport->setPolygon(QPolygonF(ep));
}
for (int i = 0; i < items.size(); i++) {
if (items.at(i)->zValue() > -1000) delete items.at(i);
}
- m_count = m_titledocument.loadDocument(url, startViewport, endViewport) + 1;
+ m_count = m_titledocument.loadDocument(url, m_startViewport, m_endViewport) + 1;
slotSelectTool();
}
}
{
if (url.isEmpty()) url = KFileDialog::getSaveUrl(KUrl(m_projectPath), "*.kdenlivetitle", this, i18n("Save Title"));
if (!url.isEmpty()) {
- if (m_titledocument.saveDocument(url, startViewport, endViewport) == false)
+ if (m_titledocument.saveDocument(url, m_startViewport, m_endViewport) == false)
KMessageBox::error(this, i18n("Cannot write to file %1", url.path()));
}
}
QDomDocument TitleWidget::xml()
{
- return m_titledocument.xml(startViewport, endViewport);
+ return m_titledocument.xml(m_startViewport, m_endViewport);
}
void TitleWidget::setXml(QDomDocument doc)
{
- m_count = m_titledocument.loadFromXml(doc, startViewport, endViewport);
+ m_count = m_titledocument.loadFromXml(doc, m_startViewport, m_endViewport);
// mbd: Update the GUI color selectors to match the stuff from the loaded document
QColor background_color = m_titledocument.getBackgroundColor();
horizontalSlider->blockSignals(true);
m_scene->clearTextSelection();
QPen framepen = m_frameBorder->pen();
m_frameBorder->setPen(Qt::NoPen);
- startViewport->setVisible(false);
- endViewport->setVisible(false);
+ m_startViewport->setVisible(false);
+ m_endViewport->setVisible(false);
m_frameImage->setVisible(false);
m_scene->render(&painter, QRectF(), QRectF(0, 0, m_frameWidth, m_frameHeight));
painter.end();
m_frameBorder->setPen(framepen);
- startViewport->setVisible(true);
- endViewport->setVisible(true);
+ m_startViewport->setVisible(true);
+ m_endViewport->setVisible(true);
m_frameImage->setVisible(true);
return pix;
}
virtual void resizeEvent(QResizeEvent * event);
private:
- QGraphicsPolygonItem *startViewport, *endViewport;
+ QGraphicsPolygonItem *m_startViewport, *m_endViewport;
GraphicsSceneRectMove *m_scene;
void initViewports();
- QMap<QGraphicsItem*, Transform > transformations;
+ QMap<QGraphicsItem*, Transform > m_transformations;
TitleDocument m_titledocument;
QGraphicsRectItem *m_frameBorder;
QGraphicsPixmapItem *m_frameImage;
m_doc(doc)
{
- view.setupUi(this);
+ m_view.setupUi(this);
m_scene = new CustomTrackScene(doc);
m_trackview = new CustomTrackView(doc, m_scene, parent);
m_ruler = new CustomRuler(doc->timecode(), m_trackview);
connect(m_ruler, SIGNAL(zoneMoved(int, int)), this, SIGNAL(zoneMoved(int, int)));
QHBoxLayout *layout = new QHBoxLayout;
- view.ruler_frame->setLayout(layout);
+ m_view.ruler_frame->setLayout(layout);
int left_margin;
int right_margin;
layout->getContentsMargins(&left_margin, 0, &right_margin, 0);
QHBoxLayout *tracksLayout = new QHBoxLayout;
tracksLayout->setContentsMargins(0, 0, 0, 0);
- view.tracks_frame->setLayout(tracksLayout);
+ m_view.tracks_frame->setLayout(tracksLayout);
- view.headers_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- view.headers_area->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_view.headers_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_view.headers_area->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_headersLayout = new QVBoxLayout;
m_headersLayout->setContentsMargins(0, 0, 0, 0);
m_headersLayout->setSpacing(0);
- view.headers_container->setLayout(m_headersLayout);
+ m_view.headers_container->setLayout(m_headersLayout);
- connect(view.headers_area->verticalScrollBar(), SIGNAL(valueChanged(int)), m_trackview->verticalScrollBar(), SLOT(setValue(int)));
+ connect(m_view.headers_area->verticalScrollBar(), SIGNAL(valueChanged(int)), m_trackview->verticalScrollBar(), SLOT(setValue(int)));
tracksLayout->addWidget(m_trackview);
- connect(m_trackview->verticalScrollBar(), SIGNAL(valueChanged(int)), view.headers_area->verticalScrollBar(), SLOT(setValue(int)));
+ connect(m_trackview->verticalScrollBar(), SIGNAL(valueChanged(int)), m_view.headers_area->verticalScrollBar(), SLOT(setValue(int)));
connect(m_trackview, SIGNAL(trackHeightChanged()), this, SLOT(slotRebuildTrackHeaders()));
parseDocument(m_doc->toXml());
connect(header, SIGNAL(changeTrack(int)), this, SIGNAL(changeTrack(int)));
m_headersLayout->addWidget(header);
}
- view.headers_container->adjustSize();
+ m_view.headers_container->adjustSize();
}
void slotSetZone(QPoint p);
private:
- Ui::TimeLine_UI view;
+ Ui::TimeLine_UI m_view;
CustomRuler *m_ruler;
CustomTrackView *m_trackview;
QList <QString> m_invalidProducers;
m_usedTransition(NULL),
m_tracksCount(0)
{
- ui.setupUi(this);
- effectEdit = new EffectStackEdit(ui.frame);
- connect(effectEdit, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
+ m_ui.setupUi(this);
+ m_effectEdit = new EffectStackEdit(m_ui.frame);
+ connect(m_effectEdit, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
setEnabled(false);
- ui.transitionList->addItems(MainWindow::transitions.effectNames());
- for (int i = 0; i < ui.transitionList->count(); i++) {
- ui.transitionList->setItemData(i, MainWindow::transitions.getInfoFromIndex(i), Qt::ToolTipRole);
+ m_ui.transitionList->addItems(MainWindow::transitions.effectNames());
+ for (int i = 0; i < m_ui.transitionList->count(); i++) {
+ m_ui.transitionList->setItemData(i, MainWindow::transitions.getInfoFromIndex(i), Qt::ToolTipRole);
}
//kDebug() << MainWindow::transitions.effectNames().size();
- //ui.listWidget->setCurrentRow(0);
- connect(ui.transitionList, SIGNAL(activated(int)), this, SLOT(slotTransitionChanged()));
- connect(ui.transitionTrack, SIGNAL(activated(int)), this, SLOT(slotTransitionTrackChanged()));
+ //m_ui.listWidget->setCurrentRow(0);
+ connect(m_ui.transitionList, SIGNAL(activated(int)), this, SLOT(slotTransitionChanged()));
+ connect(m_ui.transitionTrack, SIGNAL(activated(int)), this, SLOT(slotTransitionTrackChanged()));
- connect(this, SIGNAL(transferParamDesc(const QDomElement&, int , int)), effectEdit , SLOT(transferParamDesc(const QDomElement&, int , int)));
- connect(effectEdit, SIGNAL(parameterChanged(const QDomElement&, const QDomElement&)), this , SLOT(slotUpdateEffectParams(const QDomElement&, const QDomElement&)));
+ connect(this, SIGNAL(transferParamDesc(const QDomElement&, int , int)), m_effectEdit , SLOT(transferParamDesc(const QDomElement&, int , int)));
+ connect(m_effectEdit, SIGNAL(parameterChanged(const QDomElement&, const QDomElement&)), this , SLOT(slotUpdateEffectParams(const QDomElement&, const QDomElement&)));
}
void TransitionSettings::updateProjectFormat(MltVideoProfile profile, Timecode t, const uint tracksCount)
{
m_tracksCount = tracksCount;
- effectEdit->updateProjectFormat(profile, t);
+ m_effectEdit->updateProjectFormat(profile, t);
QStringList tracksList;
tracksList << i18n("Auto");
for (uint i = 0; i < tracksCount; i++) {
tracksList << QString::number(i);
}
tracksList << i18n("Black");
- ui.transitionTrack->blockSignals(true);
- ui.transitionTrack->clear();
- ui.transitionTrack->addItems(tracksList);
- ui.transitionTrack->blockSignals(false);
+ m_ui.transitionTrack->blockSignals(true);
+ m_ui.transitionTrack->clear();
+ m_ui.transitionTrack->addItems(tracksList);
+ m_ui.transitionTrack->blockSignals(false);
}
QDomElement e = m_usedTransition->toXML().cloneNode().toElement();
if (reinit) {
// Reset the transition parameters to the default one
- QDomElement newTransition = MainWindow::transitions.getEffectByName(ui.transitionList->currentText()).cloneNode().toElement();
+ QDomElement newTransition = MainWindow::transitions.getEffectByName(m_ui.transitionList->currentText()).cloneNode().toElement();
slotUpdateEffectParams(e, newTransition);
emit transferParamDesc(newTransition, m_usedTransition->startPos().frames(KdenliveSettings::project_fps()), m_usedTransition->endPos().frames(KdenliveSettings::project_fps()));
} else if (!updateCurrent) {
// Transition changed, update parameters dialog
//slotUpdateEffectParams(e, e);
- effectEdit->transferParamDesc(e, m_usedTransition->startPos().frames(KdenliveSettings::project_fps()), m_usedTransition->endPos().frames(KdenliveSettings::project_fps()));
+ m_effectEdit->transferParamDesc(e, m_usedTransition->startPos().frames(KdenliveSettings::project_fps()), m_usedTransition->endPos().frames(KdenliveSettings::project_fps()));
} else {
// Same transition, we just want to update the parameters value
slotUpdateEffectParams(e, e);
if (m_usedTransition == NULL) return;
int ix = 0;
QDomElement oldxml = m_usedTransition->toXML().cloneNode().toElement();
- if (ui.transitionTrack->currentIndex() > 0) {
- ix = ui.transitionTrack->count() - ui.transitionTrack->currentIndex() - 1;
+ if (m_ui.transitionTrack->currentIndex() > 0) {
+ ix = m_ui.transitionTrack->count() - m_ui.transitionTrack->currentIndex() - 1;
m_usedTransition->setForcedTrack(true, ix);
- effectEdit->updateParameter("force_track", "1");
+ m_effectEdit->updateParameter("force_track", "1");
emit transitionUpdated(m_usedTransition, oldxml);
} else {
m_usedTransition->setForcedTrack(false, ix);
- effectEdit->updateParameter("force_track", "0");
+ m_effectEdit->updateParameter("force_track", "0");
emit transitionUpdated(m_usedTransition, oldxml);
}
- effectEdit->updateParameter("transition_btrack", QString::number(ix));
+ m_effectEdit->updateParameter("transition_btrack", QString::number(ix));
}
void TransitionSettings::slotTransitionItemSelected(Transition* t, bool update)
if (t == m_usedTransition) {
if (t == NULL) return;
if (update) {
- ui.transitionTrack->blockSignals(true);
- if (t->forcedTrack()) ui.transitionTrack->setCurrentIndex(m_tracksCount + 1 - t->transitionEndTrack());
- else ui.transitionTrack->setCurrentIndex(0);
- ui.transitionTrack->blockSignals(false);
+ m_ui.transitionTrack->blockSignals(true);
+ if (t->forcedTrack()) m_ui.transitionTrack->setCurrentIndex(m_tracksCount + 1 - t->transitionEndTrack());
+ else m_ui.transitionTrack->setCurrentIndex(0);
+ m_ui.transitionTrack->blockSignals(false);
}
if (update || t->duration() != m_transitionDuration || t->startPos() != m_transitionStart) {
m_transitionDuration = t->duration();
if (t) {
m_transitionDuration = t->duration();
m_transitionStart = t->startPos();
- ui.transitionTrack->blockSignals(true);
- if (!t->forcedTrack()) ui.transitionTrack->setCurrentIndex(0);
- else ui.transitionTrack->setCurrentIndex(m_tracksCount + 1 - t->transitionEndTrack());
- ui.transitionTrack->blockSignals(false);
- int ix = ui.transitionList->findText(t->transitionName(), Qt::MatchExactly);
+ m_ui.transitionTrack->blockSignals(true);
+ if (!t->forcedTrack()) m_ui.transitionTrack->setCurrentIndex(0);
+ else m_ui.transitionTrack->setCurrentIndex(m_tracksCount + 1 - t->transitionEndTrack());
+ m_ui.transitionTrack->blockSignals(false);
+ int ix = m_ui.transitionList->findText(t->transitionName(), Qt::MatchExactly);
m_usedTransition = t;
if (ix != -1) {
- ui.transitionList->blockSignals(true);
- ui.transitionList->setCurrentIndex(ix);
+ m_ui.transitionList->blockSignals(true);
+ m_ui.transitionList->setCurrentIndex(ix);
slotTransitionChanged(false, false);
- ui.transitionList->blockSignals(false);
+ m_ui.transitionList->blockSignals(false);
}
}
void updateProjectFormat(MltVideoProfile profile, Timecode t, const uint tracksCount);
private:
- Ui::TransitionSettings_UI ui;
- EffectStackEdit *effectEdit;
+ Ui::TransitionSettings_UI m_ui;
+ EffectStackEdit *m_effectEdit;
Transition* m_usedTransition;
GenTime m_transitionDuration;
GenTime m_transitionStart;
bool WestleyPreview::create(const QString &path, int width, int /*height*/, QImage &img)
{
QFileInfo fi(path);
- playerBin = KStandardDirs::findExe("inigo");
- if (playerBin.isEmpty()) {
+ m_playerBin = KStandardDirs::findExe("inigo");
+ if (m_playerBin.isEmpty()) {
kDebug(DBG_AREA) << "westleypreview: inigo not found, exiting.\n";
return false;
}
const int START = 25;
const int RANGE = 500;
args.clear();
- args << playerBin << "\"" + path + "\"";
+ args << m_playerBin << "\"" + path + "\"";
unsigned long start = (unsigned long)(START + (m_rand->getDouble() * RANGE));
args << QString("in=%1").arg(start) << QString("out=%1").arg(start) << "-consumer";
private:
QProcess *m_inigoprocess;
KRandomSequence *m_rand;
- QString playerBin;
+ QString m_playerBin;
bool startAndWaitProcess(const QStringList &args);
enum frameflags { framerandom = 0x1, framestart = 0x2, frameend = 0x4 };
struct {