Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
2d0670d1
Commit
2d0670d1
authored
Aug 17, 2009
by
Hugo Beauzee-Luyssen
Browse files
Allow a track to be muted
parent
71a96244
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Workflow/MainWorkflow.cpp
View file @
2d0670d1
...
...
@@ -41,7 +41,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
memset
(
MainWorkflow
::
blackOutput
,
0
,
VIDEOHEIGHT
*
VIDEOWIDTH
*
3
);
m_tracks
=
new
Toggleable
<
TrackWorkflow
*>
[
trackCount
];
for
(
int
i
=
0
;
i
<
trackCount
;
++
i
)
for
(
int
i
=
0
;
i
<
trackCount
;
++
i
)
{
m_tracks
[
i
].
setPtr
(
new
TrackWorkflow
(
i
)
);
connect
(
m_tracks
[
i
],
SIGNAL
(
trackEndReached
(
unsigned
int
)
),
this
,
SLOT
(
trackEndReached
(
unsigned
int
)
)
);
...
...
@@ -49,6 +49,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
connect
(
m_tracks
[
i
],
SIGNAL
(
trackUnpaused
()
),
this
,
SLOT
(
trackUnpaused
()
)
);
connect
(
m_tracks
[
i
],
SIGNAL
(
renderCompleted
(
unsigned
int
)
),
this
,
SLOT
(
tracksRenderCompleted
(
unsigned
int
)
),
Qt
::
QueuedConnection
);
}
muteTrack
(
0
);
m_renderStartedLock
=
new
QReadWriteLock
;
m_renderMutex
=
new
QMutex
;
m_highestTrackNumberMutex
=
new
QMutex
;
...
...
@@ -356,3 +357,13 @@ void MainWorkflow::cancelSynchronisation()
}
m_synchroneRenderWaitCondition
->
wakeAll
();
}
void
MainWorkflow
::
muteTrack
(
unsigned
int
trackId
)
{
m_tracks
[
trackId
].
setHardDeactivation
(
true
);
}
void
MainWorkflow
::
unmuteTrack
(
unsigned
int
trackId
)
{
m_tracks
[
trackId
].
setHardDeactivation
(
false
);
}
src/Workflow/MainWorkflow.h
View file @
2d0670d1
...
...
@@ -90,6 +90,9 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
*/
void
cancelSynchronisation
();
void
muteTrack
(
unsigned
int
trackId
);
void
unmuteTrack
(
unsigned
int
trackId
);
private:
static
MainWorkflow
*
m_instance
;
...
...
src/tools/Toggleable.hpp
View file @
2d0670d1
...
...
@@ -32,7 +32,7 @@ template <typename T>
class
Toggleable
{
public:
Toggleable
()
:
m_ptr
(
NULL
),
m_activated
(
true
)
Toggleable
()
:
m_ptr
(
NULL
),
m_activated
(
true
)
,
m_hardDeactivated
(
false
)
{
}
void
setPtr
(
T
ptr
)
...
...
@@ -51,11 +51,11 @@ class Toggleable
}
bool
activated
()
const
{
return
m_activated
;
return
(
m_hardDeactivated
==
false
&&
m_activated
==
true
)
;
}
bool
deactivated
()
const
{
return
!
m_activated
;
return
(
m_hardDeactivated
==
true
||
m_activated
==
false
)
;
}
void
activate
()
{
...
...
@@ -65,10 +65,15 @@ class Toggleable
{
m_activated
=
false
;
}
void
setHardDeactivation
(
bool
val
)
{
m_hardDeactivated
=
val
;
}
private:
T
m_ptr
;
bool
m_activated
;
bool
m_hardDeactivated
;
};
#endif // TOGGLEABLE_HPP
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