[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdenlive] src: Replace uppercase enums into camel into.
From: Jean-Nicolas Artaud <jeannicolasartaud () gmail ! com>
Date: 2014-01-17 19:06:02
Message-ID: E1W4Ejy-0006mS-D5 () scm ! kde ! org
[Download RAW message or body]
Git commit f69a24d18f8134c93e407ea485967ac31187da47 by Jean-Nicolas Artaud.
Committed on 17/01/2014 at 19:04.
Pushed by artaud into branch 'master'.
Replace uppercase enums into camel into.
M +2 -2 src/abstractgroupitem.cpp
M +1 -1 src/clipitem.cpp
M +3 -3 src/customtrackscene.cpp
M +10 -4 src/customtrackscene.h
M +14 -14 src/customtrackview.cpp
M +3 -3 src/customtrackview.h
M +3 -3 src/mainwindow.cpp
M +1 -1 src/recmonitor.h
http://commits.kde.org/kdenlive/f69a24d18f8134c93e407ea485967ac31187da47
diff --git a/src/abstractgroupitem.cpp b/src/abstractgroupitem.cpp
index 15770b8..2b74e01 100644
--- a/src/abstractgroupitem.cpp
+++ b/src/abstractgroupitem.cpp
@@ -292,7 +292,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
QList<QGraphicsItem*> collidingItems;
QPainterPath shape;
- if (projectScene()->editMode() == NORMALEDIT) {
+ if (projectScene()->editMode() == NormalEdit) {
shape = clipGroupShape(newPos - pos());
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
@@ -356,7 +356,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
}
}
- if (projectScene()->editMode() == NORMALEDIT) {
+ if (projectScene()->editMode() == NormalEdit) {
shape = transitionGroupShape(newPos - pos());
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
diff --git a/src/clipitem.cpp b/src/clipitem.cpp
index ce8ace3..a4d582f 100644
--- a/src/clipitem.cpp
+++ b/src/clipitem.cpp
@@ -1415,7 +1415,7 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
QRectF sceneShape = rect();
sceneShape.translate(newPos);
QList<QGraphicsItem*> items;
- if (projectScene()->editMode() == NORMALEDIT)
+ if (projectScene()->editMode() == NormalEdit)
items = scene()->items(sceneShape, Qt::IntersectsItemShape);
items.removeAll(this);
bool forwardMove = newPos.x() > pos().x();
diff --git a/src/customtrackscene.cpp b/src/customtrackscene.cpp
index cf5dffd..35d1206 100644
--- a/src/customtrackscene.cpp
+++ b/src/customtrackscene.cpp
@@ -26,7 +26,7 @@ CustomTrackScene::CustomTrackScene(KdenliveDoc *doc, QObject *parent) :
QGraphicsScene(parent),
m_document(doc),
m_scale(1.0, 1.0),
- m_editMode(NORMALEDIT)
+ m_editMode(NormalEdit)
{
}
@@ -98,12 +98,12 @@ MltVideoProfile CustomTrackScene::profile() const
return m_document->mltProfile();
}
-void CustomTrackScene::setEditMode(EDITMODE mode)
+void CustomTrackScene::setEditMode(EditMode mode)
{
m_editMode = mode;
}
-EDITMODE CustomTrackScene::editMode() const
+EditMode CustomTrackScene::editMode() const
{
return m_editMode;
}
diff --git a/src/customtrackscene.h b/src/customtrackscene.h
index c950656..386ec2f 100644
--- a/src/customtrackscene.h
+++ b/src/customtrackscene.h
@@ -35,7 +35,13 @@
class KdenliveDoc;
class MltVideoProfile;
-enum EDITMODE { NORMALEDIT = 0 , OVERWRITEEDIT = 1 , INSERTEDIT = 2 };
+enum EditMode {
+ NormalEdit = 0,
+ OverwriteEdit = 1,
+ InsertEdit = 2
+};
+
+
class CustomTrackScene : public QGraphicsScene
{
@@ -52,14 +58,14 @@ public:
QPointF scale() const;
int tracksCount() const;
MltVideoProfile profile() const;
- void setEditMode(EDITMODE mode);
- EDITMODE editMode() const;
+ void setEditMode(EditMode mode);
+ EditMode editMode() const;
private:
KdenliveDoc *m_document;
QList <GenTime> m_snapPoints;
QPointF m_scale;
- EDITMODE m_editMode;
+ EditMode m_editMode;
};
#endif
diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp
index 65454aa..186552f 100644
--- a/src/customtrackview.cpp
+++ b/src/customtrackview.cpp
@@ -1663,7 +1663,7 @@ void CustomTrackView::insertClipCut(DocClipBase *clip, int in, int out)
QUndoCommand *addCommand = new QUndoCommand();
addCommand->setText(i18n("Add timeline clip"));
new RefreshMonitorCommand(this, false, true, addCommand);
- new AddTimelineClipCommand(this, clip->toXML(), clip->getId(), pasteInfo, EffectsList(), \
m_scene->editMode() == OVERWRITEEDIT, m_scene->editMode() == INSERTEDIT, true, false, addCommand); + \
new AddTimelineClipCommand(this, clip->toXML(), clip->getId(), pasteInfo, EffectsList(), \
m_scene->editMode() == OverwriteEdit, m_scene->editMode() == InsertEdit, true, false, addCommand); new \
RefreshMonitorCommand(this, true, false, addCommand); updateTrackDuration(pasteInfo.track, addCommand);
@@ -2823,7 +2823,7 @@ void CustomTrackView::dropEvent(QDropEvent * event)
ItemInfo clipInfo = info;
clipInfo.track = m_document->tracksCount() - item->track();
- int worked = m_document->renderer()->mltInsertClip(clipInfo, item->xml(), \
item->baseClip()->getProducer(item->track()), m_scene->editMode() == OVERWRITEEDIT, m_scene->editMode() \
== INSERTEDIT); + int worked = m_document->renderer()->mltInsertClip(clipInfo, item->xml(), \
item->baseClip()->getProducer(item->track()), m_scene->editMode() == OverwriteEdit, m_scene->editMode() \
== InsertEdit); if (worked == -1) {
emit displayMessage(i18n("Cannot insert clip in timeline"), ErrorMessage);
brokenClips.append(item);
@@ -2831,7 +2831,7 @@ void CustomTrackView::dropEvent(QDropEvent * event)
}
adjustTimelineClips(m_scene->editMode(), item, ItemInfo(), addCommand);
- new AddTimelineClipCommand(this, item->xml(), item->clipProducer(), item->info(), \
item->effectList(), m_scene->editMode() == OVERWRITEEDIT, m_scene->editMode() == INSERTEDIT, false, \
false, addCommand); + new AddTimelineClipCommand(this, item->xml(), item->clipProducer(), \
item->info(), item->effectList(), m_scene->editMode() == OverwriteEdit, m_scene->editMode() == \
InsertEdit, false, false, addCommand); updateTrackDuration(info.track, addCommand);
if (item->baseClip()->isTransparent() && getTransitionItemAtStart(info.startPos, info.track) \
== NULL) { @@ -2892,11 +2892,11 @@ void CustomTrackView::dropEvent(QDropEvent * event)
setFocus();
}
-void CustomTrackView::adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInfo posinfo, QUndoCommand \
*command) +void CustomTrackView::adjustTimelineClips(EditMode mode, ClipItem *item, ItemInfo posinfo, \
QUndoCommand *command) {
bool snap = KdenliveSettings::snaptopoints();
KdenliveSettings::setSnaptopoints(false);
- if (mode == OVERWRITEEDIT) {
+ if (mode == OverwriteEdit) {
// if we are in overwrite mode, move clips accordingly
ItemInfo info;
if (item == NULL) info = posinfo;
@@ -2947,7 +2947,7 @@ void CustomTrackView::adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInf
}
}
}
- } else if (mode == INSERTEDIT) {
+ } else if (mode == InsertEdit) {
// if we are in push mode, move clips accordingly
ItemInfo info;
if (item == NULL) info = posinfo;
@@ -2981,9 +2981,9 @@ void CustomTrackView::adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInf
}
-void CustomTrackView::adjustTimelineTransitions(EDITMODE mode, Transition *item, QUndoCommand *command)
+void CustomTrackView::adjustTimelineTransitions(EditMode mode, Transition *item, QUndoCommand *command)
{
- if (mode == OVERWRITEEDIT) {
+ if (mode == OverwriteEdit) {
// if we are in overwrite or push mode, move clips accordingly
bool snap = KdenliveSettings::snaptopoints();
KdenliveSettings::setSnaptopoints(false);
@@ -3806,7 +3806,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
if (m_dragItem->type() == AVWidget && (m_dragItemInfo.startPos != info.startPos || \
m_dragItemInfo.track != info.track)) { ClipItem *item = static_cast <ClipItem *>(m_dragItem);
Mlt::Producer *prod = item->getProducer(info.track);
- bool success = m_document->renderer()->mltMoveClip((int)(m_document->tracksCount() - \
m_dragItemInfo.track), (int)(m_document->tracksCount() - info.track), (int) \
m_dragItemInfo.startPos.frames(m_document->fps()), (int)(info.startPos.frames(m_document->fps())), prod, \
m_scene->editMode() == OVERWRITEEDIT, m_scene->editMode() == INSERTEDIT); + bool success = \
m_document->renderer()->mltMoveClip((int)(m_document->tracksCount() - m_dragItemInfo.track), \
(int)(m_document->tracksCount() - info.track), (int) m_dragItemInfo.startPos.frames(m_document->fps()), \
(int)(info.startPos.frames(m_document->fps())), prod, m_scene->editMode() == OverwriteEdit, \
m_scene->editMode() == InsertEdit);
if (success) {
QUndoCommand *moveCommand = new QUndoCommand();
@@ -4015,7 +4015,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
int trackProducer = info.track;
info.track = m_document->tracksCount() - info.track;
adjustTimelineClips(m_scene->editMode(), clip, ItemInfo(), moveGroup);
- m_document->renderer()->mltInsertClip(info, clip->xml(), \
clip->getProducer(trackProducer), m_scene->editMode() == OVERWRITEEDIT, m_scene->editMode() == \
INSERTEDIT); + m_document->renderer()->mltInsertClip(info, clip->xml(), \
clip->getProducer(trackProducer), m_scene->editMode() == OverwriteEdit, m_scene->editMode() == \
InsertEdit); for (int i = 0; i < clip->effectsCount(); ++i) {
m_document->renderer()->mltAddEffect(info.track, info.startPos, \
getEffectArgs(clip->effect(i)), false); }
@@ -6048,7 +6048,7 @@ void CustomTrackView::copyClip()
bool CustomTrackView::canBePastedTo(ItemInfo info, int type) const
{
- if (m_scene->editMode() != NORMALEDIT) {
+ if (m_scene->editMode() != NormalEdit) {
// If we are in overwrite mode, always allow the move
return true;
}
@@ -6183,7 +6183,7 @@ void CustomTrackView::pasteClip()
info.endPos += offset;
info.track += trackOffset;
if (canBePastedTo(info, AVWidget)) {
- new AddTimelineClipCommand(this, clip->xml(), clip->clipProducer(), info, \
clip->effectList(), m_scene->editMode() == OVERWRITEEDIT, m_scene->editMode() == INSERTEDIT, true, false, \
pasteClips); + new AddTimelineClipCommand(this, clip->xml(), clip->clipProducer(), info, \
clip->effectList(), m_scene->editMode() == OverwriteEdit, m_scene->editMode() == InsertEdit, true, false, \
pasteClips);
} else emit displayMessage(i18n("Cannot paste clip to selected place"), ErrorMessage);
} else if (m_copiedItems.at(i) && m_copiedItems.at(i)->type() == TransitionWidget) {
Transition *tr = static_cast <Transition *>(m_copiedItems.at(i));
@@ -7350,7 +7350,7 @@ QStringList CustomTrackView::extractTransitionsLumas()
return urls;
}
-void CustomTrackView::setEditMode(EDITMODE mode)
+void CustomTrackView::setEditMode(EditMode mode)
{
m_scene->setEditMode(mode);
}
@@ -7389,7 +7389,7 @@ void CustomTrackView::insertZoneOverwrite(QStringList data, int in)
info.track = m_selectedTrack;
QUndoCommand *addCommand = new QUndoCommand();
addCommand->setText(i18n("Insert clip"));
- adjustTimelineClips(OVERWRITEEDIT, NULL, info, addCommand);
+ adjustTimelineClips(OverwriteEdit, NULL, info, addCommand);
new AddTimelineClipCommand(this, clip->toXML(), clip->getId(), info, EffectsList(), true, false, \
true, false, addCommand); updateTrackDuration(info.track, addCommand);
m_commandStack->push(addCommand);
diff --git a/src/customtrackview.h b/src/customtrackview.h
index 4d5184a..e7d404f 100644
--- a/src/customtrackview.h
+++ b/src/customtrackview.h
@@ -183,7 +183,7 @@ public:
void selectClip(bool add, bool group = false, int track = -1, int pos = -1);
void selectTransition(bool add, bool group = false);
QStringList extractTransitionsLumas();
- void setEditMode(EDITMODE mode);
+ void setEditMode(EditMode mode);
/** @brief Inserts @param clip.
* @param clip The clip to insert
@@ -418,8 +418,8 @@ private:
/** Selects all items in the scene rect, and sets ok to false if a group going over several tracks \
is found in it */ QList<QGraphicsItem *> checkForGroups(const QRectF &rect, bool *ok);
/** Adjust clips under another one when working in overwrite mode */
- void adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInfo posinfo, QUndoCommand *command);
- void adjustTimelineTransitions(EDITMODE mode, Transition *item, QUndoCommand *command);
+ void adjustTimelineClips(EditMode mode, ClipItem *item, ItemInfo posinfo, QUndoCommand *command);
+ void adjustTimelineTransitions(EditMode mode, Transition *item, QUndoCommand *command);
/** Adjust keyframes when pasted to another clip */
void adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime duration, QDomElement xml);
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ea651f6..4d45e99 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -3585,11 +3585,11 @@ void MainWindow::slotChangeEdit(QAction * action)
return;
if (action == m_overwriteEditTool)
- m_activeTimeline->projectView()->setEditMode(OVERWRITEEDIT);
+ m_activeTimeline->projectView()->setEditMode(OverwriteEdit);
else if (action == m_insertEditTool)
- m_activeTimeline->projectView()->setEditMode(INSERTEDIT);
+ m_activeTimeline->projectView()->setEditMode(InsertEdit);
else
- m_activeTimeline->projectView()->setEditMode(NORMALEDIT);
+ m_activeTimeline->projectView()->setEditMode(NormalEdit);
}
void MainWindow::slotSetTool(ProjectTool tool)
diff --git a/src/recmonitor.h b/src/recmonitor.h
index b27cfc3..62d9459 100644
--- a/src/recmonitor.h
+++ b/src/recmonitor.h
@@ -61,7 +61,7 @@ public:
AbstractRender *abstractRender();
void analyseFrames(bool analyse);
- enum CAPTUREDEVICE {
+ enum CaptureDevice {
Firewire = 0,
Video4Linux = 1,
ScreenBag = 2,
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic