Commit 30d4fa34 authored by Clement CHAVANCE's avatar Clement CHAVANCE

Clip added from the mainWindow are now added to the library

parent aff0ecd0
......@@ -167,6 +167,8 @@ void MainWindow::setupLibrary()
m_clipPreview->getGenericRenderer(), SLOT( mediaUnloaded( QUuid ) ) );
connect( mediaLibraryWidget, SIGNAL( importRequired() ), this, SLOT( on_actionImport_triggered() ) );
connect( m_clipPreview, SIGNAL( addClip( Clip* ) ), mediaLibraryWidget, SLOT( clipAdded( Clip* ) ) );
}
void MainWindow::on_actionSave_triggered()
......
......@@ -193,5 +193,6 @@ void PreviewWidget::createNewClipFromMarkers()
//Adding the newly created clip to the media
selectedMedia->addClip( part );
emit addClip( part );
return ;
}
......@@ -70,6 +70,9 @@ private slots:
void markerStartClicked();
void markerStopClicked();
void createNewClipFromMarkers();
signals:
void addClip( Clip* clip );
};
#endif // PREVIEWWIDGET_H
......@@ -53,6 +53,11 @@ const ViewController* MediaLibraryWidget::getCurrentViewController()
return m_nav->getCurrentViewController();
}
void MediaLibraryWidget::clipAdded( Clip* clip )
{
Library::getInstance()->addClip( clip );
}
void MediaLibraryWidget::mediaSelection( Media* media )
{
emit mediaSelected( media );
......
......@@ -42,6 +42,9 @@ public:
private:
StackViewController* m_nav;
public slots:
void clipAdded( Clip* clip );
private slots:
void mediaSelection( Media* media );
void clipSelection( Clip* clip );
......
......@@ -135,6 +135,11 @@ void Library::addMedia( Media* media )
metaDataComputed( media );
}
void Library::addClip( Clip* clip )
{
m_clips[clip->getUuid()] = clip;
}
void Library::loadMedia( const QString& path, const QUuid& uuid )
{
Media* it;
......
......@@ -55,6 +55,7 @@ public:
*/
void addMedia( Media* media );
void deleteMedia( Media* media );
void addClip( Clip* clip );
private:
Library();
......
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