cutcutcodec 1.0.post3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cutcutcodec might be problematic. Click here for more details.
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__main__.py +38 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/c_build.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/_helper_properties.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/duration.py +83 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/ffprobe.py +637 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/find.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/time_backprop.py +68 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_audio.py +239 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_video.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/shape.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/time_backprop.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/duration.py +162 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/nb_frames.py +159 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/rate.py +102 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/timestamps.py +194 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/container.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/encoder.py +152 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/filter.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame.py +127 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_audio.py +205 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_video.py +322 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/layout.py +206 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/meta_filter.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/muxer.py +184 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/node.py +164 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream.py +182 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_audio.py +130 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_video.py +193 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/__init__.py +7 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/ast_to_file.py +125 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/compatibility.py +734 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/default.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/encodec.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/muxer.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/rate.py +133 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_ast.py +477 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_json.py +104 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_tree.py +190 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/json_to_graph.py +114 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/parse.py +123 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +15 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +544 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +612 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +698 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/printer.py +926 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/tree_to_graph.py +168 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/decision/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/add.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/remove.py +476 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/exceptions.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/add.py +170 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cut.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/delay.py +85 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/equation.py +261 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/fir.py +231 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/resample.py +451 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/cut.py +74 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/audio_cast.py +208 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/video_cast.py +197 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/subclip.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/add.py +331 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cut.py +113 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/delay.py +84 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/equation.py +265 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/pad.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/empty.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/equation.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/noise.py +243 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/c_fractal.cpython-312-x86_64-linux-gnu.so +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/empty.py +69 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/equation.py +109 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/fractal.c +116 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/geometry.py +100 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/mandelbrot.py +176 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/noise.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/seedable.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_ffmpeg.py +904 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_svg.py +145 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/scheduler.py +356 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/write.py +340 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/basic.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/graph.py +80 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/graph.py +81 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/singleton.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cuda/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/proba.py +189 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/delay_to_fir.py +88 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/graph.py +17 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/buffer.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/utils.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/intro.webm +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/logo.svg +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/project.json +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/video.mp4 +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__main__.py +25 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/actions.py +63 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/app.py +248 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/base.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/container_input_ffmpeg.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_equation.py +45 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_fir.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_cut.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_delay.py +20 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_subclip.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_equation.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_equation.py +14 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_noise.py +19 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_equation.py +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_mandelbrot.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_noise.py +18 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/base.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/default.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/documentation.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/general.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/interface.py +305 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/loader.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/main.py +62 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edition_tabs.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/base.py +122 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/filters.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/generators.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry_tabs.py +46 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/_helper.py +54 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/container.py +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/doc.py +67 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/encodec.py +289 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/main.py +173 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/edge_properties.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/main.py +280 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/node.py +44 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/main.py +151 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/menu.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/audio_settings.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/main.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/video_settings.py +257 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/run.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/main.py +30 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/slider.py +286 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/track.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/view.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/toolbar.py +29 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/tools.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/audio_player.py +103 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/control.py +96 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/frame_extractor.py +254 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/main.py +115 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__main__.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/coding_style.py +49 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/generation.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/install.py +72 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/run.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/abstract.py +215 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_cast.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_equation.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/c_memory.py +132 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compatibility.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compile.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/encoder.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_cut.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_delay.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_empty.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/fir.py +143 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/hashes.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/initialisation.py +24 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/muxer.py +22 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/nan_snapshot.py +39 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/read.py +192 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/serialization_equality.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/snapshot_shape.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/sympy_to_torch.py +135 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/thread_safe.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/time_range.py +55 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/video_equation.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/write.py +95 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/utils.py +40 -0
- cutcutcodec-1.0.post3.dist-info/LICENSE +7 -0
- cutcutcodec-1.0.post3.dist-info/METADATA +271 -0
- cutcutcodec-1.0.post3.dist-info/RECORD +233 -0
- cutcutcodec-1.0.post3.dist-info/WHEEL +5 -0
- cutcutcodec-1.0.post3.dist-info/entry_points.txt +6 -0
- cutcutcodec-1.0.post3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow to avoid redundancy in the node editing windows.
|
|
4
|
+
|
|
5
|
+
Defines several accessors that allow to lighten the code of child classes.
|
|
6
|
+
This is also where methods common to several classes are implemented to avoid data redundancy.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import math
|
|
10
|
+
import numbers
|
|
11
|
+
import re
|
|
12
|
+
|
|
13
|
+
from qtpy import QtWidgets
|
|
14
|
+
|
|
15
|
+
from cutcutcodec.core.classes.layout import AllLayouts, Layout
|
|
16
|
+
from cutcutcodec.core.compilation.parse import parse_to_number
|
|
17
|
+
from cutcutcodec.core.compilation.parse import parse_to_sympy
|
|
18
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AudioLayoutable:
|
|
22
|
+
"""Allow to select an audio layout."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, edit: EditBase, enable_default=True):
|
|
25
|
+
assert isinstance(edit, EditBase), edit.__class__.__name__
|
|
26
|
+
assert "layout" in edit.state, sorted(edit.state)
|
|
27
|
+
assert isinstance(enable_default, bool), enable_default.__class__.__name__
|
|
28
|
+
self.edit = edit
|
|
29
|
+
self.edit.ref.append(self)
|
|
30
|
+
self.combobox = QtWidgets.QComboBox(edit)
|
|
31
|
+
self.enable_default = enable_default
|
|
32
|
+
|
|
33
|
+
def __call__(self, grid_layout: QtWidgets.QGridLayout, ref_span=0):
|
|
34
|
+
"""Display and allows to select the layout field."""
|
|
35
|
+
assert isinstance(grid_layout, QtWidgets.QGridLayout), grid_layout.__class__.__name__
|
|
36
|
+
grid_layout.addWidget(QtWidgets.QLabel("Audio layout:", self.edit), ref_span, 0)
|
|
37
|
+
self.combobox.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents)
|
|
38
|
+
self.combobox.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAtBottom)
|
|
39
|
+
|
|
40
|
+
if self.enable_default:
|
|
41
|
+
self.combobox.addItem("default")
|
|
42
|
+
layouts = AllLayouts().layouts
|
|
43
|
+
defaults = (
|
|
44
|
+
{Layout(nb_channels).name for nb_channels in set(map(len, layouts.values()))}
|
|
45
|
+
)
|
|
46
|
+
for layout in sorted(layouts, key=lambda p: (len(layouts[p]), (p not in defaults), p)):
|
|
47
|
+
if layout in defaults:
|
|
48
|
+
item = (
|
|
49
|
+
f'{len(layouts[layout])} channels default "{layout}" '
|
|
50
|
+
f"({'+'.join(layouts[layout])})"
|
|
51
|
+
)
|
|
52
|
+
else:
|
|
53
|
+
item = (
|
|
54
|
+
f'{len(layouts[layout])} channels "{layout}" ({"+".join(layouts[layout])})'
|
|
55
|
+
)
|
|
56
|
+
self.combobox.addItem(item)
|
|
57
|
+
if self.edit.state["layout"] == layout:
|
|
58
|
+
self.combobox.setCurrentText(item)
|
|
59
|
+
self.combobox.currentTextChanged.connect(self.validate)
|
|
60
|
+
|
|
61
|
+
grid_layout.addWidget(self.combobox, ref_span, 1)
|
|
62
|
+
return ref_span + 1
|
|
63
|
+
|
|
64
|
+
def validate(self, text):
|
|
65
|
+
"""Check and updates the audio layout."""
|
|
66
|
+
old_layout = self.edit.state["layout"]
|
|
67
|
+
new_layout = None if text == "default" else re.search(r'".+"', text).group()[1:-1]
|
|
68
|
+
if new_layout != old_layout:
|
|
69
|
+
if "signals" in self.edit.state:
|
|
70
|
+
signals = self.edit.state["signals"]
|
|
71
|
+
layout = Layout(new_layout or len(signals))
|
|
72
|
+
signals = (
|
|
73
|
+
signals + ["0"]*(len(layout.channels)-len(signals))
|
|
74
|
+
)[:len(layout.channels)]
|
|
75
|
+
self.edit.try_set_state(
|
|
76
|
+
self.edit.get_updated_state_dict({"layout": new_layout, "signals": signals})
|
|
77
|
+
)
|
|
78
|
+
else:
|
|
79
|
+
self.edit.try_set_state(self.edit.get_updated_state_dict({"layout": new_layout}))
|
|
80
|
+
if hasattr(self.edit, "reset"):
|
|
81
|
+
self.edit.reset()
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class Equationable:
|
|
85
|
+
"""Allow to manage a list of sympy equation."""
|
|
86
|
+
|
|
87
|
+
def __init__(self, edit: EditBase, pos_state: tuple[int, str], label: str, re_symb=str):
|
|
88
|
+
assert isinstance(edit, EditBase), edit.__class__.__name__
|
|
89
|
+
assert isinstance(pos_state, tuple), pos_state.__class__.__name__
|
|
90
|
+
assert len(pos_state) == 2, pos_state
|
|
91
|
+
position, state = pos_state
|
|
92
|
+
assert isinstance(position, int), position.__class__.__name__
|
|
93
|
+
assert position >= 0, position
|
|
94
|
+
assert isinstance(state, str), state
|
|
95
|
+
assert state in edit.state
|
|
96
|
+
assert isinstance(edit.state[state], list), edit.state.__class__.__name__
|
|
97
|
+
assert isinstance(label, str), label.__class__.__name__
|
|
98
|
+
assert isinstance(re_symb, str), re_symb.__class__.__name__
|
|
99
|
+
if len(edit.state[state]) < position:
|
|
100
|
+
edit.state[state].extend(["0"]*(position-len(edit.state[state])))
|
|
101
|
+
self.edit = edit
|
|
102
|
+
self.position = position
|
|
103
|
+
self.state = state
|
|
104
|
+
self.label = QtWidgets.QLabel(label)
|
|
105
|
+
self.re_symb = re_symb
|
|
106
|
+
self.textbox = QtWidgets.QLineEdit(edit)
|
|
107
|
+
|
|
108
|
+
def __call__(self, grid_layout: QtWidgets.QGridLayout, ref_span=0):
|
|
109
|
+
"""Display and allows to modify an equation field."""
|
|
110
|
+
assert isinstance(grid_layout, QtWidgets.QGridLayout), grid_layout.__class__.__name__
|
|
111
|
+
grid_layout.addWidget(self.label, ref_span, 0)
|
|
112
|
+
if len(self.edit.state[self.state]) > self.position:
|
|
113
|
+
self.textbox.setText(str(self.edit.state[self.state][self.position]))
|
|
114
|
+
self.textbox.textEdited.connect(self.validate)
|
|
115
|
+
grid_layout.addWidget(self.textbox, ref_span, 1)
|
|
116
|
+
return ref_span + 1
|
|
117
|
+
|
|
118
|
+
def delete(self):
|
|
119
|
+
"""Delete the widgets."""
|
|
120
|
+
self.label.deleteLater()
|
|
121
|
+
self.textbox.deleteLater()
|
|
122
|
+
|
|
123
|
+
def validate(self, text):
|
|
124
|
+
"""Check and updates the new equation."""
|
|
125
|
+
eqs = self.edit.state[self.state].copy()
|
|
126
|
+
reset = False
|
|
127
|
+
if text:
|
|
128
|
+
try:
|
|
129
|
+
expr = parse_to_sympy(text)
|
|
130
|
+
except (SyntaxError, ZeroDivisionError):
|
|
131
|
+
self.textbox.setStyleSheet("background:red;")
|
|
132
|
+
return
|
|
133
|
+
for symb in map(str, expr.free_symbols):
|
|
134
|
+
if not re.fullmatch(self.re_symb, symb):
|
|
135
|
+
self.textbox.setStyleSheet("background:red;")
|
|
136
|
+
return
|
|
137
|
+
if self.position == len(eqs):
|
|
138
|
+
eqs.append(str(expr))
|
|
139
|
+
reset = True
|
|
140
|
+
else:
|
|
141
|
+
eqs[self.position] = str(expr)
|
|
142
|
+
elif len(eqs) - 1 == self.position:
|
|
143
|
+
if self.position == 0:
|
|
144
|
+
self.textbox.setStyleSheet("background:red;")
|
|
145
|
+
return
|
|
146
|
+
del eqs[self.position]
|
|
147
|
+
reset = True
|
|
148
|
+
else:
|
|
149
|
+
self.textbox.setStyleSheet("background:red;")
|
|
150
|
+
return
|
|
151
|
+
|
|
152
|
+
self.edit.try_set_state(self.edit.get_updated_state_dict({self.state: eqs}), self.textbox)
|
|
153
|
+
if reset:
|
|
154
|
+
self.edit.reset()
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class Numerable:
|
|
158
|
+
"""Allow to manage a number field to extract a fraction or or inf."""
|
|
159
|
+
|
|
160
|
+
def __init__(
|
|
161
|
+
self,
|
|
162
|
+
edit: EditBase,
|
|
163
|
+
state: str,
|
|
164
|
+
bounds: tuple[numbers.Real, numbers.Real] = (-math.inf, math.inf),
|
|
165
|
+
isfinite: bool = False,
|
|
166
|
+
):
|
|
167
|
+
assert isinstance(edit, EditBase), edit.__class__.__name__
|
|
168
|
+
assert isinstance(state, str), state.__class__.__name__
|
|
169
|
+
assert state in edit.state, f"{state} not in {sorted(edit.state)}"
|
|
170
|
+
assert isinstance(bounds, tuple), bounds.__class__.__name__
|
|
171
|
+
assert len(bounds) == 2, bounds
|
|
172
|
+
assert isinstance(bounds[0], numbers.Real), bounds[0].__class__.__name__
|
|
173
|
+
assert isinstance(bounds[1], numbers.Real), bounds[1].__class__.__name__
|
|
174
|
+
assert bounds[0] < bounds[1], bounds
|
|
175
|
+
assert isinstance(isfinite, bool), isfinite.__class__.__name__
|
|
176
|
+
self.edit = edit
|
|
177
|
+
self.edit.ref.append(self)
|
|
178
|
+
self.state = state
|
|
179
|
+
self.bounds = bounds
|
|
180
|
+
self.isfinite = isfinite
|
|
181
|
+
self.textbox = QtWidgets.QLineEdit(edit)
|
|
182
|
+
|
|
183
|
+
def __call__(self, grid_layout: QtWidgets.QGridLayout, ref_span=0):
|
|
184
|
+
"""Display and allows to modify the number field."""
|
|
185
|
+
assert isinstance(grid_layout, QtWidgets.QGridLayout), grid_layout.__class__.__name__
|
|
186
|
+
grid_layout.addWidget(
|
|
187
|
+
QtWidgets.QLabel(
|
|
188
|
+
f"{self.state.replace('_', ' ').title()} "
|
|
189
|
+
f"({self.bounds[0]} {'<=' if math.isfinite(self.bounds[0]) else '<'} "
|
|
190
|
+
"number "
|
|
191
|
+
f"{'<=' if math.isfinite(self.bounds[1]) else '<'} {self.bounds[1]}):",
|
|
192
|
+
self.edit,
|
|
193
|
+
),
|
|
194
|
+
ref_span,
|
|
195
|
+
0,
|
|
196
|
+
)
|
|
197
|
+
self.textbox.setText(str(self.edit.state[self.state]))
|
|
198
|
+
self.textbox.textEdited.connect(self.validate)
|
|
199
|
+
grid_layout.addWidget(self.textbox, ref_span, 1)
|
|
200
|
+
return ref_span + 1
|
|
201
|
+
|
|
202
|
+
def validate(self, text):
|
|
203
|
+
"""Check and updates the new number."""
|
|
204
|
+
try:
|
|
205
|
+
val = parse_to_number(text)
|
|
206
|
+
except (ValueError, ZeroDivisionError):
|
|
207
|
+
self.textbox.setStyleSheet("background:red;")
|
|
208
|
+
return
|
|
209
|
+
if val < self.bounds[0] or val > self.bounds[1]:
|
|
210
|
+
self.textbox.setStyleSheet("background:red;")
|
|
211
|
+
return
|
|
212
|
+
if self.isfinite and not math.isfinite(val):
|
|
213
|
+
self.textbox.setStyleSheet("background:red;")
|
|
214
|
+
return
|
|
215
|
+
|
|
216
|
+
self.edit.try_set_state(
|
|
217
|
+
self.edit.get_updated_state_dict({self.state: str(val)}),
|
|
218
|
+
self.textbox,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
class Seedable:
|
|
223
|
+
"""Allow to manage a `seed` field.
|
|
224
|
+
|
|
225
|
+
It is a float between [0, 1[.
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
def __init__(self, edit: EditBase):
|
|
229
|
+
assert isinstance(edit, EditBase), edit.__class__.__name__
|
|
230
|
+
assert "seed" in edit.state, sorted(edit.state)
|
|
231
|
+
self.edit = edit
|
|
232
|
+
self.edit.ref.append(self)
|
|
233
|
+
self.textbox = QtWidgets.QLineEdit(edit)
|
|
234
|
+
|
|
235
|
+
def __call__(self, grid_layout: QtWidgets.QGridLayout, ref_span=0):
|
|
236
|
+
"""Display and allows to modify the seed field."""
|
|
237
|
+
assert isinstance(grid_layout, QtWidgets.QGridLayout), grid_layout.__class__.__name__
|
|
238
|
+
grid_layout.addWidget(QtWidgets.QLabel("Seed (0 <= float < 1):", self.edit), ref_span, 0)
|
|
239
|
+
self.textbox.setText(str(self.edit.state["seed"]))
|
|
240
|
+
self.textbox.textEdited.connect(self.validate)
|
|
241
|
+
grid_layout.addWidget(self.textbox, ref_span, 1)
|
|
242
|
+
return ref_span + 1
|
|
243
|
+
|
|
244
|
+
def validate(self, text):
|
|
245
|
+
"""Check and updates the new seed."""
|
|
246
|
+
try:
|
|
247
|
+
seed = float(text)
|
|
248
|
+
except ValueError:
|
|
249
|
+
self.textbox.setStyleSheet("background:red;")
|
|
250
|
+
return
|
|
251
|
+
if seed < 0 or seed >= 1:
|
|
252
|
+
self.textbox.setStyleSheet("background:red;")
|
|
253
|
+
return
|
|
254
|
+
|
|
255
|
+
self.edit.try_set_state(self.edit.get_updated_state_dict({"seed": seed}), self.textbox)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
class SingleEq:
|
|
259
|
+
"""Allow to manage a single sympy equation field."""
|
|
260
|
+
|
|
261
|
+
def __init__(
|
|
262
|
+
self, edit: EditBase, getter_setter: tuple[callable, callable], label: str, re_symb=str
|
|
263
|
+
):
|
|
264
|
+
assert isinstance(edit, EditBase), edit.__class__.__name__
|
|
265
|
+
assert isinstance(getter_setter, tuple), getter_setter.__class__.__name__
|
|
266
|
+
assert len(getter_setter) == 2, getter_setter
|
|
267
|
+
getter, setter = getter_setter
|
|
268
|
+
assert hasattr(getter, "__call__"), getter.__class__.__name__
|
|
269
|
+
assert hasattr(setter, "__call__"), setter.__class__.__name__
|
|
270
|
+
assert isinstance(getter(), str), getter().__class__.__name__
|
|
271
|
+
assert isinstance(label, str), label.__class__.__name__
|
|
272
|
+
assert isinstance(re_symb, str), re_symb.__class__.__name__
|
|
273
|
+
|
|
274
|
+
self.edit = edit
|
|
275
|
+
self.edit.ref.append(self)
|
|
276
|
+
self.getter = getter
|
|
277
|
+
self.setter = setter
|
|
278
|
+
self.label = QtWidgets.QLabel(label)
|
|
279
|
+
self.re_symb = re_symb
|
|
280
|
+
self.textbox = QtWidgets.QLineEdit(edit)
|
|
281
|
+
|
|
282
|
+
def __call__(self, grid_layout: QtWidgets.QGridLayout, ref_span=0):
|
|
283
|
+
"""Display and allows to modify an equation field."""
|
|
284
|
+
assert isinstance(grid_layout, QtWidgets.QGridLayout), grid_layout.__class__.__name__
|
|
285
|
+
grid_layout.addWidget(self.label, ref_span, 0)
|
|
286
|
+
self.textbox.setText(self.getter())
|
|
287
|
+
self.textbox.textEdited.connect(self.validate)
|
|
288
|
+
grid_layout.addWidget(self.textbox, ref_span, 1)
|
|
289
|
+
return ref_span + 1
|
|
290
|
+
|
|
291
|
+
def validate(self, text):
|
|
292
|
+
"""Check and updates the new equation."""
|
|
293
|
+
try:
|
|
294
|
+
expr = parse_to_sympy(text)
|
|
295
|
+
except (SyntaxError, ZeroDivisionError):
|
|
296
|
+
self.textbox.setStyleSheet("background:red;")
|
|
297
|
+
return
|
|
298
|
+
for symb in map(str, expr.free_symbols):
|
|
299
|
+
if not re.fullmatch(self.re_symb, symb):
|
|
300
|
+
self.textbox.setStyleSheet("background:red;")
|
|
301
|
+
return
|
|
302
|
+
self.edit.try_set_state(
|
|
303
|
+
self.edit.get_updated_state(self.getter, self.setter, text),
|
|
304
|
+
self.textbox,
|
|
305
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow to import dynamically the windows associated to the edition of a node."""
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
import inspect
|
|
7
|
+
import re
|
|
8
|
+
|
|
9
|
+
from cutcutcodec.core.classes.node import Node
|
|
10
|
+
from cutcutcodec.gui.edit_node_state.default import ViewNodeState
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def load_edit_windows(node_subclass: type) -> type:
|
|
14
|
+
"""Find and import the edit window for a specific node.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
node_subclass : type
|
|
19
|
+
A subclass that inherits from ``cutcutcodec.core.classes.node.Node``.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
edit_class : type
|
|
24
|
+
Subclass of ``cutcutcodec.gui.edit_node_state.base.EditBase``.
|
|
25
|
+
The uninstantiated class of a window allowing to see
|
|
26
|
+
and if possible to edit the properties of the node.
|
|
27
|
+
If this class is not defined,
|
|
28
|
+
``cutcutcodec.gui.edit_node_state.default.ViewNodeState`` is returned.
|
|
29
|
+
"""
|
|
30
|
+
assert issubclass(node_subclass, Node), node_subclass.__name__
|
|
31
|
+
|
|
32
|
+
class_name = node_subclass.__name__
|
|
33
|
+
class_name_snake = re.sub(r"(?!^)([A-Z]+)", r"_\1", class_name).lower()
|
|
34
|
+
try:
|
|
35
|
+
mod = importlib.import_module(f"cutcutcodec.gui.edit_node_state.all.{class_name_snake}")
|
|
36
|
+
except ModuleNotFoundError:
|
|
37
|
+
return ViewNodeState
|
|
38
|
+
members = dict(inspect.getmembers(mod))
|
|
39
|
+
edit_class_name = f"Edit{class_name}"
|
|
40
|
+
assert edit_class_name in members, f"{edit_class_name} not found in {mod.__name__}"
|
|
41
|
+
return members[edit_class_name]
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Global and contextual window for viewing and editing the properties of a node."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtCore, QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
8
|
+
from cutcutcodec.gui.edit_node_state.documentation import Documentation
|
|
9
|
+
from cutcutcodec.gui.edit_node_state.general import General
|
|
10
|
+
from cutcutcodec.gui.edit_node_state.loader import load_edit_windows
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class EditNodeWindow(CutcutcodecWidget, QtWidgets.QDialog):
|
|
14
|
+
"""Show the node properties."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, parent, node_name):
|
|
17
|
+
super().__init__(parent)
|
|
18
|
+
self._parent = parent
|
|
19
|
+
assert node_name in self.app.graph.nodes, (node_name, set(self.app.graph.nodes))
|
|
20
|
+
self.node_name = node_name
|
|
21
|
+
|
|
22
|
+
self._edit_state = None
|
|
23
|
+
|
|
24
|
+
self.setWindowTitle(f'Edit node "{node_name}"')
|
|
25
|
+
|
|
26
|
+
layout = QtWidgets.QVBoxLayout()
|
|
27
|
+
self.init_general(layout)
|
|
28
|
+
self.init_edit(layout)
|
|
29
|
+
self.init_documentation(layout)
|
|
30
|
+
self.setLayout(layout)
|
|
31
|
+
|
|
32
|
+
def init_documentation(self, layout):
|
|
33
|
+
"""Append documentation context."""
|
|
34
|
+
title = QtWidgets.QLabel("Documentation")
|
|
35
|
+
title.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
36
|
+
title.setStyleSheet("font-weight: bold")
|
|
37
|
+
layout.addWidget(title)
|
|
38
|
+
scrollable_layout = QtWidgets.QScrollArea(self)
|
|
39
|
+
scrollable_layout.setWidget(Documentation(self, self.node_name))
|
|
40
|
+
layout.addWidget(scrollable_layout)
|
|
41
|
+
|
|
42
|
+
def init_edit(self, layout):
|
|
43
|
+
"""Choose and instantiate the right widget for this node's class."""
|
|
44
|
+
title = QtWidgets.QLabel("Node State")
|
|
45
|
+
title.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
46
|
+
title.setStyleSheet("font-weight: bold")
|
|
47
|
+
layout.addWidget(title)
|
|
48
|
+
edit_class = load_edit_windows(self.app.graph.nodes[self.node_name]["class"])
|
|
49
|
+
self._edit_state = edit_class(self, self.node_name)
|
|
50
|
+
layout.addWidget(self._edit_state)
|
|
51
|
+
|
|
52
|
+
def init_general(self, layout):
|
|
53
|
+
"""Append general information context."""
|
|
54
|
+
title = QtWidgets.QLabel("General Node Properties")
|
|
55
|
+
title.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
56
|
+
title.setStyleSheet("font-weight: bold")
|
|
57
|
+
layout.addWidget(title)
|
|
58
|
+
layout.addWidget(General(self, self.node_name))
|
|
59
|
+
|
|
60
|
+
def refresh(self):
|
|
61
|
+
"""Update the elements of this widget and child widgets."""
|
|
62
|
+
self._edit_state.refresh()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""The widget that contains all the elements for the video edition."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
8
|
+
from cutcutcodec.gui.flowchart.main import FlowChart
|
|
9
|
+
from cutcutcodec.gui.timeline.main import Timeline
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EditionTabs(CutcutcodecWidget, QtWidgets.QWidget):
|
|
13
|
+
"""Contains the different selection windows."""
|
|
14
|
+
|
|
15
|
+
def __init__(self, parent):
|
|
16
|
+
super().__init__(parent)
|
|
17
|
+
self._parent = parent
|
|
18
|
+
|
|
19
|
+
# declaration
|
|
20
|
+
self.timeline = Timeline(self)
|
|
21
|
+
self.flowchart = FlowChart(self)
|
|
22
|
+
|
|
23
|
+
# location
|
|
24
|
+
tabs = QtWidgets.QTabWidget()
|
|
25
|
+
tabs.addTab(self.timeline, "Timeline")
|
|
26
|
+
tabs.addTab(self.flowchart, "Flow Chart")
|
|
27
|
+
layout = QtWidgets.QVBoxLayout()
|
|
28
|
+
layout.addWidget(tabs)
|
|
29
|
+
self.setLayout(layout)
|
|
30
|
+
|
|
31
|
+
def refresh(self):
|
|
32
|
+
"""Update the elements of this widget and child widgets."""
|
|
33
|
+
self.timeline.refresh()
|
|
34
|
+
self.flowchart.refresh()
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Defines the global style and behavior of the tabs of the entries table."""
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
import inspect
|
|
7
|
+
import logging
|
|
8
|
+
import re
|
|
9
|
+
import typing
|
|
10
|
+
|
|
11
|
+
from qtpy import QtCore, QtGui, QtWidgets
|
|
12
|
+
import numpy as np
|
|
13
|
+
|
|
14
|
+
from cutcutcodec.core.classes.node import Node
|
|
15
|
+
from cutcutcodec.core.compilation.tree_to_graph import new_node
|
|
16
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
17
|
+
from cutcutcodec.utils import get_project_root
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Entry(CutcutcodecWidget, QtWidgets.QListWidget):
|
|
21
|
+
"""Allow to visualize the entries and to unify some functionalities."""
|
|
22
|
+
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
parent,
|
|
26
|
+
sub_dirs: list[str],
|
|
27
|
+
excluded_clsn: set[str],
|
|
28
|
+
classnames: typing.Union[type, tuple[type]]
|
|
29
|
+
):
|
|
30
|
+
"""Initialise and create the class.
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
parent
|
|
35
|
+
The parent widget.
|
|
36
|
+
sub_dirs : list[str]
|
|
37
|
+
The name of the folders to explore in the ``cutcutcodec/core/`` directory.
|
|
38
|
+
excluded_clsn : set[str]
|
|
39
|
+
All classes name to be excluded from the widget.
|
|
40
|
+
classnames : typing.Union[type, tuple[type]]
|
|
41
|
+
Valid classes for object selection.
|
|
42
|
+
"""
|
|
43
|
+
super().__init__(parent)
|
|
44
|
+
self._parent = parent
|
|
45
|
+
|
|
46
|
+
assert isinstance(sub_dirs, list), sub_dirs.__class__.__name__
|
|
47
|
+
assert all(isinstance(e, str) for e in sub_dirs), sub_dirs
|
|
48
|
+
assert isinstance(excluded_clsn, set), excluded_clsn.__class__.__name__
|
|
49
|
+
assert all(isinstance(e, str) for e in excluded_clsn), excluded_clsn
|
|
50
|
+
self.sub_dirs = sub_dirs
|
|
51
|
+
self.excluded_clsn = excluded_clsn
|
|
52
|
+
self.classnames = classnames
|
|
53
|
+
|
|
54
|
+
self.setViewMode(QtWidgets.QListView.ViewMode.IconMode)
|
|
55
|
+
self.setResizeMode(QtWidgets.QListView.ResizeMode.Adjust)
|
|
56
|
+
self.setUniformItemSizes(True)
|
|
57
|
+
self.setIconSize(QtCore.QSize(128, 128))
|
|
58
|
+
|
|
59
|
+
def dragMoveEvent(self, event):
|
|
60
|
+
"""Prevent user drag-and-drop duplication of entries."""
|
|
61
|
+
event.ignore()
|
|
62
|
+
|
|
63
|
+
def dragLeaveEvent(self, event):
|
|
64
|
+
"""Prepare for drop in other widgets."""
|
|
65
|
+
if len(self.selectedItems()) != 1:
|
|
66
|
+
logging.error("can drag and drop only one item, not %d", len(self.selectedItems()))
|
|
67
|
+
self.app.global_vars["drag_an_drop"] = None
|
|
68
|
+
event.ignore()
|
|
69
|
+
return
|
|
70
|
+
|
|
71
|
+
classname, path = [i.data(3) for i in self.selectedItems()].pop()
|
|
72
|
+
mod = importlib.import_module(
|
|
73
|
+
".".join(("cutcutcodec" / path.relative_to(get_project_root()).with_suffix("")).parts)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
generator_cls = dict(inspect.getmembers(mod))[classname]
|
|
77
|
+
node_name, attrs = new_node(self.app.graph, generator_cls.default())
|
|
78
|
+
self.app.global_vars["drag_an_drop"] = (node_name, attrs)
|
|
79
|
+
event.accept()
|
|
80
|
+
|
|
81
|
+
def refresh(self):
|
|
82
|
+
"""Update the elements of this widget and child widgets."""
|
|
83
|
+
self.clear()
|
|
84
|
+
|
|
85
|
+
# find all the elements
|
|
86
|
+
elements = {}
|
|
87
|
+
for filepath in (
|
|
88
|
+
file for sub_dir in self.sub_dirs
|
|
89
|
+
for file in (get_project_root() / "core" / sub_dir).rglob("*.py")
|
|
90
|
+
):
|
|
91
|
+
mod = importlib.import_module(
|
|
92
|
+
".".join(
|
|
93
|
+
("cutcutcodec" / filepath.relative_to(get_project_root()).with_suffix("")).parts
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
for classname, node_cls in inspect.getmembers(mod):
|
|
97
|
+
if (
|
|
98
|
+
inspect.isclass(node_cls)
|
|
99
|
+
and issubclass(node_cls, Node)
|
|
100
|
+
and issubclass(node_cls, self.classnames)
|
|
101
|
+
and classname not in self.excluded_clsn
|
|
102
|
+
):
|
|
103
|
+
widget_name = re.sub(r"(?!^)([A-Z]+)", r"_\1", classname).lower()
|
|
104
|
+
elements[widget_name] = (classname, filepath)
|
|
105
|
+
|
|
106
|
+
# deletion of common name parts
|
|
107
|
+
if len(elements) != 1:
|
|
108
|
+
while len({n[0] for n in elements}) == 1:
|
|
109
|
+
elements = {n[1:]: e for n, e in elements.items()}
|
|
110
|
+
while len({n[-1] for n in elements}) == 1:
|
|
111
|
+
elements = {n[:-1]: e for n, e in elements.items()}
|
|
112
|
+
|
|
113
|
+
# append generator to the view
|
|
114
|
+
for widget_name in sorted(elements):
|
|
115
|
+
img = np.zeros((128, 128, 3), dtype=np.uint8)
|
|
116
|
+
icon = QtGui.QIcon(QtGui.QPixmap(QtGui.QImage(
|
|
117
|
+
img.data, img.shape[1], img.shape[0], 3*img.shape[1],
|
|
118
|
+
QtGui.QImage.Format.Format_BGR888
|
|
119
|
+
)))
|
|
120
|
+
item = QtWidgets.QListWidgetItem(icon, widget_name) # parent=self only for pyqt6
|
|
121
|
+
item.setData(3, elements[widget_name]) # 0 for text, 1 for icon, 2 for text, 3 is free!
|
|
122
|
+
self.addItem(item)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow to view and add all generators."""
|
|
4
|
+
|
|
5
|
+
from cutcutcodec.core.classes.filter import Filter
|
|
6
|
+
from cutcutcodec.gui.entry.base import Entry
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Filters(Entry):
|
|
10
|
+
"""Filters visualization window."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, parent):
|
|
13
|
+
super().__init__(
|
|
14
|
+
parent,
|
|
15
|
+
["filters"],
|
|
16
|
+
{"Filter", "FilterAudioIdentity", "FilterVideoIdentity", "MetaFilter"},
|
|
17
|
+
Filter,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class FiltersAudio(Entry):
|
|
22
|
+
"""Audio filters visualization window."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, parent):
|
|
25
|
+
super().__init__(
|
|
26
|
+
parent,
|
|
27
|
+
["filters/audio"],
|
|
28
|
+
{"Filter", "FilterAudioIdentity", "MetaFilter"},
|
|
29
|
+
Filter,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class FiltersVideo(Entry):
|
|
34
|
+
"""Video filters visualization window."""
|
|
35
|
+
|
|
36
|
+
def __init__(self, parent):
|
|
37
|
+
super().__init__(
|
|
38
|
+
parent,
|
|
39
|
+
["filters/video"],
|
|
40
|
+
{"Filter", "FilterVideoIdentity", "MetaFilter"},
|
|
41
|
+
Filter,
|
|
42
|
+
)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow to view and add all generators."""
|
|
4
|
+
|
|
5
|
+
from cutcutcodec.core.classes.container import ContainerInput
|
|
6
|
+
from cutcutcodec.gui.entry.base import Entry
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Generators(Entry):
|
|
10
|
+
"""Generators visualization window."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, parent):
|
|
13
|
+
super().__init__(
|
|
14
|
+
parent,
|
|
15
|
+
["generation"],
|
|
16
|
+
{"ContainerInput", "GeneratorAudioEmpty", "GeneratorVideoEmpty"},
|
|
17
|
+
ContainerInput
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class GeneratorsAudio(Entry):
|
|
22
|
+
"""Audio generators visualization window."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, parent):
|
|
25
|
+
super().__init__(
|
|
26
|
+
parent,
|
|
27
|
+
["generation/audio"],
|
|
28
|
+
{"ContainerInput", "GeneratorAudioEmpty"},
|
|
29
|
+
ContainerInput
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class GeneratorsVideo(Entry):
|
|
34
|
+
"""Video generators visualization window."""
|
|
35
|
+
|
|
36
|
+
def __init__(self, parent):
|
|
37
|
+
super().__init__(
|
|
38
|
+
parent,
|
|
39
|
+
["generation/video"],
|
|
40
|
+
{"ContainerInput", "GeneratorVideoEmpty"},
|
|
41
|
+
ContainerInput
|
|
42
|
+
)
|