Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Define Code Execution Model #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions docs/code-execution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Executing code
Executing the code is one of the core features an Editor for VapourSynth must provide. Also the user might want to preview the outputs of the script.

## Operations
### run
Creating a new core is important as otherwise pre-existing variables may interfere with the script that the user wants to execute.
How the core is created and where its VapourSynth-Core will actually live is defined by the concrete implementation of the `AbstractCore`
class.

```
User EditorContext(1) AbstractCore(2)
| | |
|====run()====>| |
| | ====restart()====> |
| | |====\
| | | | stop()
| | ||<==/
| | ||---\
| | | |
| | |<---/
| | |====\
| | | | start()
| | ||<==/
| | ||---\
| | | |
| | |<---/
| | <----------------- |
| | ==push_script()==> |
| | <----------------- |
|<------------ | |
```

### preview
The preview-function will first try to receive an `AbstractClip`-instance that acts as a remote Proxy[GOF207] to the actual `VideoNode`-instance.
It will then try to retrieve a frame from the clip whenever a frame is needed.

```
User EditorContext(1) AbstractCore(2)
|==preview()==>| |
| | ==get_output()===> |
| | | ======CREATE======> AbstractClip
| | | <----------------------- |
| | <----------------- | |
|<------------ | | |
|===========================get_frame()=======================>|
|<-------------------------------------------------------------|
```

## References
GOF207: “Proxy.” Design Patterns: Elements of Reusable Object-Oriented Software, by Erich Gamma, Addison-Wesley, 1995, pp. 207–217.