Skip to content

Commit

Permalink
Add FastClip
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed Jan 1, 2022
1 parent 2292df7 commit 38334e5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MediaSidekick.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.13.2, 2020-10-31T20:54:48. -->
<!-- Written by QtCreator 4.13.2, 2021-05-15T18:17:01. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
34 changes: 34 additions & 0 deletions agfolderrectitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,40 @@ void AGFolderRectItem::onItemRightClicked(QPoint pos)

});

fileContextMenu->addAction(new QAction("Fast clips",fileContextMenu));
fileContextMenu->actions().last()->setIcon(qApp->style()->standardIcon(QStyle::SP_DirOpenIcon));
fileContextMenu->actions().last()->setShortcut(QKeySequence(tr("Ctrl+C")));
connect(fileContextMenu->actions().last(), &QAction::triggered, [=]()
{
// foreach (AGClipRectItem *clipItem, fileGroup->timelineGroupItem->clips)
// {

// }
foreach (QGraphicsItem *item, scene()->items())
{
if (item->data(mediaTypeIndex).toString() == "MediaFile" && item->data(itemTypeIndex).toString() == "Base")
{
AGMediaFileRectItem *mediaItem = (AGMediaFileRectItem *)item;

// mediaItem->processAction("actionPlay_Pause");

if (mediaItem->m_player == nullptr)
mediaItem->initPlayer(false);

for (int position = 10000; position<mediaItem->duration - 3000; position=position+10000) {
mediaItem->m_player->setPosition(position);

qDebug()<<"Fast clips"<<mediaItem->fileInfo.fileName()<<mediaItem->m_player->position();
mediaItem->processAction("actionIn");

}


}
}
});


fileContextMenu->addSeparator();

AGViewRectItem::onItemRightClicked(pos);
Expand Down

0 comments on commit 38334e5

Please sign in to comment.