Save vertical zoom in project:

http://www.kdenlive.org:80/mantis/view.php?id=380

svn path=/trunk/kdenlive/; revision=3641
parent 90ab57b2
......@@ -66,6 +66,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
// init default document properties
m_documentProperties["zoom"] = "7";
m_documentProperties["verticalzoom"] = "1";
m_documentProperties["zonein"] = "0";
m_documentProperties["zoneout"] = "100";
......@@ -387,14 +388,15 @@ void KdenliveDoc::slotAutoSave()
}
}
void KdenliveDoc::setZoom(int factor)
void KdenliveDoc::setZoom(int horizontal, int vertical)
{
m_documentProperties["zoom"] = QString::number(factor);
m_documentProperties["zoom"] = QString::number(horizontal);
m_documentProperties["verticalzoom"] = QString::number(vertical);
}
int KdenliveDoc::zoom() const
QPoint KdenliveDoc::zoom() const
{
return m_documentProperties.value("zoom").toInt();
return QPoint(m_documentProperties.value("zoom").toInt(), m_documentProperties.value("verticalzoom").toInt());
}
void KdenliveDoc::setZone(int start, int end)
......
......@@ -90,8 +90,8 @@ Q_OBJECT public:
/** Used to inform main app of the current document loading progress */
void loadingProgressed();
void syncGuides(QList <Guide *> guides);
void setZoom(int factor);
int zoom() const;
void setZoom(int horizontal, int vertical);
QPoint zoom() const;
double dar();
double projectDuration() const;
bool saveSceneList(const QString &path, const QString &scene);
......
......@@ -1610,7 +1610,6 @@ void MainWindow::slotRenderProject()
if (!m_renderWidget) {
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
m_renderWidget = new RenderWidget(projectfolder, this);
connect(m_renderWidget, SIGNAL(doRender(const QStringList&, const QStringList&)), this, SLOT(slotDoRender(const QStringList&, const QStringList&)));
connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &)));
connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
connect(m_renderWidget, SIGNAL(abortProcess(const QString &)), this, SIGNAL(abortRenderJob(const QString &)));
......@@ -1762,7 +1761,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha
connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), this, SLOT(slotActivateEffectStackView()));
connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_transitionConfig, SLOT(slotTransitionItemSelected(Transition*, int, QPoint, bool)));
connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), this, SLOT(slotActivateTransitionView(Transition *)));
m_zoomSlider->setValue(doc->zoom());
m_zoomSlider->setValue(doc->zoom().x());
connect(m_zoomSlider, SIGNAL(valueChanged(int)), trackView, SLOT(slotChangeZoom(int)));
connect(trackView->projectView(), SIGNAL(zoomIn()), this, SLOT(slotZoomIn()));
connect(trackView->projectView(), SIGNAL(zoomOut()), this, SLOT(slotZoomOut()));
......
......@@ -109,7 +109,7 @@ TrackView::TrackView(KdenliveDoc *doc, QWidget *parent) :
connect(m_trackview, SIGNAL(mousePosition(int)), this, SIGNAL(mousePosition(int)));
connect(m_trackview, SIGNAL(doTrackLock(int, bool)), this, SLOT(slotChangeTrackLock(int, bool)));
slotChangeZoom(m_doc->zoom());
slotChangeZoom(m_doc->zoom().x(), m_doc->zoom().y());
slotSetZone(m_doc->zone());
}
......@@ -400,12 +400,21 @@ void TrackView::moveCursorPos(int pos)
m_trackview->setCursorPos(pos, false);
}
void TrackView::slotChangeZoom(int factor)
void TrackView::slotChangeZoom(int horizontal, int vertical)
{
m_doc->setZoom(factor);
m_ruler->setPixelPerMark(factor);
m_scale = (double) FRAME_SIZE / m_ruler->comboScale[factor]; // m_ruler->comboScale[m_currentZoom] /
m_trackview->setScale(m_scale, m_scene->scale().y());
m_ruler->setPixelPerMark(horizontal);
m_scale = (double) FRAME_SIZE / m_ruler->comboScale[horizontal]; // m_ruler->comboScale[m_currentZoom] /
if (vertical == -1) {
// user called zoom
m_doc->setZoom(horizontal, m_verticalZoom);
m_trackview->setScale(m_scale, m_scene->scale().y());
} else {
m_verticalZoom = vertical;
if (m_verticalZoom == 0) m_trackview->setScale(m_scale, 0.5);
else m_trackview->setScale(m_scale, m_verticalZoom);
adjustTrackHeaders();
}
}
int TrackView::fitZoom() const
......@@ -774,6 +783,7 @@ void TrackView::slotVerticalZoomDown()
{
if (m_verticalZoom == 0) return;
m_verticalZoom--;
m_doc->setZoom(m_doc->zoom().x(), m_verticalZoom);
if (m_verticalZoom == 0) m_trackview->setScale(m_scene->scale().x(), 0.5);
else m_trackview->setScale(m_scene->scale().x(), 1);
adjustTrackHeaders();
......@@ -785,6 +795,7 @@ void TrackView::slotVerticalZoomUp()
{
if (m_verticalZoom == 2) return;
m_verticalZoom++;
m_doc->setZoom(m_doc->zoom().x(), m_verticalZoom);
/*KdenliveSettings::setTrackheight(KdenliveSettings::trackheight() * 2);
m_trackview->checkTrackHeight(false);*/
if (m_verticalZoom == 2) m_trackview->setScale(m_scene->scale().x(), 2);
......
......@@ -61,7 +61,7 @@ public:
public slots:
void slotDeleteClip(const QString &clipId);
void slotChangeZoom(int factor);
void slotChangeZoom(int horizontal, int vertical = -1);
void setDuration(int dur);
void slotSetZone(QPoint p);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment