mirror of
https://github.com/mfontanini/presenterm.git
synced 2025-05-05 15:32:58 +00:00
feat: use UDP to publish/listen for speaker notes
This commit is contained in:
parent
954f112bfd
commit
e2d8313132
418
Cargo.lock
generated
418
Cargo.lock
generated
@ -1,6 +1,6 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "adler2"
|
||||
@ -17,12 +17,6 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aliasable"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
|
||||
|
||||
[[package]]
|
||||
name = "aligned-vec"
|
||||
version = "0.5.0"
|
||||
@ -176,29 +170,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.69.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"itertools 0.12.1",
|
||||
"lazy_static",
|
||||
"lazycell",
|
||||
"log",
|
||||
"prettyplease",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"rustc-hash",
|
||||
"shlex",
|
||||
"syn",
|
||||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
@ -296,25 +267,6 @@ dependencies = [
|
||||
"shlex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cdr"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9617422bf43fde9280707a7e90f8f7494389c182f5c70b0f67592d0f06d41dfa"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cexpr"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
|
||||
dependencies = [
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-expr"
|
||||
version = "0.15.8"
|
||||
@ -344,17 +296,6 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clang-sys"
|
||||
version = "1.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
|
||||
dependencies = [
|
||||
"glob",
|
||||
"libc",
|
||||
"libloading",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.23"
|
||||
@ -383,7 +324,7 @@ version = "4.5.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
@ -580,26 +521,6 @@ version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca"
|
||||
|
||||
[[package]]
|
||||
name = "enum-iterator"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c280b9e6b3ae19e152d8e31cf47f18389781e119d4013a2a2bb0180e5facc635"
|
||||
dependencies = [
|
||||
"enum-iterator-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum-iterator-derive"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "equivalent"
|
||||
version = "1.0.1"
|
||||
@ -613,7 +534,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -705,12 +626,6 @@ dependencies = [
|
||||
"stable_deref_trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.5.0"
|
||||
@ -723,15 +638,6 @@ version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||
|
||||
[[package]]
|
||||
name = "home"
|
||||
version = "0.5.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"
|
||||
dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone"
|
||||
version = "0.1.61"
|
||||
@ -755,184 +661,6 @@ dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "12c091b5786a230240f8f2691b9d29508ed0a02c025c254abaed8bc788a66bb3"
|
||||
dependencies = [
|
||||
"cdr",
|
||||
"iceoryx2-bb-container",
|
||||
"iceoryx2-bb-derive-macros",
|
||||
"iceoryx2-bb-elementary",
|
||||
"iceoryx2-bb-lock-free",
|
||||
"iceoryx2-bb-log",
|
||||
"iceoryx2-bb-memory",
|
||||
"iceoryx2-bb-posix",
|
||||
"iceoryx2-bb-system-types",
|
||||
"iceoryx2-cal",
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"lazy_static",
|
||||
"serde",
|
||||
"sha1_smol",
|
||||
"tiny-fn",
|
||||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-container"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fff9d75921f8ccd3e19261d72082b52ccc4704dcdd6930efe6c17b15693ab519"
|
||||
dependencies = [
|
||||
"iceoryx2-bb-derive-macros",
|
||||
"iceoryx2-bb-elementary",
|
||||
"iceoryx2-bb-log",
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-derive-macros"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9257482fb822946bb3028225b6807350e3f815068961ff5bf683735ce01d59a4"
|
||||
dependencies = [
|
||||
"iceoryx2-bb-elementary",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-elementary"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "38aae0237ff1575a7d9672c0202e5d313e7f674a635f6aaf619d2090fb7a12c2"
|
||||
dependencies = [
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-lock-free"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ec3227a0c8b1d9e1ea4c61fa6a773e7c3b721fa3e2fd4363324f302b35ac85b"
|
||||
dependencies = [
|
||||
"iceoryx2-bb-elementary",
|
||||
"iceoryx2-bb-log",
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"tiny-fn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-log"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "07df5e6ff06cc2ffb0a86b67c7cd4be86b11264d5e83c02a52b384e2d5e6363a"
|
||||
dependencies = [
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"termsize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-memory"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "55a4ae8856404b6e7eca567004673ca39109fc70fcf387b96ca6d6d27c61f31b"
|
||||
dependencies = [
|
||||
"iceoryx2-bb-elementary",
|
||||
"iceoryx2-bb-lock-free",
|
||||
"iceoryx2-bb-log",
|
||||
"iceoryx2-bb-posix",
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"lazy_static",
|
||||
"tiny-fn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-posix"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "122ff88c452a3045a9de6db73d0429da736578f76eab75779dd0d3681de75d57"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"enum-iterator",
|
||||
"iceoryx2-bb-container",
|
||||
"iceoryx2-bb-elementary",
|
||||
"iceoryx2-bb-log",
|
||||
"iceoryx2-bb-system-types",
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"iceoryx2-pal-configuration",
|
||||
"iceoryx2-pal-posix",
|
||||
"lazy_static",
|
||||
"serde",
|
||||
"tiny-fn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-bb-system-types"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac2fb11a94823c3b9117a5e14edf16fd467794cf5391738eb2d8b7fc8e9b04fd"
|
||||
dependencies = [
|
||||
"iceoryx2-bb-container",
|
||||
"iceoryx2-bb-elementary",
|
||||
"iceoryx2-bb-log",
|
||||
"iceoryx2-pal-configuration",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-cal"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c64b8eee1d57c4336d7df7d521671d8b76c72cac16af0db651e40f8c45f0946"
|
||||
dependencies = [
|
||||
"cdr",
|
||||
"iceoryx2-bb-container",
|
||||
"iceoryx2-bb-elementary",
|
||||
"iceoryx2-bb-lock-free",
|
||||
"iceoryx2-bb-log",
|
||||
"iceoryx2-bb-memory",
|
||||
"iceoryx2-bb-posix",
|
||||
"iceoryx2-bb-system-types",
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"lazy_static",
|
||||
"once_cell",
|
||||
"ouroboros",
|
||||
"serde",
|
||||
"sha1_smol",
|
||||
"tiny-fn",
|
||||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-pal-concurrency-sync"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92dc4ec7c023819c41b5a14c9ca58e8dbb86476053321decda73ac440996f35f"
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-pal-configuration"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d900aa8f9c5b661a9c5ddfbdc28eb87ac8c32be5375ca9b055b087d1c89c984d"
|
||||
|
||||
[[package]]
|
||||
name = "iceoryx2-pal-posix"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5789169791a6274b492561b95543e1c635285cb454d547f78e53cbc1acd9b3f5"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"cc",
|
||||
"iceoryx2-pal-concurrency-sync",
|
||||
"iceoryx2-pal-configuration",
|
||||
"lazy_static",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ident_case"
|
||||
version = "1.0.1"
|
||||
@ -1056,18 +784,6 @@ dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "lazycell"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.169"
|
||||
@ -1084,16 +800,6 @@ dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libredox"
|
||||
version = "0.1.3"
|
||||
@ -1317,31 +1023,6 @@ dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ouroboros"
|
||||
version = "0.18.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "944fa20996a25aded6b4795c6d63f10014a7a83f8be9828a11860b08c5fc4a67"
|
||||
dependencies = [
|
||||
"aliasable",
|
||||
"ouroboros_macro",
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ouroboros_macro"
|
||||
version = "0.18.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39b0deead1528fd0e5947a8546a9642a9777c25f6e1e26f34c97b204bbb465bd"
|
||||
dependencies = [
|
||||
"heck 0.4.1",
|
||||
"itertools 0.12.1",
|
||||
"proc-macro2",
|
||||
"proc-macro2-diagnostics",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.12.3"
|
||||
@ -1431,7 +1112,6 @@ dependencies = [
|
||||
"directories",
|
||||
"flate2",
|
||||
"hex",
|
||||
"iceoryx2",
|
||||
"image",
|
||||
"itertools 0.13.0",
|
||||
"libc",
|
||||
@ -1447,6 +1127,7 @@ dependencies = [
|
||||
"serde_with",
|
||||
"serde_yaml",
|
||||
"sixel-rs",
|
||||
"socket2",
|
||||
"strum",
|
||||
"syntect",
|
||||
"tempfile",
|
||||
@ -1474,19 +1155,6 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2-diagnostics"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"version_check",
|
||||
"yansi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "profiling"
|
||||
version = "1.0.16"
|
||||
@ -1718,12 +1386,6 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.4.1"
|
||||
@ -1743,7 +1405,7 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1898,12 +1560,6 @@ dependencies = [
|
||||
"unsafe-libyaml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha1_smol"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d"
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.3.0"
|
||||
@ -1989,18 +1645,22 @@ version = "1.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stable_deref_trait"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.11.1"
|
||||
@ -2022,7 +1682,7 @@ version = "0.26.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
@ -2068,7 +1728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349"
|
||||
dependencies = [
|
||||
"cfg-expr",
|
||||
"heck 0.5.0",
|
||||
"heck",
|
||||
"pkg-config",
|
||||
"toml",
|
||||
"version-compare",
|
||||
@ -2090,17 +1750,7 @@ dependencies = [
|
||||
"fastrand",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termsize"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6f11ff5c25c172608d5b85e2fb43ee9a6d683a7f4ab7f96ae07b3d8b590368fd"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"winapi",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2174,12 +1824,6 @@ dependencies = [
|
||||
"time-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tiny-fn"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2fde9a76dac5751480f711f327371c809d7f8a9f036436e6237d67859adbf3bd"
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.8.1"
|
||||
@ -2297,12 +1941,6 @@ version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.5.0"
|
||||
@ -2379,18 +2017,6 @@ version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082"
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "4.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
|
||||
dependencies = [
|
||||
"either",
|
||||
"home",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
@ -2413,7 +2039,7 @@ version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2588,12 +2214,6 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yansi"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.7.35"
|
||||
|
@ -29,6 +29,7 @@ serde = { version = "1.0", features = ["derive"] }
|
||||
serde_yaml = "0.9"
|
||||
serde_json = "1.0"
|
||||
serde_with = "3.6"
|
||||
socket2 = "0.5.8"
|
||||
strum = { version = "0.26", features = ["derive"] }
|
||||
tempfile = "3.10"
|
||||
tl = "0.7"
|
||||
@ -36,7 +37,6 @@ thiserror = "2"
|
||||
unicode-width = "0.2"
|
||||
os_pipe = "1.1.5"
|
||||
libc = "0.2.155"
|
||||
iceoryx2 = "0.5.0"
|
||||
|
||||
[dependencies.syntect]
|
||||
version = "5.2"
|
||||
|
@ -23,6 +23,9 @@
|
||||
"snippet": {
|
||||
"$ref": "#/definitions/SnippetConfig"
|
||||
},
|
||||
"speaker_notes": {
|
||||
"$ref": "#/definitions/SpeakerNotesConfig"
|
||||
},
|
||||
"typst": {
|
||||
"$ref": "#/definitions/TypstConfig"
|
||||
}
|
||||
@ -496,6 +499,27 @@
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"SpeakerNotesConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"always_publish": {
|
||||
"description": "Whether to always publish speaker notes.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"listen_address": {
|
||||
"description": "The address in which to listen for speaker note events.",
|
||||
"default": "127.255.255.255:59418",
|
||||
"type": "string"
|
||||
},
|
||||
"publish_address": {
|
||||
"description": "The address in which to publish speaker notes events.",
|
||||
"default": "127.255.255.255:59418",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"TypstConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -23,16 +23,17 @@ Run the following two commands in separate terminals.
|
||||
|
||||
<!-- speaker_note: This is a speaker note from slide 2. -->
|
||||
|
||||
The `--speaker-notes-mode=publisher` argument will render your actual presentation as normal, without speaker notes:
|
||||
The `--publish-speaker-notes` argument will render your actual presentation as normal, without speaker notes:
|
||||
|
||||
```
|
||||
presenterm --speaker-notes-mode=publisher examples/speaker-notes.md
|
||||
presenterm --publish-speaker-notes examples/speaker-notes.md
|
||||
```
|
||||
|
||||
The `--speaker-notes-mode=receiver` argument will render only the speaker notes for the current slide being shown in the actual presentation:
|
||||
The `--listen-speaker-notes` argument will render only the speaker notes for the current slide being shown in the actual
|
||||
presentation:
|
||||
|
||||
```
|
||||
presenterm --speaker-notes-mode=receiver examples/speaker-notes.md
|
||||
presenterm --listen-speaker-notes examples/speaker-notes.md
|
||||
```
|
||||
|
||||
<!-- speaker_note: Demonstrate changing slides in the actual presentation. -->
|
||||
|
@ -1,9 +1,8 @@
|
||||
use super::{
|
||||
SpeakerNotesCommand,
|
||||
keyboard::{CommandKeyBindings, KeyBindingsValidationError, KeyboardListener},
|
||||
speaker_notes::{SpeakerNotesEvent, SpeakerNotesEventListener},
|
||||
};
|
||||
use crate::{config::KeyBindingsConfig, presenter::PresentationError};
|
||||
use iceoryx2::{port::subscriber::Subscriber, service::ipc::Service};
|
||||
use serde::Deserialize;
|
||||
use std::time::Duration;
|
||||
use strum::EnumDiscriminants;
|
||||
@ -11,28 +10,28 @@ use strum::EnumDiscriminants;
|
||||
/// A command listener that allows polling all command sources in a single place.
|
||||
pub struct CommandListener {
|
||||
keyboard: KeyboardListener,
|
||||
speaker_notes_event_receiver: Option<Subscriber<Service, SpeakerNotesCommand, ()>>,
|
||||
speaker_notes_event_listener: Option<SpeakerNotesEventListener>,
|
||||
}
|
||||
|
||||
impl CommandListener {
|
||||
/// Create a new command source over the given presentation path.
|
||||
pub fn new(
|
||||
config: KeyBindingsConfig,
|
||||
speaker_notes_event_receiver: Option<Subscriber<Service, SpeakerNotesCommand, ()>>,
|
||||
speaker_notes_event_listener: Option<SpeakerNotesEventListener>,
|
||||
) -> Result<Self, KeyBindingsValidationError> {
|
||||
let bindings = CommandKeyBindings::try_from(config)?;
|
||||
Ok(Self { keyboard: KeyboardListener::new(bindings), speaker_notes_event_receiver })
|
||||
Ok(Self { keyboard: KeyboardListener::new(bindings), speaker_notes_event_listener })
|
||||
}
|
||||
|
||||
/// Try to get the next command.
|
||||
///
|
||||
/// This attempts to get a command and returns `Ok(None)` on timeout.
|
||||
pub(crate) fn try_next_command(&mut self) -> Result<Option<Command>, PresentationError> {
|
||||
if let Some(receiver) = self.speaker_notes_event_receiver.as_mut() {
|
||||
if let Some(msg) = receiver.receive()? {
|
||||
let command = match msg.payload() {
|
||||
SpeakerNotesCommand::GoToSlide(idx) => Command::GoToSlide(*idx),
|
||||
SpeakerNotesCommand::Exit => Command::Exit,
|
||||
if let Some(receiver) = &self.speaker_notes_event_listener {
|
||||
if let Some(msg) = receiver.try_recv()? {
|
||||
let command = match msg {
|
||||
SpeakerNotesEvent::GoToSlide { slide } => Command::GoToSlide(slide),
|
||||
SpeakerNotesEvent::Exit => Command::Exit,
|
||||
};
|
||||
return Ok(Some(command));
|
||||
}
|
||||
|
@ -1,9 +1,3 @@
|
||||
pub(crate) mod keyboard;
|
||||
pub(crate) mod listener;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[repr(C)]
|
||||
pub enum SpeakerNotesCommand {
|
||||
GoToSlide(u32),
|
||||
Exit,
|
||||
}
|
||||
pub(crate) mod speaker_notes;
|
||||
|
75
src/commands/speaker_notes.rs
Normal file
75
src/commands/speaker_notes.rs
Normal file
@ -0,0 +1,75 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use socket2::{Domain, Protocol, Socket, Type};
|
||||
use std::{
|
||||
io,
|
||||
net::{SocketAddr, UdpSocket},
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
pub struct SpeakerNotesEventPublisher {
|
||||
socket: UdpSocket,
|
||||
presentation_path: PathBuf,
|
||||
}
|
||||
|
||||
impl SpeakerNotesEventPublisher {
|
||||
pub fn new(address: SocketAddr, presentation_path: PathBuf) -> io::Result<Self> {
|
||||
let socket = UdpSocket::bind("127.0.0.1:0")?;
|
||||
socket.set_broadcast(true)?;
|
||||
socket.connect(address)?;
|
||||
Ok(Self { socket, presentation_path })
|
||||
}
|
||||
|
||||
pub(crate) fn send(&self, event: SpeakerNotesEvent) -> io::Result<()> {
|
||||
// Wrap this event in an envelope that contains the presentation path so listeners can
|
||||
// ignore unrelated events.
|
||||
let envelope = SpeakerNotesEventEnvelope { event, presentation_path: self.presentation_path.clone() };
|
||||
let data = serde_json::to_string(&envelope).expect("serialization failed");
|
||||
self.socket.send(data.as_bytes())?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct SpeakerNotesEventListener {
|
||||
socket: UdpSocket,
|
||||
presentation_path: PathBuf,
|
||||
}
|
||||
|
||||
impl SpeakerNotesEventListener {
|
||||
pub fn new(address: SocketAddr, presentation_path: PathBuf) -> io::Result<Self> {
|
||||
let s = Socket::new(Domain::IPV4, Type::DGRAM, Some(Protocol::UDP))?;
|
||||
// Use SO_REUSEADDR so we can have multiple listeners on the same port.
|
||||
s.set_reuse_address(true)?;
|
||||
// Don't block so we can listen to the keyboard and this socket at the same time.
|
||||
s.set_nonblocking(true)?;
|
||||
s.bind(&address.into())?;
|
||||
Ok(Self { socket: s.into(), presentation_path })
|
||||
}
|
||||
|
||||
pub(crate) fn try_recv(&self) -> io::Result<Option<SpeakerNotesEvent>> {
|
||||
let mut buffer = [0; 1024];
|
||||
let bytes_read = match self.socket.recv(&mut buffer) {
|
||||
Ok(bytes_read) => bytes_read,
|
||||
Err(e) if e.kind() == io::ErrorKind::WouldBlock => return Ok(None),
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
// Ignore garbage. Odds are this is someone else sending garbage rather than presenterm
|
||||
// itself.
|
||||
let Ok(envelope) = serde_json::from_slice::<SpeakerNotesEventEnvelope>(&buffer[0..bytes_read]) else {
|
||||
return Ok(None);
|
||||
};
|
||||
if envelope.presentation_path == self.presentation_path { Ok(Some(envelope.event)) } else { Ok(None) }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "command")]
|
||||
pub(crate) enum SpeakerNotesEvent {
|
||||
GoToSlide { slide: u32 },
|
||||
Exit,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
struct SpeakerNotesEventEnvelope {
|
||||
presentation_path: PathBuf,
|
||||
event: SpeakerNotesEvent,
|
||||
}
|
@ -11,6 +11,7 @@ use serde::Deserialize;
|
||||
use std::{
|
||||
collections::{BTreeMap, HashMap},
|
||||
fs, io,
|
||||
net::{IpAddr, Ipv4Addr, SocketAddr},
|
||||
path::Path,
|
||||
};
|
||||
|
||||
@ -35,6 +36,9 @@ pub struct Config {
|
||||
|
||||
#[serde(default)]
|
||||
pub snippet: SnippetConfig,
|
||||
|
||||
#[serde(default)]
|
||||
pub speaker_notes: SpeakerNotesConfig,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
@ -385,6 +389,32 @@ impl Default for KeyBindingsConfig {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, JsonSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct SpeakerNotesConfig {
|
||||
/// The address in which to listen for speaker note events.
|
||||
#[serde(default = "default_speaker_notes_address")]
|
||||
pub listen_address: SocketAddr,
|
||||
|
||||
/// The address in which to publish speaker notes events.
|
||||
#[serde(default = "default_speaker_notes_address")]
|
||||
pub publish_address: SocketAddr,
|
||||
|
||||
/// Whether to always publish speaker notes.
|
||||
#[serde(default)]
|
||||
pub always_publish: bool,
|
||||
}
|
||||
|
||||
impl Default for SpeakerNotesConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
listen_address: default_speaker_notes_address(),
|
||||
publish_address: default_speaker_notes_address(),
|
||||
always_publish: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn make_keybindings<const N: usize>(raw_bindings: [&str; N]) -> Vec<KeyBinding> {
|
||||
let mut bindings = Vec::new();
|
||||
for binding in raw_bindings {
|
||||
@ -449,6 +479,10 @@ fn default_suspend_bindings() -> Vec<KeyBinding> {
|
||||
make_keybindings(["<c-z>"])
|
||||
}
|
||||
|
||||
fn default_speaker_notes_address() -> SocketAddr {
|
||||
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 255, 255, 255)), 59418)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
118
src/main.rs
118
src/main.rs
@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
code::{execute::SnippetExecutor, highlighting::HighlightThemeSet},
|
||||
commands::{SpeakerNotesCommand, listener::CommandListener},
|
||||
commands::listener::CommandListener,
|
||||
config::{Config, ImageProtocol, ValidateOverflows},
|
||||
demo::ThemesDemo,
|
||||
export::Exporter,
|
||||
@ -15,18 +15,10 @@ use crate::{
|
||||
theme::{PresentationTheme, PresentationThemeSet},
|
||||
third_party::{ThirdPartyConfigs, ThirdPartyRender},
|
||||
};
|
||||
use clap::{CommandFactory, Parser, ValueEnum, error::ErrorKind};
|
||||
use clap::{CommandFactory, Parser, error::ErrorKind};
|
||||
use commands::speaker_notes::{SpeakerNotesEventListener, SpeakerNotesEventPublisher};
|
||||
use comrak::Arena;
|
||||
use directories::ProjectDirs;
|
||||
use iceoryx2::{
|
||||
node::NodeBuilder,
|
||||
service::{
|
||||
builder::publish_subscribe::{Builder, PublishSubscribeCreateError, PublishSubscribeOpenError},
|
||||
ipc::Service,
|
||||
},
|
||||
};
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
use std::{
|
||||
env::{self, current_dir},
|
||||
io,
|
||||
@ -53,41 +45,6 @@ mod ui;
|
||||
|
||||
const DEFAULT_THEME: &str = "dark";
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, ValueEnum, JsonSchema)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum SpeakerNotesMode {
|
||||
Publisher,
|
||||
Receiver,
|
||||
}
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
enum IpcServiceError {
|
||||
#[error("no presenterm process in publisher mode running for presentation")]
|
||||
ServiceOpenError,
|
||||
#[error("existing presenterm process in publisher mode already running for presentation")]
|
||||
ServiceCreateError,
|
||||
#[error("{0}")]
|
||||
Other(String),
|
||||
}
|
||||
|
||||
impl From<PublishSubscribeOpenError> for IpcServiceError {
|
||||
fn from(value: PublishSubscribeOpenError) -> Self {
|
||||
match value {
|
||||
PublishSubscribeOpenError::DoesNotExist => Self::ServiceOpenError,
|
||||
_ => Self::Other(value.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PublishSubscribeCreateError> for IpcServiceError {
|
||||
fn from(value: PublishSubscribeCreateError) -> Self {
|
||||
match value {
|
||||
PublishSubscribeCreateError::AlreadyExists => Self::ServiceCreateError,
|
||||
_ => Self::Other(value.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Run slideshows from your terminal.
|
||||
#[derive(Parser)]
|
||||
#[command()]
|
||||
@ -149,8 +106,13 @@ struct Cli {
|
||||
#[clap(short, long)]
|
||||
config_file: Option<String>,
|
||||
|
||||
#[clap(short, long)]
|
||||
speaker_notes_mode: Option<SpeakerNotesMode>,
|
||||
/// Whether to publish speaker notes to local listeners.
|
||||
#[clap(short = 'P', long, group = "speaker-notes")]
|
||||
publish_speaker_notes: bool,
|
||||
|
||||
/// Whether to listen for speaker notes.
|
||||
#[clap(short, long, group = "speaker-notes")]
|
||||
listen_speaker_notes: bool,
|
||||
}
|
||||
|
||||
fn create_splash() -> String {
|
||||
@ -216,7 +178,7 @@ fn make_builder_options(
|
||||
config: &Config,
|
||||
mode: &PresentMode,
|
||||
force_default_theme: bool,
|
||||
speaker_notes_mode: Option<SpeakerNotesMode>,
|
||||
render_speaker_notes_only: bool,
|
||||
) -> PresentationBuilderOptions {
|
||||
PresentationBuilderOptions {
|
||||
allow_mutations: !matches!(mode, PresentMode::Export),
|
||||
@ -230,7 +192,7 @@ fn make_builder_options(
|
||||
strict_front_matter_parsing: config.options.strict_front_matter_parsing.unwrap_or(true),
|
||||
enable_snippet_execution: config.snippet.exec.enable,
|
||||
enable_snippet_execution_replace: config.snippet.exec_replace.enable,
|
||||
render_speaker_notes_only: speaker_notes_mode.is_some_and(|mode| matches!(mode, SpeakerNotesMode::Receiver)),
|
||||
render_speaker_notes_only,
|
||||
auto_render_languages: config.options.auto_render_languages.clone(),
|
||||
}
|
||||
}
|
||||
@ -270,22 +232,6 @@ fn overflow_validation(mode: &PresentMode, config: &ValidateOverflows) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
fn create_speaker_notes_service_builder(
|
||||
presentation_path: &Path,
|
||||
) -> Result<Builder<SpeakerNotesCommand, (), Service>, Box<dyn std::error::Error>> {
|
||||
let file_name = presentation_path
|
||||
.file_name()
|
||||
.ok_or(Cli::command().error(ErrorKind::InvalidValue, "failed to resolve presentation file name"))?
|
||||
.to_string_lossy();
|
||||
let service_name = format!("presenterm/{file_name}").as_str().try_into()?;
|
||||
let service = NodeBuilder::new()
|
||||
.create::<Service>()?
|
||||
.service_builder(&service_name)
|
||||
.publish_subscribe::<SpeakerNotesCommand>()
|
||||
.max_publishers(1);
|
||||
Ok(service)
|
||||
}
|
||||
|
||||
fn run(mut cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if cli.generate_config_file_schema {
|
||||
let schema = schemars::schema_for!(Config);
|
||||
@ -326,7 +272,7 @@ fn run(mut cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let parser = MarkdownParser::new(&arena);
|
||||
|
||||
let validate_overflows = overflow_validation(&mode, &config.defaults.validate_overflows) || cli.validate_overflows;
|
||||
let mut options = make_builder_options(&config, &mode, force_default_theme, cli.speaker_notes_mode);
|
||||
let mut options = make_builder_options(&config, &mode, force_default_theme, cli.listen_speaker_notes);
|
||||
if cli.enable_snippet_execution {
|
||||
options.enable_snippet_execution = true;
|
||||
}
|
||||
@ -367,29 +313,21 @@ fn run(mut cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("{}", serde_json::to_string_pretty(&meta)?);
|
||||
}
|
||||
} else {
|
||||
let speaker_notes_event_receiver = if let Some(SpeakerNotesMode::Receiver) = cli.speaker_notes_mode {
|
||||
let receiver = create_speaker_notes_service_builder(&path)?
|
||||
.open()
|
||||
.map_err(|err| Cli::command().error(ErrorKind::InvalidValue, IpcServiceError::from(err)))?
|
||||
.subscriber_builder()
|
||||
.create()?;
|
||||
Some(receiver)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let command_listener = CommandListener::new(config.bindings.clone(), speaker_notes_event_receiver)?;
|
||||
options.print_modal_background = matches!(graphics_mode, GraphicsMode::Kitty { .. });
|
||||
let full_presentation_path = path.canonicalize().unwrap_or_else(|_| path.clone());
|
||||
let publish_speaker_notes =
|
||||
cli.publish_speaker_notes || (config.speaker_notes.always_publish && !cli.listen_speaker_notes);
|
||||
let events_publisher = publish_speaker_notes
|
||||
.then(|| {
|
||||
SpeakerNotesEventPublisher::new(config.speaker_notes.publish_address, full_presentation_path.clone())
|
||||
})
|
||||
.transpose()?;
|
||||
let events_listener = cli
|
||||
.listen_speaker_notes
|
||||
.then(|| SpeakerNotesEventListener::new(config.speaker_notes.listen_address, full_presentation_path))
|
||||
.transpose()?;
|
||||
let command_listener = CommandListener::new(config.bindings.clone(), events_listener)?;
|
||||
|
||||
let speaker_notes_event_publisher = if let Some(SpeakerNotesMode::Publisher) = cli.speaker_notes_mode {
|
||||
let publisher = create_speaker_notes_service_builder(&path)?
|
||||
.create()
|
||||
.map_err(|err| Cli::command().error(ErrorKind::InvalidValue, IpcServiceError::from(err)))?
|
||||
.publisher_builder()
|
||||
.create()?;
|
||||
Some(publisher)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
options.print_modal_background = matches!(graphics_mode, GraphicsMode::Kitty { .. });
|
||||
let options = PresenterOptions {
|
||||
builder_options: options,
|
||||
mode,
|
||||
@ -408,7 +346,7 @@ fn run(mut cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
|
||||
themes,
|
||||
printer,
|
||||
options,
|
||||
speaker_notes_event_publisher,
|
||||
events_publisher,
|
||||
);
|
||||
presenter.present(&path)?;
|
||||
}
|
||||
|
@ -1,15 +1,9 @@
|
||||
use iceoryx2::{
|
||||
port::{
|
||||
publisher::{Publisher, PublisherLoanError, PublisherSendError},
|
||||
subscriber::SubscriberReceiveError,
|
||||
},
|
||||
service::ipc::Service,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
SpeakerNotesCommand,
|
||||
code::execute::SnippetExecutor,
|
||||
commands::listener::{Command, CommandListener},
|
||||
commands::{
|
||||
listener::{Command, CommandListener},
|
||||
speaker_notes::{SpeakerNotesEvent, SpeakerNotesEventPublisher},
|
||||
},
|
||||
config::KeyBindingsConfig,
|
||||
export::ImageReplacer,
|
||||
markdown::parse::{MarkdownParser, ParseError},
|
||||
@ -63,7 +57,7 @@ pub struct Presenter<'a> {
|
||||
image_printer: Arc<ImagePrinter>,
|
||||
themes: Themes,
|
||||
options: PresenterOptions,
|
||||
speaker_notes_event_publisher: Option<Publisher<Service, SpeakerNotesCommand, ()>>,
|
||||
speaker_notes_event_publisher: Option<SpeakerNotesEventPublisher>,
|
||||
}
|
||||
|
||||
impl<'a> Presenter<'a> {
|
||||
@ -79,7 +73,7 @@ impl<'a> Presenter<'a> {
|
||||
themes: Themes,
|
||||
image_printer: Arc<ImagePrinter>,
|
||||
options: PresenterOptions,
|
||||
speaker_notes_event_publisher: Option<Publisher<Service, SpeakerNotesCommand, ()>>,
|
||||
speaker_notes_event_publisher: Option<SpeakerNotesEventPublisher>,
|
||||
) -> Self {
|
||||
Self {
|
||||
default_theme,
|
||||
@ -139,11 +133,7 @@ impl<'a> Presenter<'a> {
|
||||
};
|
||||
match self.apply_command(command) {
|
||||
CommandSideEffect::Exit => {
|
||||
if let Some(publisher) = self.speaker_notes_event_publisher.as_mut() {
|
||||
let sample = publisher.loan_uninit()?;
|
||||
let sample = sample.write_payload(SpeakerNotesCommand::Exit);
|
||||
sample.send()?;
|
||||
}
|
||||
self.publish_event(SpeakerNotesEvent::Exit)?;
|
||||
return Ok(());
|
||||
}
|
||||
CommandSideEffect::Suspend => {
|
||||
@ -160,15 +150,19 @@ impl<'a> Presenter<'a> {
|
||||
CommandSideEffect::None => (),
|
||||
};
|
||||
}
|
||||
if let Some(publisher) = self.speaker_notes_event_publisher.as_mut() {
|
||||
let current_slide_idx = self.state.presentation().current_slide_index() as u32;
|
||||
let sample = publisher.loan_uninit()?;
|
||||
let sample = sample.write_payload(SpeakerNotesCommand::GoToSlide(current_slide_idx + 1));
|
||||
sample.send()?;
|
||||
}
|
||||
self.publish_event(SpeakerNotesEvent::GoToSlide {
|
||||
slide: self.state.presentation().current_slide_index() as u32 + 1,
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
fn publish_event(&self, event: SpeakerNotesEvent) -> io::Result<()> {
|
||||
if let Some(publisher) = &self.speaker_notes_event_publisher {
|
||||
publisher.send(event)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn check_async_error(&mut self) -> bool {
|
||||
let error_holder = self.state.presentation().state.async_error_holder();
|
||||
let error_holder = error_holder.lock().unwrap();
|
||||
@ -513,13 +507,4 @@ pub enum PresentationError {
|
||||
|
||||
#[error("fatal error: {0}")]
|
||||
Fatal(String),
|
||||
|
||||
#[error(transparent)]
|
||||
SpeakerNotesPublisher(#[from] PublisherLoanError),
|
||||
|
||||
#[error(transparent)]
|
||||
SpeakerNotesSend(#[from] PublisherSendError),
|
||||
|
||||
#[error(transparent)]
|
||||
SpeakerNotesReceive(#[from] SubscriberReceiveError),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user