Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 453c4e05 authored by Nicolas Carion's avatar Nicolas Carion

[Timeline2][Model] First draft of the headers for the model

parent 5beb03dc
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* 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) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* 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, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <QSharedPointer>
/* @brief This class represents a Clip object, as viewed by the backend.
In general, the Gui associated with it will send modification queries (such as resize or move), and this class authorize them or not depending on the validity of the modifications
*/
class ClipModel
{
ClipModel() = delete;
/* Creates a clip attached to the given track
*/
ClipModel(QSharedPointer<TrackModel> parent);
public slots:
/* This is called whenever a resize of the clip is issued
If the resize is accepted, it should send back a signal to the QML interface.
If a snap point is withing reach, the operation will be coerced to use it.
*/
void slotRequestResize(int newSize);
/* This is called whenever a move of the clip is issued
If the move is accepted, it should send back a signal to the QML interface.
If a snap point is withing reach, the operation will be coerced to use it.
*/
void slotRequestMove(int newPosition);
/* Delete the current clip
*/
void slotDelete();
/* Split the current clip at the given position
*/
void slotSplit(int position);
signals:
void signalSizeChanged(int);
void signalPositionChanged(int);
private:
Mlt::Producer m_producer;
QSharedPointer<TimelineModel> m_timeline;
};
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* 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) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* 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, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <QSharedPointer>
/* @brief This class represents a Timeline object, as viewed by the backend.
In general, the Gui associated with it will send modification queries (such as resize or move), and this class authorize them or not depending on the validity of the modifications
*/
class TimelineModel
{
TimelineModel();
private:
Mlt::Tractor m_tractor;
QVector<int> m_snapPoints; // this will be modified from a lot of different places, we will probably need a mutex
QSet<QSharedPointer<TrackModel>> m_allTracks;
};
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* 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) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* 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, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <QSharedPointer>
#include <QSet>
/* @brief This class represents a Track object, as viewed by the backend.
In general, the Gui associated with it will send modification queries (such as resize or move), and this class authorize them or not depending on the validity of the modifications
*/
class TrackModel
{
public:
TrackModel() = delete;
TrackModel(QSharedPointer<TimelineModel> parent);
/* Perform a resize operation on a clip. Returns true if the operation succeeded*/
bool requestClipResize(QSharedPointer<ClipModel> caller, int newSize);
/* Perform a move operation on a clip. Returns true if the operation succeeded*/
bool requestClipMove(QSharedPointer<ClipModel> caller, int newPosition);
/* Perform a split at the requested position */
bool splitClip(QSharedPointer<ClipModel> caller, int position);
public slots:
/*Delete the current track and all its associated clips */
void slotDelete();
private:
Mlt::Playlist m_playlist;
QSet<QSharedPointer<ClipModel>> m_allClips;
};
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