Commit 8b6a97ec authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Merge branch 'master' into chouquette_sound_workflow

Conflicts:
	src/GUI/TracksView.cpp
	src/Renderer/WorkflowRenderer.cpp
parents a54d4618 00c45dd6
......@@ -29,6 +29,10 @@
<file alias="hpoff">images/hpoff.png</file>
<file>images/audio.png</file>
<file>images/video.png</file>
<file alias="wizard_watermark">images/wizard_watermark.png</file>
<file alias="keyboard">images/keyboard.png</file>
<file alias="marker_start">images/marker_start.png</file>
<file alias="marker_stop">images/marker_stop.png</file>
</qresource>
<qresource prefix="/text">
<file>AUTHORS</file>
......
......@@ -39,6 +39,7 @@ namespace Action
Resize,
Remove,
Add,
Move,
};
Generic( Type type ) : m_type( type ) {}
virtual ~Generic(){}
......@@ -108,6 +109,27 @@ namespace Action
QUuid m_uuid;
};
class MoveClip : public Track
{
public:
MoveClip( MainWorkflow* mainWorkflow, const QUuid& uuid, uint32_t oldTrack,
uint32_t newTrack, qint64 newPos, MainWorkflow::TrackType trackType, bool undoRedoAction ) :
Track( mainWorkflow, oldTrack, trackType, Move ),
m_uuid( uuid ), m_newTrack( newTrack ),
m_newPos( newPos ), m_undoRedoAction( undoRedoAction )
{
}
void execute()
{
m_mainWorkflow->moveClip( m_uuid, m_trackId, m_newTrack, m_newPos, m_trackType, m_undoRedoAction );
}
private:
QUuid m_uuid;
uint32_t m_newTrack;
qint64 m_newPos;
bool m_undoRedoAction;
};
class ResizeClip : public Generic
{
public:
......
......@@ -60,14 +60,14 @@ void Commands::MainWorkflow::AddClip::undo()
}
Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, qint64 oldPos, unsigned int newTrack, qint64 newPos,
unsigned int oldTrack, unsigned int newTrack, qint64 newPos,
::MainWorkflow::TrackType trackType ) :
m_workflow( workflow ), m_uuid( uuid ), m_oldTrack( oldTrack ),
m_newTrack( newTrack ), m_pos( newPos ), m_oldPos( oldPos ),
m_trackType( trackType )
m_newTrack( newTrack ), m_pos( newPos ), m_trackType( trackType )
{
setText( QObject::tr( "Moving clip" ) );
m_undoRedoAction = false;
m_oldPos = m_workflow->getClipPosition( uuid, oldTrack, trackType );
}
void Commands::MainWorkflow::MoveClip::redo()
......@@ -102,28 +102,48 @@ void Commands::MainWorkflow::RemoveClips::undo()
m_renderer->addClip( m_clips.at( i ).clip, m_clips.at( i ).trackNumber, m_clips.at( i ).pos, m_clips.at( i ).trackType );
}
Commands::MainWorkflow::ResizeClip::ResizeClip( ::MainWorkflow* mainWorkflow, const QUuid& uuid, unsigned int trackId,
qint64 newBegin, qint64 newEnd, ::MainWorkflow::TrackType trackType ) :
m_mainWorkflow( mainWorkflow ),
Commands::MainWorkflow::ResizeClip::ResizeClip( WorkflowRenderer* renderer, const QUuid& uuid,
qint64 newBegin, qint64 newEnd,
qint64 oldBegin, qint64 oldEnd,
qint64 newPos, qint64 oldPos,
uint32_t trackId,
::MainWorkflow::TrackType trackType ) :
m_renderer( renderer ),
m_uuid( uuid ),
m_newBegin( newBegin ),
m_newEnd( newEnd ),
m_trackType( trackType )
m_oldBegin( oldBegin ),
m_oldEnd( oldEnd ),
m_newPos( newPos ),
m_oldPos( oldPos ),
m_trackId( trackId ),
m_trackType( trackType ),
m_undoRedoAction( false )
{
m_clip = mainWorkflow->getClip( uuid, trackId, m_trackType );
m_oldBegin = m_clip->getBegin();
m_oldEnd = m_clip->getEnd();
m_clip = ::MainWorkflow::getInstance()->getClip( uuid, trackId, m_trackType );
setText( QObject::tr( "Resizing clip" ) );
}
void Commands::MainWorkflow::ResizeClip::redo()
{
m_clip->setBegin( m_newBegin );
m_clip->setEnd( m_newEnd );
m_renderer->resizeClip( m_clip, m_newBegin, m_newEnd, m_newPos, m_trackId, m_trackType, m_undoRedoAction );
m_undoRedoAction = true;
}
void Commands::MainWorkflow::ResizeClip::undo()
{
m_clip->setBegin( m_oldBegin );
m_clip->setEnd( m_oldEnd );
//This code is complete crap.
// We need to case, because when we redo a "begin-resize", we need to first resize, then move.
//In the other cases, we need to move, then resize.
if ( m_oldBegin == m_newBegin )
{
m_renderer->resizeClip( m_clip, m_oldBegin, m_oldEnd, m_oldPos, m_trackId, m_trackType, m_undoRedoAction );
}
else
{
m_clip->setBoundaries( m_oldBegin, m_oldEnd );
::MainWorkflow::getInstance()->moveClip( m_clip->getUuid(), m_trackId, m_trackId, m_oldPos, m_trackType, m_undoRedoAction );
}
}
Commands::MainWorkflow::SplitClip::SplitClip( WorkflowRenderer* renderer, Clip* toSplit, uint32_t trackId,
......
......@@ -67,7 +67,7 @@ namespace Commands
{
public:
MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, qint64 oldPos, unsigned int newTrack,
unsigned int oldTrack, unsigned int newTrack,
qint64 newPos, ::MainWorkflow::TrackType trackType );
virtual void redo();
virtual void undo();
......@@ -95,22 +95,40 @@ namespace Commands
QVector<ClipActionInfo> m_clips;
};
/**
* \brief This command is used to resize a clip.
* \param renderer: The workflow renderer
* \param uuid: The clip's uuid
* \param newBegin: The clip's new beginning
* \param newEnd: The clip's new end
* \param newPos: if the clip was resized from the beginning, it is moved
* so we have to know its new position
* \param trackId:The track in which the modification occurs. This is only
* used when the clip is resized from the beginning.
* \param trackType: The track's type (Audio or Video)
*/
NEW_COMMAND( ResizeClip )
{
public:
ResizeClip( ::MainWorkflow* mainWorkflow, const QUuid& uuid, unsigned int trackId,
qint64 newBegin, qint64 newEnd,
::MainWorkflow::TrackType trackType );
ResizeClip( WorkflowRenderer* renderer, const QUuid& uuid,
qint64 newBegin, qint64 newEnd, qint64 oldBegin,
qint64 oldEnd, qint64 newPos, qint64 oldPos,
uint32_t trackId, ::MainWorkflow::TrackType trackType );
virtual void redo();
virtual void undo();
private:
::MainWorkflow* m_mainWorkflow;
qint64 m_oldBegin;
qint64 m_oldEnd;
WorkflowRenderer* m_renderer;
QUuid m_uuid;
qint64 m_newBegin;
qint64 m_newEnd;
qint64 m_oldBegin;
qint64 m_oldEnd;
qint64 m_newPos;
qint64 m_oldPos;
uint32_t m_trackId;
Clip* m_clip;
::MainWorkflow::TrackType m_trackType;
bool m_undoRedoAction;
};
NEW_COMMAND( SplitClip )
......
#include <QtDebug>
#include "SettingValue.h"
#include "SettingsManager.h"
#include "KeyboardShortcutHelper.h"
KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QWidget* parent, bool menu ) :
QShortcut( parent ),
m_name( name ),
m_menu( menu )
{
const SettingValue* set = SettingsManager::getInstance()->getValue( "keyboard_shortcut", name );
if ( m_menu == false )
setKey( QKeySequence( set->get().toString() ) );
connect( set, SIGNAL( changed( const QVariant& ) ), this, SLOT( shortcutUpdated( const QVariant& ) ) );
}
void KeyboardShortcutHelper::shortcutUpdated( const QVariant& value )
{
if ( m_menu == false )
setKey( QKeySequence( value.toString() ) );
else
emit changed( m_name, value.toString() );
}
/*****************************************************************************
* KeyboardShortcutHelper.h: An helper to catch keyboard shortcut modifications
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzee-Luyssen <beauze.h@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 KEYBOARDSHORTCUTHELPER_H
#define KEYBOARDSHORTCUTHELPER_H
#include <QShortcut>
#include <QString>
class KeyboardShortcutHelper : public QShortcut
{
Q_OBJECT
public:
KeyboardShortcutHelper( const QString& name, QWidget* parent = NULL, bool menu = false );
virtual ~KeyboardShortcutHelper()
{
}
private:
QString m_name;
bool m_menu;
private slots:
void shortcutUpdated( const QVariant& value );
signals:
void changed( const QString&, const QString& );
};
#endif // KEYBOARDSHORTCUTHELPER_H
HEADERS += Commands.h
SOURCES += Commands.cpp
HEADERS += Commands.h \
KeyboardShortcutHelper.h
SOURCES += Commands.cpp \
KeyboardShortcutHelper.cpp
......@@ -22,6 +22,7 @@
#include "SettingsManager.h"
#include "ProjectSettingsDefault.h"
#include "ProjectManager.h"
void ProjectSettingsDefault::load( const QString& part )
{
......@@ -66,9 +67,7 @@ void ProjectSettingsDefault::loadVideoDefaults( const QString& part )
void ProjectSettingsDefault::loadProjectDefaults( const QString& part )
{
SettingsManager* setMan = SettingsManager::getInstance();
QVariant defaultName = "project";
setMan->setValue( part, "ProjectName", defaultName );
setMan->setValue( part, "ProjectName", ProjectManager::unNamedProject );
return ;
}
......
/*****************************************************************************
* SettingValue.cpp: A setting value that can broadcast its changes
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.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) 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 "SettingValue.h"
SettingValue::SettingValue( const QVariant& val ) : m_val ( val )
{
}
void SettingValue::set( const QVariant& val )
{
if ( val != m_val )
{
m_val = val;
emit changed( m_val );
}
}
const QVariant& SettingValue::get() const
{
return m_val;
}
QVariant& SettingValue::get()
{
return m_val;
}
/*****************************************************************************
* SettingValue.h: A setting value that can broadcast its changes
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.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) 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 SETTINGVALUE_H
#define SETTINGVALUE_H
#include <QObject>
#include <QVariant>
class SettingValue : public QObject
{
Q_OBJECT
Q_DISABLE_COPY( SettingValue );
public:
SettingValue( const QVariant& val );
void set( const QVariant& val );
const QVariant& get() const;
QVariant& get();
private:
QVariant m_val;
signals:
void changed( const QVariant& );
};
#endif // SETTINGVALUE_H
......@@ -44,23 +44,23 @@ SettingsManager::~SettingsManager()
{
}
void SettingsManager::setValues( const QString& part, QHash<QString, QVariant> values )
{
if ( !m_tempData.contains( part ) )
addNewSettingsPart( part );
m_globalLock.lockForRead();
SettingsPart* sett = m_tempData[part];
m_globalLock.unlock();
QHash<QString, QVariant>::iterator it = values.begin();
QHash<QString, QVariant>::iterator end = values.end();
QWriteLocker lock( &sett->m_lock );
for ( ; it != end; ++it )
sett->m_data.insert( it.key(), it.value() );
return ;
}
void SettingsManager::setValue( const QString& part , const QString& key, QVariant& value )
//void SettingsManager::setValues( const QString& part, SettingsPart::ConfigPair values )
//{
// if ( !m_tempData.contains( part ) )
// addNewSettingsPart( part );
// m_globalLock.lockForRead();
// SettingsPart* sett = m_tempData[part];
// m_globalLock.unlock();
// SettingsPart::ConfigPair::iterator it = values.begin();
// SettingsPart::ConfigPair::iterator end = values.end();
//
// QWriteLocker lock( &sett->m_lock );
// for ( ; it != end; ++it )
// sett->m_data.insert( it.key(), it.value() );
// return ;
//}
void SettingsManager::setValue( const QString& part , const QString& key, const QVariant& value )
{
m_globalLock.lockForRead();
if ( !m_tempData.contains( part ) )
......@@ -70,18 +70,23 @@ void SettingsManager::setValue( const QString& part , const QString& key, QVari
m_globalLock.unlock();
QWriteLocker lock( &m_globalLock );
SettingsPart* tmp = m_tempData[part];
tmp->m_data.insert( key, value );
SettingsPart::ConfigPair::iterator it = tmp->m_data.find( key );
if ( it == tmp->m_data.end() )
tmp->m_data[key] = new SettingValue( value );
else
it.value()->set( value );
return ;
}
const QVariant& SettingsManager::getValue( const QString& part, const QString& key ) const
const SettingValue* SettingsManager::getValue( const QString& part, const QString& key ) const
{
if ( !m_data.contains( part ) )
return getValue( "default", key );
QReadLocker readLock( &m_globalLock );
QReadLocker rdLock( &m_data[part]->m_lock );
QVariant& value = m_data[part]->m_data[key];
return value;
if ( m_data[part]->m_data.contains( key ) == true )
return m_data[part]->m_data[key];
return NULL;
}
void SettingsManager::saveSettings( const QString& part, QDomDocument& xmlfile, QDomElement& root )
......@@ -89,6 +94,7 @@ void SettingsManager::saveSettings( const QString& part, QDomDocument& xmlfile,
m_globalLock.lockForRead();
if ( !m_data.contains( part ) )
{
qDebug() << "no part named" << part;
m_globalLock.unlock();
return ;
}
......@@ -96,13 +102,13 @@ void SettingsManager::saveSettings( const QString& part, QDomDocument& xmlfile,
m_globalLock.unlock();
//SAVE SETTINGS TO DomDocument
QReadLocker lock( &sett->m_lock );
QHash<QString, QVariant>::iterator it = sett->m_data.begin();
QHash<QString, QVariant>::iterator end = sett->m_data.end();
SettingsPart::ConfigPair::const_iterator it = sett->m_data.begin();
SettingsPart::ConfigPair::const_iterator end = sett->m_data.end();
QDomElement settingsNode = xmlfile.createElement( part );
for ( ; it != end; ++it )
{
QDomElement elem = xmlfile.createElement( it.key() );
elem.setAttribute( "value", it.value().toString() );
elem.setAttribute( "value", it.value()->get().toString() );
settingsNode.appendChild( elem );
}
......@@ -139,7 +145,7 @@ void SettingsManager::loadSettings( const QString& part, const QDomElement& set
return ;
}
sett->m_data.insert( list.at( idx ).toElement().tagName(),
QVariant( attrMap.item( 0 ).nodeValue() ));
new SettingValue( QVariant( attrMap.item( 0 ).nodeValue() ) ) );
}
sett->m_lock.unlock();
m_globalLock.unlock();
......@@ -170,11 +176,17 @@ void SettingsManager::commit()
SettingsPart* sett = it.value();
QReadLocker rLock( &sett->m_lock );
QHash<QString, QVariant>::iterator iter = sett->m_data.begin();
QHash<QString, QVariant>::iterator ed = sett->m_data.end();
SettingsPart::ConfigPair::iterator iter = sett->m_data.begin();
SettingsPart::ConfigPair::iterator end = sett->m_data.end();
QWriteLocker wLock( &m_data[it.key()]->m_lock );
for ( ; iter != ed; ++iter )
m_data[it.key()]->m_data.insert( iter.key(), iter.value() );
for ( ; iter != end; ++iter )
{
SettingsPart::ConfigPair::iterator insert_it = m_data[it.key()]->m_data.find( iter.key() );
if ( insert_it == m_data[it.key()]->m_data.end() )
m_data[it.key()]->m_data.insert( iter.key(), new SettingValue( iter.value()->get() ) );
else
m_data[it.key()]->m_data[ iter.key() ]->set( iter.value()->get() );
}
}
lock.unlock();
flush();
......@@ -213,3 +225,11 @@ SettingsManager* SettingsManager::getInstance()
return ret;
}
const SettingsPart* SettingsManager::getConfigPart( const QString& part ) const
{
QHash<QString, SettingsPart*>::const_iterator it = m_data.find( part );
if ( it == m_data.end() )
return NULL;
return it.value();
}
......@@ -31,12 +31,15 @@
#include <QVariant>
#include <QDomDocument>
#include "SettingValue.h"
#include "QSingleton.hpp"
struct SettingsPart
{
typedef QHash<QString, SettingValue*> ConfigPair;
SettingsPart() {}
QHash<QString, QVariant> m_data;
ConfigPair m_data;
mutable QReadWriteLock m_lock;
bool m_rdOnly;
......@@ -53,9 +56,10 @@ class SettingsManager : public QObject, public QSingleton<SettingsManager>
friend class QSingleton<SettingsManager>;
public:
void setValues( const QString& part, QHash<QString, QVariant> );
void setValue( const QString& part, const QString& key, QVariant& value );
const QVariant& getValue( const QString& part, const QString& key ) const;
// void setValues( const QString& part, SettingsPart::ConfigPair );
void setValue( const QString& part, const QString& key, const QVariant& value );
const SettingValue* getValue( const QString& part, const QString& key ) const;
const SettingsPart* getConfigPart( const QString& part ) const;
void saveSettings( const QString& part, QDomDocument& xmlfile, QDomElement& root );
void loadSettings( const QString& part, const QDomElement& settings );
void addNewSettingsPart( const QString& name );
......
......@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtDebug>
#include <QVariant>
#include "VLMCSettingsDefault.h"
......@@ -31,7 +32,6 @@ void VLMCSettingsDefault::load( const QString& part )
VLMCSettingsDefault::loadVLMCDefaults( part );
VLMCSettingsDefault::loadlanguageDefaults( part );
SettingsManager::getInstance()->commit();
return ;
}
......@@ -61,3 +61,36 @@ void VLMCSettingsDefault::loadlanguageDefaults( const QString& part )
return ;
}
void VLMCSettingsDefault::loadKeyboardShortcutDefaults()
{
SettingsManager::getInstance()->addNewSettingsPart( "keyboard_shortcut" );
loadKeyboardShortcutDefaults( "default" );
loadKeyboardShortcutDefaults( "keyboard_shortcut" );
SettingsManager::getInstance()->commit();
}
#define ADD_SHORTCUT(NAME, KEYS) setMan->setValue( part, QObject::tr( NAME ), QVariant( QObject::tr( KEYS ) ) )
void VLMCSettingsDefault::loadKeyboardShortcutDefaults( const QString& part )
{
SettingsManager* setMan = SettingsManager::getInstance();
ADD_SHORTCUT( "Default mode", "n" );
ADD_SHORTCUT( "Cut mode", "x" );
ADD_SHORTCUT( "Launch media preview", "Ctrl+Return" );
ADD_SHORTCUT( "Start render preview", "Space" );
//A bit nasty, but we better use what Qt's providing as default shortcut
ADD_SHORTCUT( "Undo", QKeySequence( QKeySequence::Undo ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Redo", QKeySequence( QKeySequence::Redo ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Help", QKeySequence( QKeySequence::HelpContents ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Quit", "Ctrl+Q" );
ADD_SHORTCUT( "Preferences", "Alt+P" );
ADD_SHORTCUT( "Fullscreen", "F" );
ADD_SHORTCUT( "New project", QKeySequence( QKeySequence::New ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Open project", QKeySequence( QKeySequence::Open ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Save", QKeySequence( QKeySequence::Save ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Save as", "Ctrl+Shift+S" );
ADD_SHORTCUT( "Close project", QKeySequence( QKeySequence::Close ).toString().toLocal8Bit() );
return ;
}
......@@ -27,10 +27,12 @@ class VLMCSettingsDefault
{
public:
static void load( const QString& part );
static void loadKeyboardShortcutDefaults();
private:
static void loadVLMCDefaults( const QString& part );
static void loadlanguageDefaults( const QString& part );
static void loadKeyboardShortcutDefaults( const QString& part );
private:
VLMCSettingsDefault();
~VLMCSettingsDefault();
......
HEADERS += ProjectSettingsDefault.h \
SettingsManager.h \
VLMCSettingsDefault.h
SOURCES += ProjectSettingsDefault.cpp \
SettingsManager.cpp \
VLMCSettingsDefault.cpp
HEADERS += ProjectSettingsDefault.h \
SettingsManager.h \
VLMCSettingsDefault.h \
SettingValue.h
SOURCES += ProjectSettingsDefault.cpp \
SettingsManager.cpp \
VLMCSettingsDefault.cpp \
SettingValue.cpp
......@@ -21,6 +21,9 @@
*****************************************************************************/
#include "AbstractGraphicsMediaItem.h"
#include "TracksView.h"
#include "Commands.h"
AbstractGraphicsMediaItem::AbstractGraphicsMediaItem() :
oldTrackNumber( -1 ), oldPosition( -1 ), m_tracksView( NULL ),
......@@ -97,25 +100,33 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
{
Q_ASSERT( clip() );
if ( size > clip()->getParent()->getNbFrames() )
{
qWarning( "AbstractGraphicsMediaItem: Can't expand a clip beyond its original size" );
if ( size > clip()->getParent()->getNbFrames() || size < 1 )
return;
}
if ( size < 0 ) return;
qint64 realBegin = startPos() - clip()->getBegin();
qint64 realEnd = realBegin + clip()->getParent()->getNbFrames();
if ( from == BEGINNING )
clip()->setEnd( clip()->getBegin() + size );
{
if ( realBegin + clip()->getBegin() + size > realEnd )
return ;
tracksView()->getRenderer()->resizeClip( clip(), clip()->getBegin(), clip()->getBegin() + size, 0, //This parameter is unused in this case
trackNumber(), MainWorkflow::VideoTrack );
}
else
{
qint64 newBegin = qMax( clip()->getEnd() - size, (qint64)0 );
if ( realBegin > newBegin + startPos() )
return ;
qint64 oldLength = clip()->getLength();
if ( ( clip()->getEnd() - size ) < 0 )
{
qWarning( "Warning: resizing a region with a size below 0" );
size += clip()->getEnd() - size;
}
clip()->setBegin( qMax( clip()->getEnd() - size, (qint64)0 ) );
m_resizeExpected = true;
tracksView()->getRenderer()->resizeClip( clip(), qMax( clip()->getEnd() - size, (qint64)0 ), clip()->getEnd(),
startPos() + ( oldLength - size ), trackNumber(), MainWorkflow::VideoTrack );