Commit 0cdc568d authored by Jason Wood's avatar Jason Wood

monitors now display a range of zero if the project is empty.

svn path=/trunk/kdenlive/; revision=269
parent 3863135e
...@@ -34,7 +34,7 @@ KMMEditPanel::KMMEditPanel(KdenliveDoc *document, QWidget* parent, const char* n ...@@ -34,7 +34,7 @@ KMMEditPanel::KMMEditPanel(KdenliveDoc *document, QWidget* parent, const char* n
m_document = document; m_document = document;
m_ruler->setRulerModel(new KRulerTimeModel()); m_ruler->setRulerModel(new KRulerTimeModel());
m_ruler->setRange(0, 1500); m_ruler->setRange(0, 0);
m_ruler->setMargin(40); m_ruler->setMargin(40);
m_ruler->setAutoClickSlider(0); m_ruler->setAutoClickSlider(0);
...@@ -127,7 +127,7 @@ void KMMEditPanel::stop() ...@@ -127,7 +127,7 @@ void KMMEditPanel::stop()
void KMMEditPanel::seek(const GenTime &time) void KMMEditPanel::seek(const GenTime &time)
{ {
m_ruler->setSliderValue(0, (int)(floor(time.frames(m_document->framesPerSecond()) + 0.5))); m_ruler->setSliderValue(0, (int)(floor(time.frames(m_document->framesPerSecond()) + 0.5)));
} }
void KMMEditPanel::rendererConnected() void KMMEditPanel::rendererConnected()
......
...@@ -59,7 +59,7 @@ KMMMonitor::~KMMMonitor() ...@@ -59,7 +59,7 @@ KMMMonitor::~KMMMonitor()
void KMMMonitor::seek(const GenTime &time) void KMMMonitor::seek(const GenTime &time)
{ {
m_editPanel->seek(time); m_editPanel->seek(time);
} }
void KMMMonitor::screenPositionChanged(const GenTime &time) void KMMMonitor::screenPositionChanged(const GenTime &time)
...@@ -212,7 +212,8 @@ void KMMMonitor::slotSetClip(DocClipBase *clip) ...@@ -212,7 +212,8 @@ void KMMMonitor::slotSetClip(DocClipBase *clip)
if( (!m_noSeek) || if( (!m_noSeek) ||
(seekPosition() < clip->cropStartTime()) || (seekPosition() < clip->cropStartTime()) ||
(seekPosition() > clip->cropStartTime() + clip->cropDuration())) { (seekPosition() > clip->cropStartTime() + clip->cropDuration())) {
seek(GenTime(clip->cropStartTime())); seek(clip->cropStartTime());
m_screen->seek(clip->cropStartTime());
} }
} }
......
...@@ -126,9 +126,12 @@ void KMMTimeLine::insertTrack(int index, KMMTrackPanel *track) ...@@ -126,9 +126,12 @@ void KMMTimeLine::insertTrack(int index, KMMTrackPanel *track)
connect(track->docTrack(), SIGNAL(clipLayoutChanged()), this, SLOT(drawTrackViewBackBuffer())); connect(track->docTrack(), SIGNAL(clipLayoutChanged()), this, SLOT(drawTrackViewBackBuffer()));
connect(track->docTrack(), SIGNAL(clipSelectionChanged()), this, SLOT(drawTrackViewBackBuffer())); connect(track->docTrack(), SIGNAL(clipSelectionChanged()), this, SLOT(drawTrackViewBackBuffer()));
connect(track, SIGNAL(signalClipCropStartChanged(const GenTime &)), this, SIGNAL(signalClipCropStartChanged(const GenTime &))); connect(track, SIGNAL(signalClipCropStartChanged(const GenTime &)),
connect(track, SIGNAL(signalClipCropEndChanged(const GenTime &)), this, SIGNAL(signalClipCropEndChanged(const GenTime &))); this, SIGNAL(signalClipCropStartChanged(const GenTime &)));
connect(track, SIGNAL(lookingAtClip(DocClipBase *, const GenTime &)), this, SIGNAL(lookingAtClip(DocClipBase *, const GenTime &))); connect(track, SIGNAL(signalClipCropEndChanged(const GenTime &)),
this, SIGNAL(signalClipCropEndChanged(const GenTime &)));
connect(track, SIGNAL(lookingAtClip(DocClipBase *, const GenTime &)),
this, SIGNAL(lookingAtClip(DocClipBase *, const GenTime &)));
resizeTracks(); resizeTracks();
} }
...@@ -255,13 +258,21 @@ void KMMTimeLine::dragMoveEvent ( QDragMoveEvent *event ) ...@@ -255,13 +258,21 @@ void KMMTimeLine::dragMoveEvent ( QDragMoveEvent *event )
void KMMTimeLine::dragLeaveEvent ( QDragLeaveEvent *event ) void KMMTimeLine::dragLeaveEvent ( QDragLeaveEvent *event )
{ {
m_addingClips = false;
if(!m_selection.isEmpty()) { if(!m_selection.isEmpty()) {
m_selection.setAutoDelete(true); m_selection.setAutoDelete(true);
m_selection.clear(); m_selection.clear();
m_selection.setAutoDelete(false); m_selection.setAutoDelete(false);
} }
if(m_addingClips) {
m_addingClips = false;
QPtrListIterator<KMMTrackPanel> itt(m_trackList);
while(itt.current() != 0) {
itt.current()->docTrack()->deleteClips(true);
++itt;
}
}
if(m_moveClipsCommand) { if(m_moveClipsCommand) {
// In a drag Leave Event, any clips in the selection are removed from the timeline. // In a drag Leave Event, any clips in the selection are removed from the timeline.
...@@ -271,16 +282,16 @@ void KMMTimeLine::dragLeaveEvent ( QDragLeaveEvent *event ) ...@@ -271,16 +282,16 @@ void KMMTimeLine::dragLeaveEvent ( QDragLeaveEvent *event )
if(m_deleteClipsCommand) { if(m_deleteClipsCommand) {
m_app->addCommand(m_deleteClipsCommand, false); m_app->addCommand(m_deleteClipsCommand, false);
m_deleteClipsCommand = 0; m_deleteClipsCommand = 0;
QPtrListIterator<KMMTrackPanel> itt(m_trackList); QPtrListIterator<KMMTrackPanel> itt(m_trackList);
while(itt.current() != 0) { while(itt.current() != 0) {
itt.current()->docTrack()->deleteClips(true); itt.current()->docTrack()->deleteClips(true);
++itt; ++itt;
} }
} }
calculateProjectSize(); calculateProjectSize();
drawTrackViewBackBuffer(); drawTrackViewBackBuffer();
} }
......
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