svn path=/trunk/kdenlive/; revision=4474
const int value = m_view->cursorPos() * m_factor - m_offset;
int minval = (e->rect().left() + m_offset) / FRAME_SIZE - 1;
const int maxval = (e->rect().right() + m_offset) / FRAME_SIZE + 1;
const int value = m_view->cursorPos() * m_factor - m_offset;
int minval = (e->rect().left() + m_offset) / FRAME_SIZE - 1;
const int maxval = (e->rect().right() + m_offset) / FRAME_SIZE + 1;
- if (minval < 0) minval = 0;
+ if (minval < 0)
+ minval = 0;
double f, fend;
const int offsetmax = maxval * FRAME_SIZE;
double f, fend;
const int offsetmax = maxval * FRAME_SIZE;
int offsetmin = (e->rect().left() + m_offset) / m_textSpacing;
offsetmin = offsetmin * m_textSpacing;
for (f = offsetmin; f < offsetmax; f += m_textSpacing) {
int offsetmin = (e->rect().left() + m_offset) / m_textSpacing;
offsetmin = offsetmin * m_textSpacing;
for (f = offsetmin; f < offsetmax; f += m_textSpacing) {
- QString lab = m_timecode.getTimecodeFromFrames((int)(f / m_factor + 0.5));
+ QString lab;
+ if (KdenliveSettings::frametimecode())
+ lab = QString::number((int)(f / m_factor + 0.5));
+ else
+ lab = m_timecode.getTimecodeFromFrames((int)(f / m_factor + 0.5));
p.drawText(f - m_offset + 2, LABEL_SIZE, lab);
}
p.drawText(f - m_offset + 2, LABEL_SIZE, lab);
}
offsetmin = offsetmin * littleMarkDistance;
// draw the little marks
fend = m_scale * littleMarkDistance;
offsetmin = offsetmin * littleMarkDistance;
// draw the little marks
fend = m_scale * littleMarkDistance;
- if (fend > 5) for (f = offsetmin - m_offset; f < offsetmax - m_offset; f += fend)
+ if (fend > 5) {
+ for (f = offsetmin - m_offset; f < offsetmax - m_offset; f += fend)
p.drawLine((int)f, LITTLE_MARK_X1, (int)f, LITTLE_MARK_X2);
p.drawLine((int)f, LITTLE_MARK_X1, (int)f, LITTLE_MARK_X2);
offsetmin = (e->rect().left() + m_offset) / mediumMarkDistance;
offsetmin = offsetmin * mediumMarkDistance;
// draw medium marks
fend = m_scale * mediumMarkDistance;
offsetmin = (e->rect().left() + m_offset) / mediumMarkDistance;
offsetmin = offsetmin * mediumMarkDistance;
// draw medium marks
fend = m_scale * mediumMarkDistance;
- if (fend > 5) for (f = offsetmin - m_offset - fend; f < offsetmax - m_offset + fend; f += fend)
+ if (fend > 5) {
+ for (f = offsetmin - m_offset - fend; f < offsetmax - m_offset + fend; f += fend)
p.drawLine((int)f, MIDDLE_MARK_X1, (int)f, MIDDLE_MARK_X2);
p.drawLine((int)f, MIDDLE_MARK_X1, (int)f, MIDDLE_MARK_X2);
offsetmin = (e->rect().left() + m_offset) / bigMarkDistance;
offsetmin = offsetmin * bigMarkDistance;
// draw big marks
fend = m_scale * bigMarkDistance;
offsetmin = (e->rect().left() + m_offset) / bigMarkDistance;
offsetmin = offsetmin * bigMarkDistance;
// draw big marks
fend = m_scale * bigMarkDistance;
- if (fend > 5) for (f = offsetmin - m_offset; f < offsetmax - m_offset; f += fend)
+ if (fend > 5) {
+ for (f = offsetmin - m_offset; f < offsetmax - m_offset; f += fend)
p.drawLine((int)f, BIG_MARK_X1, (int)f, BIG_MARK_X2);
p.drawLine((int)f, BIG_MARK_X1, (int)f, BIG_MARK_X2);
// draw zone cursors
int off = offset();
// draw zone cursors
int off = offset();
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
+/**
+ * @class CustomRuler
+ * @author Jean-Baptiste Mardelle
+ * @brief Manages the timeline ruler.
+ */
+
#ifndef CUSTOMRULER_H
#define CUSTOMRULER_H
#ifndef CUSTOMRULER_H
#define CUSTOMRULER_H
m_clipMonitor->updateTimecodeFormat();
m_projectMonitor->updateTimecodeFormat();
m_activeTimeline->projectView()->clearSelection();
m_clipMonitor->updateTimecodeFormat();
m_projectMonitor->updateTimecodeFormat();
m_activeTimeline->projectView()->clearSelection();
+ m_activeTimeline->updateRuler();
}
void MainWindow::slotRemoveFocus()
}
void MainWindow::slotRemoveFocus()
void slotTranscodeClip();
void slotSetDocumentRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &file);
void slotPrepareRendering(bool scriptExport, bool zoneOnly, const QString &chapterFile);
void slotTranscodeClip();
void slotSetDocumentRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &file);
void slotPrepareRendering(bool scriptExport, bool zoneOnly, const QString &chapterFile);
+ /** @brief Switches between displaying frames or timecode.
+ * @param ix 0 = display timecode, 1 = display frames. */
void slotUpdateTimecodeFormat(int ix);
/** @brief Removes the focus of anything. */
void slotRemoveFocus();
void slotUpdateTimecodeFormat(int ix);
/** @brief Removes the focus of anything. */
void slotRemoveFocus();
headers_container->layout()->setContentsMargins(0, m_trackview->frameWidth(), 0, height);
}
headers_container->layout()->setContentsMargins(0, m_trackview->frameWidth(), 0, height);
}
+void TrackView::updateRuler()
+{
+ m_ruler->update();
+}
+
int outPoint() const;
int inPoint() const;
int fitZoom() const;
int outPoint() const;
int inPoint() const;
int fitZoom() const;
+ /** @brief Updates (redraws) the ruler.
+ *
+ * Used to change from displaying frames to timecode or vice versa. */
+ void updateRuler();
protected:
virtual void keyPressEvent(QKeyEvent * event);
protected:
virtual void keyPressEvent(QKeyEvent * event);