...
 
Commits (106)
......@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
bin_PROGRAMS = vlmc
SUFFIXES = .ui .h .moc.cpp
SUFFIXES = .ui .h .moc.cpp .qrc .qml
vlmc_SOURCES = \
src/Commands/Commands.cpp \
......@@ -17,7 +17,7 @@ vlmc_SOURCES = \
src/Backend/MLT/MLTMultiTrack.cpp \
src/EffectsEngine/EffectHelper.cpp \
src/Library/Library.cpp \
src/Library/MediaContainer.cpp \
src/Library/MediaLibraryModel.cpp \
src/Main/Core.cpp \
src/Main/main.cpp \
src/Media/Clip.cpp \
......@@ -67,7 +67,6 @@ vlmc_SOURCES += \
src/Services/YouTube/YouTubeService.h \
src/Services/YouTube/YouTubeFeedParser.h \
src/EffectsEngine/EffectHelper.h \
src/Media/Transcoder.h \
src/Media/Media.h \
src/Media/Clip.h \
src/Settings/Settings.h \
......@@ -92,7 +91,7 @@ vlmc_SOURCES += \
src/Backend/IMultiTrack.h \
src/Main/Core.h \
src/Library/Library.h \
src/Library/MediaContainer.h \
src/Library/MediaLibraryModel.h \
src/Workflow/Helper.h \
src/Workflow/Types.h \
src/Workflow/MainWorkflow.h \
......@@ -117,7 +116,6 @@ nodist_vlmc_SOURCES = \
src/Services/AbstractSharingService.moc.cpp \
src/Workflow/MainWorkflow.moc.cpp \
src/Project/RecentProjects.moc.cpp \
src/Library/MediaContainer.moc.cpp \
src/Commands/Commands.moc.cpp \
src/Renderer/ClipRenderer.moc.cpp \
src/Project/Project.moc.cpp \
......@@ -126,11 +124,12 @@ nodist_vlmc_SOURCES = \
src/Tools/OutputEventWatcher.moc.cpp \
src/Services/UploaderIODevice.moc.cpp \
src/Library/Library.moc.cpp \
src/Library/MediaLibraryModel.moc.cpp \
src/Gui/library/MediaLibraryView.moc.cpp \
$(NULL)
vlmc_RC = \
$(top_srcdir)/resources.qrc \
$(top_srcdir)/src/Gui/timeline/resources-timeline.qrc \
$(NULL)
EXTRA_DIST = $(vlmc_RC)
......@@ -147,6 +146,7 @@ vlmc_CPPFLAGS = \
$(QT_CFLAGS) \
$(MLT_CFLAGS) \
$(LIBVLCPP_CFLAGS) \
$(MEDIALIBRARY_CFLAGS) \
-I$(top_srcdir)/src \
$(NULL)
......@@ -158,6 +158,7 @@ vlmc_LDADD = \
$(QT_LIBS) \
$(MLT_LIBS) \
$(MLTPP_LIBS) \
$(MEDIALIBRARY_LIBS) \
$(NULL)
vlmc_LDFLAGS=
......@@ -183,14 +184,8 @@ vlmc_SOURCES += \
src/Gui/effectsengine/EffectWidget.cpp \
src/Gui/export/RendererSettings.cpp \
src/Gui/export/ShareOnInternet.cpp \
src/Gui/import/ImportController.cpp \
src/Gui/import/TagWidget.cpp \
src/Gui/library/ListViewController.cpp \
src/Gui/library/MediaCellView.cpp \
src/Gui/library/MediaLibrary.cpp \
src/Gui/library/MediaListView.cpp \
src/Gui/library/StackViewController.cpp \
src/Gui/library/StackViewNavController.cpp \
src/Gui/library/MediaLibraryView.cpp \
src/Gui/media/ClipMetadataDisplayer.cpp \
src/Gui/preview/LCDTimecode.cpp \
src/Gui/preview/PreviewRuler.cpp \
......@@ -208,11 +203,11 @@ vlmc_SOURCES += \
src/Gui/settings/PreferenceWidget.cpp \
src/Gui/settings/SettingsDialog.cpp \
src/Gui/settings/StringWidget.cpp \
src/Gui/settings/FolderListWidget.cpp \
src/Gui/timeline/Timeline.cpp \
src/Gui/timeline/ThumbnailImageProvider.cpp \
src/Gui/widgets/ExtendedLabel.cpp \
src/Gui/widgets/FramelessButton.cpp \
src/Gui/widgets/NotificationZone.cpp \
src/Gui/widgets/SearchLineEdit.cpp \
src/Gui/wizard/GeneralPage.cpp \
src/Gui/wizard/OpenPage.cpp \
......@@ -223,6 +218,7 @@ vlmc_SOURCES += \
src/Gui/wizard/firstlaunch/FirstLaunchPage.cpp \
src/Gui/wizard/firstlaunch/WorkspaceLocation.cpp \
src/Gui/wizard/firstlaunch/Done.cpp \
src/Gui/wizard/firstlaunch/MediaLibraryDirs.cpp \
$(NULL)
if HAVE_DARWIN
......@@ -237,7 +233,6 @@ vlmc_SOURCES += \
src/Gui/widgets/ExtendedLabel.h \
src/Gui/widgets/SearchLineEdit.h \
src/Gui/widgets/CrashHandler.h \
src/Gui/widgets/NotificationZone.h \
src/Gui/MainWindow.h \
src/Gui/wizard/ProjectWizard.h \
src/Gui/wizard/GeneralPage.h \
......@@ -249,16 +244,12 @@ vlmc_SOURCES += \
src/Gui/wizard/firstlaunch/WorkspaceLocation.h \
src/Gui/wizard/firstlaunch/Done.h \
src/Gui/wizard/OpenPage.h \
src/Gui/wizard/firstlaunch/MediaLibraryDirs.h \
src/Gui/timeline/Timeline.h \
src/Gui/timeline/ThumbnailImageProvider.h \
src/Gui/About.h \
src/Gui/LanguageHelper.h \
src/Gui/library/ListViewController.h \
src/Gui/library/StackViewController.h \
src/Gui/library/MediaListView.h \
src/Gui/library/MediaLibrary.h \
src/Gui/library/MediaCellView.h \
src/Gui/library/StackViewNavController.h \
src/Gui/library/MediaLibraryView.h \
src/Gui/library/ViewController.h \
src/Gui/media/ClipMetadataDisplayer.h \
src/Gui/preview/RenderWidget.h \
......@@ -279,7 +270,7 @@ vlmc_SOURCES += \
src/Gui/settings/LanguageWidget.h \
src/Gui/settings/Panel.h \
src/Gui/settings/PreferenceWidget.h \
src/Gui/import/ImportController.h \
src/Gui/settings/FolderListWidget.h \
src/Gui/import/TagWidget.h \
src/Gui/effectsengine/EffectStack.h \
src/Gui/effectsengine/EffectWidget.h \
......@@ -293,26 +284,20 @@ vlmc_SOURCES += \
nodist_vlmc_SOURCES += \
src/Gui/wizard/WelcomePage.moc.cpp \
src/Gui/library/ListViewController.moc.cpp \
src/Gui/settings/SettingsDialog.moc.cpp \
src/Gui/export/ShareOnInternet.moc.cpp \
src/Gui/widgets/FramelessButton.moc.cpp \
src/Gui/wizard/OpenPage.moc.cpp \
src/Gui/settings/ColorWidget.moc.cpp \
src/Gui/import/ImportController.moc.cpp \
src/Gui/library/StackViewController.moc.cpp \
src/Gui/library/MediaLibrary.moc.cpp \
src/Gui/wizard/firstlaunch/FirstLaunchPage.moc.cpp \
src/Gui/settings/Panel.moc.cpp \
src/Gui/preview/RenderWidget.moc.cpp \
src/Gui/settings/BoolWidget.moc.cpp \
src/Gui/WorkflowFileRendererDialog.moc.cpp \
src/Gui/library/MediaListView.moc.cpp \
src/Gui/wizard/firstlaunch/Done.moc.cpp \
src/Gui/wizard/VideoPage.moc.cpp \
src/Gui/settings/ISettingsCategoryWidget.moc.cpp \
src/Gui/wizard/GeneralPage.moc.cpp \
src/Gui/library/MediaCellView.moc.cpp \
src/Gui/MainWindow.moc.cpp \
src/Gui/settings/KeyboardShortcut.moc.cpp \
src/Gui/preview/PreviewWidget.moc.cpp \
......@@ -322,7 +307,6 @@ nodist_vlmc_SOURCES += \
src/Gui/timeline/ThumbnailImageProvider.moc.cpp \
src/Gui/settings/LanguageWidget.moc.cpp \
src/Gui/import/TagWidget.moc.cpp \
src/Gui/widgets/NotificationZone.moc.cpp \
src/Gui/settings/DoubleSliderWidget.moc.cpp \
src/Gui/widgets/ExtendedLabel.moc.cpp \
src/Gui/About.moc.cpp \
......@@ -341,10 +325,10 @@ nodist_vlmc_SOURCES += \
src/Gui/IntroDialog.moc.cpp \
src/Gui/settings/KeyboardShortcutInput.moc.cpp \
src/Gui/widgets/SearchLineEdit.moc.cpp \
src/Gui/library/StackViewNavController.moc.cpp \
src/Gui/settings/PathWidget.moc.cpp \
src/Gui/settings/IntWidget.moc.cpp \
src/Gui/settings/StringWidget.moc.cpp \
src/Gui/settings/FolderListWidget.moc.cpp \
src/Gui/effectsengine/EffectsListView.moc.cpp \
$(NULL)
......@@ -354,11 +338,8 @@ vlmc_UI = \
src/Gui/ui/EffectWidget.ui \
src/Gui/ui/RendererSettings.ui \
src/Gui/ui/ShareOnInternet.ui \
src/Gui/ui/ImportController.ui \
src/Gui/ui/TagWidget.ui \
src/Gui/ui/MediaCellView.ui \
src/Gui/ui/MediaLibrary.ui \
src/Gui/ui/StackViewNavController.ui \
src/Gui/ui/FolderListWidget.ui \
src/Gui/ui/ClipMetadataDisplayer.ui \
src/Gui/ui/PreviewWidget.ui \
src/Gui/ui/About.ui \
......@@ -367,12 +348,12 @@ vlmc_UI = \
src/Gui/ui/MainWindow.ui \
src/Gui/ui/Timeline.ui \
src/Gui/ui/WorkflowFileRendererDialog.ui \
src/Gui/ui/NotificationZone.ui \
src/Gui/ui/GeneralPage.ui \
src/Gui/ui/OpenPage.ui \
src/Gui/ui/VideoPage.ui \
src/Gui/ui/WelcomePage.ui \
src/Gui/ui/FirstLaunchPage.ui \
src/Gui/ui/MediaLibraryDirs.ui \
src/Gui/ui/WorkspaceLocation.ui \
src/Gui/ui/Done.ui \
$(NULL)
......@@ -392,9 +373,31 @@ vlmc_CPPFLAGS += -Isrc/Gui/ -I$(top_srcdir)/src/Gui
nodist_vlmc_SOURCES += $(vlmc_UI:.ui=.h)
vlmc_QML = \
src/Gui/timeline/PropertyButton.qml \
src/Gui/timeline/MarkerContextMenu.qml \
src/Gui/timeline/Ruler.qml \
src/Gui/timeline/Track.qml \
src/Gui/timeline/Clip.qml \
src/Gui/timeline/TrackContainer.qml \
src/Gui/timeline/Marker.qml \
src/Gui/timeline/main.qml \
src/Gui/timeline/ClipContextMenu.qml \
src/Gui/timeline/Cursor.qml \
src/Gui/library/ui/MediaLibraryView.qml \
src/Gui/library/ui/MediaItem.qml \
src/Gui/effectsengine/Effect.qml \
src/Gui/effectsengine/EffectsListView.qml \
$(NULL)
EXTRA_DIST += $(vlmc_QML)
vlmc_RC += $(vlmc_QML:.qml=.qrc)
nodist_vlmc_SOURCES += $(vlmc_QML:.qml=.qrc)
endif
resources.cpp:
resources.cpp: $(vlmc_QML)
$(RCC) -o $@ $(vlmc_RC)
nodist_vlmc_SOURCES += resources.cpp
......@@ -416,6 +419,17 @@ uic_verbose__0 = $(uic_verbose_0)
$(AM_V_at)mkdir -p $(@D)
$(uic_verbose)$(UIC) -p $< -o $@
qmlrc_verbose = $(qmlrc_verbose_$(V))
qmlrc_verbose_ = $(qmlrc_verbose__$(AM_DEFAULT_VERBOSITY))
qmlrc_verbose_0 = @echo " QML->QRC " $@;
qmlrc_verbose__0 = $(qmlrc_verbose_0)
.qml.qrc:
$(AM_V_at)mkdir -p $(@D)
$(qmlrc_verbose)echo "<RCC><qresource prefix=\"/QML\">\
<file alias=\"$(<F)\">$(abs_top_builddir)/$<</file>\
</qresource></RCC>" > $@
BUILT_SOURCES = $(nodist_vlmc_SOURCES)
CLEANFILES = $(BUILT_SOURCES)
......@@ -259,6 +259,7 @@ PKG_CHECK_MODULES(QT, [Qt5Core Qt5Widgets Qt5Gui Qt5Network Qt5Quick], [
])
PKG_CHECK_MODULES(VLC, libvlc >= 3.0)
PKG_CHECK_MODULES(VLCPP, libvlcpp)
PKG_CHECK_MODULES(MEDIALIBRARY, medialibrary)
PKG_CHECK_MODULES(MLT, mlt-framework >= 6.3)
PKG_CHECK_MODULES(MLTPP, mlt++ >= 6.3.0)
......
......@@ -29,6 +29,7 @@
#include "Project/Project.h"
#include "Main/Core.h"
#include "Media/Clip.h"
#include "Media/Media.h"
#include "EffectsEngine/EffectHelper.h"
#include "Workflow/SequenceWorkflow.h"
#include "Workflow/MainWorkflow.h"
......@@ -117,7 +118,7 @@ Commands::Clip::Add::internalRedo()
if ( QUuid( ret ).isNull() == false )
{
m_clip = m_workflow->clip( ret );
connect( m_clip.get(), &::Clip::destroyed, this, &Add::invalidate );
connect( m_clip.data(), &::Clip::destroyed, this, &Add::invalidate );
emit Core::instance()->workflow()->clipAdded( ret );
}
else
......@@ -141,7 +142,7 @@ Commands::Clip::Add::retranslate()
setText( tr( "Adding clip to track %1" ).arg( m_trackId ) );
}
std::shared_ptr<Clip>
QSharedPointer<::Clip>
Commands::Clip::Add::newClip()
{
return m_clip;
......@@ -157,7 +158,7 @@ Commands::Clip::Move::Move( std::shared_ptr<SequenceWorkflow> const& workflow,
m_newPos( pos ),
m_oldPos( workflow->position( uuid ) )
{
connect( m_clip.get(), SIGNAL( destroyed() ), this, SLOT( invalidate() ) );
connect( m_clip.data(), SIGNAL( destroyed() ), this, SLOT( invalidate() ) );
retranslate();
}
......@@ -208,7 +209,7 @@ Commands::Clip::Remove::Remove( std::shared_ptr<SequenceWorkflow> const& workflo
m_trackId( workflow->trackId( uuid ) ),
m_pos( workflow->position( uuid ) )
{
connect( m_clip.get(), &::Clip::destroyed, this, &Remove::invalidate );
connect( m_clip.data(), &::Clip::destroyed, this, &Remove::invalidate );
retranslate();
}
......@@ -256,7 +257,7 @@ Commands::Clip::Resize::Resize( std::shared_ptr<SequenceWorkflow> const& workflo
m_newEnd( newEnd ),
m_newPos( newPos )
{
connect( m_clip.get(), &::Clip::destroyed, this, &Resize::invalidate );
connect( m_clip.data(), &::Clip::destroyed, this, &Resize::invalidate );
if ( !m_clip )
{
invalidate();
......@@ -304,14 +305,16 @@ Commands::Clip::Split::Split( std::shared_ptr<SequenceWorkflow> const& workflow,
m_newClipPos( newClipPos ),
m_newClipBegin( newClipBegin )
{
connect( m_toSplit.get(), &::Clip::destroyed, this, &Split::invalidate );
connect( m_toSplit.data(), &::Clip::destroyed, this, &Split::invalidate );
if ( !m_toSplit )
{
invalidate();
retranslate();
return;
}
m_newClip = std::make_shared<::Clip>( m_toSplit.get(), newClipBegin - m_toSplit->begin(), m_toSplit->end() - m_toSplit->begin() );
m_newClip = m_toSplit->media()->cut( newClipBegin - m_toSplit->begin(),
m_toSplit->end() - m_toSplit->begin() );
m_newClip->setFormats( m_toSplit->formats() );
m_oldEnd = m_toSplit->end();
retranslate();
}
......
......@@ -31,6 +31,8 @@
#endif
#include <QObject>
#include <QUuid>
#include <QSharedPointer>
#include <memory>
class Clip;
......@@ -83,12 +85,12 @@ namespace Commands
virtual void internalUndo();
virtual void retranslate();
std::shared_ptr<::Clip> newClip();
QSharedPointer<::Clip> newClip();
private:
std::shared_ptr<SequenceWorkflow> m_workflow;
QUuid m_uuid;
std::shared_ptr<::Clip> m_clip;
QSharedPointer<::Clip> m_clip;
quint32 m_trackId;
qint64 m_pos;
bool m_isAudioClip;
......@@ -104,7 +106,7 @@ namespace Commands
private:
std::shared_ptr<SequenceWorkflow> m_workflow;
std::shared_ptr<::Clip> m_clip;
QSharedPointer<::Clip> m_clip;
quint32 m_newTrackId;
quint32 m_oldTrackId;
qint64 m_newPos;
......@@ -121,7 +123,7 @@ namespace Commands
private:
std::shared_ptr<SequenceWorkflow> m_workflow;
std::shared_ptr<::Clip> m_clip;
QSharedPointer<::Clip> m_clip;
quint32 m_trackId;
qint64 m_pos;
};
......@@ -144,7 +146,7 @@ namespace Commands
private:
std::shared_ptr<SequenceWorkflow> m_workflow;
std::shared_ptr<::Clip> m_clip;
QSharedPointer<::Clip> m_clip;
qint64 m_newBegin;
qint64 m_oldBegin;
qint64 m_newEnd;
......@@ -163,9 +165,9 @@ namespace Commands
virtual void retranslate();
private:
std::shared_ptr<SequenceWorkflow> m_workflow;
std::shared_ptr<::Clip> m_toSplit;
QSharedPointer<::Clip> m_toSplit;
quint32 m_trackId;
std::shared_ptr<::Clip> m_newClip;
QSharedPointer<::Clip> m_newClip;
qint64 m_newClipPos;
qint64 m_newClipBegin;
qint64 m_oldEnd;
......
......@@ -45,9 +45,10 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) );
connect( this, SIGNAL( rejected() ), this, SLOT( deleteLater() ) );
setWindowTitle( m_clip->media()->fileInfo()->fileName() + " " + tr( "properties" ) );
setWindowTitle( m_clip->media()->title() + " " + tr( "properties" ) );
//Snapshot
ui->snapshotLabel->setPixmap( m_clip->media()->snapshot().scaled( 128, 128, Qt::KeepAspectRatio ) );
QPixmap snapshot( m_clip->media()->snapshot() );
ui->snapshotLabel->setPixmap( snapshot.scaled( 128, 128, Qt::KeepAspectRatio ) );
//Metatags
const QPushButton* button = ui->buttonBox->button( QDialogButtonBox::Apply );
Q_ASSERT( button != nullptr);
......
......@@ -36,6 +36,7 @@
#include <QNetworkProxy>
#include <QSysInfo>
#include <QScrollArea>
#include <QProgressBar>
#include "Main/Core.h"
#include "Project/Project.h"
#include "Library/Library.h"
......@@ -55,9 +56,7 @@
/* Widgets */
#include "effectsengine/EffectsListView.h"
#include "import/ImportController.h"
#include "library/MediaLibrary.h"
#include "widgets/NotificationZone.h"
#include "library/MediaLibraryView.h"
#include "preview/PreviewWidget.h"
#include "timeline/Timeline.h"
......@@ -79,8 +78,6 @@ MainWindow::MainWindow( Backend::IBackend* backend, QWidget *parent )
Core::instance()->logger()->setup();
//Preferences
initVlmcPreferences();
//All preferences have been created: restore them:
Core::instance()->settings()->load();
// GUI
createGlobalPreferences();
......@@ -95,29 +92,52 @@ MainWindow::MainWindow( Backend::IBackend* backend, QWidget *parent )
setupCrashTester();
#endif
connect( Core::instance()->project(), SIGNAL( projectNameChanged(QString) ),
this, SLOT( projectNameChanged( QString ) ) );
connect( Core::instance()->project(), SIGNAL( outdatedBackupFileFound() ),
this, SLOT( onOudatedBackupFile() ) );
connect( Core::instance()->project(), SIGNAL( backupProjectLoaded() ),
this, SLOT( onBackupFileLoaded() ) );
connect( Core::instance()->project(), SIGNAL( projectSaved() ),
this, SLOT( onProjectSaved() ) );
connect( Core::instance()->project(), &Project::projectNameChanged,
this, &MainWindow::projectNameChanged );
connect( Core::instance()->project(), &Project::outdatedBackupFileFound,
this, &MainWindow::onOudatedBackupFile );
connect( Core::instance()->project(), &Project::backupProjectLoaded,
this, &MainWindow::onBackupFileLoaded );
connect( Core::instance()->project(), &Project::projectSaved,
this, &MainWindow::onProjectSaved );
connect( Core::instance()->project(), &Project::cleanStateChanged,
this, &MainWindow::cleanStateChanged );
// Connect the medialibrary before it starts discovering/reloading
connect( Core::instance()->library(), &Library::progressUpdated, this,
[this]( int percent ) {
if ( percent < 100 )
m_progressBar->setValue( percent );
else
{
m_progressBar->hide();
m_ui.statusbar->clearMessage();
}
});
connect( Core::instance()->library(), &Library::discoveryProgress, this,
[this](const QString& folder) {
m_ui.statusbar->showMessage( "Discovering " + folder + "...", 2500 );
}, Qt::QueuedConnection );
connect( Core::instance()->library(), &Library::discoveryCompleted, this,
[this]( const QString& ) {
m_ui.statusbar->showMessage( "Analyzing media" );
}, Qt::QueuedConnection );
//Connecting Library stuff:
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getAbstractRenderer() );
Q_ASSERT( clipRenderer != nullptr );
connect( m_mediaLibrary, SIGNAL( clipSelected( Clip* ) ),
clipRenderer, SLOT( setClip( Clip* ) ) );
connect( m_mediaLibrary, SIGNAL( importRequired() ),
this, SLOT( on_actionImport_triggered() ) );
#ifdef WITH_CRASHHANDLER
if ( restoreSession() == true )
return ;
#endif
//All preferences have been created: restore them:
Core::instance()->settings()->load();
// Restore the geometry
restoreGeometry( VLMC_GET_BYTEARRAY( "private/MainWindowGeometry" ) );
// Restore the layout
......@@ -129,7 +149,6 @@ MainWindow::~MainWindow()
{
m_projectPreview->stop();
m_clipPreview->stop();
delete m_importController;
delete m_timeline;
}
......@@ -382,7 +401,7 @@ MainWindow::on_actionSave_As_triggered()
path, QObject::tr( "VLMC project file(*.vlmc)" ) );
if ( dest.isEmpty() == true )
return;
if ( !dest.endsWith( ".vlmc" ) )
if ( !dest.endsWith( ".vlmc" ) )
dest += ".vlmc";
Core::instance()->project()->saveAs( dest );
}
......@@ -398,21 +417,12 @@ MainWindow::on_actionLoad_Project_triggered()
Core::instance()->loadProject( fileName );
}
void
MainWindow::createNotificationZone()
{
QWidget *notifSpacer = new QWidget( this );
notifSpacer->setFixedWidth( 75 );
m_ui.statusbar->addPermanentWidget( notifSpacer );
m_ui.statusbar->addPermanentWidget( NotificationZone::instance() );
}
void
MainWindow::createStatusBar()
{
//Notifications:
createNotificationZone();
m_progressBar = new QProgressBar( this );
m_ui.statusbar->addPermanentWidget( m_progressBar );
m_progressBar->show();
// Spacer
QWidget* spacer = new QWidget( this );
......@@ -459,8 +469,6 @@ MainWindow::initializeDockWidgets()
m_timeline = new Timeline( this );
setCentralWidget( m_timeline->container() );
m_importController = new ImportController();
setupLibrary();
setupEffectsList();
setupClipPreview();
......@@ -486,14 +494,14 @@ void
MainWindow::setupEffectsList()
{
m_effectsList = new EffectsListView;
m_dockedEffectsList = dockWidget( m_effectsList, Qt::TopDockWidgetArea );
m_dockedEffectsList = dockWidget( m_effectsList->container(), Qt::TopDockWidgetArea );
}
void
MainWindow::setupLibrary()
{
m_mediaLibrary = new MediaLibrary;
m_dockedLibrary = dockWidget( m_mediaLibrary, Qt::TopDockWidgetArea );
m_mediaLibrary = new MediaLibraryView( this );
m_dockedLibrary = dockWidget( m_mediaLibrary->container(), Qt::TopDockWidgetArea );
}
void
......@@ -890,12 +898,6 @@ MainWindow::restoreSession()
return ret;
}
void
MainWindow::on_actionImport_triggered()
{
m_importController->exec();
}
void
MainWindow::canUndoChanged( bool canUndo )
{
......
......@@ -24,6 +24,7 @@
#define MAINWINDOW_H
class QUndoView;
class QProgressBar;
#include <QApplication>
#include <QSlider>
......@@ -36,8 +37,7 @@ class QUndoView;
#include "ui/MainWindow.h"
class EffectsListView;
class ImportController;
class MediaLibrary;
class MediaLibraryView;
class PreviewWidget;
class Project;
class ProjectWizard;
......@@ -76,7 +76,6 @@ private:
void initializeDockWidgets();
void checkFolders();
void createStatusBar();
void createNotificationZone();
void createGlobalPreferences();
void createProjectPreferences();
void clearTemporaryFiles();
......@@ -129,8 +128,7 @@ private:
SettingsDialog* m_DefaultProjectPreferences;
SettingsDialog* m_projectPreferences;
ProjectWizard* m_wizard;
ImportController* m_importController;
MediaLibrary *m_mediaLibrary;
MediaLibraryView *m_mediaLibrary;
EffectsListView* m_effectsList;
QUndoView* m_undoView;
QDockWidget* m_dockedUndoView;
......@@ -138,6 +136,7 @@ private:
QDockWidget* m_dockedLibrary;
QDockWidget* m_dockedClipPreview;
QDockWidget* m_dockedProjectPreview;
QProgressBar* m_progressBar;
private slots:
void on_actionFullscreen_triggered( bool checked );
......@@ -155,7 +154,6 @@ private slots:
void on_actionUndo_triggered();
void on_actionRedo_triggered();
void on_actionCrash_triggered();
void on_actionImport_triggered();
void toolButtonClicked( QAction *action );
void projectNameChanged(const QString& projectName);
void cleanStateChanged( bool isClean );
......
import QtQuick 2.0
import QtQuick.Controls 1.4
Rectangle {
id: effect
color: "#444444"
width: parent.width
height: 100
border.color: "#222222"
border.width: 1
property string identifier
property string name
property string description
property string author
Column {
width: sView.viewport.width
Text {
text: name
font.pointSize: 20
color: "#EEEEEE"
elide: Text.ElideRight
width: parent.width
}
Text {
text: identifier
color: "#EEEEEE"
elide: Text.ElideRight
width: parent.width
}
Text {
text: description
color: "#EEEEEE"
elide: Text.ElideRight
width: parent.width
}
Text {
text: author
color: "#EEEEEE"
elide: Text.ElideRight
width: parent.width
}
}
MouseArea {
anchors.fill: parent
onPressed: {
view.startDrag( identifier );
}
}
}
......@@ -30,67 +30,57 @@
#include "EffectsListView.h"
#include "EffectWidget.h"
#include <QApplication>
#include <QDialog>
#include <QMouseEvent>
#include <QStandardItem>
#include <QVBoxLayout>
#include <QJsonObject>
#include <QQmlContext>
#include <QQuickView>
#include <QMimeData>
#include <QDrag>
EffectsListView::EffectsListView( QWidget *parent ) :
QListView(parent)
EffectsListView::EffectsListView( QWidget* parent ) :
QObject(parent)
{
m_model = new QStandardItemModel( this );
setModel( m_model );
connect( this, SIGNAL( activated( QModelIndex ) ),
this, SLOT( effectActivated( QModelIndex ) ) );
setEditTriggers( QAbstractItemView::NoEditTriggers );
setObjectName( QStringLiteral( "Effects List" ) );
for ( auto filter : Backend::instance()->availableFilters() )
m_model->appendRow( new QStandardItem( QString::fromStdString( filter.second->identifier() ) ) );
setObjectName( QStringLiteral( "EffectsListView" ) );
auto view = new QQuickView;
m_container = QWidget::createWindowContainer( view, parent );
m_container->setMinimumSize( 100, 1 );
m_container->setObjectName( objectName() );
view->rootContext()->setContextProperty( QStringLiteral( "view" ), this );
view->setSource( QUrl( QStringLiteral( "qrc:/QML/EffectsListView.qml" ) ) );
view->setResizeMode( QQuickView::SizeRootObjectToView );
}
void
EffectsListView::mousePressEvent( QMouseEvent *event )
QWidget*
EffectsListView::container()
{
QListView::mousePressEvent( event );
return m_container;
}
if ( ( event->buttons() | Qt::LeftButton ) == Qt::LeftButton )
m_dragStartPos = event->pos();
QJsonArray
EffectsListView::effects()
{
QJsonArray array;
for ( auto p : Backend::instance()->availableFilters() )
{
auto info = p.second;
QJsonObject jInfo;
jInfo[QStringLiteral( "identifier" )] = QString::fromStdString( info->identifier() );
jInfo[QStringLiteral( "name" )] = QString::fromStdString( info->name() );
jInfo[QStringLiteral( "description" )] = QString::fromStdString( info->description() );
jInfo[QStringLiteral( "author" )] = QString::fromStdString( info->author() );
array.append( jInfo );
}
return array;
}
void
EffectsListView::mouseMoveEvent( QMouseEvent *event )
EffectsListView::startDrag( const QString& effectId )
{
if ( ( event->buttons() | Qt::LeftButton ) != Qt::LeftButton )
return;
QDrag* drag = new QDrag( this );
QMimeData* mimeData = new QMimeData;
if ( ( event->pos() - m_dragStartPos ).manhattanLength()
< QApplication::startDragDistance() )
return;
mimeData->setData( QStringLiteral( "vlmc/effect_name" ), effectId.toUtf8() );
QMimeData* mimeData = new QMimeData;
mimeData->setData( "vlmc/effect_name", m_model->data( currentIndex() ).toByteArray() );
QDrag* drag = new QDrag( this );
drag->setMimeData( mimeData );
drag->exec( Qt::CopyAction | Qt::MoveAction, Qt::CopyAction );
}
void
EffectsListView::effectActivated( const QModelIndex &index ) const
{
if ( index.isValid() == false )
return ;
auto filterInfo = Backend::instance()->filterInfo( m_model->data( index, Qt::DisplayRole ).toString().toStdString() );
drag->exec();
QDialog *dialog = new QDialog();
QVBoxLayout *layout = new QVBoxLayout( dialog );
EffectWidget *wid = new EffectWidget( dialog );
layout->addWidget( wid );
wid->setFilterInfo( filterInfo );
dialog->setWindowTitle( tr( "%1 informations" ).arg( QString::fromStdString( filterInfo->name() ) ) );
dialog->exec();
delete dialog;
}
......@@ -23,28 +23,27 @@
#ifndef EFFECTLISTVIEW_H
#define EFFECTLISTVIEW_H
#include <QObject>
#include <QJsonArray>
#include <QListView>
class QWidget;
class QStandardItemModel;
class EffectsListView : public QListView
class EffectsListView : public QObject
{
Q_OBJECT
public:
explicit EffectsListView(QWidget *parent = 0);
explicit EffectsListView( QWidget* parent = 0 );
QWidget* container();
protected:
void mousePressEvent( QMouseEvent *event );
void mouseMoveEvent( QMouseEvent *event );
Q_INVOKABLE
QJsonArray effects();
private:
QStandardItemModel *m_model;
QPoint m_dragStartPos;
public slots:
void startDrag( const QString& effectId );
private slots:
void effectActivated( const QModelIndex& index ) const;
private:
QWidget* m_container;
};
#endif // EFFECTLISTVIEW_H
import QtQuick 2.0
import QtQuick.Controls 1.4
Rectangle {
anchors.fill: parent
color: "#999999"
ListModel {
id: effects
}
Component.onCompleted: {
var effectsInfo = view.effects();
for ( var i = 0; i < effectsInfo.length; ++i ) {
effects.append( effectsInfo[i] );
}
}
ScrollView {
id: sView
height: parent.height
width: parent.width
ListView {
width: sView.viewport.width
model: effects
delegate: Effect {
identifier: model.identifier
name: model.name
description: model.description
author: model.author
}
}
}
}
/*****************************************************************************
* ImportController.cpp
*****************************************************************************
* Copyright (C) 2008-2016 VideoLAN
*
* Authors: Geoffroy Lacarriere <geoffroylaca@gmail.com>
* Thomas Boquet <thomas.boquet@gmail.com>
* Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "ImportController.h"
#include "ui/ImportController.h"
#include "Main/Core.h"
#include "Project/Project.h"
#include "Media/Clip.h"
#include "Renderer/ClipRenderer.h"
#include "Backend/IInput.h"
#include "Library/Library.h"
#include "Media/Media.h"
#include "Settings/Settings.h"
#include "TagWidget.h"
#include "Media/Transcoder.h"
#include "Tools/VlmcDebug.h"
#include "media/ClipMetadataDisplayer.h"
#include "library/MediaCellView.h"
#include "library/MediaListView.h"
#include "preview/PreviewWidget.h"
#include <QFileSystemModel>
#include <QHeaderView>
#include <QMessageBox>
#include <QPalette>
#include <QTime>
#include <QTimer>
ImportController::ImportController(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::ImportController),
m_nbMediaToLoad( 0 ),
m_nbMediaLoaded( 0 )
{
m_ui->setupUi(this);
//The renderer will be deleted by the PreviewWidget
m_clipRenderer = new ClipRenderer;
m_ui->previewContainer->setRenderer( m_clipRenderer );
m_stackNav = new StackViewController( m_ui->stackViewContainer );
m_temporaryMedias = new MediaContainer;
m_mediaListView = new MediaListView( m_stackNav );
m_mediaListView->setMediaContainer( m_temporaryMedias );
// m_tag = new TagWidget( m_ui->tagContainer, 6 );
m_filesModel = new QFileSystemModel( this );
m_stackNav->pushViewController( m_mediaListView );
m_nameFilters << Media::AudioExtensions.split(' ', QString::SkipEmptyParts)
<< Media::VideoExtensions.split(' ', QString::SkipEmptyParts)
<< Media::ImageExtensions.split(' ', QString::SkipEmptyParts);
m_filesModel->setFilter( QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot );
m_filesModel->setNameFilters( m_nameFilters );
m_filesModel->setRootPath( "/" );
m_filesModel->setNameFilterDisables( false );
restoreCurrentPath();
m_filesModel->sort( 0 );
m_ui->treeView->setModel( m_filesModel );
m_ui->treeView->setHeaderHidden( true );
m_ui->treeView->setCurrentIndex( m_filesModel->index( m_currentlyWatchedDir ) );
m_ui->treeView->setExpanded( m_ui->treeView->currentIndex() , true );
m_ui->treeView->header()->setStretchLastSection( false );
m_ui->treeView->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
m_ui->treeView->setColumnHidden( 1, true );
m_ui->treeView->setColumnHidden( 2, true );
m_ui->treeView->setColumnHidden( 3, true );
m_ui->forwardButton->setEnabled( true );
m_ui->progressBar->setHidden( true );
m_ui->errorLabelImg->hide();
m_ui->errorLabel->hide();
connect( m_ui->treeView, SIGNAL( clicked( QModelIndex ) ),
this, SLOT( treeViewClicked( QModelIndex ) ) );
connect( m_ui->treeView, SIGNAL( doubleClicked( QModelIndex ) ),
this, SLOT( treeViewDoubleClicked( QModelIndex ) ) );
connect( m_ui->forwardButton, SIGNAL( clicked() ),
this, SLOT( forwardButtonClicked() ) );
connect( this, SIGNAL( clipSelected( Clip* ) ),
m_clipRenderer, SLOT( setClip( Clip* ) ) );
connect( m_mediaListView, SIGNAL( clipSelected( Clip* ) ),
this, SLOT( clipSelection( Clip* ) ) );
connect( m_mediaListView, SIGNAL( clipRemoved( const QUuid& ) ),
m_clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) );
}
ImportController::~ImportController()
{
delete m_ui;
delete m_stackNav;
// delete m_tag;
}
void
ImportController::changeEvent( QEvent *e )
{
QDialog::changeEvent( e );
switch ( e->type() )
{
case QEvent::LanguageChange:
m_ui->retranslateUi( this );
break;
default:
break;
}
}
void
ImportController::clipSelection( Clip* clip )
{
if ( clip != nullptr )
{
const QUuid& uuid = clip->uuid();
if ( m_currentUuid == uuid )
return ;
m_ui->metadataContainer->setWatchedClip( clip );
m_clipRenderer->stop();
m_currentUuid = uuid;
// m_tag->clipSelected( clip );
}
emit clipSelected( clip );
}
void
ImportController::importMedia( const QString &filePath )
{
vlmcDebug() << "Importing" << filePath;
if ( Core::instance()->library()->mediaAlreadyLoaded( filePath ) == true ||
m_temporaryMedias->mediaAlreadyLoaded( filePath ) == true )
return ;
Media* media = m_temporaryMedias->addMedia( filePath );
if ( media == nullptr )
return ;
connect( media, SIGNAL( metaDataComputed() ), this, SLOT( mediaLoaded() ) );
Clip* clip = new Clip( media );
media->setBaseClip( clip );
m_temporaryMedias->addClip( clip );
++m_nbMediaToLoad;
m_ui->progressBar->setMaximum( m_nbMediaToLoad );
}
void
ImportController::importDir( const QString &path )
{
QDir dir( path );
QFileInfoList files = dir.entryInfoList( m_nameFilters, QDir::NoDotAndDotDot | QDir::Readable
| QDir::AllEntries );
foreach ( QFileInfo fInfo, files )
{
if ( fInfo.isDir() == true )
importDir( fInfo.absoluteFilePath() );
else
importMedia( fInfo.absoluteFilePath() );
}
}
void
ImportController::forwardButtonClicked()
{
QModelIndex index = m_ui->treeView->selectionModel()->currentIndex();
QString filePath = m_filesModel->fileInfo( index ).filePath();
if ( !m_filesModel->isDir( index ) )
importMedia( filePath );
else
importDir( filePath );
}
void
ImportController::treeViewClicked( const QModelIndex& index )
{
if ( m_filesModel->isDir( index ) )
{
m_currentlyWatchedDir = m_filesModel->filePath( index );
saveCurrentPath();
}
m_ui->forwardButton->setEnabled( true );
}
void
ImportController::treeViewDoubleClicked( const QModelIndex& index )
{
if ( m_filesModel->isDir( index ) == false )
forwardButtonClicked();
}
void
ImportController::reject()
{
m_clipRenderer->stop();
m_mediaListView->clear();
m_temporaryMedias->clear();
collapseAllButCurrentPath();
m_clipRenderer->setClip( nullptr );
done( Rejected );
}
void
ImportController::accept()
{
bool invalidMedias = false;
m_mediaListView->clear();
m_clipRenderer->stop();
collapseAllButCurrentPath();
foreach ( Clip* clip, m_temporaryMedias->clips().values() )
{
if ( clip->media()->input()->length() == 0 )
invalidMedias = true;
Core::instance()->library()->addClip( clip );
}
if ( invalidMedias == true )
handleInvalidMedias();
m_temporaryMedias->removeAll();
m_clipRenderer->setClip( nullptr );
done( Accepted );
}
void
ImportController::handleInvalidMedias()
{
QMessageBox::StandardButton res = QMessageBox::question( nullptr, tr( "Invalid medias" ),
tr( "Some of the medias you loaded can't be used for video editing. Do you want VLMC to convert them"
" so you can use them in your project?" ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes );
if ( res == QMessageBox::Yes )
{
foreach ( Clip* clip, m_temporaryMedias->clips().values() )
{
if ( clip->media()->input()->length() == 0 )
{/* TODO
Transcoder *transcoder = new Transcoder( clip->media() );
connect( transcoder, SIGNAL( done() ), transcoder, SLOT( deleteLater() ) );
transcoder->transcodeToPs();*/
}
}
}
}
void
ImportController::collapseAllButCurrentPath()
{
m_ui->treeView->collapseAll();
QStringList paths;
for ( QDir directory( m_currentlyWatchedDir ); !directory.isRoot(); directory.cdUp() )
paths.prepend( directory.absolutePath() );
while ( paths.count() > 0 )
{
m_ui->treeView->setCurrentIndex( m_filesModel->index( paths.takeFirst() ) );
m_ui->treeView->setExpanded( m_ui->treeView->currentIndex() , true );
}
m_ui->forwardButton->setEnabled( true );
}
void
ImportController::saveCurrentPath()
{
Core::instance()->settings()->setValue( "private/ImportPreviouslySelectPath", m_currentlyWatchedDir );
}
void
ImportController::restoreCurrentPath()
{
QString path = VLMC_GET_STRING( "private/ImportPreviouslySelectPath" );
if ( QFile::exists( path ) == false )
path = QDir::homePath();
QFileInfo info = path;
m_currentlyWatchedDir = info.absoluteFilePath();
}
void
ImportController::mediaLoaded()
{
++m_nbMediaLoaded;
if ( m_nbMediaLoaded == m_nbMediaToLoad )
{
m_nbMediaLoaded = 0;
m_nbMediaToLoad = 0;
m_ui->progressBar->hide();
}
else
{
if ( m_nbMediaToLoad > 3 )
m_ui->progressBar->show();
m_ui->progressBar->setValue( m_nbMediaLoaded );
}
}
void
ImportController::failedToLoad( Media *media )
{
m_ui->errorLabel->setText( tr( "Failed to load %1").arg(
media->fileInfo()->fileName() ) );
m_ui->errorLabelImg->show();
m_ui->errorLabel->show();
QTimer::singleShot( 3000, this, SLOT( hideErrors() ) );
m_temporaryMedias->deleteClip( media->baseClip()->uuid() );
mediaLoaded();
}
void
ImportController::hideErrors()
{
m_ui->errorLabelImg->hide();
m_ui->errorLabel->hide();
}
/*****************************************************************************
* ImportController.h
*****************************************************************************
* Copyright (C) 2008-2016 VideoLAN
*
* Authors: Geoffroy Lacarriere <geoffroylaca@gmail.com>
* Thomas Boquet <thomas.boquet@gmail.com>
* Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/** \file
* This file ImportController contains class declaration/definition.
* It's the the controler of the import menu widget of vlmc.
*/
#ifndef IMPORTCONTROLLER_H
#define IMPORTCONTROLLER_H
#include "Gui/library/StackViewController.h"
#include <QDialog>
#include <QUuid>
class Clip;
class ClipMetadataDisplayer;
class ClipRenderer;
class Media;
class MediaContainer;
class MediaListView;
class PreviewWidget;
class TagWidget;
class QFileSystemModel;
class QModelIndex;
namespace Ui
{
class ImportController;
}
/**
* \class ImportController
* \brief Controller of the import menu
*/
class ImportController : public QDialog
{
Q_OBJECT
public:
ImportController(QWidget *parent = 0);
~ImportController();
protected:
void changeEvent( QEvent *e );
private:
void saveCurrentPath();
void restoreCurrentPath();
void collapseAllButCurrentPath();
void importMedia( const QString &filePath );
void importDir( const QString &path );
void handleInvalidMedias();
private:
Ui::ImportController* m_ui;
StackViewController* m_stackNav;
// TagWidget* m_tag;
MediaListView *m_mediaListView;
QFileSystemModel *m_filesModel;
QString m_currentlyWatchedDir;
QUuid m_currentUuid;
MediaContainer *m_temporaryMedias;
quint32 m_nbMediaToLoad;
quint32 m_nbMediaLoaded;
ClipRenderer* m_clipRenderer;
QStringList m_nameFilters;
public slots:
void accept();
void reject();
private slots:
void clipSelection( Clip* clip );
void forwardButtonClicked();
void treeViewClicked( const QModelIndex& index );
void treeViewDoubleClicked( const QModelIndex& index );
void mediaLoaded();
void failedToLoad( Media* media );
void hideErrors();
signals:
void clipSelected( Clip* );
};
#endif // IMPORTCONTROLLER_H
......@@ -72,7 +72,7 @@ TagWidget::clipSelected( Clip* clip )
else
static_cast<QPushButton*>(m_buttonList[i])->setChecked( false );
}
connect( clip->media(), SIGNAL( metaDataComputed( const Media* ) ),
connect( clip->media().data(), SIGNAL( metaDataComputed( const Media* ) ),
this, SLOT( setMetaTags() ) );
connect( clip, SIGNAL( destroyed() ), this, SLOT( clipDestroyed() ) );
}
......
/*****************************************************************************
* ListViewController.h:
*****************************************************************************
* Copyright (C) 2008-2016 VideoLAN
*
* Authors: Thomas Boquet <thomas.boquet@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <QPushButton>
#include <QScrollArea>
#include <QVBoxLayout>
#include "ListViewController.h"
#include "MediaCellView.h"
#include "Library/Library.h"
#include "StackViewController.h"
ListViewController::ListViewController( StackViewController* nav ) : m_nav( nav )
{
m_title = tr( "Media List" );
m_scrollArea = new QScrollArea();
m_layout = new QVBoxLayout();
m_container = new QWidget( nav );
m_layout->setAlignment( Qt::AlignTop );
m_layout->setSpacing( 0 );
m_layout->setContentsMargins( 0, 0, 0, 0 );
m_container->setLayout( m_layout );
m_scrollArea->setWidget( m_container );
m_scrollArea->setWidgetResizable( true );
m_scrollArea->setAcceptDrops( true );
}
ListViewController::~ListViewController()
{
delete m_container;
delete m_scrollArea;
}
// ViewController method implementation
const QString&
ListViewController::title() const
{
return m_title;
}
QWidget*
ListViewController::view() const
{
return m_scrollArea;
}
void
ListViewController::addCell( QWidget* cell )
{
m_layout->addWidget( cell );
}
void
ListViewController::removeCell( QWidget* cell )
{
m_layout->removeWidget( cell );
delete cell;
}
/*****************************************************************************
* MediaCellView.cpp
*****************************************************************************
* Copyright (C) 2008-2016 VideoLAN
*
* Authors: Thomas Boquet <thomas.boquet@gmail.com>
* Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "MediaCellView.h"
#include "ui/MediaCellView.h"
#include "Project/Project.h"
#include "Main/Core.h"
#include "Media/Clip.h"
#include "ClipProperty.h"
#include "Library/Library.h"
#include "Media/Media.h"
#include "Workflow/MainWorkflow.h"
#include "Project/Workspace.h"
#include <QMenu>
#include <QMessageBox>
#include <QTime>
#include <QMimeData>
#include <QDrag>
MediaCellView::MediaCellView( Clip* clip, QWidget *parent ) :
QWidget( parent ),
m_ui( new Ui::MediaCellView ),
m_clip( clip )
{
m_ui->setupUi( this );
setFocusPolicy( Qt::ClickFocus );
setAutoFillBackground( true );
connect( m_ui->delLabel, SIGNAL( clicked( QWidget*, QMouseEvent* ) ),
this, SLOT( deleteButtonClicked( QWidget*, QMouseEvent* ) ) );