Compare commits
434 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c7ea3a16d | ||
|
|
4ded0d03d0 | ||
|
|
ac45ad740d | ||
|
|
f010c840e6 | ||
|
|
90b59908c6 | ||
|
|
13c6693cdd | ||
|
|
cd56c960a6 | ||
|
|
a51423a4d6 | ||
|
|
80a25ec71c | ||
|
|
51209179d1 | ||
|
|
b3937caa10 | ||
|
|
8927ba7c73 | ||
|
|
5f4c867618 | ||
|
|
fced4178be | ||
|
|
da0944c814 | ||
|
|
7aa14219b8 | ||
|
|
09a3494183 | ||
|
|
8924d81e0a | ||
|
|
b599fbf88d | ||
|
|
578a72f560 | ||
|
|
6b1e298d43 | ||
|
|
698665c4cc | ||
|
|
caa3e4d07a | ||
|
|
7606baa20b | ||
|
|
fde6be3f97 | ||
|
|
abdc70121d | ||
|
|
879a0524fc | ||
|
|
a529b34f99 | ||
|
|
e8daeb5f30 | ||
|
|
f610e8ba1e | ||
|
|
b3245c967b | ||
|
|
0af9da2214 | ||
|
|
db68f80048 | ||
|
|
b0efd80e42 | ||
|
|
3e12e0b84d | ||
|
|
5465a45dc6 | ||
|
|
53bd7d6ae2 | ||
|
|
d66751b6ac | ||
|
|
95de6d0afc | ||
|
|
147daa7681 | ||
|
|
ece925858a | ||
|
|
657b05d077 | ||
|
|
cf3bceeb46 | ||
|
|
6735e5eaaa | ||
|
|
7b9e71df40 | ||
|
|
fae61f3d87 | ||
|
|
a57419150e | ||
|
|
378257b7bf | ||
|
|
885b92a0a1 | ||
|
|
58371c36d3 | ||
|
|
d39064b209 | ||
|
|
f497da7967 | ||
|
|
03931cb232 | ||
|
|
4eeb02d9d4 | ||
|
|
8ff5ae3555 | ||
|
|
053a5e9dbe | ||
|
|
5a1a88bf33 | ||
|
|
f19b18d806 | ||
|
|
f6e4701d6b | ||
|
|
c3d686e472 | ||
|
|
6c7ff870e8 | ||
|
|
38bac83ddd | ||
|
|
4d8c77cf3e | ||
|
|
0a147697d2 | ||
|
|
21837e7464 | ||
|
|
d747962e24 | ||
|
|
49f09d1b3a | ||
|
|
783d6e69b1 | ||
|
|
6452ff78c0 | ||
|
|
a430d39849 | ||
|
|
33c222555f | ||
|
|
00f7e0fe62 | ||
|
|
44a31ede74 | ||
|
|
fb3ee2aa8c | ||
|
|
58e5dd9186 | ||
|
|
27ec46c64e | ||
|
|
12a5d777e5 | ||
|
|
276a94f9e8 | ||
|
|
ccc3c86900 | ||
|
|
124415363f | ||
|
|
de850b39f2 | ||
|
|
379f73b6ca | ||
|
|
159b778fa9 | ||
|
|
007f7a0ce1 | ||
|
|
54fa642693 | ||
|
|
2fbc6f9193 | ||
|
|
262c6fd8ab | ||
|
|
7fcb53c7d0 | ||
|
|
d0e1101bfb | ||
|
|
a8bb4ae6d1 | ||
|
|
d743307e59 | ||
|
|
e92e9eb45c | ||
|
|
aaefa356ae | ||
|
|
3a7da2bc98 | ||
|
|
94b211e3b7 | ||
|
|
9ff5b90605 | ||
|
|
a033b74f7f | ||
|
|
bb4e81b00a | ||
|
|
5f2e0b79cd | ||
|
|
64a7fef7c1 | ||
|
|
09dbc5c84e | ||
|
|
e71e0791bc | ||
|
|
2a4be39c9a | ||
|
|
3cde191afb | ||
|
|
02a8d9a243 | ||
|
|
7f4e313a78 | ||
|
|
44e3d90dcb | ||
|
|
945eb3ccc6 | ||
|
|
793008852a | ||
|
|
7e791ee5e4 | ||
|
|
1413490579 | ||
|
|
57154e5d0b | ||
|
|
57a1556e23 | ||
|
|
e248e92ca1 | ||
|
|
fa5adcf08b | ||
|
|
87a51afd99 | ||
|
|
4efaa1f350 | ||
|
|
1d329600af | ||
|
|
c2a0e51984 | ||
|
|
ebd59e38ce | ||
|
|
f75b384c17 | ||
|
|
5419622c74 | ||
|
|
ab40011954 | ||
|
|
1b658e9b40 | ||
|
|
49605f9c23 | ||
|
|
d9b6b808f7 | ||
|
|
1607dd329d | ||
|
|
74337b2699 | ||
|
|
d6a684bbe7 | ||
|
|
feeb997f62 | ||
|
|
26da3bf9a8 | ||
|
|
82046afd9f | ||
|
|
97704deea0 | ||
|
|
64b2a18ff3 | ||
|
|
cf16edceec | ||
|
|
f6008737d1 | ||
|
|
61de8c4717 | ||
|
|
83ad83e656 | ||
|
|
2afb13c580 | ||
|
|
e48a963503 | ||
|
|
c846a0626f | ||
|
|
a6b1d09ff1 | ||
|
|
3603e146cc | ||
|
|
9ab597c0e9 | ||
|
|
3251e9f845 | ||
|
|
3e7b24a3de | ||
|
|
6989cd4d40 | ||
|
|
c7205a512e | ||
|
|
c0befa0f49 | ||
|
|
2223024383 | ||
|
|
216d9a1686 | ||
|
|
1f9bff6182 | ||
|
|
0f7d42ab83 | ||
|
|
60334f24f1 | ||
|
|
d7d099d2d7 | ||
|
|
514d4170be | ||
|
|
6b1c1853b8 | ||
|
|
ced318637f | ||
|
|
c2c7c37ef6 | ||
|
|
7e5041eac5 | ||
|
|
4b7db87444 | ||
|
|
22aba74ed9 | ||
|
|
5283dd2f9e | ||
|
|
8bc69ba0a4 | ||
|
|
90207c6184 | ||
|
|
678590fc4f | ||
|
|
9170aba906 | ||
|
|
59a92bb172 | ||
|
|
f12cf8a6ce | ||
|
|
26cb75f93f | ||
|
|
e8b05cd7c2 | ||
|
|
4930c07e9c | ||
|
|
39d4002491 | ||
|
|
e095b139ae | ||
|
|
088cf97ebf | ||
|
|
be90b30b8f | ||
|
|
0ff3041e89 | ||
|
|
9d2c2c0e47 | ||
|
|
b35f2b7cb4 | ||
|
|
1988c5fe9a | ||
|
|
aad99ce3a4 | ||
|
|
1d7209693a | ||
|
|
4017732d71 | ||
|
|
c09f2a1121 | ||
|
|
9467a0700a | ||
|
|
ef74faeef4 | ||
|
|
2891ad7efe | ||
|
|
364ffc4659 | ||
|
|
8aa82274ff | ||
|
|
71ca037ca8 | ||
|
|
341aac8ff7 | ||
|
|
99ccfb8e94 | ||
|
|
4ed884de55 | ||
|
|
f9caa75aa7 | ||
|
|
37a7bc43fd | ||
|
|
cdd6ac1d8b | ||
|
|
235e0efc09 | ||
|
|
2f4f93d3ba | ||
|
|
f25a1b70f3 | ||
|
|
6ec8edd5e2 | ||
|
|
8beeced7c2 | ||
|
|
f4add84a13 | ||
|
|
c507d0ed7e | ||
|
|
3ff193f42d | ||
|
|
8104050658 | ||
|
|
b53f0b4c1b | ||
|
|
7698c05dd5 | ||
|
|
18734345a1 | ||
|
|
ad54ee4bda | ||
|
|
f8a4b7b1db | ||
|
|
e6966df9ac | ||
|
|
8e17fc0edb | ||
|
|
2cdb8c022d | ||
|
|
04822346a6 | ||
|
|
6fcfc2da34 | ||
|
|
62c7b8cdc1 | ||
|
|
d2d899a8d0 | ||
|
|
921e09227f | ||
|
|
39c274a515 | ||
|
|
5db65b6e6e | ||
|
|
c71fc5575f | ||
|
|
2ebf264feb | ||
|
|
aa20cf5138 | ||
|
|
5f96a8991a | ||
|
|
47e0d6ae19 | ||
|
|
e3e2d8d2f6 | ||
|
|
f57e057f2a | ||
|
|
dc0df8cc61 | ||
|
|
c30d7a2089 | ||
|
|
03bffb3319 | ||
|
|
65dc93ed37 | ||
|
|
8ed04b9c6e | ||
|
|
e6a9327bae | ||
|
|
658c506653 | ||
|
|
ad4a4281b4 | ||
|
|
6b0070ec56 | ||
|
|
c9cf6baf4b | ||
|
|
85a25a0a39 | ||
|
|
e192d254f9 | ||
|
|
9e2b9d7cf4 | ||
|
|
cd545213e4 | ||
|
|
935d2ff02c | ||
|
|
b7d6218b89 | ||
|
|
d86754b0e6 | ||
|
|
b97674a404 | ||
|
|
f91522fc14 | ||
|
|
9b4ef00278 | ||
|
|
43270c7763 | ||
|
|
9a98fb399c | ||
|
|
c255b0249f | ||
|
|
b0e71f6f18 | ||
|
|
7e59377daf | ||
|
|
73aa369e6d | ||
|
|
731d7e5d6b | ||
|
|
bc5e1c7df9 | ||
|
|
1a15f9b581 | ||
|
|
136d6052d8 | ||
|
|
811b270bae | ||
|
|
7870e3cfce | ||
|
|
4874af1d5a | ||
|
|
1b7ead0479 | ||
|
|
ac97984314 | ||
|
|
8c778e8afb | ||
|
|
2b6bbce1d9 | ||
|
|
b8e0a9c1dd | ||
|
|
4c3c3de065 | ||
|
|
a74801a0af | ||
|
|
cbe8217790 | ||
|
|
e1cdf34955 | ||
|
|
fefc20c52a | ||
|
|
ad1e574cfe | ||
|
|
c25d4b7dad | ||
|
|
207aa88daf | ||
|
|
3be08a3e63 | ||
|
|
7d91ffbafa | ||
|
|
128ba084ad | ||
|
|
0defff8f7c | ||
|
|
6e3497e4c4 | ||
|
|
1c309b2c89 | ||
|
|
35507e7fbb | ||
|
|
bc439829cf | ||
|
|
93f433f388 | ||
|
|
f9e99e2a33 | ||
|
|
94dcf7c3f3 | ||
|
|
c3bb29182e | ||
|
|
b11f6d5b3b | ||
|
|
d2b900f7c3 | ||
|
|
bf2b5d8882 | ||
|
|
e7878bdb8f | ||
|
|
0670550521 | ||
|
|
f5df923c51 | ||
|
|
f1f62816b5 | ||
|
|
db462690b3 | ||
|
|
c28685c700 | ||
|
|
1f1780597c | ||
|
|
1590251dad | ||
|
|
d25c17342b | ||
|
|
e105022185 | ||
|
|
16931917b7 | ||
|
|
e2e316a079 | ||
|
|
1dd2151a20 | ||
|
|
c7367ad46a | ||
|
|
21045411e7 | ||
|
|
128e8834e8 | ||
|
|
7433772606 | ||
|
|
8967f5f090 | ||
|
|
3b51a6e2a9 | ||
|
|
c5cb635b4e | ||
|
|
1e9f8d707e | ||
|
|
69a0aa4bd8 | ||
|
|
581fa88055 | ||
|
|
f991ae5aed | ||
|
|
44825ece04 | ||
|
|
eac2c5c020 | ||
|
|
a593e97227 | ||
|
|
ecad786f50 | ||
|
|
9012d33c05 | ||
|
|
268751815f | ||
|
|
6529b170e6 | ||
|
|
5ce465cb30 | ||
|
|
48f1df2fd6 | ||
|
|
3e6ddf560a | ||
|
|
0051533ac8 | ||
|
|
e69ac7ca28 | ||
|
|
9c8abb8edf | ||
|
|
9ee434f275 | ||
|
|
4826d9fbf0 | ||
|
|
3fd7b8ed3c | ||
|
|
ebc8d483d9 | ||
|
|
9821d3595a | ||
|
|
f21be9d10c | ||
|
|
d221036cde | ||
|
|
1dbff48ebb | ||
|
|
43e56fc433 | ||
|
|
b3b562f4bb | ||
|
|
784ac996d3 | ||
|
|
fb6a95078d | ||
|
|
189e7b8bc9 | ||
|
|
55967ad27c | ||
|
|
e2c82af4d6 | ||
|
|
8712923bec | ||
|
|
416635179b | ||
|
|
c1b635e036 | ||
|
|
2860d8f1de | ||
|
|
c1fb07b4c7 | ||
|
|
5036c2231c | ||
|
|
c848666e17 | ||
|
|
55aef98a30 | ||
|
|
7cbbf799dc | ||
|
|
30a4e0297c | ||
|
|
5f68f51693 | ||
|
|
8e6aaf29e0 | ||
|
|
cde0e74a2e | ||
|
|
2a573cbab3 | ||
|
|
941275a1b9 | ||
|
|
c5884ec498 | ||
|
|
da06cf52ec | ||
|
|
07e8f489c1 | ||
|
|
baed2ac031 | ||
|
|
cdab138b2f | ||
|
|
06524edfb3 | ||
|
|
0e40550427 | ||
|
|
e08b6ade9e | ||
|
|
36bc4944f9 | ||
|
|
a0be95d634 | ||
|
|
faf8d4c4ad | ||
|
|
8af740caa8 | ||
|
|
69fa3521f9 | ||
|
|
991a96d3dc | ||
|
|
b10bf06305 | ||
|
|
7f54b30fbe | ||
|
|
ee79043536 | ||
|
|
c9e6611b92 | ||
|
|
73d128d89a | ||
|
|
5a240acd86 | ||
|
|
7dc4a5cf87 | ||
|
|
6d835297b2 | ||
|
|
b44c29e235 | ||
|
|
8da9a9cf27 | ||
|
|
a3617626f7 | ||
|
|
e44832ea9e | ||
|
|
f841e78dcf | ||
|
|
e7a8d48cca | ||
|
|
69e8d0e32f | ||
|
|
830d1a6bf9 | ||
|
|
e9b72b442a | ||
|
|
77ac7eca18 | ||
|
|
86d4198ffd | ||
|
|
37dfe31ac2 | ||
|
|
584e1c48e6 | ||
|
|
15766ceb97 | ||
|
|
6e79f28b69 | ||
|
|
e9632d206b | ||
|
|
a0f55bfcb5 | ||
|
|
3c32f1da6e | ||
|
|
7e13c1b22a | ||
|
|
2fc52e673f | ||
|
|
48001a660b | ||
|
|
5a6daf79b6 | ||
|
|
ae4fd9f7df | ||
|
|
7dfa8776fd | ||
|
|
a836796fcc | ||
|
|
fb131972d4 | ||
|
|
140ce358fa | ||
|
|
dd92f2dccb | ||
|
|
d62004eadf | ||
|
|
abc21e9692 | ||
|
|
a13b0d5d91 | ||
|
|
12f8c75c2d | ||
|
|
bdc1920166 | ||
|
|
8cb0d57ffe | ||
|
|
7344689263 | ||
|
|
f521ca1118 | ||
|
|
6712f1383e | ||
|
|
d756fd4a29 | ||
|
|
e070ef1b7f | ||
|
|
ea7786a002 | ||
|
|
3eec07fac1 | ||
|
|
46afa76af8 | ||
|
|
6cc1ba64d8 | ||
|
|
225596481f | ||
|
|
4ef3b3b332 | ||
|
|
e7ac768b5b | ||
|
|
b1e8833daa | ||
|
|
155d71dc80 | ||
|
|
94ebf17134 | ||
|
|
d6fe2edf0d | ||
|
|
867cd7e583 | ||
|
|
1a2471a32d | ||
|
|
057dd9c01d | ||
|
|
5a2c0e15e9 | ||
|
|
ae5ae24f6f | ||
|
|
7a2f3fe840 | ||
|
|
b46788c81a |
50
.github/workflows/jekyll-gh-pages.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
|
||||
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["master"]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow one concurrent deployment
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Build job
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v2
|
||||
- name: Build with Jekyll
|
||||
uses: actions/jekyll-build-pages@v1
|
||||
with:
|
||||
source: ./docs
|
||||
destination: ./_site
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
|
||||
# Deployment job
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v1
|
||||
6
.gitignore
vendored
@@ -26,3 +26,9 @@ osx/.DS_Store
|
||||
osx/runvimix
|
||||
|
||||
*.autosave
|
||||
|
||||
flatpak/.flatpak-builder
|
||||
|
||||
flatpak/repo/
|
||||
|
||||
flatpak/build/
|
||||
|
||||
2
.gitmodules
vendored
@@ -21,4 +21,4 @@
|
||||
url = https://github.com/Ableton/link.git
|
||||
[submodule "ext/tfd"]
|
||||
path = ext/tfd
|
||||
url = https://git.code.sf.net/p/tinyfiledialogs/code
|
||||
url = https://git.code.sf.net/p/tinyfiledialogs/code
|
||||
613
CMakeLists.txt
@@ -1,9 +1,15 @@
|
||||
#####
|
||||
##### This file is part of vimix - video live mixer
|
||||
##### **Copyright** (C) 2019-2023 Bruno Herbelin <bruno.herbelin@gmail.com>
|
||||
#####
|
||||
|
||||
cmake_minimum_required(VERSION 3.8.2)
|
||||
project(vimix VERSION 0.0.1 LANGUAGES CXX C)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# use git
|
||||
#####
|
||||
##### Use git to read version from tags
|
||||
#####
|
||||
find_package (Git)
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(
|
||||
@@ -16,28 +22,37 @@ if(GIT_EXECUTABLE)
|
||||
if(NOT GIT_DESCRIBE_ERROR_CODE)
|
||||
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 0 1 VIMIX_VERSION_MAJOR)
|
||||
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 2 1 VIMIX_VERSION_MINOR)
|
||||
string(FIND ${GIT_DESCRIBE_VERSION} "-" VIMIX_VERSION_LENGTH)
|
||||
string(LENGTH ${GIT_DESCRIBE_VERSION} VIMIX_VERSION_LENGTH)
|
||||
if (VIMIX_VERSION_LENGTH GREATER 4)
|
||||
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 4 1 VIMIX_VERSION_PATCH)
|
||||
else()
|
||||
set(VIMIX_VERSION_PATCH "0")
|
||||
endif()
|
||||
add_definitions(-DVIMIX_GIT="${GIT_DESCRIBE_VERSION}")
|
||||
add_definitions(-DVIMIX_VERSION_MAJOR=${VIMIX_VERSION_MAJOR})
|
||||
add_definitions(-DVIMIX_VERSION_MINOR=${VIMIX_VERSION_MINOR})
|
||||
add_definitions(-DVIMIX_VERSION_PATCH=${VIMIX_VERSION_PATCH})
|
||||
message(STATUS "Compiling vimix version ${VIMIX_VERSION_MAJOR}.${VIMIX_VERSION_MINOR}.${VIMIX_VERSION_PATCH}")
|
||||
else()
|
||||
message(STATUS "Compiling vimix (unknown version)")
|
||||
message(STATUS "Compiling vimix version ${VIMIX_VERSION_MAJOR}.${VIMIX_VERSION_MINOR}.${VIMIX_VERSION_PATCH} (${GIT_DESCRIBE_VERSION})")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENTDIR ON)
|
||||
|
||||
# Find the cmake modules
|
||||
#####
|
||||
##### Find the cmake modules
|
||||
#####
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/share/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
|
||||
include(MacroLogFeature)
|
||||
include(MacroFindGStreamerLibrary)
|
||||
|
||||
|
||||
#####
|
||||
##### Configure cmake
|
||||
#####
|
||||
|
||||
set(BUILD_STATIC_LIBS ON)
|
||||
set(CMAKE_INCLUDE_CURRENTDIR ON)
|
||||
|
||||
if(UNIX)
|
||||
if (APPLE)
|
||||
add_definitions(-DAPPLE)
|
||||
@@ -45,15 +60,28 @@ if(UNIX)
|
||||
# the RPATH to be used when installing
|
||||
set(CMAKE_SKIP_RPATH TRUE)
|
||||
set(OpenGL_DIR /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/)
|
||||
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11")
|
||||
|
||||
# set(CMAKE_OSX_ARCHITECTURES "arm64")
|
||||
# set(CMAKE_OSX_DEPLOYMENT_TARGET "12")
|
||||
|
||||
# CPACK
|
||||
set(CPACK_SYSTEM_NAME "OSX_${CMAKE_OSX_DEPLOYMENT_TARGET}_${CMAKE_OSX_ARCHITECTURES}")
|
||||
set(CPACK_GENERATOR DragNDrop)
|
||||
set(CPACK_BINARY_DRAGNDROP ON)
|
||||
set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
|
||||
|
||||
# find icu4c in OSX (pretty well hidden...)
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig")
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig")
|
||||
|
||||
else()
|
||||
add_definitions(-DLINUX)
|
||||
|
||||
# CPACK
|
||||
set(CPACK_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
|
||||
|
||||
# linux opengl
|
||||
set(OpenGL_GL_PREFERENCE "GLVND")
|
||||
|
||||
@@ -61,6 +89,11 @@ if(UNIX)
|
||||
find_package(GTK 3.0 REQUIRED)
|
||||
macro_log_feature(GTK_FOUND "GTK" "GTK cross-platform widget toolkit" "http://www.gtk.org" TRUE)
|
||||
|
||||
find_package(X11 REQUIRED COMPONENTS xcb)
|
||||
include_directories(
|
||||
${X11_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
endif()
|
||||
add_definitions(-DUNIX)
|
||||
elseif(WIN32)
|
||||
@@ -68,29 +101,27 @@ elseif(WIN32)
|
||||
add_definitions(-DMINGW32)
|
||||
endif()
|
||||
|
||||
# static sub packages in ext
|
||||
set(BUILD_STATIC_LIBS ON)
|
||||
|
||||
#####
|
||||
##### Dependencies
|
||||
#####
|
||||
|
||||
#
|
||||
# Basics
|
||||
#
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_package(GLIB2)
|
||||
macro_log_feature(GLIB2_FOUND "GLib" "GTK general-purpose utility library" "http://www.gtk.org" TRUE)
|
||||
|
||||
find_package(GObject)
|
||||
macro_log_feature(GOBJECT_FOUND "GObject" "GTK object-oriented framework" "http://www.gtk.org" TRUE)
|
||||
|
||||
find_package(PNG REQUIRED)
|
||||
macro_log_feature(PNG_FOUND "PNG" "Portable Network Graphics" "http://www.libpng.org" TRUE)
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
#
|
||||
# GSTREAMER
|
||||
#
|
||||
find_package(GLIB2 REQUIRED)
|
||||
macro_log_feature(GLIB2_FOUND "GLib" "GTK general-purpose utility library" "http://www.gtk.org" TRUE)
|
||||
|
||||
find_package(GObject REQUIRED)
|
||||
macro_log_feature(GOBJECT_FOUND "GObject" "GTK object-oriented framework" "http://www.gtk.org" TRUE)
|
||||
|
||||
find_package(GStreamer 1.0.0 COMPONENTS base)
|
||||
macro_log_feature(GSTREAMER_FOUND "GStreamer"
|
||||
"Open Source Multiplatform Multimedia Framework"
|
||||
@@ -115,6 +146,17 @@ macro_log_feature(GSTREAMER_GL_LIBRARY_FOUND "GStreamerPluginsBase" "GStreamer o
|
||||
# Various preprocessor definitions for GST
|
||||
add_definitions(-DGST_DISABLE_XML -DGST_DISABLE_LOADSAVE)
|
||||
|
||||
include_directories(
|
||||
${GLIB2_INCLUDE_DIR}
|
||||
${GSTREAMER_INCLUDE_DIR}
|
||||
${GSTREAMER_AUDIO_INCLUDE_DIR}
|
||||
${GSTREAMER_VIDEO_INCLUDE_DIR}
|
||||
${GSTREAMER_BASE_INCLUDE_DIR}
|
||||
${GSTREAMER_APP_INCLUDE_DIR}
|
||||
${GSTREAMER_PBUTILS_INCLUDE_DIR}
|
||||
${GSTREAMER_GL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
#
|
||||
# ICU4C
|
||||
#
|
||||
@@ -123,8 +165,17 @@ if (PKG_CONFIG_FOUND)
|
||||
else ()
|
||||
find_package(ICU REQUIRED COMPONENTS i18n io uc)
|
||||
endif ()
|
||||
|
||||
macro_log_feature(ICU_FOUND "ICU" "International Components for Unicode" "http://site.icu-project.org" TRUE)
|
||||
|
||||
include_directories(
|
||||
${ICU_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${ICU_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
#
|
||||
# GLFW3
|
||||
#
|
||||
@@ -133,15 +184,24 @@ if (PKG_CONFIG_FOUND)
|
||||
else ()
|
||||
find_package(glfw3 3.2 REQUIRED)
|
||||
endif()
|
||||
|
||||
macro_log_feature(GLFW3_FOUND "glfw3" "Open Source multi-platform library for OpenGL" "http://www.glfw.org" TRUE)
|
||||
|
||||
include_directories(
|
||||
${GLFW3_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${GLFW3_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
#
|
||||
# GLM
|
||||
#
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(GLM QUIET glm>=0.9.9)
|
||||
else ()
|
||||
find_package(glm QUIET)
|
||||
find_package(glm 0.9.9 QUIET)
|
||||
endif()
|
||||
|
||||
if (GLM_FOUND)
|
||||
@@ -152,13 +212,17 @@ else ()
|
||||
message(STATUS "Compiling 'GLM' OpenGL mathematics https://glm.g-truc.net -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${GLM_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
#
|
||||
# TINY XML 2
|
||||
#
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(TINYXML2 QUIET tinyxml2>=8.0)
|
||||
else ()
|
||||
find_package(tinyxml2 QUIET)
|
||||
find_package(tinyxml2 8.0 QUIET)
|
||||
endif()
|
||||
|
||||
if (TINYXML2_FOUND)
|
||||
@@ -170,6 +234,10 @@ else ()
|
||||
message(STATUS "Compiling 'TinyXML2' from https://github.com/leethomason/tinyxml2.git -- ${TINYXML2_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${TINYXML2_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
#
|
||||
# STB
|
||||
#
|
||||
@@ -186,6 +254,10 @@ else ()
|
||||
message(STATUS "Including 'STB' single-file image and audio processing from https://github.com/nothings/stb -- ${STB_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${STB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
#
|
||||
# Ableton LINK
|
||||
#
|
||||
@@ -198,46 +270,87 @@ else ()
|
||||
message(STATUS "Compiling 'Ableton Link' from https://github.com/Ableton/link -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/link")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${link_HEADERS}
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# FILE DIALOG: use tinyfiledialog for all except Linux
|
||||
#
|
||||
if(UNIX)
|
||||
if (APPLE)
|
||||
set(TINYFD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd)
|
||||
add_library(TINYFD "${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd/tinyfiledialogs.c")
|
||||
message(STATUS "Compiling 'TinyFileDialog' from https://git.code.sf.net/p/tinyfiledialogs/code -- ${TINYFD_INCLUDE_DIR}.")
|
||||
set(TINYFD_LIBRARY TINYFD)
|
||||
endif()
|
||||
else()
|
||||
if(APPLE OR WIN32)
|
||||
set(TINYFD_LIBRARIES TINYFD)
|
||||
set(TINYFD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd)
|
||||
include_directories(
|
||||
${TINYFD_INCLUDE_DIR}
|
||||
)
|
||||
add_library(TINYFD "${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd/tinyfiledialogs.c")
|
||||
message(STATUS "Compiling 'TinyFileDialog' from https://git.code.sf.net/p/tinyfiledialogs/code -- ${TINYFD_INCLUDE_DIR}.")
|
||||
set(TINYFD_LIBRARY TINYFD)
|
||||
endif()
|
||||
|
||||
#
|
||||
# DIRENT (windows only)
|
||||
if(WIN32)
|
||||
set(DIRENT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/Dirent/include)
|
||||
include_directories(
|
||||
${DIRENT_INCLUDE_DIR}
|
||||
)
|
||||
message(STATUS "Including 'Dirent' from https://github.com/tronkko/dirent -- ${DIRENT_INCLUDE_DIR}.")
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# SHMDATA (Unix only)
|
||||
#
|
||||
if(UNIX)
|
||||
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(SHMDATA QUIET shmdata-1.3)
|
||||
endif()
|
||||
|
||||
if(SHMDATA_FOUND)
|
||||
find_library(GSTREAMER_SHMDATA_LIBRARY
|
||||
NAMES gstshmdata
|
||||
HINTS ${SHMDATA_LIBRARY_DIRS}/gstreamer-1.0
|
||||
)
|
||||
if(GSTREAMER_SHMDATA_LIBRARY)
|
||||
add_definitions(-DGSTREAMER_SHMDATA_PLUGIN=\"${GSTREAMER_SHMDATA_LIBRARY}\")
|
||||
endif()
|
||||
|
||||
macro_log_feature(GSTREAMER_SHMDATA_LIBRARY "GStreamerPluginShmdata" "Plugin to share any flow" "https://gitlab.com/sat-mtl/tools/shmdata" FALSE)
|
||||
endif(SHMDATA_FOUND)
|
||||
|
||||
endif(UNIX)
|
||||
|
||||
|
||||
# show message about found libs
|
||||
macro_display_feature_log()
|
||||
|
||||
#####
|
||||
##### Custom built libraries
|
||||
##### Locally built libraries
|
||||
#####
|
||||
|
||||
#
|
||||
# GLAD
|
||||
#
|
||||
set(GLAD_LIBRARIES GLAD)
|
||||
set(GLAD_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include)
|
||||
include_directories(
|
||||
${GLAD_INCLUDE_DIRS}
|
||||
)
|
||||
add_library(GLAD "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/src/glad.c")
|
||||
message(STATUS "Including 'GLAD' Open source multi-language OpenGL loader https://glad.dav1d.de -- ${GLAD_INCLUDE_DIRS}")
|
||||
|
||||
#
|
||||
# DEAR IMGUI
|
||||
#
|
||||
set(IMGUI_LIBRARIES IMGUI IMGUITEXTEDIT)
|
||||
set(IMGUI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui)
|
||||
set(IMGUI_BACKEND_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/examples)
|
||||
include_directories(
|
||||
${IMGUI_INCLUDE_DIRS}
|
||||
${IMGUI_BACKEND_INCLUDE_DIRS}
|
||||
)
|
||||
set(IMGUI_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/imgui.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui//imgui_demo.cpp
|
||||
@@ -249,9 +362,19 @@ set(IMGUI_SRCS
|
||||
add_library(IMGUI "${IMGUI_SRCS}")
|
||||
target_compile_definitions(IMGUI PRIVATE "IMGUI_IMPL_OPENGL_LOADER_GLAD")
|
||||
target_compile_definitions(IMGUI PRIVATE "IMGUI_USE_STB_SPRINTF")
|
||||
set(IMGUI_LIBRARIES IMGUI)
|
||||
message(STATUS "Compiling 'Dear ImGui' from https://github.com/ocornut/imgui.git -- ${IMGUI_INCLUDE_DIRS}")
|
||||
|
||||
#
|
||||
# ImGui Color Text Editor
|
||||
#
|
||||
set(IMGUITEXTEDIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit)
|
||||
include_directories(
|
||||
${IMGUITEXTEDIT_INCLUDE_DIR}
|
||||
)
|
||||
add_library(IMGUITEXTEDIT "${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit/TextEditor.cpp")
|
||||
set_property(TARGET IMGUITEXTEDIT PROPERTY CXX_STANDARD 17)
|
||||
message(STATUS "Compiling 'ImGuiColorTextEdit' from https://github.com/BalazsJako/ImGuiColorTextEdit -- ${IMGUITEXTEDIT_INCLUDE_DIR}")
|
||||
|
||||
|
||||
#
|
||||
# OSCPack
|
||||
@@ -270,200 +393,104 @@ set(OSCPACK_SRCS
|
||||
${OSCPACK_PLATFORM_DIR}/NetworkingUtils.cpp
|
||||
${OSCPACK_PLATFORM_DIR}/UdpSocket.cpp
|
||||
)
|
||||
set(OSCPACK_LIBRARIES OSCPACK)
|
||||
set(OSCPACK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack)
|
||||
include_directories(
|
||||
${OSCPACK_INCLUDE_DIR}
|
||||
)
|
||||
add_library(OSCPACK "${OSCPACK_SRCS}")
|
||||
if(APPLE)
|
||||
target_compile_definitions(OSCPACK
|
||||
PRIVATE
|
||||
_M_X64
|
||||
)
|
||||
endif(APPLE)
|
||||
message(STATUS "Compiling 'OSCPack' from http://www.rossbencina.com/code/oscpack -- ${OSCPACK_INCLUDE_DIR}")
|
||||
|
||||
#
|
||||
# ImGui Color Text Editor
|
||||
#
|
||||
set(IMGUITEXTEDIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit)
|
||||
set(IMGUITEXTEDIT_SRC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit/TextEditor.cpp
|
||||
)
|
||||
message(STATUS "Including 'ImGuiColorTextEdit' from https://github.com/BalazsJako/ImGuiColorTextEdit -- ${IMGUITEXTEDIT_INCLUDE_DIR}")
|
||||
|
||||
##
|
||||
## Fonts
|
||||
##
|
||||
#####
|
||||
##### Ressources
|
||||
#####
|
||||
|
||||
file(GLOB_RECURSE ROBOTO_REGULAR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Roboto-Regular.ttf")
|
||||
set(RSC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rsc)
|
||||
|
||||
#
|
||||
# Fonts
|
||||
#
|
||||
|
||||
file(GLOB_RECURSE ROBOTO_REGULAR "${RSC_DIR}/*/Roboto-Regular.ttf")
|
||||
if(NOT ROBOTO_REGULAR)
|
||||
file(GLOB_RECURSE ROBOTO_REGULAR "/usr/share/fonts/*/Roboto-Regular.ttf")
|
||||
message(STATUS "Copy ${ROBOTO_REGULAR} to ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts")
|
||||
file(COPY ${ROBOTO_REGULAR} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts)
|
||||
set(ROBOTO_REGULAR "./rsc/fonts/Roboto-Regular.ttf")
|
||||
message(STATUS "Copy ${ROBOTO_REGULAR} to ${RSC_DIR}/fonts")
|
||||
file(COPY ${ROBOTO_REGULAR} DESTINATION ${RSC_DIR}/fonts)
|
||||
set(ROBOTO_REGULAR "${RSC_DIR}/fonts/Roboto-Regular.ttf")
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE ROBOTO_BOLD RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Roboto-Bold.ttf")
|
||||
file(GLOB_RECURSE ROBOTO_BOLD "${RSC_DIR}/*/Roboto-Bold.ttf")
|
||||
if(NOT ROBOTO_BOLD)
|
||||
file(GLOB_RECURSE ROBOTO_BOLD "/usr/share/fonts/*/Roboto-Bold.ttf")
|
||||
message(STATUS "Copy ${ROBOTO_BOLD} to ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts")
|
||||
file(COPY ${ROBOTO_BOLD} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts)
|
||||
set(ROBOTO_BOLD "./rsc/fonts/Roboto-Bold.ttf")
|
||||
message(STATUS "Copy ${ROBOTO_BOLD} to ${RSC_DIR}/fonts")
|
||||
file(COPY ${ROBOTO_BOLD} DESTINATION ${RSC_DIR}/fonts)
|
||||
set(ROBOTO_BOLD "${RSC_DIR}/fonts/Roboto-Bold.ttf")
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE ROBOTO_ITALIC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Roboto-Italic.ttf")
|
||||
file(GLOB_RECURSE ROBOTO_ITALIC "${RSC_DIR}/*/Roboto-Italic.ttf")
|
||||
if(NOT ROBOTO_ITALIC)
|
||||
file(GLOB_RECURSE ROBOTO_ITALIC "/usr/share/fonts/*/Roboto-Italic.ttf")
|
||||
message(STATUS "Copy ${ROBOTO_ITALIC} to ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts")
|
||||
file(COPY ${ROBOTO_ITALIC} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts)
|
||||
set(ROBOTO_ITALIC "./rsc/fonts/Roboto-Italic.ttf")
|
||||
message(STATUS "Copy ${ROBOTO_ITALIC} to ${RSC_DIR}/fonts")
|
||||
file(COPY ${ROBOTO_ITALIC} DESTINATION ${RSC_DIR}/fonts)
|
||||
set(ROBOTO_ITALIC "${RSC_DIR}/fonts/Roboto-Italic.ttf")
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE HACK_REGULAR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Hack-Regular.ttf")
|
||||
file(GLOB_RECURSE HACK_REGULAR "${RSC_DIR}/*/Hack-Regular.ttf")
|
||||
if(NOT HACK_REGULAR)
|
||||
file(GLOB_RECURSE HACK_REGULAR "/usr/share/fonts/*/Hack-Regular.ttf")
|
||||
message(STATUS "Copy ${HACK_REGULAR} to ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts")
|
||||
file(COPY ${HACK_REGULAR} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts)
|
||||
set(HACK_REGULAR "./rsc/fonts/Hack-Regular.ttf")
|
||||
message(STATUS "Copy ${HACK_REGULAR} to ${RSC_DIR}/fonts")
|
||||
file(COPY ${HACK_REGULAR} DESTINATION ${RSC_DIR}/fonts)
|
||||
set(HACK_REGULAR "${RSC_DIR}/fonts/Hack-Regular.ttf")
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE AWESOME_SOLID RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "fa-solid-900.ttf")
|
||||
file(GLOB_RECURSE AWESOME_SOLID "${RSC_DIR}/*/fa-solid-900.ttf")
|
||||
if(NOT AWESOME_SOLID)
|
||||
file(GLOB_RECURSE AWESOME_SOLID "/usr/share/fonts/*/fa-solid-900.ttf")
|
||||
message(STATUS "Copy ${AWESOME_SOLID} to ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts")
|
||||
file(COPY ${AWESOME_SOLID} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts)
|
||||
set(AWESOME_SOLID "./rsc/fonts/fa-solid-900.ttf")
|
||||
message(STATUS "Copy ${AWESOME_SOLID} to ${RSC_DIR}/fonts")
|
||||
file(COPY ${AWESOME_SOLID} DESTINATION ${RSC_DIR}/fonts)
|
||||
set(AWESOME_SOLID "${RSC_DIR}/fonts/fa-solid-900.ttf")
|
||||
endif()
|
||||
|
||||
|
||||
file(GLOB_RECURSE AWESOME_REGULAR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "fa-regular-400.ttf")
|
||||
file(GLOB_RECURSE AWESOME_REGULAR "${RSC_DIR}/*/fa-regular-400.ttf")
|
||||
if(NOT AWESOME_REGULAR)
|
||||
file(GLOB_RECURSE AWESOME_REGULAR "/usr/share/fonts/*/fa-regular-400.ttf")
|
||||
message(STATUS "Copy ${AWESOME_REGULAR} to ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts")
|
||||
file(COPY ${AWESOME_REGULAR} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/rsc/fonts)
|
||||
set(AWESOME_REGULAR "./rsc/fonts/fa-regular-400.ttf")
|
||||
message(STATUS "Copy ${AWESOME_REGULAR} to ${RSC_DIR}/fonts")
|
||||
file(COPY ${AWESOME_REGULAR} DESTINATION ${RSC_DIR}/fonts)
|
||||
set(AWESOME_REGULAR "${RSC_DIR}/fonts/fa-regular-400.ttf")
|
||||
endif()
|
||||
|
||||
# All done
|
||||
macro_display_feature_log()
|
||||
|
||||
#####
|
||||
##### Application
|
||||
#####
|
||||
|
||||
# Setup the environment
|
||||
include_directories(
|
||||
${GSTREAMER_INCLUDE_DIR}
|
||||
${GSTREAMER_AUDIO_INCLUDE_DIR}
|
||||
${GSTREAMER_VIDEO_INCLUDE_DIR}
|
||||
${GSTREAMER_BASE_INCLUDE_DIR}
|
||||
${GSTREAMER_APP_INCLUDE_DIR}
|
||||
${GSTREAMER_PBUTILS_INCLUDE_DIR}
|
||||
${GSTREAMER_GL_INCLUDE_DIR}
|
||||
${GLFW3_INCLUDE_DIRS}
|
||||
${ICU_INCLUDE_DIRS}
|
||||
${GLM_INCLUDE_DIRS}
|
||||
${GLIB2_INCLUDE_DIR}
|
||||
${GLAD_INCLUDE_DIRS}
|
||||
${IMGUI_INCLUDE_DIRS}
|
||||
${IMGUI_BACKEND_INCLUDE_DIRS}
|
||||
${IMGUITEXTEDIT_INCLUDE_DIR}
|
||||
${TINYXML2_INCLUDE_DIRS}
|
||||
${TINYFD_INCLUDE_DIR}
|
||||
${STB_INCLUDE_DIRS}
|
||||
${DIRENT_INCLUDE_DIR}
|
||||
${OSCPACK_INCLUDE_DIR}
|
||||
${link_HEADERS}
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${GLFW3_LIBRARY_DIRS}
|
||||
${ICU_LIBRARY_DIRS}
|
||||
"${RSC_DIR}/fonts"
|
||||
)
|
||||
|
||||
|
||||
set(VMIX_BINARY "vimix")
|
||||
set(VMIX_SRCS
|
||||
main.cpp
|
||||
Log.cpp
|
||||
BaseToolkit.cpp
|
||||
Shader.cpp
|
||||
ImageShader.cpp
|
||||
ImageProcessingShader.cpp
|
||||
UpdateCallback.cpp
|
||||
Scene.cpp
|
||||
Primitives.cpp
|
||||
Mesh.cpp
|
||||
Decorations.cpp
|
||||
View.cpp
|
||||
RenderView.cpp
|
||||
GeometryView.cpp
|
||||
MixingView.cpp
|
||||
MixingGroup.cpp
|
||||
LayerView.cpp
|
||||
TextureView.cpp
|
||||
TransitionView.cpp
|
||||
Source.cpp
|
||||
CloneSource.cpp
|
||||
RenderSource.cpp
|
||||
SourceCallback.cpp
|
||||
SourceList.cpp
|
||||
Session.cpp
|
||||
Selection.cpp
|
||||
SessionSource.cpp
|
||||
SessionVisitor.cpp
|
||||
Interpolator.cpp
|
||||
SessionCreator.cpp
|
||||
SessionParser.cpp
|
||||
Mixer.cpp
|
||||
FrameGrabber.cpp
|
||||
Recorder.cpp
|
||||
Streamer.cpp
|
||||
Loopback.cpp
|
||||
Settings.cpp
|
||||
Screenshot.cpp
|
||||
Resource.cpp
|
||||
Timeline.cpp
|
||||
Stream.cpp
|
||||
MediaPlayer.cpp
|
||||
MediaSource.cpp
|
||||
StreamSource.cpp
|
||||
PatternSource.cpp
|
||||
DeviceSource.cpp
|
||||
NetworkSource.cpp
|
||||
MultiFileSource.cpp
|
||||
FrameBuffer.cpp
|
||||
FrameBufferFilter.cpp
|
||||
ImageFilter.cpp
|
||||
DelayFilter.cpp
|
||||
RenderingManager.cpp
|
||||
UserInterfaceManager.cpp
|
||||
PickingVisitor.cpp
|
||||
BoundingBoxVisitor.cpp
|
||||
DrawVisitor.cpp
|
||||
SearchVisitor.cpp
|
||||
ImGuiToolkit.cpp
|
||||
ImGuiVisitor.cpp
|
||||
InfoVisitor.cpp
|
||||
CountVisitor.cpp
|
||||
GstToolkit.cpp
|
||||
GlmToolkit.cpp
|
||||
SystemToolkit.cpp
|
||||
DialogToolkit.cpp
|
||||
tinyxml2Toolkit.cpp
|
||||
NetworkToolkit.cpp
|
||||
Connection.cpp
|
||||
ActionManager.cpp
|
||||
Overlay.cpp
|
||||
Metronome.cpp
|
||||
ControlManager.cpp
|
||||
VideoBroadcast.cpp
|
||||
SrtReceiverSource.cpp
|
||||
MultiFileRecorder.cpp
|
||||
)
|
||||
#
|
||||
# CMake RC module
|
||||
#
|
||||
|
||||
# Include the CMake RC module
|
||||
include(CMakeRC)
|
||||
message(STATUS "Using 'CMakeRC ' from https://github.com/vector-of-bool/cmrc.git -- ${CMAKE_MODULE_PATH}.")
|
||||
|
||||
# set the files to package
|
||||
set(VMIX_RSC_FILES
|
||||
${HACK_REGULAR}
|
||||
${ROBOTO_REGULAR}
|
||||
${ROBOTO_BOLD}
|
||||
${ROBOTO_ITALIC}
|
||||
${HACK_REGULAR}
|
||||
${AWESOME_REGULAR}
|
||||
${AWESOME_SOLID}
|
||||
./rsc/shaders/simple.fs
|
||||
./rsc/shaders/simple.vs
|
||||
./rsc/shaders/texture.fs
|
||||
./rsc/shaders/texture.vs
|
||||
./rsc/shaders/image.fs
|
||||
./rsc/shaders/mask_elipse.fs
|
||||
./rsc/shaders/mask_box.fs
|
||||
@@ -484,6 +511,7 @@ set(VMIX_RSC_FILES
|
||||
./rsc/images/mask_linear_left.png
|
||||
./rsc/images/mask_linear_right.png
|
||||
./rsc/images/vimix_256x256.png
|
||||
./rsc/images/vimix_crow_white.png
|
||||
./rsc/images/icons.dds
|
||||
./rsc/images/gradient_0_cross_linear.png
|
||||
./rsc/images/gradient_1_black_linear.png
|
||||
@@ -517,9 +545,12 @@ set(VMIX_RSC_FILES
|
||||
./rsc/mesh/border_handles_sharp.ply
|
||||
./rsc/mesh/border_handles_menu.ply
|
||||
./rsc/mesh/border_handles_crop.ply
|
||||
./rsc/mesh/border_handles_shape.ply
|
||||
./rsc/mesh/border_handles_lock.ply
|
||||
./rsc/mesh/border_handles_lock_open.ply
|
||||
./rsc/mesh/border_handles_shadow.ply
|
||||
./rsc/mesh/border_handles_arrows.ply
|
||||
./rsc/mesh/border_handles_roundcorner.ply
|
||||
./rsc/mesh/border_large_sharp.ply
|
||||
./rsc/mesh/border_vertical_overlay.ply
|
||||
./rsc/mesh/perspective_layer.ply
|
||||
@@ -532,6 +563,7 @@ set(VMIX_RSC_FILES
|
||||
./rsc/mesh/icon_video.ply
|
||||
./rsc/mesh/icon_image.ply
|
||||
./rsc/mesh/icon_render.ply
|
||||
./rsc/mesh/icon_pattern.ply
|
||||
./rsc/mesh/icon_gear.ply
|
||||
./rsc/mesh/icon_camera.ply
|
||||
./rsc/mesh/icon_share.ply
|
||||
@@ -553,12 +585,14 @@ set(VMIX_RSC_FILES
|
||||
./rsc/mesh/icon_crop.ply
|
||||
./rsc/mesh/icon_eye.ply
|
||||
./rsc/mesh/icon_eye_slash.ply
|
||||
./rsc/mesh/icon_vector_square_slash.ply
|
||||
./rsc/mesh/icon_tv.ply
|
||||
./rsc/mesh/icon_cube.ply
|
||||
./rsc/mesh/icon_sequence.ply
|
||||
./rsc/mesh/icon_receive.ply
|
||||
./rsc/mesh/icon_text.ply
|
||||
./rsc/mesh/icon_magnet.ply
|
||||
./rsc/mesh/h_line.ply
|
||||
./rsc/mesh/h_mark.ply
|
||||
./rsc/mesh/h_mark.ply
|
||||
./rsc/shaders/filters/default.glsl
|
||||
./rsc/shaders/filters/bloom.glsl
|
||||
./rsc/shaders/filters/bokeh.glsl
|
||||
@@ -603,88 +637,15 @@ set(VMIX_RSC_FILES
|
||||
./rsc/shaders/filters/resample_quarter.glsl
|
||||
./rsc/shaders/filters/earlybird.glsl
|
||||
./rsc/shaders/filters/logo.glsl
|
||||
./rsc/shaders/filters/whitebalance.glsl
|
||||
)
|
||||
|
||||
# Include the CMake RC module
|
||||
include(CMakeRC)
|
||||
cmrc_add_resource_library(vmix-resources ALIAS vmix::rc NAMESPACE vmix WHENCE rsc ${VMIX_RSC_FILES})
|
||||
message(STATUS "Using 'CMakeRC ' from https://github.com/vector-of-bool/cmrc.git -- ${CMAKE_MODULE_PATH}.")
|
||||
|
||||
### DEFINE THE TARGET (OS specific)
|
||||
|
||||
IF(APPLE)
|
||||
|
||||
# set icon
|
||||
set(MACOSX_BUNDLE_ICON vimix.icns)
|
||||
set(MACOSX_BUNDLE_ICON_FILE ${CMAKE_SOURCE_DIR}/osx/${MACOSX_BUNDLE_ICON})
|
||||
# set where in the bundle to put the icns file
|
||||
set_source_files_properties(${MACOSX_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
|
||||
# create the application
|
||||
add_executable(${VMIX_BINARY} MACOSX_BUNDLE
|
||||
${VMIX_SRCS}
|
||||
${IMGUITEXTEDIT_SRC}
|
||||
${MACOSX_BUNDLE_ICON_FILE}
|
||||
)
|
||||
|
||||
# set the Info.plist file
|
||||
set(MACOSX_BUNDLE_PLIST_FILE ${CMAKE_SOURCE_DIR}/osx/Info.plist)
|
||||
set_target_properties(${VMIX_BINARY} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MACOSX_BUNDLE_PLIST_FILE})
|
||||
|
||||
set(PLATFORM_LIBS
|
||||
"-framework CoreFoundation"
|
||||
"-framework Appkit"
|
||||
)
|
||||
|
||||
ELSE(APPLE)
|
||||
|
||||
link_directories (${GTK3_LIBRARY_DIRS})
|
||||
|
||||
add_executable(${VMIX_BINARY}
|
||||
${VMIX_SRCS}
|
||||
${IMGUITEXTEDIT_SRC}
|
||||
)
|
||||
|
||||
set(PLATFORM_LIBS
|
||||
GTK::GTK
|
||||
)
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
### COMPILE THE TARGET (all OS)
|
||||
|
||||
set_property(TARGET ${VMIX_BINARY} PROPERTY CXX_STANDARD 17)
|
||||
set_property(TARGET ${VMIX_BINARY} PROPERTY C_STANDARD 11)
|
||||
|
||||
target_compile_definitions(${VMIX_BINARY} PUBLIC "IMGUI_IMPL_OPENGL_LOADER_GLAD")
|
||||
|
||||
target_link_libraries(${VMIX_BINARY} LINK_PRIVATE
|
||||
vmix::rc
|
||||
${GLM_LIBRARIES}
|
||||
GLAD
|
||||
OSCPACK
|
||||
${IMGUI_LIBRARIES}
|
||||
${TINYFD_LIBRARY}
|
||||
${GLFW3_LIBRARIES}
|
||||
${TINYXML2_LIBRARIES}
|
||||
${ICU_LIBRARIES}
|
||||
${CMAKE_DL_LIBS}
|
||||
${GOBJECT_LIBRARIES}
|
||||
${GSTREAMER_LIBRARY}
|
||||
${GSTREAMER_BASE_LIBRARY}
|
||||
${GSTREAMER_APP_LIBRARY}
|
||||
${GSTREAMER_AUDIO_LIBRARY}
|
||||
${GSTREAMER_VIDEO_LIBRARY}
|
||||
${GSTREAMER_PBUTILS_LIBRARY}
|
||||
${GSTREAMER_GL_LIBRARY}
|
||||
Threads::Threads
|
||||
PNG::PNG
|
||||
Ableton::Link
|
||||
${PLATFORM_LIBS}
|
||||
)
|
||||
|
||||
|
||||
### DEFINE THE PACKAGING (all OS)
|
||||
#####
|
||||
##### DEFINE THE PACKAGING (all OS)
|
||||
#####
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "vimix")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vimix\nReal-time video mixing for live performance.")
|
||||
@@ -701,127 +662,15 @@ SET(CPACK_SOURCE_IGNORE_FILES
|
||||
"/\\\\.gitignore$"
|
||||
"/\\\\.gitmodules$"
|
||||
)
|
||||
|
||||
|
||||
# optimize size ?
|
||||
SET(CPACK_STRIP_FILES TRUE)
|
||||
|
||||
### DEFINE THE PACKAGING (OS specific)
|
||||
|
||||
IF(APPLE)
|
||||
|
||||
# Bundle target
|
||||
set(CPACK_GENERATOR DragNDrop)
|
||||
set(CPACK_BINARY_DRAGNDROP ON)
|
||||
|
||||
# OSX cpack info
|
||||
set(CPACK_SYSTEM_NAME "OSX_${CMAKE_OSX_DEPLOYMENT_TARGET}_${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
install(TARGETS ${VMIX_BINARY}
|
||||
CONFIGURATIONS Release RelWithDebInfo
|
||||
BUNDLE DESTINATION . COMPONENT Runtime
|
||||
RUNTIME DESTINATION bin COMPONENT Runtime
|
||||
)
|
||||
|
||||
# create GST plugins directory in Bundle Resources subfolder
|
||||
set(plugin_dest_dir vimix.app/Contents/Resources/)
|
||||
|
||||
### TODO configure auto to find installation dir of gst
|
||||
|
||||
message(STATUS "install gst-plugins ${PKG_GSTREAMER_PLUGIN_DIR}")
|
||||
message(STATUS "install gst-plugins-base ${PKG_GSTREAMER_BASE_PLUGIN_DIR}")
|
||||
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PKG_GSTREAMER_PLUGINS_BAD gstreamer-plugins-bad-${GSTREAMER_ABI_VERSION})
|
||||
set(PKG_GSTREAMER_BAD_PLUGIN_DIR ${PKG_GSTREAMER_PLUGINS_BAD_LIBDIR}/gstreamer-${GSTREAMER_ABI_VERSION})
|
||||
message(STATUS "install gst-plugins-bad ${PKG_GSTREAMER_BAD_PLUGIN_DIR}")
|
||||
endif()
|
||||
|
||||
|
||||
# intall the gst-plugin-scanner program (used by plugins at load time)
|
||||
set(PKG_GSTREAMER_SCANNER "${PKG_GSTREAMER_PREFIX}/libexec/gstreamer-1.0/gst-plugin-scanner")
|
||||
message(STATUS "install gst-plugin-scanner ${PKG_GSTREAMER_SCANNER}")
|
||||
install(FILES "${PKG_GSTREAMER_SCANNER}"
|
||||
DESTINATION "${plugin_dest_dir}"
|
||||
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
COMPONENT Runtime
|
||||
)
|
||||
|
||||
# Install the gst-plugins (all those installed with brew )
|
||||
install(DIRECTORY "${PKG_GSTREAMER_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
|
||||
install(DIRECTORY "${PKG_GSTREAMER_BASE_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
|
||||
install(DIRECTORY "${PKG_GSTREAMER_BAD_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
|
||||
|
||||
install(DIRECTORY "/usr/local/Cellar/gst-plugins-good/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
|
||||
install(DIRECTORY "/usr/local/Cellar/gst-plugins-ugly/1.18.4_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
|
||||
install(DIRECTORY "/usr/local/Cellar/gst-libav/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
|
||||
|
||||
# install locally recompiled & installed gst-plugins (because not included in brew package)
|
||||
install(FILES "/usr/local/lib/gstreamer-1.0/libgstapplemedia.dylib"
|
||||
"/usr/local/lib/gstreamer-1.0/libgstde265.dylib"
|
||||
"/usr/local/lib/gstreamer-1.0/libgstx265.dylib"
|
||||
DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
|
||||
|
||||
# install frei0r plugins (dependencies of gstreamer-1.0/libgstfrei0r.dylib plugin)
|
||||
install(FILES "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/lissajous0r.so"
|
||||
"/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/rgbnoise.so"
|
||||
DESTINATION "${plugin_dest_dir}/frei0r-1" COMPONENT Runtime)
|
||||
|
||||
|
||||
# ICU DATA LIB GST dependency : undocumented and hacked here : seems to work
|
||||
# install(FILES "${ICU_LINK_LIBRARIES}" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
|
||||
install(FILES "/usr/local/Cellar/icu4c/69.1/lib/libicudata.69.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
|
||||
message(STATUS "install ${ICU_LINK_LIBRARIES} from ${ICU_LIBRARY_DIRS}")
|
||||
|
||||
# package runtime fixup bundle
|
||||
set(APPS "\${CMAKE_INSTALL_PREFIX}/vimix.app")
|
||||
install(CODE "
|
||||
file(GLOB_RECURSE GSTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/gstreamer-1.0/*.dylib\")
|
||||
list(APPEND LIBS_PATH \"\${ICU_LIBRARY_DIRS}\")
|
||||
include(BundleUtilities)
|
||||
set(BU_CHMOD_BUNDLE_ITEMS TRUE)
|
||||
fixup_bundle(\"${APPS}\" \"\${GSTPLUGINS}\" \"${LIBS_PATH}\")
|
||||
"
|
||||
COMPONENT Runtime
|
||||
)
|
||||
|
||||
set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
|
||||
set(APPLE_CODESIGN_IDENTITY "" CACHE STRING "")
|
||||
string(LENGTH "${APPLE_CODESIGN_IDENTITY}" APPLE_CODESIGN_IDENTITY_LENGHT)
|
||||
if( ${APPLE_CODESIGN_IDENTITY_LENGHT} LESS 40 )
|
||||
message(STATUS "Not signing bundle. Specify APPLE_CODESIGN_IDENTITY to cmake before running cpack to sign")
|
||||
else()
|
||||
install(CODE "
|
||||
execute_process(COMMAND
|
||||
codesign -vvv --deep --force
|
||||
--entitlements \"${APPLE_CODESIGN_ENTITLEMENTS}\"
|
||||
--sign \"${APPLE_CODESIGN_IDENTITY}\"
|
||||
\"${APPS}\" )
|
||||
"
|
||||
COMPONENT Runtime
|
||||
)
|
||||
endif()
|
||||
|
||||
# # package runtime fixup bundle and codesign
|
||||
# set(BUNDLE_NAME "vimix.app")
|
||||
# set(BUNDLE_LIBS_DIR "${plugin_dest_dir}/gstreamer-1.0")
|
||||
# set(BUNDLE_DIRS "${ICU_LIBRARY_DIRS}")
|
||||
# set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
|
||||
|
||||
# configure_file(cmake/modules/BundleInstall.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" @ONLY)
|
||||
# install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" COMPONENT Runtime)
|
||||
|
||||
ELSE(APPLE)
|
||||
|
||||
install(TARGETS ${VMIX_BINARY}
|
||||
CONFIGURATIONS Release RelWithDebInfo
|
||||
RUNTIME DESTINATION bin COMPONENT Runtime
|
||||
)
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
# Package full name
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_SYSTEM_NAME}")
|
||||
set(CPACK_STRIP_FILES TRUE)
|
||||
|
||||
|
||||
#####
|
||||
##### Build Application
|
||||
#####
|
||||
add_subdirectory(src)
|
||||
|
||||
|
||||
# To Create a package, run "cpack"
|
||||
include(CPack)
|
||||
|
||||
149
DeviceSource.h
@@ -1,149 +0,0 @@
|
||||
#ifndef DEVICESOURCE_H
|
||||
#define DEVICESOURCE_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
#include "GstToolkit.h"
|
||||
#include "StreamSource.h"
|
||||
|
||||
class DeviceSource : public StreamSource
|
||||
{
|
||||
public:
|
||||
DeviceSource(uint64_t id = 0);
|
||||
~DeviceSource();
|
||||
|
||||
// Source interface
|
||||
bool failed() const override;
|
||||
void accept (Visitor& v) override;
|
||||
void setActive (bool on) override;
|
||||
|
||||
// StreamSource interface
|
||||
Stream *stream() const override { return stream_; }
|
||||
|
||||
// specific interface
|
||||
void setDevice(const std::string &devicename);
|
||||
inline std::string device() const { return device_; }
|
||||
void unplug() { unplugged_ = true; }
|
||||
|
||||
glm::ivec2 icon() const override;
|
||||
std::string info() const override;
|
||||
|
||||
private:
|
||||
std::string device_;
|
||||
std::atomic<bool> unplugged_;
|
||||
void unsetDevice();
|
||||
};
|
||||
|
||||
struct DeviceConfig {
|
||||
gint width;
|
||||
gint height;
|
||||
gint fps_numerator;
|
||||
gint fps_denominator;
|
||||
std::string stream;
|
||||
std::string format;
|
||||
|
||||
DeviceConfig() {
|
||||
width = 0;
|
||||
height = 0;
|
||||
fps_numerator = 30;
|
||||
fps_denominator = 1;
|
||||
stream = "";
|
||||
format = "";
|
||||
}
|
||||
|
||||
inline DeviceConfig& operator = (const DeviceConfig& b)
|
||||
{
|
||||
if (this != &b) {
|
||||
this->width = b.width;
|
||||
this->height = b.height;
|
||||
this->fps_numerator = b.fps_numerator;
|
||||
this->fps_denominator = b.fps_denominator;
|
||||
this->stream = b.stream;
|
||||
this->format = b.format;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator < (const DeviceConfig b) const
|
||||
{
|
||||
int formatscore = this->format.find("R") != std::string::npos ? 2 : 1; // best score for RGBx
|
||||
int b_formatscore = b.format.find("R") != std::string::npos ? 2 : 1;
|
||||
float fps = static_cast<float>(this->fps_numerator) / static_cast<float>(this->fps_denominator);
|
||||
float b_fps = static_cast<float>(b.fps_numerator) / static_cast<float>(b.fps_denominator);
|
||||
return ( fps * static_cast<float>(this->height * formatscore) < b_fps * static_cast<float>(b.height * b_formatscore));
|
||||
}
|
||||
};
|
||||
|
||||
struct better_device_comparator
|
||||
{
|
||||
inline bool operator () (const DeviceConfig a, const DeviceConfig b) const
|
||||
{
|
||||
return (a < b);
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::set<DeviceConfig, better_device_comparator> DeviceConfigSet;
|
||||
|
||||
struct DeviceHandle {
|
||||
|
||||
std::string name;
|
||||
std::string pipeline;
|
||||
DeviceConfigSet configs;
|
||||
|
||||
Stream *stream;
|
||||
std::list<DeviceSource *> connected_sources;
|
||||
|
||||
DeviceHandle() {
|
||||
stream = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class Device
|
||||
{
|
||||
friend class DeviceSource;
|
||||
|
||||
Device();
|
||||
Device(Device const& copy) = delete;
|
||||
Device& operator=(Device const& copy) = delete;
|
||||
|
||||
public:
|
||||
|
||||
static Device& manager()
|
||||
{
|
||||
// The only instance
|
||||
static Device _instance;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
int numDevices () ;
|
||||
std::string name (int index) ;
|
||||
std::string description (int index) ;
|
||||
DeviceConfigSet config (int index) ;
|
||||
|
||||
int index (const std::string &device);
|
||||
bool exists (const std::string &device) ;
|
||||
|
||||
static gboolean callback_device_monitor (GstBus *, GstMessage *, gpointer);
|
||||
static DeviceConfigSet getDeviceConfigs(const std::string &src_description);
|
||||
|
||||
private:
|
||||
|
||||
static void launchMonitoring(Device *d);
|
||||
static bool initialized();
|
||||
void remove(GstDevice *device);
|
||||
void add(GstDevice *device);
|
||||
|
||||
std::mutex access_;
|
||||
std::vector< DeviceHandle > handles_;
|
||||
|
||||
GstDeviceMonitor *monitor_;
|
||||
std::condition_variable monitor_initialization_;
|
||||
bool monitor_initialized_;
|
||||
bool monitor_unplug_event_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // DEVICESOURCE_H
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef DRAWVISITOR_H
|
||||
#define DRAWVISITOR_H
|
||||
|
||||
#include "GlmToolkit.h"
|
||||
#include "Visitor.h"
|
||||
|
||||
class DrawVisitor : public Visitor
|
||||
{
|
||||
glm::mat4 modelview_;
|
||||
glm::mat4 projection_;
|
||||
std::vector<Node *> targets_;
|
||||
bool force_;
|
||||
int num_duplicat_;
|
||||
glm::mat4 transform_duplicat_;
|
||||
|
||||
public:
|
||||
DrawVisitor(Node *nodetodraw, glm::mat4 projection, bool force = false);
|
||||
DrawVisitor(const std::vector<Node *> &nodestodraw, glm::mat4 projection, bool force = false);
|
||||
|
||||
void loop(int num, glm::mat4 transform);
|
||||
|
||||
void visit(Scene& n) override;
|
||||
void visit(Node& n) override;
|
||||
void visit(Primitive& ) override;
|
||||
void visit(Group& n) override;
|
||||
void visit(Switch& n) override;
|
||||
};
|
||||
|
||||
#endif // DRAWVISITOR_H
|
||||
1232
FileDialog.cpp
112
FileDialog.h
@@ -1,112 +0,0 @@
|
||||
#ifndef __IMGUI_FILE_DIALOG_H_
|
||||
#define __IMGUI_FILE_DIALOG_H_
|
||||
|
||||
#include "imgui.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <future>
|
||||
#include <functional>
|
||||
|
||||
#define MAX_FILE_DIALOG_NAME_BUFFER 1024
|
||||
|
||||
struct FileInfoStruct
|
||||
{
|
||||
char type = ' ';
|
||||
std::string filePath;
|
||||
std::string fileName;
|
||||
std::string ext;
|
||||
};
|
||||
|
||||
class FileDialog
|
||||
{
|
||||
private:
|
||||
std::vector<FileInfoStruct> m_FileList;
|
||||
std::map<std::string, ImVec4> m_FilterColor;
|
||||
std::string m_SelectedFileName;
|
||||
std::string m_SelectedExt;
|
||||
std::string m_CurrentPath;
|
||||
std::vector<std::string> m_CurrentPath_Decomposition;
|
||||
std::string m_Name;
|
||||
bool m_ShowDialog;
|
||||
bool m_ShowDrives;
|
||||
|
||||
public:
|
||||
static char FileNameBuffer[MAX_FILE_DIALOG_NAME_BUFFER];
|
||||
static char DirectoryNameBuffer[MAX_FILE_DIALOG_NAME_BUFFER];
|
||||
static char SearchBuffer[MAX_FILE_DIALOG_NAME_BUFFER];
|
||||
static int FilterIndex;
|
||||
bool IsOk;
|
||||
bool m_AnyWindowsHovered;
|
||||
bool m_CreateDirectoryMode;
|
||||
|
||||
private:
|
||||
std::string dlg_key;
|
||||
std::string dlg_name;
|
||||
const char *dlg_filters;
|
||||
std::string dlg_path;
|
||||
std::string dlg_defaultFileName;
|
||||
std::string dlg_defaultExt;
|
||||
std::function<void(std::string, bool*)> dlg_optionsPane;
|
||||
size_t dlg_optionsPaneWidth;
|
||||
std::string searchTag;
|
||||
std::string dlg_userString;
|
||||
|
||||
public:
|
||||
static FileDialog* Instance()
|
||||
{
|
||||
static FileDialog *_instance = new FileDialog();
|
||||
return _instance;
|
||||
}
|
||||
|
||||
static void RenderCurrent();
|
||||
// Open an Open File dialog for TEXT file
|
||||
static void SetCurrentOpenText();
|
||||
// Open an Open File dialog for IMAGE file
|
||||
static void SetCurrentOpenImage();
|
||||
// Open an Open File dialog for MEDIA file
|
||||
static void SetCurrentOpenMedia();
|
||||
|
||||
protected:
|
||||
|
||||
FileDialog(); // Prevent construction
|
||||
FileDialog(const FileDialog&) = delete; // Prevent construction by copying
|
||||
FileDialog& operator =(const FileDialog&) = delete; // Prevent assignment
|
||||
~FileDialog(); // Prevent unwanted destruction
|
||||
|
||||
public:
|
||||
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
|
||||
const std::string& vPath, const std::string& vDefaultFileName,
|
||||
std::function<void(std::string, bool*)> vOptionsPane, size_t vOptionsPaneWidth = 250, const std::string& vUserString = "");
|
||||
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
|
||||
const std::string& vDefaultFileName,
|
||||
std::function<void(std::string, bool*)> vOptionsPane, size_t vOptionsPaneWidth = 250, const std::string& vUserString = "");
|
||||
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
|
||||
const std::string& vPath, const std::string& vDefaultFileName, const std::string& vUserString = "");
|
||||
void OpenDialog(const std::string& vKey, const char* vName, const char* vFilters,
|
||||
const std::string& vFilePathName, const std::string& vUserString = "");
|
||||
|
||||
void CloseDialog(const std::string& vKey);
|
||||
bool Render(const std::string& vKey, ImVec2 geometry);
|
||||
std::string GetFilepathName();
|
||||
std::string GetCurrentPath();
|
||||
std::string GetCurrentFileName();
|
||||
std::string GetCurrentFilter();
|
||||
std::string GetUserString();
|
||||
|
||||
void SetFilterColor(const std::string &vFilter, ImVec4 vColor);
|
||||
bool GetFilterColor(const std::string &vFilter, ImVec4 *vColor);
|
||||
void ClearFilterColor();
|
||||
|
||||
private:
|
||||
void SetPath(const std::string& vPath);
|
||||
void ScanDir(const std::string& vPath);
|
||||
void SetCurrentDir(const std::string& vPath);
|
||||
bool CreateDir(const std::string& vPath);
|
||||
void ComposeNewPath(std::vector<std::string>::iterator vIter);
|
||||
void GetDrives();
|
||||
};
|
||||
|
||||
|
||||
#endif // __IMGUI_FILE_DIALOG_H_
|
||||
@@ -1,103 +0,0 @@
|
||||
/*
|
||||
* This file is part of vimix - Live video mixer
|
||||
*
|
||||
* **Copyright** (C) 2020-2021 Bruno Herbelin <bruno.herbelin@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "Log.h"
|
||||
#include "Scene.h"
|
||||
#include "GarbageVisitor.h"
|
||||
|
||||
|
||||
GarbageVisitor::GarbageVisitor(Node *nodetocollect) : Visitor()
|
||||
{
|
||||
targets_.push_front(nodetocollect);
|
||||
current_ = nullptr;
|
||||
found_ = false;
|
||||
}
|
||||
|
||||
GarbageVisitor::GarbageVisitor(Source *sourcetocollect) : Visitor()
|
||||
{
|
||||
targets_.push_front(sourcetocollect->group(View::MIXING));
|
||||
targets_.push_front(sourcetocollect->group(View::GEOMETRY));
|
||||
targets_.push_front(sourcetocollect->group(View::RENDERING));
|
||||
current_ = nullptr;
|
||||
found_ = false;
|
||||
}
|
||||
|
||||
|
||||
void GarbageVisitor::visit(Node &n)
|
||||
{
|
||||
// found the target
|
||||
// if (n.id() == target_->id())
|
||||
// if ( &n == target_ )
|
||||
if ( std::count(targets_.begin(), targets_.end(), &n) )
|
||||
{
|
||||
// end recursive
|
||||
found_ = true;
|
||||
|
||||
// take the node out of the Tree
|
||||
if (current_)
|
||||
current_->detach(&n);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GarbageVisitor::~GarbageVisitor()
|
||||
{
|
||||
// actually delete the Node
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GarbageVisitor::visit(Group &n)
|
||||
{
|
||||
// no need to go further if the node was found (or is this group)
|
||||
if (found_)
|
||||
return;
|
||||
|
||||
// current group
|
||||
current_ = &n;
|
||||
|
||||
// loop over members of a group
|
||||
// and stop when found
|
||||
for (NodeSet::iterator node = n.begin(); !found_ && node != n.end(); ++node) {
|
||||
// visit the child node
|
||||
(*node)->accept(*this);
|
||||
// un-stack recursive browsing
|
||||
current_ = &n;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GarbageVisitor::visit(Scene &n)
|
||||
{
|
||||
n.root()->accept(*this);
|
||||
}
|
||||
|
||||
void GarbageVisitor::visit(Switch &n)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GarbageVisitor::visit(Primitive &n)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef GARBAGEVISITOR_H
|
||||
#define GARBAGEVISITOR_H
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "Source.h"
|
||||
#include "Visitor.h"
|
||||
|
||||
|
||||
class GarbageVisitor : public Visitor
|
||||
{
|
||||
Group *current_;
|
||||
std::list<Node *> targets_;
|
||||
bool found_;
|
||||
|
||||
public:
|
||||
GarbageVisitor(Source *sourcetocollect);
|
||||
GarbageVisitor(Node *nodetocollect);
|
||||
~GarbageVisitor();
|
||||
|
||||
void visit(Scene& n) override;
|
||||
void visit(Node& n) override;
|
||||
void visit(Group& n) override;
|
||||
void visit(Switch& n) override;
|
||||
void visit(Primitive& n) override;
|
||||
|
||||
};
|
||||
|
||||
#endif // GARBAGEVISITOR_H
|
||||
1148
GeometryView.cpp
35
GstToolkit.h
@@ -1,35 +0,0 @@
|
||||
#ifndef __GSTGUI_TOOLKIT_H_
|
||||
#define __GSTGUI_TOOLKIT_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
namespace GstToolkit
|
||||
{
|
||||
|
||||
typedef enum {
|
||||
TIME_STRING_FIXED = 0,
|
||||
TIME_STRING_ADJUSTED,
|
||||
TIME_STRING_MINIMAL,
|
||||
TIME_STRING_READABLE
|
||||
} time_string_mode;
|
||||
|
||||
std::string time_to_string(guint64 t, time_string_mode m = TIME_STRING_ADJUSTED);
|
||||
std::string filename_to_uri(std::string filename);
|
||||
|
||||
std::string gst_version();
|
||||
|
||||
std::list<std::string> all_plugins();
|
||||
std::list<std::string> enable_gpu_decoding_plugins(bool enable = true);
|
||||
std::string used_gpu_decoding_plugins(GstElement *gstbin);
|
||||
std::string used_decoding_plugins(GstElement *gstbin);
|
||||
|
||||
std::list<std::string> all_plugin_features(std::string pluginname);
|
||||
bool has_feature (std::string name);
|
||||
bool enable_feature (std::string name, bool enable);
|
||||
|
||||
}
|
||||
|
||||
#endif // __GSTGUI_TOOLKIT_H_
|
||||
1267
ImGuiVisitor.cpp
399
InfoVisitor.cpp
@@ -1,399 +0,0 @@
|
||||
/*
|
||||
* This file is part of vimix - video live mixer
|
||||
*
|
||||
* **Copyright** (C) 2019-2022 Bruno Herbelin <bruno.herbelin@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <glm/gtc/constants.hpp>
|
||||
#include <glm/gtc/matrix_access.hpp>
|
||||
|
||||
#include <tinyxml2.h>
|
||||
#include "tinyxml2Toolkit.h"
|
||||
|
||||
#include "defines.h"
|
||||
#include "Log.h"
|
||||
#include "Scene.h"
|
||||
#include "Primitives.h"
|
||||
#include "ImageShader.h"
|
||||
#include "ImageProcessingShader.h"
|
||||
#include "MediaPlayer.h"
|
||||
#include "MediaSource.h"
|
||||
#include "CloneSource.h"
|
||||
#include "RenderSource.h"
|
||||
#include "SessionSource.h"
|
||||
#include "PatternSource.h"
|
||||
#include "DeviceSource.h"
|
||||
#include "NetworkSource.h"
|
||||
#include "SrtReceiverSource.h"
|
||||
#include "MultiFileSource.h"
|
||||
#include "SessionCreator.h"
|
||||
#include "SessionVisitor.h"
|
||||
#include "Settings.h"
|
||||
#include "Mixer.h"
|
||||
#include "ActionManager.h"
|
||||
#include "BaseToolkit.h"
|
||||
#include "UserInterfaceManager.h"
|
||||
#include "SystemToolkit.h"
|
||||
|
||||
#include "InfoVisitor.h"
|
||||
|
||||
|
||||
|
||||
InfoVisitor::InfoVisitor() : brief_(true), current_id_(0)
|
||||
{
|
||||
}
|
||||
|
||||
void InfoVisitor::visit(Node &n)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << std::fixed << std::setprecision(1);
|
||||
oss << "Pos ( " << n.translation_.x << ", " << n.translation_.y << " )" << std::endl;
|
||||
oss << "Scale ( " << n.scale_.x << ", " << n.scale_.y << " )" << std::endl;
|
||||
oss << "Angle " << std::setprecision(2) << n.rotation_.z * 180.f / M_PI << "\u00B0" << std::endl;
|
||||
|
||||
if (!brief_) {
|
||||
oss << n.crop_.x << ", " << n.crop_.y << " Crop" << std::endl;
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit(Group &)
|
||||
{
|
||||
}
|
||||
|
||||
void InfoVisitor::visit(Switch &)
|
||||
{
|
||||
}
|
||||
|
||||
void InfoVisitor::visit(Scene &)
|
||||
{
|
||||
}
|
||||
|
||||
void InfoVisitor::visit(Primitive &)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void InfoVisitor::visit(MediaPlayer &mp)
|
||||
{
|
||||
// do not ask twice
|
||||
if (current_id_ == mp.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
if (brief_) {
|
||||
oss << SystemToolkit::filename(mp.filename()) << std::endl;
|
||||
oss << mp.media().codec_name.substr(0, mp.media().codec_name.find_first_of(" (,")) << ", ";
|
||||
oss << mp.width() << " x " << mp.height();
|
||||
if (!mp.isImage())
|
||||
oss << ", " << std::fixed << std::setprecision(0) << mp.frameRate() << "fps";
|
||||
}
|
||||
else {
|
||||
oss << mp.filename() << std::endl;
|
||||
oss << mp.media().codec_name << std::endl;
|
||||
oss << mp.width() << " x " << mp.height() ;
|
||||
if (!mp.isImage())
|
||||
oss << ", " << std::fixed << std::setprecision(1) << mp.frameRate() << " fps";
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
|
||||
// remember (except if codec was not identified yet)
|
||||
if ( !mp.media().codec_name.empty() )
|
||||
current_id_ = mp.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit(Stream &n)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
if (brief_) {
|
||||
oss << BaseToolkit::splitted(n.description(), '!').front();
|
||||
}
|
||||
else {
|
||||
oss << n.description();
|
||||
}
|
||||
information_ = oss.str();
|
||||
}
|
||||
|
||||
|
||||
void InfoVisitor::visit (MediaSource& s)
|
||||
{
|
||||
s.mediaplayer()->accept(*this);
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (SessionFileSource& s)
|
||||
{
|
||||
if (current_id_ == s.id() || s.session() == nullptr)
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
if (s.session()->frame()){
|
||||
uint N = s.session()->size();
|
||||
std::string numsource = std::to_string(N) + " source" + (N>1 ? "s" : "");
|
||||
uint T = s.session()->numSources();
|
||||
if (T>N)
|
||||
numsource += " (" + std::to_string(T) + " total)";
|
||||
if (brief_) {
|
||||
oss << SystemToolkit::filename(s.path()) << std::endl;
|
||||
oss << numsource << ", " ;
|
||||
oss << "RGB, " << s.session()->frame()->width() << " x " << s.session()->frame()->height();
|
||||
}
|
||||
else {
|
||||
oss << s.path() << std::endl;
|
||||
oss << "MIX session (" << numsource << "), RGB" << std::endl;
|
||||
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
|
||||
}
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (SessionGroupSource& s)
|
||||
{
|
||||
if (current_id_ == s.id() || s.session() == nullptr)
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
|
||||
if (!brief_) oss << "Group of ";
|
||||
uint N = s.session()->size();
|
||||
oss << N << " source" << (N>1 ? "s" : "");
|
||||
uint T = s.session()->numSources();
|
||||
if (T>N)
|
||||
oss << " (" << std::to_string(T) << " total)";
|
||||
|
||||
if (s.session()->frame()){
|
||||
if (brief_) {
|
||||
oss << ", RGB, " << s.session()->frame()->width() << " x " << s.session()->frame()->height();
|
||||
}
|
||||
else {
|
||||
oss << std::endl;
|
||||
oss << "RGB" << std::endl;
|
||||
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
|
||||
}
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (RenderSource& s)
|
||||
{
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
|
||||
if (s.frame()){
|
||||
if (brief_) {
|
||||
oss << (s.frame()->flags() & FrameBuffer::FrameBuffer_alpha ? "RGBA, " : "RGB, ");
|
||||
oss << s.frame()->width() << " x " << s.frame()->height();
|
||||
}
|
||||
else {
|
||||
oss << "Rendering Output (";
|
||||
oss << RenderSource::rendering_provenance_label[s.renderingProvenance()] << ") " << std::endl;
|
||||
oss << (s.frame()->flags() & FrameBuffer::FrameBuffer_alpha ? "RGBA" : "RGB") << std::endl;
|
||||
oss << s.frame()->width() << " x " << s.frame()->height();
|
||||
}
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (CloneSource& s)
|
||||
{
|
||||
if (current_id_ == s.id() || s.origin() == nullptr)
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
|
||||
if (s.frame()){
|
||||
if (brief_) {
|
||||
oss << (s.frame()->flags() & FrameBuffer::FrameBuffer_alpha ? "RGBA, " : "RGB, ");
|
||||
oss << s.frame()->width() << " x " << s.frame()->height();
|
||||
}
|
||||
else {
|
||||
if (s.origin())
|
||||
oss << "Clone of '" << s.origin()->name() << "' " << std::endl;
|
||||
oss << (s.frame()->flags() & FrameBuffer::FrameBuffer_alpha ? "RGBA, " : "RGB, ");
|
||||
oss << FrameBufferFilter::type_label[s.filter()->type()] << " filter" << std::endl;
|
||||
oss << s.frame()->width() << " x " << s.frame()->height();
|
||||
}
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (PatternSource& s)
|
||||
{
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
if (s.pattern()) {
|
||||
if (brief_) {
|
||||
oss << "RGBA, " << s.pattern()->width() << " x " << s.pattern()->height();
|
||||
}
|
||||
else {
|
||||
oss << Pattern::get(s.pattern()->type()).label << " pattern" << std::endl;
|
||||
oss << "RGBA" << std::endl;
|
||||
oss << s.pattern()->width() << " x " << s.pattern()->height();
|
||||
}
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (DeviceSource& s)
|
||||
{
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
|
||||
DeviceConfigSet confs = Device::manager().config( Device::manager().index(s.device()));
|
||||
if ( !confs.empty()) {
|
||||
DeviceConfig best = *confs.rbegin();
|
||||
float fps = static_cast<float>(best.fps_numerator) / static_cast<float>(best.fps_denominator);
|
||||
|
||||
if (brief_) {
|
||||
oss << best.stream << " " << best.format << ", ";
|
||||
oss << best.width << " x " << best.height << ", ";
|
||||
oss << std::fixed << std::setprecision(0) << fps << "fps";
|
||||
}
|
||||
else {
|
||||
oss << s.device() << std::endl;
|
||||
oss << Device::manager().description( Device::manager().index(s.device()));
|
||||
oss << ", " << best.stream << " " << best.format << std::endl;
|
||||
oss << best.width << " x " << best.height << ", ";
|
||||
oss << std::fixed << std::setprecision(1) << fps << " fps";
|
||||
}
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (NetworkSource& s)
|
||||
{
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
NetworkStream *ns = s.networkStream();
|
||||
|
||||
std::ostringstream oss;
|
||||
if (brief_) {
|
||||
oss << NetworkToolkit::stream_protocol_label[ns->protocol()] << std::endl;
|
||||
oss << "IP " << ns->serverAddress() << std::endl;
|
||||
oss << ns->resolution().x << " x " << ns->resolution().y;
|
||||
}
|
||||
else {
|
||||
oss << s.connection() << std::endl;
|
||||
oss << NetworkToolkit::stream_protocol_label[ns->protocol()];
|
||||
oss << " shared from IP " << ns->serverAddress() << std::endl;
|
||||
oss << ns->resolution().x << " x " << ns->resolution().y;
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
|
||||
void InfoVisitor::visit (MultiFileSource& s)
|
||||
{
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
if (brief_) {
|
||||
oss << s.sequence().max - s.sequence().min + 1 << " images [";
|
||||
oss << s.sequence().min << " - " << s.sequence().max << "]" << std::endl;
|
||||
oss << s.sequence().codec << ", ";
|
||||
oss << s.sequence().width << " x " << s.sequence().height;
|
||||
}
|
||||
else {
|
||||
oss << s.sequence().location << " [";
|
||||
oss << s.sequence().min << " - " << s.sequence().max << "]" << std::endl;
|
||||
oss << s.sequence().max - s.sequence().min + 1 << " ";
|
||||
oss << s.sequence().codec << " images" << std::endl;
|
||||
oss << s.sequence().width << " x " << s.sequence().height << ", " << s.framerate() << " fps";
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (GenericStreamSource& s)
|
||||
{
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
if (s.stream()) {
|
||||
std::string src_element = s.gstElements().front();
|
||||
|
||||
if (brief_) {
|
||||
src_element = src_element.substr(0, src_element.find(" "));
|
||||
oss << "gstreamer '" << src_element << "'" << std::endl;
|
||||
oss << "RGBA, " << s.stream()->width() << " x " << s.stream()->height();
|
||||
}
|
||||
else {
|
||||
oss << "gstreamer '" << src_element << "'" << std::endl;
|
||||
oss << "RGBA" << std::endl;
|
||||
oss << s.stream()->width() << " x " << s.stream()->height();
|
||||
}
|
||||
}
|
||||
else
|
||||
oss << "Undefined";
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
|
||||
void InfoVisitor::visit (SrtReceiverSource& s)
|
||||
{
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
|
||||
if (s.stream()) {
|
||||
if (brief_)
|
||||
oss << s.uri() << std::endl;
|
||||
else {
|
||||
oss << "SRT Receiver " << s.uri() << std::endl;
|
||||
oss << "H264 (" << s.stream()->decoderName() << ")" << std::endl;
|
||||
oss << s.stream()->width() << " x " << s.stream()->height();
|
||||
}
|
||||
}
|
||||
else
|
||||
oss << "Undefined";
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
}
|
||||
31
Loopback.h
@@ -1,31 +0,0 @@
|
||||
#ifndef LOOPBACK_H
|
||||
#define LOOPBACK_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <gst/pbutils/pbutils.h>
|
||||
#include <gst/app/gstappsrc.h>
|
||||
|
||||
#include "FrameGrabber.h"
|
||||
|
||||
|
||||
class Loopback : public FrameGrabber
|
||||
{
|
||||
static std::string system_loopback_pipeline;
|
||||
static std::string system_loopback_name;
|
||||
static bool system_loopback_initialized;
|
||||
|
||||
std::string init(GstCaps *caps) override;
|
||||
void terminate() override;
|
||||
|
||||
public:
|
||||
|
||||
Loopback();
|
||||
|
||||
static bool systemLoopbackInitialized();
|
||||
static bool initializeSystemLoopback();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // LOOPBACK_H
|
||||
105
README.md
@@ -1,5 +1,8 @@
|
||||
# vimix
|
||||
Live Video Mixing
|
||||
__Live Video Mixing__
|
||||
|
||||
<img src=docs/vimix_screenshot.png width="800">
|
||||
|
||||
|
||||
vimix performs graphical mixing and blending of several movie clips and
|
||||
computer generated graphics, with image processing effects in real-time.
|
||||
@@ -8,7 +11,7 @@ Its intuitive and hands-on user interface gives direct control on image opacity
|
||||
shape for producing live graphics during concerts and VJ-ing sessions.
|
||||
|
||||
The output image is typically projected full-screen on an external
|
||||
monitor or a projector, but can be streamed live (SRT) or recorded (no audio).
|
||||
monitor or a projector, and can be streamed live (SRT, Shmdata) or recorded (without audio).
|
||||
|
||||
vimix is the successor for GLMixer - https://sourceforge.net/projects/glmixer/
|
||||
|
||||
@@ -17,47 +20,80 @@ vimix is the successor for GLMixer - https://sourceforge.net/projects/glmixer/
|
||||
GPL-3.0-or-later
|
||||
See [LICENSE](https://github.com/brunoherbelin/vimix/blob/master/LICENSE)
|
||||
|
||||
# Install
|
||||
# Install vimix
|
||||
|
||||
Check the [Quick Installation Guide](https://github.com/brunoherbelin/vimix/wiki/Quick-Installation-Guide)
|
||||
|
||||
### Linux
|
||||
|
||||
Download and install a release package from https://snapcraft.io/vimix
|
||||
Download and install a released [flatpak package](https://flathub.org/apps/details/io.github.brunoherbelin.Vimix)
|
||||
|
||||
$ snap install vimix
|
||||
flatpak install --user vimix
|
||||
|
||||
NB: You'll need to setup the snap permissions.
|
||||
NB: Building your flatpak package is an option for testing the latest beta version from git ; instructions are [here](https://github.com/brunoherbelin/vimix/tree/master/flatpak).
|
||||
|
||||
|
||||
Download and install a released [snap package](https://snapcraft.io/vimix) (slower release frequency)
|
||||
|
||||
snap install vimix
|
||||
|
||||
Install the stable debian package (slower release frequency)
|
||||
|
||||
sudo apt install vimix
|
||||
|
||||
### Mac OSX
|
||||
|
||||
Download and open a release package from https://github.com/brunoherbelin/vimix/releases
|
||||
|
||||
NB: You'll need to accept the exception in OSX security preference.
|
||||
|
||||
# Build vimix
|
||||
|
||||
## Clone
|
||||
|
||||
$ git clone --recursive https://github.com/brunoherbelin/vimix.git
|
||||
git clone --recursive https://github.com/brunoherbelin/vimix.git
|
||||
|
||||
This will create the directory 'vimix', download the latest version of vimix code,
|
||||
and (recursively) clone all the internal git dependencies.
|
||||
|
||||
To only update a cloned git copy:
|
||||
|
||||
$ git pull
|
||||
|
||||
## Compile
|
||||
|
||||
First time after git clone:
|
||||
|
||||
$ mkdir vimix-build
|
||||
$ cd vimix-build
|
||||
$ cmake -DCMAKE_BUILD_TYPE=Release ../vimix
|
||||
mkdir vimix-build
|
||||
cd vimix-build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ../vimix
|
||||
cmake --build .
|
||||
|
||||
Compile (or re-compile after pull):
|
||||
This will create the directory 'vimix-build', configure the program for build, and compile vimix.
|
||||
If successful, the compilation will have produced the executable `vimix` in the `src` directory.
|
||||
You can run vimix with `./src/vimix` :
|
||||
|
||||
...
|
||||
[100%] Built target vimix
|
||||
./src/vimix
|
||||
|
||||
$ cmake --build .
|
||||
## Update clone and re-compile
|
||||
|
||||
### Dependencies
|
||||
Run these commands from the `vimix-build` directory if you did 'Clone' and 'Compile' previously and only want to get the latest update and rebuild.
|
||||
|
||||
git -C ../vimix/ pull
|
||||
cmake --build .
|
||||
|
||||
This will pull the latest commit from git and recompile.
|
||||
|
||||
## Try the Beta branch
|
||||
|
||||
Run this commands from the `vimix-build` directory before runing 'Update clone and re-compile above'
|
||||
|
||||
git -C ../vimix/ checkout beta
|
||||
|
||||
It should say;
|
||||
|
||||
branch 'beta' set up to track 'origin/beta'.
|
||||
Switched to a new branch 'beta'
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Compiling tools:**
|
||||
|
||||
@@ -79,38 +115,21 @@ Optionnal:
|
||||
- stb
|
||||
- TinyXML2
|
||||
- AbletonLink
|
||||
- Shmdata
|
||||
|
||||
#### Install Dependencies
|
||||
### Install Dependencies
|
||||
|
||||
**Ubuntu**
|
||||
#### Ubuntu
|
||||
|
||||
$ apt-get install build-essential cmake libpng-dev libglfw3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav libicu-dev libgtk-3-dev
|
||||
apt-get install build-essential cmake libpng-dev libglfw3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav libicu-dev libgtk-3-dev
|
||||
|
||||
Optionnal:
|
||||
|
||||
$ apt-get install libglm-dev libstb-dev libtinyxml2-dev ableton-link-dev
|
||||
|
||||
**OSX with Brew**
|
||||
|
||||
$ brew install cmake libpng glfw gstreamer gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-ugly icu4c
|
||||
|
||||
|
||||
#### Generate snap
|
||||
|
||||
To generate the snap (from vimix directory):
|
||||
|
||||
$ snapcraft
|
||||
apt-get install libglm-dev libstb-dev libtinyxml2-dev ableton-link-dev
|
||||
|
||||
To install the locally created snap:
|
||||
|
||||
$ snap install --dangerous vimix_0.5_amd64.snap
|
||||
|
||||
### Memcheck
|
||||
+ Follow the instructions to [install Shmdata](https://gitlab.com/sat-mtl/tools/shmdata).
|
||||
|
||||
To generate memory usage plots in [massif format](https://valgrind.org/docs/manual/ms-manual.html):
|
||||
#### OSX with Brew
|
||||
|
||||
~$ brew install cmake libpng glfw gstreamer icu4c
|
||||
|
||||
$ G_SLICE=always-malloc valgrind --tool=massif ./vimix
|
||||
|
||||
To check for memory leaks:
|
||||
|
||||
$ G_SLICE=always-malloc valgrind --leak-check=full --log-file=vimix_mem.txt ./vimix
|
||||
|
||||
@@ -1,693 +0,0 @@
|
||||
/*
|
||||
* This file is part of vimix - video live mixer
|
||||
*
|
||||
* **Copyright** (C) 2019-2022 Bruno Herbelin <bruno.herbelin@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
#include "defines.h"
|
||||
#include "Source.h"
|
||||
#include "UpdateCallback.h"
|
||||
#include "Visitor.h"
|
||||
#include "Log.h"
|
||||
|
||||
#include "SourceCallback.h"
|
||||
|
||||
|
||||
SourceCallback *SourceCallback::create(CallbackType type)
|
||||
{
|
||||
SourceCallback *loadedcallback = nullptr;
|
||||
|
||||
switch (type) {
|
||||
case SourceCallback::CALLBACK_ALPHA:
|
||||
loadedcallback = new SetAlpha;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_LOOM:
|
||||
loadedcallback = new Loom;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_GEOMETRY:
|
||||
loadedcallback = new SetGeometry;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_GRAB:
|
||||
loadedcallback = new Grab;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_RESIZE:
|
||||
loadedcallback = new Resize;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_TURN:
|
||||
loadedcallback = new Turn;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_DEPTH:
|
||||
loadedcallback = new SetDepth;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_PLAY:
|
||||
loadedcallback = new Play;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_REPLAY:
|
||||
loadedcallback = new RePlay;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_RESETGEO:
|
||||
loadedcallback = new ResetGeometry;
|
||||
break;
|
||||
case SourceCallback::CALLBACK_LOCK:
|
||||
loadedcallback = new Lock;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return loadedcallback;
|
||||
}
|
||||
|
||||
|
||||
bool SourceCallback::overlap( SourceCallback *a, SourceCallback *b)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
if (a->type() == b->type()) {
|
||||
|
||||
// same type means overlap
|
||||
ret = true;
|
||||
|
||||
// but there are some exceptions..
|
||||
switch (a->type()) {
|
||||
case SourceCallback::CALLBACK_GRAB:
|
||||
{
|
||||
const Grab *_a = static_cast<Grab*>(a);
|
||||
const Grab *_b = static_cast<Grab*>(b);
|
||||
// there is no overlap if the X or Y of a vector is zero
|
||||
if ( ABS(_a->value().x) < EPSILON || ABS(_b->value().x) < EPSILON )
|
||||
ret = false;
|
||||
else if ( ABS(_a->value().y) < EPSILON || ABS(_b->value().y) < EPSILON )
|
||||
ret = false;
|
||||
}
|
||||
break;
|
||||
case SourceCallback::CALLBACK_RESIZE:
|
||||
{
|
||||
const Resize *_a = static_cast<Resize*>(a);
|
||||
const Resize *_b = static_cast<Resize*>(b);
|
||||
if ( ABS(_a->value().x) < EPSILON || ABS(_b->value().x) < EPSILON )
|
||||
ret = false;
|
||||
else if ( ABS(_a->value().y) < EPSILON || ABS(_b->value().y) < EPSILON )
|
||||
ret = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SourceCallback::SourceCallback(): status_(PENDING), delay_(0.f), elapsed_(0.f)
|
||||
{
|
||||
}
|
||||
|
||||
void SourceCallback::accept(Visitor& v)
|
||||
{
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
void SourceCallback::update (Source *s, float dt)
|
||||
{
|
||||
if (s != nullptr) {
|
||||
// time passed
|
||||
elapsed_ += dt;
|
||||
// wait for delay to start
|
||||
if ( status_ == PENDING && elapsed_ > delay_ )
|
||||
status_ = READY;
|
||||
}
|
||||
// invalid
|
||||
else
|
||||
status_ = FINISHED;
|
||||
|
||||
}
|
||||
|
||||
void ResetGeometry::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
// apply when ready
|
||||
if ( status_ == READY ){
|
||||
|
||||
s->group(View::GEOMETRY)->scale_ = glm::vec3(1.f);
|
||||
s->group(View::GEOMETRY)->rotation_.z = 0;
|
||||
s->group(View::GEOMETRY)->crop_ = glm::vec3(1.f);
|
||||
s->group(View::GEOMETRY)->translation_ = glm::vec3(0.f);
|
||||
s->touch();
|
||||
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
SourceCallback *ResetGeometry::clone() const
|
||||
{
|
||||
return new ResetGeometry;
|
||||
}
|
||||
|
||||
|
||||
SetAlpha::SetAlpha(float alpha, float ms, bool revert) : SourceCallback(),
|
||||
duration_(ms), alpha_(alpha), bidirectional_(revert)
|
||||
{
|
||||
alpha_ = CLAMP(alpha_, 0.f, 1.f);
|
||||
start_ = glm::vec2();
|
||||
target_ = glm::vec2();
|
||||
}
|
||||
|
||||
void SetAlpha::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
// set start position on first time it is ready
|
||||
if ( status_ == READY ){
|
||||
// initial mixing view position
|
||||
start_ = glm::vec2(s->group(View::MIXING)->translation_);
|
||||
|
||||
// step in diagonal by default
|
||||
glm::vec2 step = glm::normalize(glm::vec2(1.f, 1.f));
|
||||
// step in direction of source translation if possible
|
||||
if ( glm::length(start_) > DELTA_ALPHA)
|
||||
step = glm::normalize(start_);
|
||||
//
|
||||
// target mixing view position
|
||||
//
|
||||
// special case Alpha = 0
|
||||
if (alpha_ < DELTA_ALPHA) {
|
||||
target_ = step;
|
||||
}
|
||||
// special case Alpha = 1
|
||||
else if (alpha_ > 1.f - DELTA_ALPHA) {
|
||||
target_ = step * 0.005f;
|
||||
}
|
||||
// general case
|
||||
else {
|
||||
// converge to reduce the difference of alpha using dichotomic algorithm
|
||||
target_ = start_;
|
||||
float delta = 1.f;
|
||||
do {
|
||||
target_ += step * (delta / 2.f);
|
||||
delta = SourceCore::alphaFromCordinates(target_.x, target_.y) - alpha_;
|
||||
} while (glm::abs(delta) > DELTA_ALPHA);
|
||||
}
|
||||
|
||||
status_ = ACTIVE;
|
||||
}
|
||||
|
||||
if ( status_ == ACTIVE ) {
|
||||
// time passed since start
|
||||
float progress = elapsed_ - delay_;
|
||||
|
||||
// perform movement
|
||||
if ( ABS(duration_) > 0.f)
|
||||
s->group(View::MIXING)->translation_ = glm::vec3(start_ + (progress/duration_)*(target_ - start_), s->group(View::MIXING)->translation_.z);
|
||||
|
||||
// time-out
|
||||
if ( progress > duration_ ) {
|
||||
// apply alpha to target
|
||||
s->group(View::MIXING)->translation_ = glm::vec3(target_, s->group(View::MIXING)->translation_.z);
|
||||
// done
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SetAlpha::multiply (float factor)
|
||||
{
|
||||
alpha_ *= factor;
|
||||
}
|
||||
|
||||
SourceCallback *SetAlpha::clone() const
|
||||
{
|
||||
return new SetAlpha(alpha_, duration_, bidirectional_);
|
||||
}
|
||||
|
||||
SourceCallback *SetAlpha::reverse(Source *s) const
|
||||
{
|
||||
return bidirectional_ ? new SetAlpha(s->alpha(), duration_) : nullptr;
|
||||
}
|
||||
|
||||
void SetAlpha::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
Lock::Lock(bool on) : lock_(on)
|
||||
{
|
||||
}
|
||||
|
||||
void Lock::update(Source *s, float)
|
||||
{
|
||||
if (s)
|
||||
s->setLocked(lock_);
|
||||
|
||||
status_ = FINISHED;
|
||||
}
|
||||
|
||||
SourceCallback *Lock::clone() const
|
||||
{
|
||||
return new Lock(lock_);
|
||||
}
|
||||
|
||||
|
||||
Loom::Loom(float speed, float ms) : SourceCallback(),
|
||||
speed_(speed), duration_(ms)
|
||||
{
|
||||
pos_ = glm::vec2();
|
||||
step_ = glm::normalize(glm::vec2(1.f, 1.f)); // step in diagonal by default
|
||||
}
|
||||
|
||||
void Loom::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
// set start on first time it is ready
|
||||
if ( status_ == READY ){
|
||||
// initial position
|
||||
pos_ = glm::vec2(s->group(View::MIXING)->translation_);
|
||||
// step in direction of source translation if possible
|
||||
if ( glm::length(pos_) > DELTA_ALPHA)
|
||||
step_ = glm::normalize(pos_);
|
||||
status_ = ACTIVE;
|
||||
}
|
||||
|
||||
if ( status_ == ACTIVE ) {
|
||||
// time passed since start
|
||||
float progress = elapsed_ - delay_;
|
||||
|
||||
// move target by speed vector (in the direction of step_, amplitude of speed * time (in second))
|
||||
pos_ -= step_ * ( speed_ * dt * 0.001f );
|
||||
|
||||
// apply alpha if pos in range [0 MIXING_MIN_THRESHOLD]
|
||||
float l = glm::length( pos_ );
|
||||
if ( (l > 0.01f && speed_ > 0.f ) || (l < MIXING_MIN_THRESHOLD && speed_ < 0.f ) )
|
||||
s->group(View::MIXING)->translation_ = glm::vec3(pos_, s->group(View::MIXING)->translation_.z);
|
||||
else
|
||||
status_ = FINISHED;
|
||||
|
||||
// time-out
|
||||
if ( progress > duration_ )
|
||||
// done
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
void Loom::multiply (float factor)
|
||||
{
|
||||
speed_ *= factor;
|
||||
}
|
||||
|
||||
SourceCallback *Loom::clone() const
|
||||
{
|
||||
return new Loom(speed_, duration_);
|
||||
}
|
||||
|
||||
SourceCallback *Loom::reverse(Source *) const
|
||||
{
|
||||
return new Loom(speed_, 0.f);
|
||||
}
|
||||
|
||||
void Loom::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
|
||||
SetDepth::SetDepth(float target, float ms, bool revert) : SourceCallback(),
|
||||
duration_(ms), start_(0.f), target_(target), bidirectional_(revert)
|
||||
{
|
||||
target_ = CLAMP(target_, MIN_DEPTH, MAX_DEPTH);
|
||||
}
|
||||
|
||||
void SetDepth::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
// set start position on first time it is ready
|
||||
if ( status_ == READY ){
|
||||
start_ = s->group(View::LAYER)->translation_.z;
|
||||
status_ = ACTIVE;
|
||||
}
|
||||
|
||||
if ( status_ == ACTIVE ) {
|
||||
// time passed since start
|
||||
float progress = elapsed_ - delay_;
|
||||
|
||||
// perform movement
|
||||
if ( ABS(duration_) > 0.f)
|
||||
s->group(View::LAYER)->translation_.z = start_ + (progress/duration_) * (target_ - start_);
|
||||
|
||||
// time-out
|
||||
if ( progress > duration_ ) {
|
||||
// apply depth to target
|
||||
s->group(View::LAYER)->translation_.z = target_;
|
||||
// ensure reordering of view
|
||||
++View::need_deep_update_;
|
||||
// done
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetDepth::multiply (float factor)
|
||||
{
|
||||
target_ *= factor;
|
||||
}
|
||||
|
||||
SourceCallback *SetDepth::clone() const
|
||||
{
|
||||
return new SetDepth(target_, duration_, bidirectional_);
|
||||
}
|
||||
|
||||
SourceCallback *SetDepth::reverse(Source *s) const
|
||||
{
|
||||
return bidirectional_ ? new SetDepth(s->depth(), duration_) : nullptr;
|
||||
}
|
||||
|
||||
void SetDepth::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
Play::Play(bool on, bool revert) : SourceCallback(), play_(on), bidirectional_(revert)
|
||||
{
|
||||
}
|
||||
|
||||
void Play::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
// toggle play status when ready
|
||||
if ( status_ == READY ){
|
||||
|
||||
if (s->playing() != play_)
|
||||
// call play function
|
||||
s->play(play_);
|
||||
|
||||
status_ = FINISHED;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SourceCallback *Play::clone() const
|
||||
{
|
||||
return new Play(play_, bidirectional_);
|
||||
}
|
||||
|
||||
SourceCallback *Play::reverse(Source *s) const
|
||||
{
|
||||
return bidirectional_ ? new Play(s->playing()) : nullptr;
|
||||
}
|
||||
|
||||
void Play::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
RePlay::RePlay() : SourceCallback()
|
||||
{
|
||||
}
|
||||
|
||||
void RePlay::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
// apply when ready
|
||||
if ( status_ == READY ){
|
||||
|
||||
// call replay function
|
||||
s->replay();
|
||||
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
SourceCallback *RePlay::clone() const
|
||||
{
|
||||
return new RePlay;
|
||||
}
|
||||
|
||||
|
||||
SetGeometry::SetGeometry(const Group *g, float ms, bool revert) : SourceCallback(),
|
||||
duration_(ms), bidirectional_(revert)
|
||||
{
|
||||
setTarget(g);
|
||||
}
|
||||
|
||||
void SetGeometry::getTarget (Group *g) const
|
||||
{
|
||||
if (g!=nullptr)
|
||||
g->copyTransform(&target_);
|
||||
}
|
||||
|
||||
void SetGeometry::setTarget (const Group *g)
|
||||
{
|
||||
if (g!=nullptr)
|
||||
target_.copyTransform(g);
|
||||
}
|
||||
|
||||
void SetGeometry::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
// set start position on first time it is ready
|
||||
if ( status_ == READY ){
|
||||
start_.copyTransform(s->group(View::GEOMETRY));
|
||||
status_ = ACTIVE;
|
||||
}
|
||||
|
||||
if ( status_ == ACTIVE ) {
|
||||
// time passed since start
|
||||
float progress = elapsed_ - delay_;
|
||||
|
||||
// perform movement
|
||||
if ( ABS(duration_) > 0.f){
|
||||
float ratio = progress / duration_;
|
||||
Group intermediate;
|
||||
intermediate.translation_ = (1.f - ratio) * start_.translation_ + ratio * target_.translation_;
|
||||
intermediate.scale_ = (1.f - ratio) * start_.scale_ + ratio * target_.scale_;
|
||||
intermediate.rotation_ = (1.f - ratio) * start_.rotation_ + ratio * target_.rotation_;
|
||||
// apply geometry
|
||||
s->group(View::GEOMETRY)->copyTransform(&intermediate);
|
||||
s->touch();
|
||||
}
|
||||
|
||||
// time-out
|
||||
if ( progress > duration_ ) {
|
||||
// apply target
|
||||
s->group(View::GEOMETRY)->copyTransform(&target_);
|
||||
s->touch();
|
||||
// done
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetGeometry::multiply (float factor)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
SourceCallback *SetGeometry::clone() const
|
||||
{
|
||||
return new SetGeometry(&target_, duration_, bidirectional_);
|
||||
}
|
||||
|
||||
SourceCallback *SetGeometry::reverse(Source *s) const
|
||||
{
|
||||
return bidirectional_ ? new SetGeometry( s->group(View::GEOMETRY), duration_) : nullptr;
|
||||
}
|
||||
|
||||
void SetGeometry::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Grab::Grab(float dx, float dy, float ms) : SourceCallback(),
|
||||
speed_(glm::vec2(dx, dy)), duration_(ms)
|
||||
{
|
||||
}
|
||||
|
||||
void Grab::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
// set start on first time it is ready
|
||||
if ( status_ == READY ) {
|
||||
// initial position
|
||||
pos_ = glm::vec2(s->group(View::GEOMETRY)->translation_);
|
||||
status_ = ACTIVE;
|
||||
}
|
||||
|
||||
if ( status_ == ACTIVE ) {
|
||||
|
||||
// move target by speed vector * time (in second)
|
||||
pos_ += speed_ * ( dt * 0.001f);
|
||||
s->group(View::GEOMETRY)->translation_ = glm::vec3(pos_, s->group(View::GEOMETRY)->translation_.z);
|
||||
|
||||
// time-out
|
||||
if ( (elapsed_ - delay_) > duration_ )
|
||||
// done
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
void Grab::multiply (float factor)
|
||||
{
|
||||
speed_ *= factor;
|
||||
}
|
||||
|
||||
SourceCallback *Grab::clone() const
|
||||
{
|
||||
return new Grab(speed_.x, speed_.y, duration_);
|
||||
}
|
||||
|
||||
SourceCallback *Grab::reverse(Source *) const
|
||||
{
|
||||
return new Grab(speed_.x, speed_.y, 0.f);
|
||||
}
|
||||
|
||||
void Grab::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
Resize::Resize(float dx, float dy, float ms) : SourceCallback(),
|
||||
speed_(glm::vec2(dx, dy)), duration_(ms)
|
||||
{
|
||||
}
|
||||
|
||||
void Resize::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
if ( status_ == READY )
|
||||
status_ = ACTIVE;
|
||||
|
||||
if ( status_ == ACTIVE ) {
|
||||
// move target by speed vector * time (in second)
|
||||
glm::vec2 scale = glm::vec2(s->group(View::GEOMETRY)->scale_) + speed_ * ( dt * 0.001f );
|
||||
s->group(View::GEOMETRY)->scale_ = glm::vec3(scale, s->group(View::GEOMETRY)->scale_.z);
|
||||
|
||||
// time-out
|
||||
if ( (elapsed_ - delay_) > duration_ )
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
void Resize::multiply (float factor)
|
||||
{
|
||||
speed_ *= factor;
|
||||
}
|
||||
|
||||
SourceCallback *Resize::clone() const
|
||||
{
|
||||
return new Resize(speed_.x, speed_.y, duration_);
|
||||
}
|
||||
|
||||
SourceCallback *Resize::reverse(Source *) const
|
||||
{
|
||||
return new Resize(speed_.x, speed_.y, 0.f);
|
||||
}
|
||||
|
||||
void Resize::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
Turn::Turn(float speed, float ms) : SourceCallback(),
|
||||
speed_(speed), duration_(ms)
|
||||
{
|
||||
}
|
||||
|
||||
void Turn::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
if (s->locked())
|
||||
status_ = FINISHED;
|
||||
|
||||
// set start on first time it is ready
|
||||
if ( status_ == READY ){
|
||||
// initial position
|
||||
angle_ = s->group(View::GEOMETRY)->rotation_.z;
|
||||
status_ = ACTIVE;
|
||||
}
|
||||
|
||||
if ( status_ == ACTIVE ) {
|
||||
|
||||
// perform movement
|
||||
angle_ -= speed_ * ( dt * 0.001f );
|
||||
s->group(View::GEOMETRY)->rotation_.z = angle_;
|
||||
|
||||
// timeout
|
||||
if ( (elapsed_ - delay_) > duration_ )
|
||||
// done
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
void Turn::multiply (float factor)
|
||||
{
|
||||
speed_ *= factor;
|
||||
}
|
||||
|
||||
SourceCallback *Turn::clone() const
|
||||
{
|
||||
return new Turn(speed_, duration_);
|
||||
}
|
||||
|
||||
SourceCallback *Turn::reverse(Source *) const
|
||||
{
|
||||
return new Turn(speed_, 0.f);
|
||||
}
|
||||
|
||||
void Turn::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
@@ -1,515 +0,0 @@
|
||||
#ifndef __UI_MANAGER_H_
|
||||
#define __UI_MANAGER_H_
|
||||
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <list>
|
||||
#include <future>
|
||||
|
||||
#include <gst/gstutils.h>
|
||||
|
||||
#define NAV_COUNT 68
|
||||
#define NAV_MAX 64
|
||||
#define NAV_NEW 65
|
||||
#define NAV_MENU 66
|
||||
#define NAV_TRANS 67
|
||||
|
||||
#ifdef APPLE
|
||||
#define CTRL_MOD "Cmd+"
|
||||
#define ALT_MOD "Option+"
|
||||
#else
|
||||
#define CTRL_MOD "Ctrl+"
|
||||
#define ALT_MOD "Alt+"
|
||||
#endif
|
||||
|
||||
#define IMGUI_TITLE_MEDIAPLAYER ICON_FA_PLAY_CIRCLE " Player"
|
||||
#define IMGUI_TITLE_TIMER ICON_FA_CLOCK " Timer"
|
||||
#define IMGUI_TITLE_INPUT_MAPPING ICON_FA_HAND_PAPER " Inputs Mapping"
|
||||
#define IMGUI_TITLE_HELP ICON_FA_LIFE_RING " Help"
|
||||
#define IMGUI_TITLE_TOOLBOX ICON_FA_HAMSA " Guru Toolbox"
|
||||
#define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Shader Editor"
|
||||
#define IMGUI_TITLE_PREVIEW ICON_FA_DESKTOP " Output"
|
||||
|
||||
#define MENU_NEW_FILE ICON_FA_FILE " New"
|
||||
#define SHORTCUT_NEW_FILE CTRL_MOD "W"
|
||||
#define MENU_OPEN_FILE ICON_FA_FILE_UPLOAD " Open"
|
||||
#define SHORTCUT_OPEN_FILE CTRL_MOD "O"
|
||||
#define MENU_REOPEN_FILE ICON_FA_FILE_UPLOAD " Re-open"
|
||||
#define SHORTCUT_REOPEN_FILE CTRL_MOD "Shift+O"
|
||||
#define MENU_SAVE_FILE ICON_FA_FILE_DOWNLOAD " Save"
|
||||
#define SHORTCUT_SAVE_FILE CTRL_MOD "S"
|
||||
#define MENU_SAVEAS_FILE ICON_FA_FILE_DOWNLOAD " Save as"
|
||||
#define MENU_SAVE_ON_EXIT ICON_FA_LEVEL_DOWN_ALT " Save on exit"
|
||||
#define MENU_OPEN_ON_START ICON_FA_LEVEL_UP_ALT " Open last on start"
|
||||
#define SHORTCUT_SAVEAS_FILE CTRL_MOD "Shift+S"
|
||||
#define SHORTCUT_HELP CTRL_MOD "H"
|
||||
#define SHORTCUT_LOGS CTRL_MOD "L"
|
||||
#define MENU_QUIT ICON_FA_POWER_OFF " Quit"
|
||||
#define SHORTCUT_QUIT CTRL_MOD "Q"
|
||||
#define MENU_CUT ICON_FA_CUT " Cut"
|
||||
#define SHORTCUT_CUT CTRL_MOD "X"
|
||||
#define MENU_COPY ICON_FA_COPY " Copy"
|
||||
#define SHORTCUT_COPY CTRL_MOD "C"
|
||||
#define MENU_DELETE ICON_FA_ERASER " Delete"
|
||||
#define SHORTCUT_DELETE "Del"
|
||||
#define MENU_PASTE ICON_FA_PASTE " Paste"
|
||||
#define SHORTCUT_PASTE CTRL_MOD "V"
|
||||
#define MENU_SELECTALL ICON_FA_TH_LIST " Select all"
|
||||
#define SHORTCUT_SELECTALL CTRL_MOD "A"
|
||||
#define MENU_UNDO ICON_FA_UNDO " Undo"
|
||||
#define SHORTCUT_UNDO CTRL_MOD "Z"
|
||||
#define MENU_REDO ICON_FA_REDO " Redo"
|
||||
#define SHORTCUT_REDO CTRL_MOD "Shift+Z"
|
||||
#define MENU_RECORD ICON_FA_CIRCLE " Record"
|
||||
#define SHORTCUT_RECORD CTRL_MOD "R"
|
||||
#define MENU_RECORDCONT ICON_FA_STOP_CIRCLE " Save & continue"
|
||||
#define SHORTCUT_RECORDCONT CTRL_MOD "Alt+R"
|
||||
#define MENU_CAPTUREFRAME ICON_FA_CAMERA_RETRO " Capture frame"
|
||||
#define SHORTCUT_CAPTUREFRAME "F11"
|
||||
#define MENU_OUTPUTDISABLE ICON_FA_EYE_SLASH " Disable"
|
||||
#define SHORTCUT_OUTPUTDISABLE "F12"
|
||||
#define MENU_OUTPUTFULLSCREEN ICON_FA_EXPAND_ALT " Fullscreen window"
|
||||
#define SHORTCUT_OUTPUTFULLSCREEN CTRL_MOD "F"
|
||||
#define MENU_CLOSE ICON_FA_TIMES " Close"
|
||||
|
||||
#define TOOLTIP_NOTE "New sticky note "
|
||||
#define SHORTCUT_NOTE CTRL_MOD "Shift+N"
|
||||
#define TOOLTIP_METRICS "Metrics "
|
||||
#define SHORTCUT_METRICS CTRL_MOD "M"
|
||||
#define TOOLTIP_PLAYER "Player "
|
||||
#define SHORTCUT_PLAYER CTRL_MOD "P"
|
||||
#define TOOLTIP_OUTPUT "Output "
|
||||
#define SHORTCUT_OUTPUT CTRL_MOD "D"
|
||||
#define TOOLTIP_TIMER "Timer "
|
||||
#define SHORTCUT_TIMER CTRL_MOD "T"
|
||||
#define TOOLTIP_INPUTS "Inputs mapping "
|
||||
#define SHORTCUT_INPUTS CTRL_MOD "I"
|
||||
#define TOOLTIP_SHADEREDITOR "Shader Editor "
|
||||
#define SHORTCUT_SHADEREDITOR CTRL_MOD "E"
|
||||
#define TOOLTIP_FULLSCREEN "Fullscreen "
|
||||
#define SHORTCUT_FULLSCREEN CTRL_MOD "Shift+F"
|
||||
#define TOOLTIP_MAIN "Main menu "
|
||||
#define SHORTCUT_MAIN "HOME"
|
||||
#define TOOLTIP_NEW_SOURCE "New source "
|
||||
#define SHORTCUT_NEW_SOURCE "INS"
|
||||
#define TOOLTIP_HIDE "Hide windows "
|
||||
#define TOOLTIP_SHOW "Show windows "
|
||||
#define SHORTCUT_HIDE "ESC"
|
||||
|
||||
#include "SourceList.h"
|
||||
#include "InfoVisitor.h"
|
||||
#include "DialogToolkit.h"
|
||||
#include "SessionParser.h"
|
||||
#include "ImageFilter.h"
|
||||
#include "Screenshot.h"
|
||||
|
||||
|
||||
struct ImVec2;
|
||||
class MediaPlayer;
|
||||
class FrameBufferImage;
|
||||
class FrameGrabber;
|
||||
class VideoRecorder;
|
||||
class VideoBroadcast;
|
||||
|
||||
class SourcePreview {
|
||||
|
||||
Source *source_;
|
||||
std::string label_;
|
||||
bool reset_;
|
||||
|
||||
public:
|
||||
SourcePreview();
|
||||
|
||||
void setSource(Source *s = nullptr, const std::string &label = "");
|
||||
Source *getSource();
|
||||
|
||||
void Render(float width);
|
||||
bool ready() const;
|
||||
inline bool filled() const { return source_ != nullptr; }
|
||||
};
|
||||
|
||||
class Thumbnail
|
||||
{
|
||||
float aspect_ratio_;
|
||||
uint texture_;
|
||||
|
||||
public:
|
||||
Thumbnail();
|
||||
~Thumbnail();
|
||||
|
||||
void reset();
|
||||
void fill (const FrameBufferImage *image);
|
||||
bool filled();
|
||||
void Render(float width);
|
||||
};
|
||||
|
||||
class Navigator
|
||||
{
|
||||
// geometry left bar & pannel
|
||||
float width_;
|
||||
float height_;
|
||||
float pannel_width_;
|
||||
float padding_width_;
|
||||
|
||||
// behavior pannel
|
||||
bool show_config_;
|
||||
bool pannel_visible_;
|
||||
bool view_pannel_visible;
|
||||
bool selected_button[NAV_COUNT];
|
||||
int pattern_type;
|
||||
bool custom_pipeline;
|
||||
bool custom_connected;
|
||||
void clearButtonSelection();
|
||||
void clearNewPannel();
|
||||
void applyButtonSelection(int index);
|
||||
|
||||
// side pannels
|
||||
void RenderSourcePannel(Source *s);
|
||||
void RenderMainPannel();
|
||||
void RenderMainPannelVimix();
|
||||
void RenderMainPannelSettings();
|
||||
void RenderTransitionPannel();
|
||||
void RenderNewPannel();
|
||||
void RenderViewPannel(ImVec2 draw_pos, ImVec2 draw_size);
|
||||
|
||||
public:
|
||||
|
||||
typedef enum {
|
||||
SOURCE_FILE = 0,
|
||||
SOURCE_SEQUENCE,
|
||||
SOURCE_CONNECTED,
|
||||
SOURCE_GENERATED,
|
||||
SOURCE_INTERNAL,
|
||||
SOURCE_TYPES
|
||||
} NewSourceType;
|
||||
|
||||
Navigator();
|
||||
void Render();
|
||||
|
||||
bool pannelVisible() { return pannel_visible_; }
|
||||
void hidePannel();
|
||||
void showPannelSource(int index);
|
||||
void togglePannelMenu();
|
||||
void togglePannelNew();
|
||||
void showConfig();
|
||||
|
||||
typedef enum {
|
||||
MEDIA_RECENT = 0,
|
||||
MEDIA_RECORDING,
|
||||
MEDIA_FOLDER
|
||||
} MediaCreateMode;
|
||||
void setNewMedia(MediaCreateMode mode, std::string path = std::string());
|
||||
|
||||
|
||||
private:
|
||||
// for new source panel
|
||||
SourcePreview new_source_preview_;
|
||||
std::list<std::string> sourceSequenceFiles;
|
||||
std::list<std::string> sourceMediaFiles;
|
||||
std::string sourceMediaFileCurrent;
|
||||
MediaCreateMode new_media_mode;
|
||||
bool new_media_mode_changed;
|
||||
};
|
||||
|
||||
class ToolBox
|
||||
{
|
||||
bool show_demo_window;
|
||||
bool show_icons_window;
|
||||
bool show_sandbox;
|
||||
|
||||
public:
|
||||
ToolBox();
|
||||
|
||||
void Render();
|
||||
};
|
||||
|
||||
class HelperToolbox
|
||||
{
|
||||
SessionParser parser_;
|
||||
|
||||
public:
|
||||
HelperToolbox();
|
||||
|
||||
void Render();
|
||||
|
||||
};
|
||||
|
||||
class WorkspaceWindow
|
||||
{
|
||||
static std::list<WorkspaceWindow *> windows_;
|
||||
|
||||
public:
|
||||
WorkspaceWindow(const char* name);
|
||||
|
||||
// global access to Workspace control
|
||||
static bool clear() { return clear_workspace_enabled; }
|
||||
static void toggleClearRestoreWorkspace();
|
||||
static void clearWorkspace();
|
||||
static void restoreWorkspace(bool instantaneous = false);
|
||||
static void notifyWorkspaceSizeChanged(int prev_width, int prev_height, int curr_width, int curr_height);
|
||||
|
||||
// for inherited classes
|
||||
virtual void Update();
|
||||
virtual bool Visible() const { return true; }
|
||||
|
||||
protected:
|
||||
|
||||
static bool clear_workspace_enabled;
|
||||
|
||||
const char *name_;
|
||||
struct ImGuiProperties *impl_;
|
||||
};
|
||||
|
||||
class SourceController : public WorkspaceWindow
|
||||
{
|
||||
float min_width_;
|
||||
float h_space_;
|
||||
float v_space_;
|
||||
float scrollbar_;
|
||||
float timeline_height_;
|
||||
float mediaplayer_height_;
|
||||
float buttons_width_;
|
||||
float buttons_height_;
|
||||
|
||||
bool play_toggle_request_, replay_request_, capture_request_;
|
||||
bool pending_;
|
||||
std::string active_label_;
|
||||
int active_selection_;
|
||||
InfoVisitor info_;
|
||||
SourceList selection_;
|
||||
|
||||
// re-usable ui parts
|
||||
void DrawButtonBar(ImVec2 bottom, float width);
|
||||
const char *SourcePlayIcon(Source *s);
|
||||
bool SourceButton(Source *s, ImVec2 framesize);
|
||||
|
||||
// Render the sources dynamically selected
|
||||
void RenderSelectedSources();
|
||||
|
||||
// Render a stored selection
|
||||
bool selection_context_menu_;
|
||||
MediaPlayer *selection_mediaplayer_;
|
||||
double selection_target_slower_;
|
||||
double selection_target_faster_;
|
||||
void RenderSelectionContextMenu();
|
||||
void RenderSelection(size_t i);
|
||||
|
||||
// Render a single source
|
||||
void RenderSingleSource(Source *s);
|
||||
|
||||
// Render a single media player
|
||||
MediaPlayer *mediaplayer_active_;
|
||||
bool mediaplayer_edit_fading_;
|
||||
bool mediaplayer_mode_;
|
||||
bool mediaplayer_slider_pressed_;
|
||||
float mediaplayer_timeline_zoom_;
|
||||
void RenderMediaPlayer(MediaSource *ms);
|
||||
|
||||
// dialog to select frame capture location
|
||||
DialogToolkit::OpenFolderDialog *captureFolderDialog;
|
||||
Screenshot capture;
|
||||
|
||||
public:
|
||||
SourceController();
|
||||
|
||||
inline void Play() { play_toggle_request_ = true; }
|
||||
inline void Replay() { replay_request_= true; }
|
||||
inline void Capture(){ capture_request_= true; }
|
||||
void resetActiveSelection();
|
||||
|
||||
void setVisible(bool on);
|
||||
void Render();
|
||||
|
||||
// from WorkspaceWindow
|
||||
void Update() override;
|
||||
bool Visible() const override;
|
||||
};
|
||||
|
||||
class OutputPreview : public WorkspaceWindow
|
||||
{
|
||||
// frame grabbers
|
||||
VideoRecorder *video_recorder_;
|
||||
VideoBroadcast *video_broadcaster_;
|
||||
|
||||
// delayed trigger for recording
|
||||
std::vector< std::future<VideoRecorder *> > _video_recorders;
|
||||
|
||||
#if defined(LINUX)
|
||||
FrameGrabber *webcam_emulator_;
|
||||
#endif
|
||||
|
||||
// dialog to select record location
|
||||
DialogToolkit::OpenFolderDialog *recordFolderDialog;
|
||||
|
||||
public:
|
||||
OutputPreview();
|
||||
|
||||
void ToggleRecord(bool save_and_continue = false);
|
||||
inline bool isRecording() const { return video_recorder_ != nullptr; }
|
||||
|
||||
void ToggleBroadcast();
|
||||
inline bool isBroadcasting() const { return video_broadcaster_ != nullptr; }
|
||||
|
||||
void Render();
|
||||
void setVisible(bool on);
|
||||
|
||||
// from WorkspaceWindow
|
||||
void Update() override;
|
||||
bool Visible() const override;
|
||||
};
|
||||
|
||||
class TimerMetronome : public WorkspaceWindow
|
||||
{
|
||||
std::array< std::string, 2 > timer_menu;
|
||||
// clock times
|
||||
guint64 start_time_;
|
||||
guint64 start_time_hand_;
|
||||
guint64 duration_hand_;
|
||||
|
||||
public:
|
||||
TimerMetronome();
|
||||
|
||||
void Render();
|
||||
void setVisible(bool on);
|
||||
|
||||
// from WorkspaceWindow
|
||||
bool Visible() const override;
|
||||
};
|
||||
|
||||
class InputMappingInterface : public WorkspaceWindow
|
||||
{
|
||||
std::array< std::string, 4 > input_mode;
|
||||
std::array< uint, 4 > current_input_for_mode;
|
||||
uint current_input_;
|
||||
|
||||
Source *ComboSelectSource(Source *current = nullptr);
|
||||
uint ComboSelectCallback(uint current);
|
||||
void SliderParametersCallback(SourceCallback *callback, Source *source);
|
||||
|
||||
public:
|
||||
InputMappingInterface();
|
||||
|
||||
void Render();
|
||||
void setVisible(bool on);
|
||||
|
||||
// from WorkspaceWindow
|
||||
bool Visible() const override;
|
||||
};
|
||||
|
||||
class ShaderEditor : public WorkspaceWindow
|
||||
{
|
||||
CloneSource *current_;
|
||||
bool current_changed_;
|
||||
bool show_shader_inputs_;
|
||||
std::map<CloneSource *, FilteringProgram> filters_;
|
||||
std::promise<std::string> *compilation_;
|
||||
std::future<std::string> compilation_return_;
|
||||
|
||||
std::string status_;
|
||||
|
||||
public:
|
||||
ShaderEditor();
|
||||
|
||||
void Render();
|
||||
void setVisible(bool on);
|
||||
|
||||
void setVisible(CloneSource *cs);
|
||||
|
||||
// from WorkspaceWindow
|
||||
bool Visible() const override;
|
||||
};
|
||||
|
||||
|
||||
class UserInterface
|
||||
{
|
||||
friend class Navigator;
|
||||
friend class OutputPreview;
|
||||
|
||||
// Private Constructor
|
||||
UserInterface();
|
||||
UserInterface(UserInterface const& copy) = delete;
|
||||
UserInterface& operator=(UserInterface const& copy) = delete;
|
||||
|
||||
public:
|
||||
|
||||
static UserInterface& manager()
|
||||
{
|
||||
// The only instance
|
||||
static UserInterface _instance;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
// pre-loop initialization
|
||||
bool Init();
|
||||
// loop update start new frame
|
||||
void NewFrame();
|
||||
// loop update rendering
|
||||
void Render();
|
||||
// try to close, return false if cannot
|
||||
bool TryClose();
|
||||
// Post-loop termination
|
||||
void Terminate();
|
||||
// Runtime
|
||||
uint64_t Runtime() const;
|
||||
|
||||
// status querries
|
||||
inline bool keyboardAvailable() const { return keyboard_available; }
|
||||
inline bool ctrlModifier() const { return ctrl_modifier_active; }
|
||||
inline bool altModifier() const { return alt_modifier_active; }
|
||||
inline bool shiftModifier() const { return shift_modifier_active; }
|
||||
|
||||
void showPannel(int id = 0);
|
||||
void showSourceEditor(Source *s);
|
||||
|
||||
void StartScreenshot();
|
||||
|
||||
protected:
|
||||
|
||||
// internal
|
||||
uint64_t start_time;
|
||||
bool ctrl_modifier_active;
|
||||
bool alt_modifier_active;
|
||||
bool shift_modifier_active;
|
||||
bool keyboard_available;
|
||||
bool show_vimix_about;
|
||||
bool show_imgui_about;
|
||||
bool show_gst_about;
|
||||
bool show_opengl_about;
|
||||
int show_view_navigator;
|
||||
int target_view_navigator;
|
||||
unsigned int screenshot_step;
|
||||
bool pending_save_on_exit;
|
||||
|
||||
// Dialogs
|
||||
DialogToolkit::OpenSessionDialog *sessionopendialog;
|
||||
DialogToolkit::OpenSessionDialog *sessionimportdialog;
|
||||
DialogToolkit::SaveSessionDialog *sessionsavedialog;
|
||||
|
||||
// objects and windows
|
||||
Navigator navigator;
|
||||
ToolBox toolbox;
|
||||
SourceController sourcecontrol;
|
||||
OutputPreview outputcontrol;
|
||||
TimerMetronome timercontrol;
|
||||
InputMappingInterface inputscontrol;
|
||||
ShaderEditor shadercontrol;
|
||||
HelperToolbox helpwindow;
|
||||
|
||||
void showMenuFile();
|
||||
void showMenuEdit();
|
||||
bool saveOrSaveAs(bool force_versioning = false);
|
||||
void selectSaveFilename();
|
||||
void selectOpenFilename();
|
||||
|
||||
void RenderMetrics (bool* p_open, int* p_corner, int *p_mode);
|
||||
int RenderViewNavigator(int* shift);
|
||||
void RenderAbout(bool* p_open);
|
||||
void RenderNotes();
|
||||
|
||||
void handleKeyboard();
|
||||
void handleMouse();
|
||||
void handleScreenshot();
|
||||
};
|
||||
|
||||
#endif /* #define __UI_MANAGER_H_ */
|
||||
|
||||
133
Visitor.h
@@ -1,133 +0,0 @@
|
||||
#ifndef VISITOR_H
|
||||
#define VISITOR_H
|
||||
|
||||
#include <string>
|
||||
|
||||
// Forward declare different kind of Node
|
||||
class Node;
|
||||
class Group;
|
||||
class Switch;
|
||||
class Primitive;
|
||||
class Scene;
|
||||
class Surface;
|
||||
class ImageSurface;
|
||||
class FrameBufferSurface;
|
||||
class LineStrip;
|
||||
class LineSquare;
|
||||
class LineCircle;
|
||||
class Mesh;
|
||||
class Frame;
|
||||
class Handles;
|
||||
class Symbol;
|
||||
class Disk;
|
||||
class Stream;
|
||||
class MediaPlayer;
|
||||
class Shader;
|
||||
class ImageShader;
|
||||
class MaskShader;
|
||||
class ImageProcessingShader;
|
||||
|
||||
class Source;
|
||||
class MediaSource;
|
||||
class PatternSource;
|
||||
class DeviceSource;
|
||||
class GenericStreamSource;
|
||||
class SrtReceiverSource;
|
||||
class SessionFileSource;
|
||||
class SessionGroupSource;
|
||||
class RenderSource;
|
||||
class CloneSource;
|
||||
class NetworkSource;
|
||||
class MixingGroup;
|
||||
class MultiFileSource;
|
||||
|
||||
class FrameBufferFilter;
|
||||
class PassthroughFilter;
|
||||
class DelayFilter;
|
||||
class ResampleFilter;
|
||||
class BlurFilter;
|
||||
class SharpenFilter;
|
||||
class SmoothFilter;
|
||||
class EdgeFilter;
|
||||
class AlphaFilter;
|
||||
class ImageFilter;
|
||||
|
||||
class SourceCallback;
|
||||
class SetAlpha;
|
||||
class SetDepth;
|
||||
class SetGeometry;
|
||||
class Loom;
|
||||
class Grab;
|
||||
class Resize;
|
||||
class Turn;
|
||||
class Play;
|
||||
|
||||
|
||||
// Declares the interface for the visitors
|
||||
class Visitor {
|
||||
|
||||
public:
|
||||
// Need to declare overloads for basic kind of Nodes to visit
|
||||
virtual void visit (Scene&) = 0;
|
||||
virtual void visit (Node&) = 0;
|
||||
virtual void visit (Primitive&) = 0;
|
||||
virtual void visit (Group&) = 0;
|
||||
virtual void visit (Switch&) = 0;
|
||||
|
||||
// not mandatory for all others
|
||||
virtual void visit (Surface&) {}
|
||||
virtual void visit (ImageSurface&) {}
|
||||
virtual void visit (FrameBufferSurface&) {}
|
||||
virtual void visit (LineStrip&) {}
|
||||
virtual void visit (LineSquare&) {}
|
||||
virtual void visit (Mesh&) {}
|
||||
virtual void visit (Frame&) {}
|
||||
virtual void visit (Handles&) {}
|
||||
virtual void visit (Symbol&) {}
|
||||
virtual void visit (Disk&) {}
|
||||
virtual void visit (Shader&) {}
|
||||
virtual void visit (ImageShader&) {}
|
||||
virtual void visit (MaskShader&) {}
|
||||
virtual void visit (ImageProcessingShader&) {}
|
||||
|
||||
// utility
|
||||
virtual void visit (Stream&) {}
|
||||
virtual void visit (MediaPlayer&) {}
|
||||
virtual void visit (MixingGroup&) {}
|
||||
virtual void visit (Source&) {}
|
||||
virtual void visit (MediaSource&) {}
|
||||
virtual void visit (NetworkSource&) {}
|
||||
virtual void visit (SrtReceiverSource&) {}
|
||||
virtual void visit (GenericStreamSource&) {}
|
||||
virtual void visit (DeviceSource&) {}
|
||||
virtual void visit (PatternSource&) {}
|
||||
virtual void visit (SessionFileSource&) {}
|
||||
virtual void visit (SessionGroupSource&) {}
|
||||
virtual void visit (RenderSource&) {}
|
||||
virtual void visit (CloneSource&) {}
|
||||
virtual void visit (MultiFileSource&) {}
|
||||
|
||||
virtual void visit (FrameBufferFilter&) {}
|
||||
virtual void visit (PassthroughFilter&) {}
|
||||
virtual void visit (DelayFilter&) {}
|
||||
virtual void visit (ResampleFilter&) {}
|
||||
virtual void visit (BlurFilter&) {}
|
||||
virtual void visit (SharpenFilter&) {}
|
||||
virtual void visit (SmoothFilter&) {}
|
||||
virtual void visit (EdgeFilter&) {}
|
||||
virtual void visit (AlphaFilter&) {}
|
||||
virtual void visit (ImageFilter&) {}
|
||||
|
||||
virtual void visit (SourceCallback&) {}
|
||||
virtual void visit (SetAlpha&) {}
|
||||
virtual void visit (SetDepth&) {}
|
||||
virtual void visit (SetGeometry&) {}
|
||||
virtual void visit (Loom&) {}
|
||||
virtual void visit (Grab&) {}
|
||||
virtual void visit (Resize&) {}
|
||||
virtual void visit (Turn&) {}
|
||||
virtual void visit (Play&) {}
|
||||
};
|
||||
|
||||
|
||||
#endif // VISITOR_H
|
||||
@@ -34,7 +34,7 @@ endif()
|
||||
|
||||
set(_version 2.0.0)
|
||||
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(CMakeParseArguments)
|
||||
|
||||
if(COMMAND cmrc_add_resource_library)
|
||||
@@ -77,6 +77,10 @@ set(hpp_content [==[
|
||||
#include <system_error>
|
||||
#include <type_traits>
|
||||
|
||||
#if !(defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) || defined(CMRC_NO_EXCEPTIONS))
|
||||
#define CMRC_NO_EXCEPTIONS 1
|
||||
#endif
|
||||
|
||||
namespace cmrc { namespace detail { struct dummy; } }
|
||||
|
||||
#define CMRC_DECLARE(libid) \
|
||||
@@ -101,7 +105,7 @@ public:
|
||||
iterator cbegin() const noexcept { return _begin; }
|
||||
iterator end() const noexcept { return _end; }
|
||||
iterator cend() const noexcept { return _end; }
|
||||
std::size_t size() const { return std::distance(begin(), end()); }
|
||||
std::size_t size() const { return static_cast<std::size_t>(std::distance(begin(), end())); }
|
||||
|
||||
file() = default;
|
||||
file(iterator beg, iterator end) noexcept : _begin(beg), _end(end) {}
|
||||
@@ -243,16 +247,16 @@ public:
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
iterator operator++() noexcept {
|
||||
iterator& operator++() noexcept {
|
||||
++_base_iter;
|
||||
return *this;
|
||||
}
|
||||
|
||||
iterator operator++(int) noexcept {
|
||||
auto cp = *this;
|
||||
++_base_iter;
|
||||
return cp;
|
||||
}
|
||||
|
||||
iterator& operator++(int) noexcept {
|
||||
++_base_iter;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
using const_iterator = iterator;
|
||||
@@ -275,7 +279,7 @@ inline std::string normalize_path(std::string path) {
|
||||
}
|
||||
auto off = path.npos;
|
||||
while ((off = path.find("//")) != path.npos) {
|
||||
path.erase(path.begin() + off);
|
||||
path.erase(path.begin() + static_cast<std::string::difference_type>(off));
|
||||
}
|
||||
return path;
|
||||
}
|
||||
@@ -339,7 +343,12 @@ public:
|
||||
file open(const std::string& path) const {
|
||||
auto entry_ptr = _get(path);
|
||||
if (!entry_ptr || !entry_ptr->is_file()) {
|
||||
#ifdef CMRC_NO_EXCEPTIONS
|
||||
fprintf(stderr, "Error no such file or directory: %s\n", path.c_str());
|
||||
abort();
|
||||
#else
|
||||
throw std::system_error(make_error_code(std::errc::no_such_file_or_directory), path);
|
||||
#endif
|
||||
}
|
||||
auto& dat = entry_ptr->as_file();
|
||||
return file{dat.begin_ptr, dat.end_ptr};
|
||||
@@ -362,10 +371,20 @@ public:
|
||||
directory_iterator iterate_directory(const std::string& path) const {
|
||||
auto entry_ptr = _get(path);
|
||||
if (!entry_ptr) {
|
||||
#ifdef CMRC_NO_EXCEPTIONS
|
||||
fprintf(stderr, "Error no such file or directory: %s\n", path.c_str());
|
||||
abort();
|
||||
#else
|
||||
throw std::system_error(make_error_code(std::errc::no_such_file_or_directory), path);
|
||||
#endif
|
||||
}
|
||||
if (!entry_ptr->is_directory()) {
|
||||
#ifdef CMRC_NO_EXCEPTIONS
|
||||
fprintf(stderr, "Error not a directory: %s\n", path.c_str());
|
||||
abort();
|
||||
#else
|
||||
throw std::system_error(make_error_code(std::errc::not_a_directory), path);
|
||||
#endif
|
||||
}
|
||||
return entry_ptr->as_directory().begin();
|
||||
}
|
||||
@@ -387,14 +406,14 @@ endif()
|
||||
file(GENERATE OUTPUT "${cmrc_hpp}" CONTENT "${hpp_content}" CONDITION ${_generate})
|
||||
|
||||
add_library(cmrc-base INTERFACE)
|
||||
target_include_directories(cmrc-base INTERFACE "${CMRC_INCLUDE_DIR}")
|
||||
target_include_directories(cmrc-base INTERFACE $<BUILD_INTERFACE:${CMRC_INCLUDE_DIR}>)
|
||||
# Signal a basic C++11 feature to require C++11.
|
||||
target_compile_features(cmrc-base INTERFACE cxx_nullptr)
|
||||
set_property(TARGET cmrc-base PROPERTY INTERFACE_CXX_EXTENSIONS OFF)
|
||||
add_library(cmrc::base ALIAS cmrc-base)
|
||||
|
||||
function(cmrc_add_resource_library name)
|
||||
set(args ALIAS NAMESPACE)
|
||||
set(args ALIAS NAMESPACE TYPE)
|
||||
cmake_parse_arguments(ARG "" "${args}" "" "${ARGN}")
|
||||
# Generate the identifier for the resource library's namespace
|
||||
set(ns_re "[a-zA-Z_][a-zA-Z0-9_]*")
|
||||
@@ -410,6 +429,14 @@ function(cmrc_add_resource_library name)
|
||||
endif()
|
||||
endif()
|
||||
set(libname "${name}")
|
||||
# Check that type is either "STATIC" or "OBJECT", or default to "STATIC" if
|
||||
# not set
|
||||
if(NOT DEFINED ARG_TYPE)
|
||||
set(ARG_TYPE STATIC)
|
||||
elseif(NOT "${ARG_TYPE}" MATCHES "^(STATIC|OBJECT)$")
|
||||
message(SEND_ERROR "${ARG_TYPE} is not a valid TYPE (STATIC and OBJECT are acceptable)")
|
||||
set(ARG_TYPE STATIC)
|
||||
endif()
|
||||
# Generate a library with the compiled in character arrays.
|
||||
string(CONFIGURE [=[
|
||||
#include <cmrc/cmrc.hpp>
|
||||
@@ -468,7 +495,7 @@ function(cmrc_add_resource_library name)
|
||||
# Generate the actual static library. Each source file is just a single file
|
||||
# with a character array compiled in containing the contents of the
|
||||
# corresponding resource file.
|
||||
add_library(${name} STATIC ${libcpp})
|
||||
add_library(${name} ${ARG_TYPE} ${libcpp})
|
||||
set_property(TARGET ${name} PROPERTY CMRC_LIBDIR "${libdir}")
|
||||
set_property(TARGET ${name} PROPERTY CMRC_NAMESPACE "${ARG_NAMESPACE}")
|
||||
target_link_libraries(${name} PUBLIC cmrc::base)
|
||||
@@ -558,7 +585,7 @@ function(cmrc_add_resources name)
|
||||
endif()
|
||||
get_filename_component(dirpath "${ARG_PREFIX}${relpath}" DIRECTORY)
|
||||
_cmrc_register_dirs("${name}" "${dirpath}")
|
||||
get_filename_component(abs_out "${libdir}/intermediate/${relpath}.cpp" ABSOLUTE)
|
||||
get_filename_component(abs_out "${libdir}/intermediate/${ARG_PREFIX}${relpath}.cpp" ABSOLUTE)
|
||||
# Generate a symbol name relpath the file's character array
|
||||
_cm_encode_fpath(sym "${relpath}")
|
||||
# Get the symbol name for the parent directory
|
||||
|
||||
@@ -41,8 +41,8 @@ foreach(_component ${GStreamerPluginsBad_FIND_COMPONENTS})
|
||||
_find_gst_plugins_bad_component(PLAYER gstplayer.h)
|
||||
elseif (${_component} STREQUAL "webrtc")
|
||||
_find_gst_plugins_bad_component(WEBRTC webrtc.h)
|
||||
elseif (${_component} STREQUAL "mpegts")
|
||||
_find_gst_plugins_bad_component(MPEGTS mpegts.h)
|
||||
elseif (${_component} STREQUAL "srtsrc")
|
||||
_find_gst_plugins_bad_component(SRTSRC mpegts.h)
|
||||
else()
|
||||
message (AUTHOR_WARNING "FindGStreamerPluginBad.cmake: Invalid component \"${_component}\" was specified")
|
||||
endif()
|
||||
|
||||
112
defines.h
@@ -1,112 +0,0 @@
|
||||
#ifndef VMIX_DEFINES_H
|
||||
#define VMIX_DEFINES_H
|
||||
|
||||
#define APP_NAME "vimix"
|
||||
#define APP_TITLE "Video Live Mixer"
|
||||
#define APP_SETTINGS "vimix.xml"
|
||||
#define XML_VERSION_MAJOR 0
|
||||
#define XML_VERSION_MINOR 3
|
||||
#define MAX_RECENT_HISTORY 20
|
||||
#define MAX_SESSION_LEVEL 3
|
||||
|
||||
#define VIMIX_FILE_EXT "mix"
|
||||
#define VIMIX_FILE_PATTERN "*.mix"
|
||||
#define MEDIA_FILES_PATTERN "*.mix", "*.mp4", "*.mpg", "*.mpeg", "*.m2v", "*.m4v", "*.avi", "*.mov",\
|
||||
"*.mkv", "*.webm", "*.mod", "*.wmv", "*.mxf", "*.ogg",\
|
||||
"*.flv", "*.hevc", "*.asf", "*.jpg", "*.png", "*.gif",\
|
||||
"*.tif", "*.tiff", "*.webp", "*.bmp", "*.ppm", "*.svg,"
|
||||
#define IMAGES_FILES_PATTERN "*.jpg", "*.png", "*.bmp", "*.ppm", "*.gif"
|
||||
|
||||
#define MINI(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define MAXI(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#define ABS(a) (((a) < 0) ? -(a) : (a))
|
||||
#define ABS_DIFF(a, b) ( (a) < (b) ? (b - a) : (a - b) )
|
||||
#define SIGN(a) (((a) < 0) ? -1.0 : 1.0)
|
||||
#define SQUARE(a) ((a) * (a))
|
||||
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
|
||||
#define EPSILON 0.00001
|
||||
#define LOG100(val) (50.0/log(10.0)*log((float)val + 1.0))
|
||||
#define EXP100(val) (exp(log(10.0)/50.0*(float)(val))-1.0)
|
||||
#define EUCLIDEAN(P1, P2) sqrt((P1.x() - P2.x()) * (P1.x() - P2.x()) + (P1.y() - P2.y()) * (P1.y() - P2.y()))
|
||||
#define ROUND(val, factor) float( int( val * factor ) ) / factor;
|
||||
|
||||
#define SCENE_UNIT 5.f
|
||||
#define MIN_SCALE 0.01f
|
||||
#define MAX_SCALE 10.f
|
||||
#define CLAMP_SCALE(x) SIGN(x) * CLAMP( ABS(x), MIN_SCALE, MAX_SCALE)
|
||||
#define SCENE_DEPTH 14.f
|
||||
#define MIN_DEPTH 0.f
|
||||
#define MAX_DEPTH 12.f
|
||||
#define DELTA_DEPTH 0.05f
|
||||
#define DELTA_ALPHA 0.0005f
|
||||
#define MIXING_DEFAULT_SCALE 2.4f
|
||||
#define MIXING_MIN_SCALE 0.8f
|
||||
#define MIXING_MAX_SCALE 7.0f
|
||||
#define MIXING_MIN_THRESHOLD 1.3f
|
||||
#define MIXING_MAX_THRESHOLD 1.9f
|
||||
#define MIXING_ICON_SCALE 0.15f, 0.15f, 1.f
|
||||
#define GEOMETRY_DEFAULT_SCALE 1.4f
|
||||
#define GEOMETRY_MIN_SCALE 0.4f
|
||||
#define GEOMETRY_MAX_SCALE 7.0f
|
||||
#define LAYER_DEFAULT_SCALE 0.6f
|
||||
#define LAYER_MIN_SCALE 0.25f
|
||||
#define LAYER_MAX_SCALE 1.7f
|
||||
#define LAYER_PERSPECTIVE 2.0f
|
||||
#define LAYER_BACKGROUND 2.f
|
||||
#define LAYER_FOREGROUND 10.f
|
||||
#define LAYER_STEP 0.25f
|
||||
#define APPEARANCE_DEFAULT_SCALE 2.f
|
||||
#define APPEARANCE_MIN_SCALE 0.4f
|
||||
#define APPEARANCE_MAX_SCALE 7.0f
|
||||
#define BRUSH_MIN_SIZE 0.05f
|
||||
#define BRUSH_MAX_SIZE 2.f
|
||||
#define BRUSH_MIN_PRESS 0.005f
|
||||
#define BRUSH_MAX_PRESS 1.f
|
||||
#define SHAPE_MIN_BLUR 0.f
|
||||
#define SHAPE_MAX_BLUR 1.f
|
||||
#define TRANSITION_DEFAULT_SCALE 5.0f
|
||||
#define TRANSITION_MIN_DURATION 0.2f
|
||||
#define TRANSITION_MAX_DURATION 10.f
|
||||
#define ARROWS_MOVEMENT_FACTOR 0.1f
|
||||
#define SESSION_THUMBNAIL_HEIGHT 120.f
|
||||
#define RECORD_MAX_TIMEOUT 1200000
|
||||
|
||||
#define IMGUI_TITLE_LOGS ICON_FA_LIST_UL " Logs"
|
||||
#define IMGUI_LABEL_RECENT_FILES " Recent files"
|
||||
#define IMGUI_LABEL_RECENT_RECORDS " Recent recordings"
|
||||
#define IMGUI_RIGHT_ALIGN -3.5f * ImGui::GetTextLineHeightWithSpacing()
|
||||
#define IMGUI_SAME_LINE 10
|
||||
#define IMGUI_TOP_ALIGN 10
|
||||
#define IMGUI_COLOR_OVERLAY IM_COL32(5, 5, 5, 150)
|
||||
#define IMGUI_COLOR_LIGHT_OVERLAY IM_COL32(5, 5, 5, 50)
|
||||
#define IMGUI_COLOR_CAPTURE 1.0, 0.55, 0.05
|
||||
#define IMGUI_COLOR_RECORD 1.0, 0.05, 0.05
|
||||
#define IMGUI_COLOR_STREAM 0.05, 0.8, 1.0
|
||||
#define IMGUI_COLOR_BROADCAST 0.1, 0.9, 0.1
|
||||
#define IMGUI_NOTIFICATION_DURATION 2.5f
|
||||
#define IMGUI_TOOLTIP_TIMEOUT 80
|
||||
|
||||
#define COLOR_BGROUND 0.2f, 0.2f, 0.2f
|
||||
#define COLOR_NAVIGATOR 0.1f, 0.1f, 0.1f
|
||||
#define COLOR_DEFAULT_SOURCE 0.7f, 0.7f, 0.7f
|
||||
#define COLOR_HIGHLIGHT_SOURCE 1.f, 1.f, 1.f
|
||||
#define COLOR_TRANSITION_SOURCE 1.f, 0.5f, 1.f
|
||||
#define COLOR_TRANSITION_LINES 0.9f, 0.9f, 0.9f
|
||||
#define COLOR_APPEARANCE_SOURCE 0.9f, 0.9f, 0.1f
|
||||
#define COLOR_APPEARANCE_LIGHT 1.0f, 1.0f, 0.9f
|
||||
#define COLOR_APPEARANCE_MASK 0.9f, 0.9f, 0.9f
|
||||
#define COLOR_APPEARANCE_MASK_DISABLE 0.6f, 0.6f, 0.6f
|
||||
#define COLOR_FRAME 0.75f, 0.2f, 0.75f
|
||||
#define COLOR_FRAME_LIGHT 0.9f, 0.6f, 0.9f
|
||||
#define COLOR_CIRCLE 0.75f, 0.2f, 0.75f
|
||||
#define COLOR_CIRCLE_OVER 0.8f, 0.8f, 0.8f
|
||||
#define COLOR_MIXING_GROUP 0.f, 0.95f, 0.2f
|
||||
#define COLOR_LIMBO_CIRCLE 0.173f, 0.173f, 0.173f
|
||||
#define COLOR_SLIDER_CIRCLE 0.11f, 0.11f, 0.11f
|
||||
#define COLOR_STASH_CIRCLE 0.06f, 0.06f, 0.06f
|
||||
|
||||
#define OSC_PORT_RECV_DEFAULT 7000
|
||||
#define OSC_PORT_SEND_DEFAULT 7001
|
||||
#define OSC_CONFIG_FILE "osc.xml"
|
||||
|
||||
#endif // VMIX_DEFINES_H
|
||||
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 971 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 381 KiB |
|
Before Width: | Height: | Size: 350 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 337 KiB |
|
Before Width: | Height: | Size: 356 KiB After Width: | Height: | Size: 429 KiB |
BIN
docs/images/manual_clonefilter_0.png
Normal file
|
After Width: | Height: | Size: 338 KiB |
BIN
docs/images/manual_clonefilter_1.png
Normal file
|
After Width: | Height: | Size: 498 KiB |
BIN
docs/images/manual_clonefilter_2.png
Normal file
|
After Width: | Height: | Size: 913 KiB |
BIN
docs/images/manual_filter_alpha_chromakey.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
docs/images/manual_filter_alpha_fill.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
docs/images/manual_filter_alpha_lumakey.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
docs/images/manual_filter_blur_closing.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
docs/images/manual_filter_blur_fast.png
Normal file
|
After Width: | Height: | Size: 676 KiB |
BIN
docs/images/manual_filter_blur_gaussian.png
Normal file
|
After Width: | Height: | Size: 592 KiB |
BIN
docs/images/manual_filter_blur_opening.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
docs/images/manual_filter_blur_scattered.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
docs/images/manual_filter_chain_0.png
Normal file
|
After Width: | Height: | Size: 426 KiB |
BIN
docs/images/manual_filter_chain_1.png
Normal file
|
After Width: | Height: | Size: 410 KiB |
BIN
docs/images/manual_filter_chain_2.png
Normal file
|
After Width: | Height: | Size: 526 KiB |
BIN
docs/images/manual_filter_chain_3.png
Normal file
|
After Width: | Height: | Size: 443 KiB |
BIN
docs/images/manual_filter_chain_4.png
Normal file
|
After Width: | Height: | Size: 441 KiB |
BIN
docs/images/manual_filter_chain_5.png
Normal file
|
After Width: | Height: | Size: 383 KiB |
BIN
docs/images/manual_filter_delay.png
Normal file
|
After Width: | Height: | Size: 863 KiB |
BIN
docs/images/manual_filter_downsample.png
Normal file
|
After Width: | Height: | Size: 742 KiB |
BIN
docs/images/manual_filter_edge_contour.png
Normal file
|
After Width: | Height: | Size: 330 KiB |
BIN
docs/images/manual_filter_edge_freichen.png
Normal file
|
After Width: | Height: | Size: 586 KiB |
BIN
docs/images/manual_filter_edge_sobel.png
Normal file
|
After Width: | Height: | Size: 565 KiB |
BIN
docs/images/manual_filter_edge_thresholding.png
Normal file
|
After Width: | Height: | Size: 330 KiB |
BIN
docs/images/manual_filter_sharpen_blackhat.png
Normal file
|
After Width: | Height: | Size: 990 KiB |
BIN
docs/images/manual_filter_sharpen_convolution.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
docs/images/manual_filter_sharpen_edge.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
docs/images/manual_filter_sharpen_unsharpmask.png
Normal file
|
After Width: | Height: | Size: 988 KiB |
BIN
docs/images/manual_filter_sharpen_whitehat.png
Normal file
|
After Width: | Height: | Size: 1006 KiB |
BIN
docs/images/manual_filter_smooth_add_grain.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
docs/images/manual_filter_smooth_add_noise.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
docs/images/manual_filter_smooth_bilateral.png
Normal file
|
After Width: | Height: | Size: 710 KiB |
BIN
docs/images/manual_filter_smooth_closing.png
Normal file
|
After Width: | Height: | Size: 792 KiB |
BIN
docs/images/manual_filter_smooth_dilation.png
Normal file
|
After Width: | Height: | Size: 810 KiB |
BIN
docs/images/manual_filter_smooth_erosion.png
Normal file
|
After Width: | Height: | Size: 779 KiB |
BIN
docs/images/manual_filter_smooth_kuwahara.png
Normal file
|
After Width: | Height: | Size: 838 KiB |
BIN
docs/images/manual_filter_smooth_opening.png
Normal file
|
After Width: | Height: | Size: 735 KiB |
BIN
docs/images/manual_filter_smooth_removenoise.png
Normal file
|
After Width: | Height: | Size: 761 KiB |
|
Before Width: | Height: | Size: 291 KiB After Width: | Height: | Size: 986 KiB |
|
Before Width: | Height: | Size: 379 KiB After Width: | Height: | Size: 1.1 MiB |
BIN
docs/images/manual_group_sources_0.png
Normal file
|
After Width: | Height: | Size: 515 KiB |
BIN
docs/images/manual_group_sources_1.png
Normal file
|
After Width: | Height: | Size: 612 KiB |
BIN
docs/images/manual_group_sources_2.png
Normal file
|
After Width: | Height: | Size: 560 KiB |
BIN
docs/images/manual_group_sources_3.png
Normal file
|
After Width: | Height: | Size: 517 KiB |
BIN
docs/images/manual_group_sources_4.png
Normal file
|
After Width: | Height: | Size: 528 KiB |
BIN
docs/images/manual_group_sources_5.png
Normal file
|
After Width: | Height: | Size: 465 KiB |
BIN
docs/images/manual_laryxscreencast_receive.png
Normal file
|
After Width: | Height: | Size: 327 KiB |
|
Before Width: | Height: | Size: 389 KiB After Width: | Height: | Size: 392 KiB |
BIN
docs/images/manual_order_sources.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
docs/images/manual_recording_0.png
Normal file
|
After Width: | Height: | Size: 570 KiB |
BIN
docs/images/manual_recording_1.png
Normal file
|
After Width: | Height: | Size: 541 KiB |
BIN
docs/images/manual_recording_2.png
Normal file
|
After Width: | Height: | Size: 670 KiB |
BIN
docs/images/manual_sequence_0.png
Normal file
|
After Width: | Height: | Size: 270 KiB |
BIN
docs/images/manual_sequence_1.png
Normal file
|
After Width: | Height: | Size: 253 KiB |
BIN
docs/images/manual_shadertoy_0.png
Normal file
|
After Width: | Height: | Size: 866 KiB |
BIN
docs/images/manual_shadertoy_1.png
Normal file
|
After Width: | Height: | Size: 708 KiB |
BIN
docs/images/manual_shadertoy_2.png
Normal file
|
After Width: | Height: | Size: 303 KiB |
BIN
docs/images/manual_shadertoy_3.png
Normal file
|
After Width: | Height: | Size: 250 KiB |
BIN
docs/images/manual_shadertoy_4.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
docs/images/manual_shadertoy_5.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
docs/images/manual_srt_broadcast.png
Normal file
|
After Width: | Height: | Size: 310 KiB |
BIN
docs/images/manual_srt_haivision_broadcast.jpg
Executable file
|
After Width: | Height: | Size: 186 KiB |
BIN
docs/images/manual_srt_haivision_source.jpg
Executable file
|
After Width: | Height: | Size: 167 KiB |
BIN
docs/images/manual_srt_laryx_broadcast.png
Normal file
|
After Width: | Height: | Size: 664 KiB |
BIN
docs/images/manual_srt_laryx_broadcast_config.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
docs/images/manual_srt_laryx_player.png
Normal file
|
After Width: | Height: | Size: 518 KiB |
BIN
docs/images/manual_srt_laryx_player_config.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
docs/images/manual_srt_laryx_receive.png
Normal file
|
After Width: | Height: | Size: 293 KiB |
BIN
docs/images/manual_srt_laryx_screencast_config.png
Normal file
|
After Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 885 KiB |