Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
74dc0de1
Commit
74dc0de1
authored
Sep 16, 2016
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MainWorkflow: Provide an unlink action & the associated command
parent
e5d6bf87
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
0 deletions
+54
-0
src/Commands/Commands.cpp
src/Commands/Commands.cpp
+31
-0
src/Commands/Commands.h
src/Commands/Commands.h
+14
-0
src/Workflow/MainWorkflow.cpp
src/Workflow/MainWorkflow.cpp
+6
-0
src/Workflow/MainWorkflow.h
src/Workflow/MainWorkflow.h
+3
-0
No files found.
src/Commands/Commands.cpp
View file @
74dc0de1
...
...
@@ -380,6 +380,37 @@ Commands::Clip::Link::internalUndo()
invalidate
();
}
Commands
::
Clip
::
Unlink
::
Unlink
(
std
::
shared_ptr
<
SequenceWorkflow
>
const
&
workflow
,
const
QUuid
&
clipA
,
const
QUuid
&
clipB
)
:
m_workflow
(
workflow
)
,
m_clipA
(
clipA
)
,
m_clipB
(
clipB
)
{
retranslate
();
}
void
Commands
::
Clip
::
Unlink
::
retranslate
()
{
setText
(
tr
(
"Unlinking clips"
)
);
}
void
Commands
::
Clip
::
Unlink
::
internalRedo
()
{
auto
ret
=
m_workflow
->
unlinkClips
(
m_clipA
,
m_clipB
);
if
(
ret
==
false
)
invalidate
();
}
void
Commands
::
Clip
::
Unlink
::
internalUndo
()
{
auto
ret
=
m_workflow
->
linkClips
(
m_clipA
,
m_clipB
);
if
(
ret
==
false
)
invalidate
();
}
Commands
::
Effect
::
Add
::
Add
(
std
::
shared_ptr
<
EffectHelper
>
const
&
helper
,
Backend
::
IInput
*
target
)
:
m_helper
(
helper
)
,
m_target
(
target
)
...
...
src/Commands/Commands.h
View file @
74dc0de1
...
...
@@ -197,6 +197,20 @@ namespace Commands
QUuid
m_clipA
;
QUuid
m_clipB
;
};
class
Unlink
:
public
Generic
{
public:
Unlink
(
std
::
shared_ptr
<
SequenceWorkflow
>
const
&
workflow
,
const
QUuid
&
clipA
,
const
QUuid
&
clipB
);
virtual
void
internalRedo
();
virtual
void
internalUndo
();
virtual
void
retranslate
();
private:
std
::
shared_ptr
<
SequenceWorkflow
>
m_workflow
;
QUuid
m_clipA
;
QUuid
m_clipB
;
};
}
namespace
Effect
{
...
...
src/Workflow/MainWorkflow.cpp
View file @
74dc0de1
...
...
@@ -281,6 +281,12 @@ MainWorkflow::linkClips( const QString& uuidA, const QString& uuidB )
trigger
(
new
Commands
::
Clip
::
Link
(
m_sequenceWorkflow
,
uuidA
,
uuidB
)
);
}
void
MainWorkflow
::
unlinkClips
(
const
QString
&
uuidA
,
const
QString
&
uuidB
)
{
trigger
(
new
Commands
::
Clip
::
Unlink
(
m_sequenceWorkflow
,
uuidA
,
uuidB
)
);
}
QString
MainWorkflow
::
addEffect
(
const
QString
&
clipUuid
,
const
QString
&
effectId
)
{
...
...
src/Workflow/MainWorkflow.h
View file @
74dc0de1
...
...
@@ -152,6 +152,9 @@ class MainWorkflow : public QObject
Q_INVOKABLE
void
linkClips
(
const
QString
&
uuidA
,
const
QString
&
uuidB
);
Q_INVOKABLE
void
unlinkClips
(
const
QString
&
uuidA
,
const
QString
&
uuidB
);
Q_INVOKABLE
QString
addEffect
(
const
QString
&
clipUuid
,
const
QString
&
effectId
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment