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,25 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Entry point of the GUI."""
|
|
4
|
+
|
|
5
|
+
import pathlib
|
|
6
|
+
import sys
|
|
7
|
+
import typing
|
|
8
|
+
|
|
9
|
+
import click
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@click.command()
|
|
13
|
+
@click.argument(
|
|
14
|
+
"project_file",
|
|
15
|
+
required=False,
|
|
16
|
+
type=click.Path(exists=True, dir_okay=False, path_type=pathlib.Path),
|
|
17
|
+
)
|
|
18
|
+
def main(project_file: typing.Optional[pathlib.Path] = None) -> int:
|
|
19
|
+
"""Start the graphical user interface, alias to ``cutcutcodec-gui``."""
|
|
20
|
+
from cutcutcodec.gui.run import run_gui_pipeline # no global import for cutcutcodec.__main__
|
|
21
|
+
sys.exit(run_gui_pipeline(project_file))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if __name__ == '__main__':
|
|
25
|
+
main()
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Defines the actions."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtGui
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def create_actions(parent) -> dict[str, QtGui.QAction]:
|
|
9
|
+
"""Create all the actions.
|
|
10
|
+
|
|
11
|
+
Returns
|
|
12
|
+
-------
|
|
13
|
+
actions : dict
|
|
14
|
+
To each action name, associate the action PyQt ``QtGui.QAction``.
|
|
15
|
+
"""
|
|
16
|
+
actions = {}
|
|
17
|
+
|
|
18
|
+
actions["export"] = QtGui.QAction("Export", parent)
|
|
19
|
+
actions["export"].setIcon(QtGui.QIcon.fromTheme("media-record"))
|
|
20
|
+
actions["export"].setShortcut("Ctrl+E")
|
|
21
|
+
actions["export"].triggered.connect(parent.export)
|
|
22
|
+
|
|
23
|
+
actions["import"] = QtGui.QAction("Import Files", parent)
|
|
24
|
+
actions["import"].setIcon(QtGui.QIcon.fromTheme("list-add"))
|
|
25
|
+
actions["import"].setShortcut("Ctrl+I")
|
|
26
|
+
actions["import"].triggered.connect(parent.import_files)
|
|
27
|
+
|
|
28
|
+
actions["open"] = QtGui.QAction("Open", parent)
|
|
29
|
+
actions["open"].setIcon(QtGui.QIcon.fromTheme("document-open"))
|
|
30
|
+
actions["open"].setShortcut(QtGui.QKeySequence.StandardKey.Open)
|
|
31
|
+
actions["open"].triggered.connect(lambda: parent.open())
|
|
32
|
+
|
|
33
|
+
actions["redo"] = QtGui.QAction("Redo", parent)
|
|
34
|
+
actions["redo"].setIcon(QtGui.QIcon.fromTheme("edit-redo"))
|
|
35
|
+
actions["redo"].setShortcut(QtGui.QKeySequence.StandardKey.Redo)
|
|
36
|
+
actions["redo"].triggered.connect(parent.app.redo)
|
|
37
|
+
|
|
38
|
+
actions["refresh"] = QtGui.QAction("Refresh", parent)
|
|
39
|
+
actions["refresh"].setIcon(QtGui.QIcon.fromTheme("view-refresh"))
|
|
40
|
+
actions["refresh"].setShortcut(QtGui.QKeySequence.StandardKey.Refresh)
|
|
41
|
+
actions["refresh"].triggered.connect(parent.refresh)
|
|
42
|
+
|
|
43
|
+
actions["save"] = QtGui.QAction("Save", parent)
|
|
44
|
+
actions["save"].setIcon(QtGui.QIcon.fromTheme("document-save"))
|
|
45
|
+
actions["save"].setShortcut(QtGui.QKeySequence.StandardKey.Save)
|
|
46
|
+
actions["save"].triggered.connect(parent.save)
|
|
47
|
+
|
|
48
|
+
actions["save_as"] = QtGui.QAction("Save as", parent)
|
|
49
|
+
actions["save_as"].setIcon(QtGui.QIcon.fromTheme("document-save-as"))
|
|
50
|
+
actions["save_as"].setShortcut(QtGui.QKeySequence.StandardKey.SaveAs)
|
|
51
|
+
actions["save_as"].triggered.connect(parent.save_as)
|
|
52
|
+
|
|
53
|
+
actions["undo"] = QtGui.QAction("Undo", parent)
|
|
54
|
+
actions["undo"].setIcon(QtGui.QIcon.fromTheme("edit-undo"))
|
|
55
|
+
actions["undo"].setShortcut(QtGui.QKeySequence.StandardKey.Undo)
|
|
56
|
+
actions["undo"].triggered.connect(parent.app.undo)
|
|
57
|
+
|
|
58
|
+
actions["preferences"] = QtGui.QAction("Preferences", parent)
|
|
59
|
+
actions["preferences"].setIcon(QtGui.QIcon.fromTheme("document-properties"))
|
|
60
|
+
actions["preferences"].setShortcut(QtGui.QKeySequence.StandardKey.Preferences)
|
|
61
|
+
actions["preferences"].triggered.connect(parent.preferences)
|
|
62
|
+
|
|
63
|
+
return actions
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Interface between windows and data."""
|
|
4
|
+
|
|
5
|
+
import pathlib
|
|
6
|
+
import threading
|
|
7
|
+
import typing
|
|
8
|
+
|
|
9
|
+
import networkx
|
|
10
|
+
|
|
11
|
+
from cutcutcodec.core.classes.container import ContainerOutput
|
|
12
|
+
from cutcutcodec.core.classes.node import Node
|
|
13
|
+
from cutcutcodec.core.classes.stream import Stream
|
|
14
|
+
from cutcutcodec.core.compilation.graph_to_json import graph_to_json
|
|
15
|
+
from cutcutcodec.core.compilation.graph_to_tree import graph_to_tree, update_trees
|
|
16
|
+
from cutcutcodec.core.compilation.json_to_graph import json_to_graph
|
|
17
|
+
from cutcutcodec.core.compilation.tree_to_graph import tree_to_graph
|
|
18
|
+
from cutcutcodec.core.generation.audio.noise import GeneratorAudioNoise
|
|
19
|
+
from cutcutcodec.core.generation.video.noise import GeneratorVideoNoise
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class App:
|
|
23
|
+
"""Contains the shared data.
|
|
24
|
+
|
|
25
|
+
Attributes
|
|
26
|
+
----------
|
|
27
|
+
export_settings : dict[str]
|
|
28
|
+
The exportation parameters for ffmpeg.
|
|
29
|
+
graph : networkx.MultiDiGraph
|
|
30
|
+
The assembly graph, the main element that contains all the operations to be performed.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(self):
|
|
34
|
+
self._persistant = {} # all for the state.
|
|
35
|
+
self._compile_lock = threading.Lock()
|
|
36
|
+
self._graph = tree_to_graph(
|
|
37
|
+
ContainerOutput(
|
|
38
|
+
[
|
|
39
|
+
GeneratorAudioNoise().out_streams[0],
|
|
40
|
+
GeneratorVideoNoise().out_streams[0],
|
|
41
|
+
]
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
self.global_vars = {}
|
|
45
|
+
|
|
46
|
+
def __getstate__(self) -> dict:
|
|
47
|
+
"""Allow to help serialization and saving."""
|
|
48
|
+
return {
|
|
49
|
+
"export_settings": self.export_settings,
|
|
50
|
+
"graph": graph_to_json(self.graph),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __setstate__(self, state: dict):
|
|
54
|
+
"""Allow deserialization."""
|
|
55
|
+
assert isinstance(state, dict), state.__class__.__name__
|
|
56
|
+
|
|
57
|
+
self._persistant["export_settings"] = state.get("export_settings", {})
|
|
58
|
+
if (graph := state.get("graph", None)) is not None:
|
|
59
|
+
graph = json_to_graph(graph)
|
|
60
|
+
self.graph = graph
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def export_settings(self) -> dict[str]:
|
|
64
|
+
"""Return the exporation parameters for writting.
|
|
65
|
+
|
|
66
|
+
Notes
|
|
67
|
+
-----
|
|
68
|
+
* Modifications are inplace.
|
|
69
|
+
"""
|
|
70
|
+
export_settings = self._persistant.get("export_settings", {})
|
|
71
|
+
export_settings["parent"] = export_settings.get("parent", str(pathlib.Path.cwd()))
|
|
72
|
+
if "stem" not in export_settings:
|
|
73
|
+
export_settings["stem"] = "cutcutcodec_project"
|
|
74
|
+
while (pathlib.Path(export_settings["parent"]) / export_settings["stem"]).exists():
|
|
75
|
+
export_settings["stem"] += "_bis"
|
|
76
|
+
export_settings["suffix"] = export_settings.get("suffix", "")
|
|
77
|
+
export_settings["muxer"] = export_settings.get("muxer", None)
|
|
78
|
+
export_settings["muxer_settings"] = export_settings.get("muxer_settings", {})
|
|
79
|
+
|
|
80
|
+
tree = self.tree()
|
|
81
|
+
|
|
82
|
+
# codecs
|
|
83
|
+
export_settings["codecs"] = export_settings.get("codecs", {"audio": [], "video": []})
|
|
84
|
+
export_settings["codecs"]["audio"].extend([None for _ in tree.in_select("audio")])
|
|
85
|
+
export_settings["codecs"]["video"].extend([None for _ in tree.in_select("video")])
|
|
86
|
+
export_settings["codecs"]["audio"] = (
|
|
87
|
+
export_settings["codecs"]["audio"][:len(tree.in_select("audio"))]
|
|
88
|
+
)
|
|
89
|
+
export_settings["codecs"]["video"] = (
|
|
90
|
+
export_settings["codecs"]["video"][:len(tree.in_select("video"))]
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# encoders
|
|
94
|
+
export_settings["encoders"] = export_settings.get("encoders", {"audio": [], "video": []})
|
|
95
|
+
export_settings["encoders"]["audio"].extend([None for _ in tree.in_select("audio")])
|
|
96
|
+
export_settings["encoders"]["video"].extend([None for _ in tree.in_select("video")])
|
|
97
|
+
export_settings["encoders"]["audio"] = (
|
|
98
|
+
export_settings["encoders"]["audio"][:len(tree.in_select("audio"))]
|
|
99
|
+
)
|
|
100
|
+
export_settings["encoders"]["video"] = (
|
|
101
|
+
export_settings["encoders"]["video"][:len(tree.in_select("video"))]
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# encoders_settings
|
|
105
|
+
export_settings["encoders_settings"] = (
|
|
106
|
+
export_settings.get("encoders_settings", {"audio": [], "video": []})
|
|
107
|
+
)
|
|
108
|
+
export_settings["encoders_settings"]["audio"].extend([{} for _ in tree.in_select("audio")])
|
|
109
|
+
export_settings["encoders_settings"]["video"].extend([{} for _ in tree.in_select("video")])
|
|
110
|
+
export_settings["encoders_settings"]["audio"] = (
|
|
111
|
+
export_settings["encoders_settings"]["audio"][:len(tree.in_select("audio"))]
|
|
112
|
+
)
|
|
113
|
+
export_settings["encoders_settings"]["video"] = (
|
|
114
|
+
export_settings["encoders_settings"]["video"][:len(tree.in_select("video"))]
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# fps, samplerate, shapes, bitrate and pix_fmt
|
|
118
|
+
export_settings["rates"] = export_settings.get("rates", {"audio": [], "video": []})
|
|
119
|
+
export_settings["rates"]["audio"].extend([None for _ in tree.in_select("audio")])
|
|
120
|
+
export_settings["rates"]["video"].extend([None for _ in tree.in_select("video")])
|
|
121
|
+
export_settings["rates"]["audio"] = ( # type int or None
|
|
122
|
+
export_settings["rates"]["audio"][:len(tree.in_select("audio"))]
|
|
123
|
+
)
|
|
124
|
+
export_settings["rates"]["video"] = ( # type str or None
|
|
125
|
+
export_settings["rates"]["video"][:len(tree.in_select("video"))]
|
|
126
|
+
)
|
|
127
|
+
export_settings["shapes"] = export_settings.get("shapes", []) # tuple[int, int] or None
|
|
128
|
+
export_settings["shapes"].extend([None for _ in tree.in_select("video")])
|
|
129
|
+
export_settings["shapes"] = export_settings["shapes"][:len(tree.in_select("video"))]
|
|
130
|
+
export_settings["shapes"] = ( # because json convert tuple into list
|
|
131
|
+
[s if s is None else tuple(s) for s in export_settings["shapes"]]
|
|
132
|
+
)
|
|
133
|
+
export_settings["bitrate"] = export_settings.get("bitrate", {"audio": [], "video": []})
|
|
134
|
+
export_settings["bitrate"]["audio"].extend([None for _ in tree.in_select("audio")])
|
|
135
|
+
export_settings["bitrate"]["video"].extend([None for _ in tree.in_select("video")])
|
|
136
|
+
export_settings["bitrate"]["audio"] = (
|
|
137
|
+
export_settings["bitrate"]["audio"][:len(tree.in_select("audio"))]
|
|
138
|
+
)
|
|
139
|
+
export_settings["bitrate"]["video"] = (
|
|
140
|
+
export_settings["bitrate"]["video"][:len(tree.in_select("video"))]
|
|
141
|
+
)
|
|
142
|
+
export_settings["pix_fmt"] = export_settings.get("pix_fmt", []) # type str or None
|
|
143
|
+
export_settings["pix_fmt"].extend([None for _ in tree.in_select("video")])
|
|
144
|
+
export_settings["pix_fmt"] = export_settings["pix_fmt"][:len(tree.in_select("video"))]
|
|
145
|
+
|
|
146
|
+
# optimization enable
|
|
147
|
+
export_settings["optimize"] = export_settings.get("optimize", False)
|
|
148
|
+
export_settings["excecute"] = export_settings.get("excecute", True)
|
|
149
|
+
|
|
150
|
+
self._persistant["export_settings"] = export_settings # for inplace edition, not setter
|
|
151
|
+
|
|
152
|
+
return export_settings
|
|
153
|
+
|
|
154
|
+
def get_save_file(self) -> typing.Union[None, pathlib.Path]:
|
|
155
|
+
"""Return the path for the saving file, None if it is not define."""
|
|
156
|
+
return self._persistant.get("save_file", None)
|
|
157
|
+
|
|
158
|
+
@property
|
|
159
|
+
def graph(self) -> networkx.MultiDiGraph:
|
|
160
|
+
"""Return the assembly graph."""
|
|
161
|
+
return self._graph
|
|
162
|
+
|
|
163
|
+
@graph.setter
|
|
164
|
+
def graph(self, graph: networkx.MultiDiGraph):
|
|
165
|
+
"""Perform verification."""
|
|
166
|
+
assert isinstance(graph, networkx.MultiDiGraph), graph.__class__.__name__
|
|
167
|
+
with self._compile_lock:
|
|
168
|
+
self._graph = graph
|
|
169
|
+
|
|
170
|
+
def redo(self):
|
|
171
|
+
"""Allow to move forward in the steps."""
|
|
172
|
+
print("redo")
|
|
173
|
+
|
|
174
|
+
def set_save_file(self, file: typing.Union[None, str, pathlib.Path]):
|
|
175
|
+
"""Update the path of the file for saving project."""
|
|
176
|
+
if file is None:
|
|
177
|
+
self._persistant["save_file"] = None
|
|
178
|
+
assert isinstance(file, (str, pathlib.Path)), file.__class__.__name__
|
|
179
|
+
file = pathlib.Path(file)
|
|
180
|
+
self._persistant["save_file"] = file # str for jsonisable
|
|
181
|
+
|
|
182
|
+
def tree(self) -> ContainerOutput:
|
|
183
|
+
"""Return the node associated with the complete graph.
|
|
184
|
+
|
|
185
|
+
Returns
|
|
186
|
+
-------
|
|
187
|
+
container_output : cutcutcodec.core.classes.container.ContainerOutput
|
|
188
|
+
The terminal node of the assembly graph.
|
|
189
|
+
"""
|
|
190
|
+
with self._compile_lock:
|
|
191
|
+
container_output = graph_to_tree(self.graph)
|
|
192
|
+
return container_output
|
|
193
|
+
|
|
194
|
+
def tree_edge(self, edge: tuple[str, str, str]) -> Stream:
|
|
195
|
+
"""Return the updated tree of this edge.
|
|
196
|
+
|
|
197
|
+
Parameters
|
|
198
|
+
----------
|
|
199
|
+
edge : tuple[str, str, str]
|
|
200
|
+
The name of the edge in the graph (src_node, dst_node, key).
|
|
201
|
+
|
|
202
|
+
Returns
|
|
203
|
+
-------
|
|
204
|
+
Stream
|
|
205
|
+
The dynamic tree corresponding to this edge.
|
|
206
|
+
|
|
207
|
+
Notes
|
|
208
|
+
-----
|
|
209
|
+
All the ``tree`` attributes are updated to the current state of the assembly graph.
|
|
210
|
+
"""
|
|
211
|
+
assert isinstance(edge, tuple), edge.__class__.__name__
|
|
212
|
+
assert len(edge) == 3, edge
|
|
213
|
+
for name in edge:
|
|
214
|
+
assert isinstance(name, str), name.__class__.__name__
|
|
215
|
+
with self._compile_lock:
|
|
216
|
+
assert self.graph.has_edge(*edge), (edge, self.graph.edges)
|
|
217
|
+
update_trees(self.graph)
|
|
218
|
+
src, dst, key = edge
|
|
219
|
+
tree = self.graph.edges[src, dst, key]["cache"][1]["tree"]
|
|
220
|
+
return tree
|
|
221
|
+
|
|
222
|
+
def tree_node(self, node: str) -> Node:
|
|
223
|
+
"""Return the updated tree of this node.
|
|
224
|
+
|
|
225
|
+
Parameters
|
|
226
|
+
----------
|
|
227
|
+
node : str
|
|
228
|
+
The name of the node in the graph.
|
|
229
|
+
|
|
230
|
+
Returns
|
|
231
|
+
-------
|
|
232
|
+
cutcutcodec.core.classes.node.Node
|
|
233
|
+
The dynamic tree corresponding to this node.
|
|
234
|
+
|
|
235
|
+
Notes
|
|
236
|
+
-----
|
|
237
|
+
All the ``tree`` attributes are updated to the current state of the assembly graph.
|
|
238
|
+
"""
|
|
239
|
+
assert isinstance(node, str), node.__class__.__name__
|
|
240
|
+
with self._compile_lock:
|
|
241
|
+
assert node in self.graph
|
|
242
|
+
update_trees(self.graph)
|
|
243
|
+
tree = self.graph.nodes[node]["cache"][1]["tree"]
|
|
244
|
+
return tree
|
|
245
|
+
|
|
246
|
+
def undo(self):
|
|
247
|
+
"""Return to the previous step."""
|
|
248
|
+
print("undo")
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow to unify widgets by giving them interesting common properties."""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CutcutcodecWidget:
|
|
7
|
+
"""Allow to unify widgets by giving them interesting common properties."""
|
|
8
|
+
|
|
9
|
+
@property
|
|
10
|
+
def app(self):
|
|
11
|
+
"""Get the application, it is the main object sharing all data."""
|
|
12
|
+
return self.main_window.app
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def main_window(self):
|
|
16
|
+
"""Get the mother window of this descendant widget."""
|
|
17
|
+
ancestor = self
|
|
18
|
+
ultimate_ancestor = self.parent
|
|
19
|
+
while ultimate_ancestor is not None:
|
|
20
|
+
ancestor, ultimate_ancestor = ultimate_ancestor, ultimate_ancestor.parent
|
|
21
|
+
if not isinstance(ancestor, CutcutcodecWidget):
|
|
22
|
+
raise TypeError(
|
|
23
|
+
f"all ancestors of {self.__class__.__name__} "
|
|
24
|
+
"must inherit from ``CutcutcodecWidget``"
|
|
25
|
+
)
|
|
26
|
+
return ancestor
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def parent(self):
|
|
30
|
+
"""Return the mother window."""
|
|
31
|
+
if (parent := getattr(self, "_parent", None)) is not None:
|
|
32
|
+
if not isinstance(parent, CutcutcodecWidget):
|
|
33
|
+
raise TypeError(
|
|
34
|
+
f"{parent.__class__.__name__} must inherit from ``CutcutcodecWidget``"
|
|
35
|
+
)
|
|
36
|
+
return parent
|
|
37
|
+
|
|
38
|
+
def refresh(self):
|
|
39
|
+
"""Update the elements of this widget and child widgets.
|
|
40
|
+
|
|
41
|
+
This method can be re-implemented.
|
|
42
|
+
"""
|
|
43
|
+
childs = (
|
|
44
|
+
child for attr, child in self.__dict__.items()
|
|
45
|
+
if not attr.startswith("__")
|
|
46
|
+
and child is not self.parent
|
|
47
|
+
and isinstance(child, CutcutcodecWidget)
|
|
48
|
+
)
|
|
49
|
+
for child in childs:
|
|
50
|
+
child.refresh()
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/container_input_ffmpeg.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.io.read_ffmpeg.ContainerInputFFMPEG``."""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import pathlib
|
|
7
|
+
|
|
8
|
+
from qtpy import QtWidgets
|
|
9
|
+
|
|
10
|
+
from cutcutcodec.core.analysis.ffprobe import get_streams_type
|
|
11
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class EditContainerInputFFMPEG(EditBase):
|
|
15
|
+
"""Allow to view and modify the properties of a node of type ``ContainerInputFFMPEG``."""
|
|
16
|
+
|
|
17
|
+
def __init__(self, parent, node_name):
|
|
18
|
+
super().__init__(parent, node_name)
|
|
19
|
+
self._filename_av_kwargs = None
|
|
20
|
+
self._filename_textbox = None
|
|
21
|
+
|
|
22
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
23
|
+
ref_span = self.init_path(grid_layout)
|
|
24
|
+
self.init_av_kwargs(grid_layout, ref_span=ref_span)
|
|
25
|
+
self.setLayout(grid_layout)
|
|
26
|
+
|
|
27
|
+
def _validate_av_kwargs(self, text):
|
|
28
|
+
"""Check that the av kwargs are correct and update the color."""
|
|
29
|
+
try:
|
|
30
|
+
av_kwargs = json.loads(text)
|
|
31
|
+
except json.JSONDecodeError:
|
|
32
|
+
self._av_kwargs_textbox.setStyleSheet("background:red;")
|
|
33
|
+
return
|
|
34
|
+
if not all(isinstance(k, str) for k in av_kwargs):
|
|
35
|
+
self._av_kwargs_textbox.setStyleSheet("background:red;")
|
|
36
|
+
return
|
|
37
|
+
|
|
38
|
+
def setter(av_kwargs):
|
|
39
|
+
self.state["av_kwargs"] = av_kwargs
|
|
40
|
+
self.try_set_state(
|
|
41
|
+
self.get_updated_state(
|
|
42
|
+
(lambda: self.state["av_kwargs"]),
|
|
43
|
+
setter,
|
|
44
|
+
av_kwargs,
|
|
45
|
+
),
|
|
46
|
+
self._av_kwargs_textbox,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
def _validate_filename(self, text):
|
|
50
|
+
"""Check that the filename is correct and update the color."""
|
|
51
|
+
path = pathlib.Path(text)
|
|
52
|
+
if not path.is_file():
|
|
53
|
+
self._filename_textbox.setStyleSheet("background:red;")
|
|
54
|
+
return
|
|
55
|
+
if not get_streams_type(path, ignore_errors=True):
|
|
56
|
+
self._filename_textbox.setStyleSheet("background:red;")
|
|
57
|
+
return
|
|
58
|
+
|
|
59
|
+
def setter(path):
|
|
60
|
+
self.state["filename"] = path
|
|
61
|
+
self.try_set_state(
|
|
62
|
+
self.get_updated_state(
|
|
63
|
+
(lambda: self.state["filename"]),
|
|
64
|
+
setter,
|
|
65
|
+
str(path),
|
|
66
|
+
),
|
|
67
|
+
self._av_kwargs_textbox,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def init_av_kwargs(self, grid_layout, ref_span=0):
|
|
71
|
+
"""Display and allows to modify the av kwargs."""
|
|
72
|
+
grid_layout.addWidget(QtWidgets.QLabel("PyAv parameters (json):"))
|
|
73
|
+
self._av_kwargs_textbox = QtWidgets.QLineEdit()
|
|
74
|
+
self._av_kwargs_textbox.setText(
|
|
75
|
+
json.dumps(self.state["av_kwargs"], check_circular=False, indent=4, sort_keys=True)
|
|
76
|
+
)
|
|
77
|
+
self._av_kwargs_textbox.textEdited.connect(self._validate_av_kwargs)
|
|
78
|
+
grid_layout.addWidget(self._av_kwargs_textbox, ref_span, 1)
|
|
79
|
+
ref_span += 1
|
|
80
|
+
return ref_span
|
|
81
|
+
|
|
82
|
+
def init_path(self, grid_layout, ref_span=0):
|
|
83
|
+
"""Display and allows to modify the filename."""
|
|
84
|
+
grid_layout.addWidget(QtWidgets.QLabel("File Path:"), ref_span, 0)
|
|
85
|
+
self._filename_textbox = QtWidgets.QLineEdit()
|
|
86
|
+
self._filename_textbox.setText(self.state["filename"])
|
|
87
|
+
self._filename_textbox.textEdited.connect(self._validate_filename)
|
|
88
|
+
grid_layout.addWidget(self._filename_textbox, ref_span, 1)
|
|
89
|
+
ref_span += 1
|
|
90
|
+
return ref_span
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.filter.audio.delay.FilterAudioDelay``."""
|
|
4
|
+
|
|
5
|
+
from cutcutcodec.gui.edit_node_state.all.filter_delay import EditFilterDelay
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EditFilterAudioDelay(EditFilterDelay):
|
|
9
|
+
"""Allow to view and modify the properties of a filter of type ``FilterAudioDelay``."""
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_equation.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.filters.audio.equation.FilterAudioEquation``."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.core.classes.layout import AllLayouts, Layout
|
|
8
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
9
|
+
from cutcutcodec.gui.edit_node_state.interface import AudioLayoutable, Equationable
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EditFilterAudioEquation(EditBase):
|
|
13
|
+
"""Allow to view and modify the properties of a node of type ``FilterAudioEquation``."""
|
|
14
|
+
|
|
15
|
+
def __init__(self, parent, node_name):
|
|
16
|
+
super().__init__(parent, node_name)
|
|
17
|
+
self.signals = []
|
|
18
|
+
self.re_symb = r"t|" + r"|".join(fr'{p}_\d+' for p in sorted(AllLayouts().individuals))
|
|
19
|
+
|
|
20
|
+
self.grid_layout = QtWidgets.QGridLayout()
|
|
21
|
+
self.signals_ref_span = AudioLayoutable(self, enable_default=True)(self.grid_layout)
|
|
22
|
+
self.init_signal(self.grid_layout, self.signals_ref_span)
|
|
23
|
+
self.setLayout(self.grid_layout)
|
|
24
|
+
|
|
25
|
+
def init_signal(self, grid_layout, ref_span=0):
|
|
26
|
+
"""Display and allows to modify the signals."""
|
|
27
|
+
state = self.state # static
|
|
28
|
+
profile = Layout(state["profile"] or len(state["signals"]))
|
|
29
|
+
state["signals"] += ["0"] * (len(profile.channels)-len(state["signals"]))
|
|
30
|
+
state["signals"] = state["signals"][:len(profile.channels)]
|
|
31
|
+
for i, (channel, desc) in enumerate(profile.channels):
|
|
32
|
+
self.signals.append(
|
|
33
|
+
Equationable(self, (i, "signals"), f"{desc} ({channel}):", self.re_symb)
|
|
34
|
+
)
|
|
35
|
+
for equation in self.signals:
|
|
36
|
+
equation(grid_layout, ref_span)
|
|
37
|
+
ref_span += 1
|
|
38
|
+
return ref_span + 1
|
|
39
|
+
|
|
40
|
+
def reset(self):
|
|
41
|
+
"""Help when called by the signals interface."""
|
|
42
|
+
for signal in self.signals:
|
|
43
|
+
signal.delete()
|
|
44
|
+
self.signals = []
|
|
45
|
+
self.init_signal(self.grid_layout, ref_span=self.signals_ref_span)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.generation.audio.noise.GeneratorAudioNoise``."""
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
|
|
7
|
+
from qtpy import QtWidgets
|
|
8
|
+
import torch
|
|
9
|
+
|
|
10
|
+
from cutcutcodec.core.filters.audio.fir import FilterAudioFIR
|
|
11
|
+
from cutcutcodec.gui.edit_node_state.base import EditBase
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class EditFilterAudioFIR(EditBase):
|
|
15
|
+
"""Allow to view and modify the properties of a filter of type ``FilterAudioFIR``."""
|
|
16
|
+
|
|
17
|
+
def __init__(self, parent, node_name):
|
|
18
|
+
super().__init__(parent, node_name)
|
|
19
|
+
|
|
20
|
+
self.rep_textedit = self.rate_textbox = None
|
|
21
|
+
|
|
22
|
+
self.grid_layout = QtWidgets.QGridLayout()
|
|
23
|
+
ref_span = self.init_fir(self.grid_layout)
|
|
24
|
+
self.init_rate(self.grid_layout, ref_span)
|
|
25
|
+
self.setLayout(self.grid_layout)
|
|
26
|
+
|
|
27
|
+
def init_fir(self, grid_layout, ref_span=0):
|
|
28
|
+
"""Display and allows to modify the impulsional resp."""
|
|
29
|
+
grid_layout.addWidget(QtWidgets.QLabel("Impulsional Response:"), ref_span, 0)
|
|
30
|
+
self.rep_textedit = QtWidgets.QTextEdit() # QtWidgets.QLineEdit()
|
|
31
|
+
self.rep_textedit.setText(
|
|
32
|
+
", ".join(map(str, FilterAudioFIR.decode_fir(self.state["fir_encoded"]).tolist()))
|
|
33
|
+
)
|
|
34
|
+
self.rep_textedit.textEdited.connect(self.validate_fir)
|
|
35
|
+
grid_layout.addWidget(self.rep_textedit, ref_span, 1)
|
|
36
|
+
return ref_span + 1
|
|
37
|
+
|
|
38
|
+
def init_rate(self, grid_layout, ref_span=0):
|
|
39
|
+
"""Display and allows to modify the samplerate."""
|
|
40
|
+
grid_layout.addWidget(QtWidgets.QLabel("Sample Rate (Hz):"), ref_span, 0)
|
|
41
|
+
self.rate_textbox = QtWidgets.QLineEdit()
|
|
42
|
+
self.rate_textbox.setText(str(self.state["fir_rate"]))
|
|
43
|
+
self.rate_textbox.textEdited.connect(self.validate_rate)
|
|
44
|
+
grid_layout.addWidget(self.rate_textbox, ref_span, 1)
|
|
45
|
+
return ref_span + 1
|
|
46
|
+
|
|
47
|
+
def validate_fir(self):
|
|
48
|
+
"""Check than the numbers are correct and update the list."""
|
|
49
|
+
text = self.rep_textedit.toPlainText()
|
|
50
|
+
if not (items := list(map(float, re.findall(r"\d+(?:\.\d*)", text)))):
|
|
51
|
+
self.rep_textedit.setStyleSheet("background:red;")
|
|
52
|
+
return
|
|
53
|
+
fir = FilterAudioFIR.encode_fir(torch.tensor(items, dtype=torch.float64))
|
|
54
|
+
self.try_set_state(self.get_updated_state_dict({"fir_encoded": fir}), self.rep_textedit)
|
|
55
|
+
|
|
56
|
+
def validate_rate(self, text):
|
|
57
|
+
"""Check than the framerate is correct and update it."""
|
|
58
|
+
raise NotImplementedError
|
cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_subclip.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Properties of a ``cutcutcodec.core.filter.audio.subclip.FilterAudioSubclip``."""
|
|
4
|
+
|
|
5
|
+
from cutcutcodec.gui.edit_node_state.all.filter_subclip import EditFilterSubclip
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EditFilterAudioSubclip(EditFilterSubclip):
|
|
9
|
+
"""Allow to view and modify the properties of a filter of type ``FilterAudioSubclip``."""
|