Commit d3a6beaf authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Removed unused class that was "preventing" compilation

w00ps, my bad, forgot this earlier :)
parent 7a035b67
/*****************************************************************************
* TimelineBackend.cpp: Backend for Timeline
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Christophe Courtaut <christophe.courtaut@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.
*****************************************************************************/
#include "TimelineBackend.h"
TimelineBackend::TimelineBackend()
{
m_audioTracks = new QMap<int, Track*>();
m_videoTracks = new QMap<int, Track*>();
}
Track* TimelineBackend::getTrack( TimelineBackend::TrackType type, int index ) const
{
if ( type == TimelineBackend::Audio )
return m_audioTracks->value( index, NULL );
else if ( type == TimelineBackend::Video)
return m_videoTracks->value( index, NULL );
return NULL;
}
int TimelineBackend::createNewTrack( TimelineBackend::TrackType type )
{
Track* track = new Track();
if ( type == TimelineBackend::Audio )
m_audioTracks->insert( findNewIndex( type ), track );
else
m_videoTracks->insert( findNewIndex( type ), track );
return getTrackIndex( type, track );
}
bool TimelineBackend::removeTrack( TimelineBackend::TrackType type, int index )
{
QMap<int, Track*>* map = ( type == TimelineBackend::Audio ) ? m_audioTracks : m_videoTracks;
return map->remove( index );
}
int TimelineBackend::getTrackIndex( TimelineBackend::TrackType type, Track* track ) const
{
QMap<int, Track*>* map = ( type == TimelineBackend::Audio ) ? m_audioTracks : m_videoTracks;
return map->key( track, -1 );
}
int TimelineBackend::findNewIndex( TimelineBackend::TrackType type ) const
{
QMap<int, Track*>* map = ( type == TimelineBackend::Audio ) ? m_audioTracks : m_videoTracks;
int index = 0;
while ( index < map->size() )
{
if ( !map->contains( index ) )
return index;
index++;
}
return index;
}
/*****************************************************************************
* TimelineBackend.h: Backend for Timeline
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Christophe Courtaut <christophe.courtaut@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.
*****************************************************************************/
#ifndef TIMELINEBACKEND_H
#define TIMELINEBACKEND_H
#include <QObject>
#include <QMap>
#include "Track.h"
class TimelineBackend : public QObject
{
Q_OBJECT
Q_DISABLE_COPY( TimelineBackend );
public:
enum TrackType
{
Audio,
Video
};
TimelineBackend();
Track* getTrack( TimelineBackend::TrackType type , int index ) const;
int createNewTrack( TimelineBackend::TrackType type );
bool removeTrack( TimelineBackend::TrackType type, int index );
int getTrackIndex( TimelineBackend::TrackType type, Track* track) const;
private:
int findNewIndex( TimelineBackend::TrackType type ) const;
private:
QMap<int, Track*>* m_audioTracks;
QMap<int, Track*>* m_videoTracks;
};
#endif // TIMELINEBACKEND_H
...@@ -37,7 +37,6 @@ SOURCES += src/main.cpp \ ...@@ -37,7 +37,6 @@ SOURCES += src/main.cpp \
src/Media.cpp \ src/Media.cpp \
src/gui/FileBrowser.cpp \ src/gui/FileBrowser.cpp \
src/gui/GraphicsCursorItem.cpp \ src/gui/GraphicsCursorItem.cpp \
src/TimelineBackend.cpp \
src/Workflow/ClipWorkflow.cpp \ src/Workflow/ClipWorkflow.cpp \
src/Workflow/TrackWorkflow.cpp \ src/Workflow/TrackWorkflow.cpp \
src/Workflow/MainWorkflow.cpp \ src/Workflow/MainWorkflow.cpp \
...@@ -72,7 +71,6 @@ HEADERS += src/gui/MainWindow.h \ ...@@ -72,7 +71,6 @@ HEADERS += src/gui/MainWindow.h \
src/Media.h \ src/Media.h \
src/gui/FileBrowser.h \ src/gui/FileBrowser.h \
src/gui/GraphicsCursorItem.h \ src/gui/GraphicsCursorItem.h \
src/TimelineBackend.h \
src/Workflow/ClipWorkflow.h \ src/Workflow/ClipWorkflow.h \
src/Workflow/TrackWorkflow.h \ src/Workflow/TrackWorkflow.h \
src/Workflow/MainWorkflow.h \ src/Workflow/MainWorkflow.h \
......
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