Skip to content

Commit 4999144

Browse files
committed
Merge branch 'dev'
2 parents 866edd0 + aba4b86 commit 4999144

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

plugins/squareone/tutorials/firstapplication/firstapplication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ The VideoDecoderView already started playing our video. Now we can connect other
5858
Let's try to add a conversion to grayscale to our video. Within the root item, click the
5959
['add']({livekeys-hover:livekeys://open/resources/FirstApplicationHighlight.qml#add-option;livekeys://open/resources/FirstApplicationRemoveHighlight.qml#add-option})
6060
option, select [Object]({livekeys-hover:livekeys://open/resources/FirstApplicationHighlight.qml#add-option-object;livekeys://open/resources/FirstApplicationRemoveHighlight.qml#add-option-object})
61-
then search and add the `GrayscaleView` item. Once added, in the input property, type
62-
'videoDecoderView.image', then hit the return key or click on the update button. You should see the grayscale version of our video playing.
61+
then search and add the `GrayscaleView` item. Once added, in the [input property]({livekeys-hover:livekeys://open/resources/FirstApplicationHighlight.qml#grayscale-input;livekeys://open/resources/FirstApplicationRemoveHighlight.qml#grayscale-input}), type
62+
`videoDecoderView.image`, then hit the return key or click on the update button. You should see the grayscale version of our video playing.
6363

6464
## Looking over the hierarchy
6565

plugins/squareone/tutorials/firstapplication/resources/FirstApplicationHighlight.qml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,21 +302,61 @@ WorkspaceControl{
302302
highlight.boxY = coords.y + editorCoords.y + 30
303303
highlight.box.width = 35
304304
highlight.box.height = 35
305-
306-
//INFO: Setting palette value
307-
// palette.value = 'path_to_video'
308-
309305
}
310306
}
311-
312307
}
313308

314309
}
315310

316311
}
317312
}
313+
}
314+
}
315+
} else if ( fragment === 'grayscale-input' ){
316+
var editorPane = lk.layers.workspace.panes.focusPane('editor')
317+
if ( !editorPane )
318+
return
319+
320+
var editor = editorPane.editor
321+
var codeHandler = editor.documentHandler.codeHandler
322+
323+
var editingFragments = codeHandler.editingFragments()
324+
325+
for ( var i = 0; i < editingFragments.length; ++i ){
326+
var itemEdit = editingFragments[i]
327+
if ( itemEdit.type() === 'qml/QtQuick#Item' ){
328+
var childFragments = itemEdit.getChildFragments()
329+
for ( var j = 0; j < childFragments.length; ++j ){
330+
var decoderEdit = childFragments[j]
331+
if ( decoderEdit.type() === 'qml/lcvcore#GrayscaleView' ){
318332

333+
var decoderChildren = decoderEdit.getChildFragments()
334+
335+
for ( var k = 0; k < decoderChildren.length; ++k ){
336+
var inputProperty = decoderChildren[k]
337+
if ( inputProperty.identifier() === 'input' ){
338+
339+
var palettes = inputProperty.paletteList()
340+
341+
for ( var pi = 0; pi < palettes.length; ++pi ){
342+
var palette = palettes[pi]
343+
if ( palette.name === 'ConnectionPalette' ){
344+
var coords = palette.item.mapToItem(editor, 0, 0)
345+
var editorCoords = editorPane.mapGlobalPosition()
346+
347+
highlight = createHighlight(state)
348+
highlight.boxX = coords.x + editorCoords.x
349+
highlight.boxY = coords.y + editorCoords.y + 30
350+
highlight.box.width = palette.item.width - 35
351+
highlight.box.height = 35
352+
}
353+
}
354+
}
355+
356+
}
319357

358+
}
359+
}
320360
}
321361
}
322362
}

0 commit comments

Comments
 (0)