Commit 41b09019 authored by Ludovic Fauvet's avatar Ludovic Fauvet

GraphicsTrack: split header from implementation

parent ad98f412
......@@ -63,7 +63,7 @@ SET(VLMC_SRCS
Gui/timeline/GraphicsAudioItem.cpp
Gui/timeline/GraphicsCursorItem.cpp
Gui/timeline/GraphicsMovieItem.cpp
Gui/timeline/GraphicsTrack.hpp
Gui/timeline/GraphicsTrack.cpp
Gui/timeline/Timeline.cpp
Gui/timeline/TracksControls.cpp
Gui/timeline/TracksRuler.cpp
......@@ -143,7 +143,7 @@ SET (VLMC_HDRS
Gui/timeline/GraphicsAudioItem.h
Gui/timeline/GraphicsCursorItem.h
Gui/timeline/GraphicsMovieItem.h
Gui/timeline/GraphicsTrack.hpp
Gui/timeline/GraphicsTrack.h
Gui/timeline/Timeline.h
Gui/timeline/TracksControls.h
Gui/timeline/TracksRuler.h
......
......@@ -25,6 +25,7 @@
#include "AbstractGraphicsMediaItem.h"
#include "TracksView.h"
#include "TracksScene.h"
#include "GraphicsTrack.h"
#include "Clip.h"
#include "Commands.h"
......
......@@ -25,13 +25,14 @@
#include <QGraphicsItem>
#include <QUuid>
#include "GraphicsTrack.hpp"
#include "MainWorkflow.h"
#define RESIZE_ZONE 7
class TracksView;
class Clip;
class TracksScene;
class GraphicsTrack;
/**
* \brief Base class for Audio/Video items.
......
/*****************************************************************************
* GraphicsTrack.cpp: Graphically represent a track in the timeline
*****************************************************************************
* Copyright (C) 2008-2010 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 "TracksView.h"
#include "GraphicsTrack.h"
GraphicsTrack::GraphicsTrack( MainWorkflow::TrackType type, quint32 trackNumber,
QGraphicsItem *parent ) : QGraphicsWidget( parent )
{
m_type = type;
m_trackNumber = trackNumber;
m_enabled = true;
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
setContentsMargins( 0, 0, 0, 0 );
setZValue( 1 );
}
void
GraphicsTrack::setHeight( int height )
{
setPreferredHeight( height );
adjustSize();
updateGeometry();
}
int
GraphicsTrack::height()
{
return preferredHeight();
}
void
GraphicsTrack::setTrackEnabled( bool enabled )
{
if( enabled == m_enabled )
return;
m_enabled = enabled;
if( enabled )
MainWorkflow::getInstance()->unmuteTrack( m_trackNumber, m_type );
else
MainWorkflow::getInstance()->muteTrack( m_trackNumber, m_type );
}
bool
GraphicsTrack::trackEnabled()
{
return m_enabled;
}
quint32
GraphicsTrack::trackNumber()
{
return m_trackNumber;
}
MainWorkflow::TrackType
GraphicsTrack::mediaType()
{
return m_type;
}
/*****************************************************************************
* GraphicsTrack.hpp: Graphically represent a track in the timeline
* GraphicsTrack.h: Graphically represent a track in the timeline
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
* Copyright (C) 2008-2010 the VLMC team
*
* Authors: Ludovic Fauvet <etix@l0cal.com>
*
......@@ -20,13 +20,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef GRAPHICSTRACK_HPP
#define GRAPHICSTRACK_HPP
#ifndef GRAPHICSTRACK_H
#define GRAPHICSTRACK_H
#include <QGraphicsWidget>
#include <QPainter>
#include <QDebug>
#include "MainWorkflow.h"
#include "Timeline.h"
class GraphicsTrack : public QGraphicsWidget
{
......@@ -35,55 +36,15 @@ class GraphicsTrack : public QGraphicsWidget
public:
enum { Type = UserType + 2 };
GraphicsTrack( MainWorkflow::TrackType type, quint32 trackNumber, QGraphicsItem* parent = 0 ) : QGraphicsWidget( parent )
{
m_type = type;
m_trackNumber = trackNumber;
m_enabled = true;
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
setContentsMargins( 0, 0, 0, 0 );
setZValue( 1 );
}
void setHeight( int height )
{
setPreferredHeight( height );
adjustSize();
updateGeometry();
}
int height()
{
return preferredHeight();
}
void setTrackEnabled( bool enabled )
{
if ( enabled == m_enabled ) return;
m_enabled = enabled;
if ( enabled )
MainWorkflow::getInstance()->unmuteTrack( m_trackNumber, m_type );
else
MainWorkflow::getInstance()->muteTrack( m_trackNumber, m_type );
}
bool trackEnabled()
{
return m_enabled;
}
quint32 trackNumber()
{
return m_trackNumber;
}
MainWorkflow::TrackType mediaType()
{
return m_type;
}
GraphicsTrack( MainWorkflow::TrackType type, quint32 trackNumber,
QGraphicsItem *parent = 0 );
void setHeight( int height );
int height();
void setTrackEnabled( bool enabled );
bool trackEnabled();
quint32 trackNumber();
MainWorkflow::TrackType mediaType();
virtual int type() const { return Type; }
private:
......@@ -92,4 +53,4 @@ private:
bool m_enabled;
};
#endif // GRAPHICSTRACK_HPP
#endif // GRAPHICSTRACK_H
......@@ -25,9 +25,10 @@
#include <QScrollArea>
#include <QVBoxLayout>
#include "GraphicsTrack.hpp"
#include "TrackControls.h"
class GraphicsTrack;
/**
* \brief Tracks controller widget
*/
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include <QMessageBox>
#include <QKeyEvent>
#include "TracksScene.h"
#include "Commands.h"
#include "GraphicsMovieItem.h"
......
......@@ -32,7 +32,7 @@
#include "GraphicsAudioItem.h"
#include "GraphicsCursorItem.h"
#include "Commands.h"
#include "GraphicsTrack.hpp"
#include "GraphicsTrack.h"
#include "WorkflowRenderer.h"
TracksView::TracksView( QGraphicsScene* scene, MainWorkflow* mainWorkflow, WorkflowRenderer* renderer, QWidget* parent )
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include <QIcon>
#include "GraphicsTrack.h"
#include "TrackControls.h"
#include "ui_TrackControls.h"
......
......@@ -24,7 +24,8 @@
#define TRACKCONTROLS_H
#include <QtGui/QWidget>
#include "timeline/GraphicsTrack.hpp"
class GraphicsTrack;
namespace Ui {
class TrackControls;
......
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