/*QPainterPath path = m_clipType == AV ? roundRectPathLower : resultClipPath;*/
QRectF mappedRect;
if (m_clipType == AV) {
- QRectF re = br;
+ QRectF re = br;
re.setTop(re.y() + re.height() / 2);
mappedRect = painter->matrix().mapRect(re);
//painter->fillRect(mappedRect, QBrush(QColor(200, 200, 200, 140)));
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;
- const int mappedEndPixel = painter->matrix().map(QPointF(endpixel + cropLeft, 0)).x() - clipStart;
- cropLeft = cropLeft * scale;
+ const int mappedStartPixel = painter->matrix().map(QPointF(startpixel + cropLeft, 0)).x() - clipStart;
+ const int mappedEndPixel = painter->matrix().map(QPointF(endpixel + cropLeft, 0)).x() - clipStart;
+ cropLeft = cropLeft * scale;
emit prepareAudioThumb(scale, mappedStartPixel, mappedEndPixel, channels);
setContentsMargins(0, 0, 0, 0);
if (projectscene) {
m_cursorLine = projectscene->addLine(0, 0, 0, m_tracksHeight);
- m_cursorLine->setFlags(QGraphicsItem::ItemIsMovable);
m_cursorLine->setZValue(1000);
}
if (m_dragItem && m_dragItem->type() == AVWIDGET) emit clipItemSelected((ClipItem*) m_dragItem);
else emit clipItemSelected(NULL);
- if (m_operationMode == NONE) QGraphicsView::mousePressEvent(event);
+ if (m_dragItem && m_operationMode == NONE) QGraphicsView::mousePressEvent(event);
if (m_selectionGroup) {
// delete selection group
}
void CustomTrackView::setDuration(int duration) {
- kDebug() << "///////////// PRO DUR: " << duration << ", SCALE. " << (m_projectDuration + 500) << ", height: " << 50 * m_scene->m_tracksList.count();
+ if (duration > sceneRect().width())
+ setSceneRect(0, 0, (duration + 100), sceneRect().height());
m_projectDuration = duration;
- setSceneRect(0, 0, (m_projectDuration + 100), sceneRect().height());
}
int CustomTrackView::duration() const {
#include "gentime.h"
-#define FRAME_SIZE 90
-#define MAXCLIPDURATION 15000
+const int FRAME_SIZE = 90;
+const int MAXCLIPDURATION = 15000;
enum OPERATIONTYPE { NONE = 0, MOVE = 1, RESIZESTART = 2, RESIZEEND = 3, FADEIN = 4, FADEOUT = 5, TRANSITIONSTART = 6, TRANSITIONEND = 7, MOVEGUIDE = 8, KEYFRAME = 9};
enum CLIPTYPE { UNKNOWN = 0, AUDIO = 1, VIDEO = 2, AV = 3, COLOR = 4, IMAGE = 5, TEXT = 6, SLIDESHOW = 7, VIRTUAL = 8, PLAYLIST = 9, FOLDER = 10};