Commit 98511605 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Basic implementation of the timeline graphics model

parent 1c191aaa
/*****************************************************************************
* AbstractGraphicsMediaItem.h: Base class for media representation
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Ludovic Fauvet <etix@l0cal.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.
*****************************************************************************/
#ifndef ABSTRACTGRAPHICSMEDIAITEM_H
#define ABSTRACTGRAPHICSMEDIAITEM_H
#include <QGraphicsItem>
#include <QUuid>
class AbstractGraphicsMediaItem : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
virtual ~AbstractGraphicsMediaItem() { }
/// The item length can be expanded or shrinked by the user.
virtual bool expandable() const = 0;
/// The item can be moved by the user.
virtual bool moveable() const = 0;
/// Should return the unique uid of the contained media.
virtual const QUuid& uuid() const = 0;
};
#endif // ABSTRACTGRAPHICSMEDIAITEM_H
/*****************************************************************************
* GraphicsMovieItem.cpp: Represent a movie graphically in the timeline
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Ludovic Fauvet <etix@l0cal.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.
*****************************************************************************/
#include "GraphicsMovieItem.h"
GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : m_clip( clip )
{
}
GraphicsMovieItem::~GraphicsMovieItem()
{
}
int GraphicsMovieItem::tracksHeight()
{
//TODO Get this value from the TracksView
}
/*****************************************************************************
* GraphicsMovieItem.h: Represent a movie graphically in the timeline
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Ludovic Fauvet <etix@l0cal.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.
*****************************************************************************/
#ifndef GRAPHICSMOVIEITEM_H
#define GRAPHICSMOVIEITEM_H
#include "AbstractGraphicsMediaItem.h"
#include "Clip.h"
class GraphicsMovieItem : public AbstractGraphicsMediaItem
{
Q_OBJECT
public:
GraphicsMovieItem( Clip* clip );
virtual ~GraphicsMovieItem();
virtual bool expandable() const { return false; }
virtual bool moveable() const { return true; }
virtual const QUuid& uuid() const { return m_clip->getUuid(); }
protected:
int tracksHeight();
private:
Clip* m_clip;
};
#endif // GRAPHICSMOVIEITEM_H
......@@ -38,7 +38,8 @@ public:
TracksView( QGraphicsScene* scene, QWidget* parent = 0 );
void setDuration( int duration );
int duration() { return m_projectDuration; }
void setCursorPos(int pos);
int tracksHeight() { return m_tracksHeight; }
void setCursorPos( int pos );
protected:
virtual void resizeEvent( QResizeEvent* event );
......
......@@ -32,7 +32,8 @@ SOURCES += src/main.cpp \
src/gui/Slider.cpp \
src/MetaDataManager.cpp \
src/LibVLCpp/VLCMediaList.cpp \
src/Library.cpp
src/Library.cpp \
src/gui/GraphicsMovieItem.cpp
HEADERS += src/gui/MainWindow.h \
src/gui/DockWidgetManager.h \
src/gui/LibraryWidget.h \
......@@ -57,7 +58,9 @@ HEADERS += src/gui/MainWindow.h \
src/MetaDataManager.h \
src/LibVLCpp/VLCMediaList.h \
src/Singleton.hpp \
src/Library.h
src/Library.h \
src/gui/AbstractGraphicsMediaItem.h \
src/gui/GraphicsMovieItem.h
FORMS += src/gui/ui/MainWindow.ui \
src/gui/ui/PreviewWidget.ui \
src/gui/ui/Preferences.ui \
......
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