QPainterPath AbstractGroupItem::clipGroupShape(QPointF offset) const
{
- QPainterPath path;
- QList<QGraphicsItem *> children = childItems();
- for (int i = 0; i < children.count(); i++) {
- if (children.at(i)->type() == AVWIDGET) {
- QRectF r(children.at(i)->sceneBoundingRect());
- r.translate(offset);
- path.addRect(r);
- } else if (children.at(i)->type() == GROUPWIDGET) {
- QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
- for (int j = 0; j < subchildren.count(); j++) {
- if (subchildren.at(j)->type() == AVWIDGET) {
- QRectF r(subchildren.at(j)->sceneBoundingRect());
- r.translate(offset);
- path.addRect(r);
- }
- }
- }
- }
- return path;
+ return groupShape(AVWIDGET, offset);
}
QPainterPath AbstractGroupItem::transitionGroupShape(QPointF offset) const
+{
+ return groupShape(TRANSITIONWIDGET, offset);
+}
+
+QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset) const
{
QPainterPath path;
QList<QGraphicsItem *> children = childItems();
for (int i = 0; i < children.count(); i++) {
- if (children.at(i)->type() == TRANSITIONWIDGET) {
+ if (children.at(i)->type() == (int)type) {
QRectF r(children.at(i)->sceneBoundingRect());
r.translate(offset);
path.addRect(r);
} else if (children.at(i)->type() == GROUPWIDGET) {
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
for (int j = 0; j < subchildren.count(); j++) {
- if (subchildren.at(j)->type() == TRANSITIONWIDGET) {
+ if (subchildren.at(j)->type() == (int)type) {
QRectF r(subchildren.at(j)->sceneBoundingRect());
r.translate(offset);
path.addRect(r);
CustomTrackScene* projectScene();
void addItem(QGraphicsItem * item);
int track() const;
- QPainterPath clipGroupShape(QPointF) const;
- QPainterPath transitionGroupShape(QPointF) const;
+ QPainterPath clipGroupShape(QPointF offset) const;
+ QPainterPath transitionGroupShape(QPointF offset) const;
void setItemLocked(bool locked);
bool isItemLocked() const;
// ItemInfo info() const;
private:
void fixItemRect();
+ QPainterPath groupShape(GRAPHICSRECTITEM type, QPointF offset) const;
};
#endif
int freetrack = m_document->tracksCount() - track - 1;
for (; freetrack > 0; freetrack--) {
kDebug() << "// CHK DOC TRK:" << freetrack << ", DUR:" << m_document->renderer()->mltTrackDuration(freetrack);
- if (m_document->trackInfoAt(freetrack - 1).type == AUDIOTRACK) {
+ if (m_document->trackInfoAt(freetrack - 1).type == AUDIOTRACK && !m_document->trackInfoAt(freetrack - 1).isLocked) {
kDebug() << "// CHK DOC TRK:" << freetrack << ", DUR:" << m_document->renderer()->mltTrackDuration(freetrack);
if (m_document->renderer()->mltTrackDuration(freetrack) < start || m_document->renderer()->mltGetSpaceLength(pos, freetrack, false) >= clip->cropDuration().frames(m_document->fps())) {
kDebug() << "FOUND SPACE ON TRK: " << freetrack;
<Action name="clip_audio_only" />
<Action name="clip_video_only" />
<Action name="clip_audio_and_video" />
-</Menu>
+ </Menu>
<Menu name="timeline" ><text>Timeline</text>
<Menu name="keyboard_selection" ><text>Selection</text>
<Action name="get_new_titles" />
<Action name="run_wizard" />
<Menu name="themes_menu" ><text>Themes</text>
- </Menu>
+ </Menu>
</Menu>
</MenuBar>
</gui>
*
* Moves towards the end of the clip/timeline on mouse wheel down/back, the
* opposite on mouse wheel up/forward.
- * Ctrl + wheel moves by a single frame, without Ctrl it moves by a second.
- *
- * See also http://www.kdenlive.org/mantis/view.php?id=265. */
+ * Ctrl + wheel moves by a second, without Ctrl it moves by a single frame. */
virtual void wheelEvent(QWheelEvent * event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual QStringList mimeTypes() const;
/** @brief Prepares removing the selected items. */
void slotRemoveClip();
void slotAddClip(const QList <QUrl> givenList = QList <QUrl> (), const QString &groupName = QString(), const QString &groupId = QString());
+
/** @brief Adds, edits or deletes a folder item.
*
* This is triggered by AddFolderCommand and EditFolderCommand. */
void slotAddSlideshowClip();
void slotAddTitleClip();
void slotAddTitleTemplateClip();
+
/** @brief Shows the context menu after enabling and disabling actions based on the item's type.
* @param pos The position where the menu should pop up
* @param item The item for which the checks should be done */
if (service.type() != tractor_type || tractor.count() < 2) return;
Mlt::Field *field = tractor.field();
if (doit) {
- int screen = 0;
- for (int i = 1; i < tractor.count() && screen < 4; i++) {
+ for (int i = 1, screen = 0; i < tractor.count() && screen < 4; i++) {
Mlt::Producer trackProducer(tractor.track(i));
kDebug() << "// TRACK: " << i << ", HIDE: " << trackProducer.get("hide");
if (QString(trackProducer.get("hide")).toInt() != 1) {