Commit 099df26f authored by Ludovic Fauvet's avatar Ludovic Fauvet

Timeline: mute/unmute a clip from the context menu

parent 80e9ec31
......@@ -31,7 +31,8 @@
AbstractGraphicsMediaItem::AbstractGraphicsMediaItem() :
oldTrackNumber( -1 ), oldPosition( -1 ), m_tracksView( NULL ),
m_group( NULL ), m_width( 0 ), m_height( 0 ), m_resizeExpected( false )
m_group( NULL ), m_width( 0 ), m_height( 0 ), m_resizeExpected( false ),
m_muted( false )
{
}
......@@ -108,8 +109,9 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent
QMenu menu( tracksView() );
QAction* removeAction = menu.addAction( "Remove" );
menu.addSeparator();
QAction* muteAction = menu.addAction( "Mute" );
muteAction->setCheckable( true );
muteAction->setChecked( m_muted );
QAction* linkAction = NULL;
QAction* unlinkAction = NULL;
......@@ -136,6 +138,22 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent
if ( selectedAction == removeAction )
scene()->askRemoveSelectedItems();
else if ( selectedAction == muteAction )
{
if ( ( m_muted = muteAction->isChecked() ) )
{
tracksView()->m_mainWorkflow->muteClip( clip()->getUuid(),
trackNumber(),
mediaType() );
}
else
{
tracksView()->m_mainWorkflow->unmuteClip( clip()->getUuid(),
trackNumber(),
mediaType() );
}
}
else if ( selectedAction == linkAction )
{
QList<QGraphicsItem*> items = scene()->selectedItems();
......
......@@ -152,6 +152,8 @@ private:
qint64 m_width;
qint64 m_height;
bool m_muted;
QColor m_itemColor;
//FIXME: this is a nasty forest boolean
......
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