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,97 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""A single track in the timeline."""
|
|
4
|
+
|
|
5
|
+
import math
|
|
6
|
+
|
|
7
|
+
from qtpy import QtCore, QtGui, QtWidgets
|
|
8
|
+
from qtpynodeeditor.style import NodeStyle
|
|
9
|
+
|
|
10
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
11
|
+
from cutcutcodec.core.classes.node import Node
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Track(CutcutcodecWidget, QtWidgets.QGraphicsItem):
|
|
15
|
+
"""Representation of the stream of a node."""
|
|
16
|
+
|
|
17
|
+
def __init__(self, parent, node: Node):
|
|
18
|
+
super().__init__()
|
|
19
|
+
self._parent = parent
|
|
20
|
+
self.node = node
|
|
21
|
+
|
|
22
|
+
self.setAcceptHoverEvents(True)
|
|
23
|
+
self.setFlag(QtWidgets.QGraphicsItem.ItemDoesntPropagateOpacityToChildren, True)
|
|
24
|
+
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
|
25
|
+
self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable, True)
|
|
26
|
+
self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable, True)
|
|
27
|
+
self.setFlag(QtWidgets.QGraphicsItem.ItemContainsChildrenInShape, True) # for optimisation
|
|
28
|
+
# self.setFlag(QtWidgets.QGraphicsItem.ItemSendsScenePositionChanges, True)
|
|
29
|
+
|
|
30
|
+
self.is_hovered = False
|
|
31
|
+
|
|
32
|
+
def boundingRect(self) -> QtCore.QRectF:
|
|
33
|
+
"""Return the complete bounding rect of the node."""
|
|
34
|
+
beginning = self.node.in_streams[0].beginning
|
|
35
|
+
duration = self.node.in_streams[0].duration
|
|
36
|
+
(t_min, t_max), _ = self.parent.viewRange()
|
|
37
|
+
x_min, x_max = self.parent.sceneRect().left(), self.parent.sceneRect().right()
|
|
38
|
+
ratio = (x_max-x_min) / (t_max-t_min)
|
|
39
|
+
left = x_min + ratio * (beginning-t_min)
|
|
40
|
+
width = x_min + ratio * duration
|
|
41
|
+
if width == math.inf:
|
|
42
|
+
width = max(x_max-x_min, x_max-left)
|
|
43
|
+
boundary = QtCore.QRectF(left, 30, width, 70)
|
|
44
|
+
return boundary
|
|
45
|
+
|
|
46
|
+
def hoverEnterEvent(self, event):
|
|
47
|
+
"""When the mouse comes in the rectangle."""
|
|
48
|
+
self.is_hovered = True
|
|
49
|
+
event.accept()
|
|
50
|
+
self.update()
|
|
51
|
+
|
|
52
|
+
def hoverLeaveEvent(self, event):
|
|
53
|
+
"""When the mouse leave the rectangle."""
|
|
54
|
+
self.is_hovered = False
|
|
55
|
+
event.accept()
|
|
56
|
+
self.update()
|
|
57
|
+
|
|
58
|
+
def paint(self, painter: QtGui.QPainter, *_):
|
|
59
|
+
"""Draw the track."""
|
|
60
|
+
boundary = self.boundingRect()
|
|
61
|
+
|
|
62
|
+
# draw the main rectangle
|
|
63
|
+
color = (
|
|
64
|
+
NodeStyle().selected_boundary_color
|
|
65
|
+
if self.isSelected()
|
|
66
|
+
else NodeStyle().normal_boundary_color
|
|
67
|
+
)
|
|
68
|
+
style = NodeStyle().hovered_pen_width if self.is_hovered else NodeStyle().pen_width
|
|
69
|
+
pen = QtGui.QPen(color, style)
|
|
70
|
+
painter.setPen(pen)
|
|
71
|
+
gradient = QtGui.QLinearGradient(
|
|
72
|
+
QtCore.QPointF(0.0, 0.0), QtCore.QPointF(2.0, boundary.height())
|
|
73
|
+
)
|
|
74
|
+
for at_, color in NodeStyle().gradient_colors:
|
|
75
|
+
gradient.setColorAt(at_, color)
|
|
76
|
+
painter.setBrush(gradient)
|
|
77
|
+
radius = 3.0
|
|
78
|
+
painter.drawRoundedRect(boundary, radius, radius)
|
|
79
|
+
|
|
80
|
+
# draw the node name
|
|
81
|
+
font = painter.font()
|
|
82
|
+
font.setBold(True)
|
|
83
|
+
painter.setFont(font)
|
|
84
|
+
painter.setPen(NodeStyle().font_color)
|
|
85
|
+
painter.drawText(boundary, "container output")
|
|
86
|
+
font.setBold(False)
|
|
87
|
+
painter.setFont(font)
|
|
88
|
+
|
|
89
|
+
def update_node(self, new_node: Node):
|
|
90
|
+
"""Recompute the complete new tree from the given node."""
|
|
91
|
+
self.node = new_node
|
|
92
|
+
# for item in self.childItems():
|
|
93
|
+
# print(item, "todelete")
|
|
94
|
+
# for stream in self.node.in_streams:
|
|
95
|
+
# child_track = Track(self.parent, stream.node_main)
|
|
96
|
+
# child_track.setParentItem(self)
|
|
97
|
+
# self.scene().addItem(child_track)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow drawing the tracks in the timeline."""
|
|
4
|
+
|
|
5
|
+
from fractions import Fraction
|
|
6
|
+
import math
|
|
7
|
+
|
|
8
|
+
from qtpy import QtCore
|
|
9
|
+
import pyqtgraph
|
|
10
|
+
|
|
11
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
12
|
+
# from cutcutcodec.gui.timeline.track import Track
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TimeAxisItem(pyqtgraph.AxisItem):
|
|
16
|
+
"""Internal timestamp for x-axis."""
|
|
17
|
+
|
|
18
|
+
def tickStrings(self, values, scale, spacing):
|
|
19
|
+
"""Overload the weak default version to provide timestamp."""
|
|
20
|
+
if spacing >= 1e-1:
|
|
21
|
+
return [f"{int(value)//60:02d}:{value%60:04.1f}" for value in values]
|
|
22
|
+
return [f"{int(value)//60:02d}:{value%60:06.3f}" for value in values]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class View(CutcutcodecWidget, pyqtgraph.widgets.PlotWidget.PlotWidget):
|
|
26
|
+
"""Canva with tracks and time rules.
|
|
27
|
+
|
|
28
|
+
self.viewRange() -> [[xmin, xmax], [ymin, ymax]]
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
def __init__(self, parent):
|
|
32
|
+
super().__init__(parent)
|
|
33
|
+
self._parent = parent
|
|
34
|
+
|
|
35
|
+
self.setLimits(xMin=0, minYRange=1, maxYRange=1)
|
|
36
|
+
self.invertY(True)
|
|
37
|
+
self.setAxisItems({"top": TimeAxisItem(orientation="top")})
|
|
38
|
+
self.showAxis("left", False)
|
|
39
|
+
self.showAxis("bottom", False)
|
|
40
|
+
self.sigRangeChanged.connect(View.event_range_changed)
|
|
41
|
+
|
|
42
|
+
# self.track = Track(self, self.app.tree())
|
|
43
|
+
|
|
44
|
+
self.cursor = pyqtgraph.graphicsItems.InfiniteLine.InfiniteLine(angle=90, movable=True)
|
|
45
|
+
self.cursor.addMarker("<|>", 0, 20)
|
|
46
|
+
self.cursor.sigDragged.connect(self.event_position_changed) # sigPositionChangeFinished
|
|
47
|
+
|
|
48
|
+
# self.scene().addItem(self.track)
|
|
49
|
+
self.addItem(self.cursor)
|
|
50
|
+
|
|
51
|
+
# self.showGrid(x=True, y=True)
|
|
52
|
+
# p = self.plot([5, 14, 14, 5, 5], [0, 0, 0.2, 0.2, 0])
|
|
53
|
+
# print(p)
|
|
54
|
+
|
|
55
|
+
# self.setYRange(0, 10)
|
|
56
|
+
|
|
57
|
+
def event_position_changed(self, cursor):
|
|
58
|
+
"""Help when called when the cursor is moved."""
|
|
59
|
+
timestamp = Fraction(cursor.x())
|
|
60
|
+
self.main_window.sub_windows["video_preview"].frame_extractor.set_position(timestamp)
|
|
61
|
+
|
|
62
|
+
def event_range_changed(self, box):
|
|
63
|
+
"""Help when called when the range is changed."""
|
|
64
|
+
(t_min, t_max), _ = box
|
|
65
|
+
# for track in self.tracks:
|
|
66
|
+
# track.update_range(t_min, t_max)
|
|
67
|
+
self.parent.slider.update_range(t_min, t_max)
|
|
68
|
+
|
|
69
|
+
def refresh(self):
|
|
70
|
+
"""Update the elements of this widget and child widgets."""
|
|
71
|
+
duration = (
|
|
72
|
+
max((s.beginning+s.duration for s in self.app.tree().in_streams), default=math.inf)
|
|
73
|
+
)
|
|
74
|
+
if duration == math.inf:
|
|
75
|
+
self.setLimits(xMax=None)
|
|
76
|
+
else:
|
|
77
|
+
self.setLimits(xMax=duration) # duration + 10%
|
|
78
|
+
|
|
79
|
+
# if (new_tree := self.app.tree()) != self.track.node:
|
|
80
|
+
# self.track.update_node(new_tree)
|
|
81
|
+
self.update()
|
|
82
|
+
|
|
83
|
+
@QtCore.Slot(Fraction)
|
|
84
|
+
def update_pos(self, timestamp):
|
|
85
|
+
"""Set the cursor at the write position."""
|
|
86
|
+
self.cursor.setPos(timestamp)
|
|
87
|
+
|
|
88
|
+
def update_range(self, t_min: Fraction, t_max: Fraction):
|
|
89
|
+
"""Update the position from slice."""
|
|
90
|
+
self.setXRange(t_min, t_max, padding=0) # E1124 (redundant-keyword-arg) in pylint 2.17.2
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Definition of the toolbar."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MainToolBar(CutcutcodecWidget, QtWidgets.QToolBar):
|
|
11
|
+
"""Main window menu bar."""
|
|
12
|
+
|
|
13
|
+
def __init__(self, parent, actions):
|
|
14
|
+
super().__init__(parent)
|
|
15
|
+
self._parent = parent
|
|
16
|
+
|
|
17
|
+
self.addAction(actions["import"])
|
|
18
|
+
self.addAction(actions["open"])
|
|
19
|
+
self.addAction(actions["save"])
|
|
20
|
+
|
|
21
|
+
self.addSeparator()
|
|
22
|
+
|
|
23
|
+
self.addAction(actions["refresh"])
|
|
24
|
+
self.addAction(actions["undo"])
|
|
25
|
+
self.addAction(actions["redo"])
|
|
26
|
+
|
|
27
|
+
self.addSeparator()
|
|
28
|
+
|
|
29
|
+
self.addAction(actions["export"])
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""General GUI tools."""
|
|
4
|
+
|
|
5
|
+
from qtpy import QtCore, QtWidgets
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class WaitCursor:
|
|
9
|
+
"""Context manager for a wait cursor."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, widget: QtWidgets.QWidget):
|
|
12
|
+
assert isinstance(widget, QtWidgets.QWidget), widget.__class__.__name__
|
|
13
|
+
self.widget = widget
|
|
14
|
+
self.old_cursor = None
|
|
15
|
+
|
|
16
|
+
def __enter__(self):
|
|
17
|
+
"""Enter in a context manager, change the cursor."""
|
|
18
|
+
self.old_cursor = self.widget.cursor()
|
|
19
|
+
self.widget.setCursor(QtCore.Qt.CursorShape.WaitCursor)
|
|
20
|
+
|
|
21
|
+
def __exit__(self, *_):
|
|
22
|
+
"""Exit from the context manager, restor the old cursor."""
|
|
23
|
+
self.widget.setCursor(self.old_cursor)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Plays audio in background for the video preview."""
|
|
4
|
+
|
|
5
|
+
import queue
|
|
6
|
+
import threading
|
|
7
|
+
import sys
|
|
8
|
+
import subprocess
|
|
9
|
+
|
|
10
|
+
import numpy as np
|
|
11
|
+
|
|
12
|
+
from cutcutcodec.core.classes.frame_audio import FrameAudio
|
|
13
|
+
from cutcutcodec.core.classes.layout import Layout
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AudioPlayer(threading.Thread):
|
|
17
|
+
"""Allow to play sound buffers in the background, without blocking."""
|
|
18
|
+
|
|
19
|
+
def __init__(self, *args, **kwargs):
|
|
20
|
+
super().__init__(*args, **kwargs)
|
|
21
|
+
|
|
22
|
+
self._layout = "mono" # is quicklely overwriten
|
|
23
|
+
self._buff = queue.Queue()
|
|
24
|
+
self._restart = False
|
|
25
|
+
self._is_alive = True
|
|
26
|
+
self._samplerate = 48000 # is quickely overwriten
|
|
27
|
+
|
|
28
|
+
def get_layout(self) -> str:
|
|
29
|
+
"""Return the numbers of audio channels."""
|
|
30
|
+
return self._layout
|
|
31
|
+
|
|
32
|
+
def set_layout(self, new_profile: str):
|
|
33
|
+
"""Update the number of channels and recreate a new ffmpeg connection."""
|
|
34
|
+
assert isinstance(new_profile, str), new_profile.__class__.__name__
|
|
35
|
+
if new_profile != self.get_layout():
|
|
36
|
+
self._layout = new_profile
|
|
37
|
+
self.restart()
|
|
38
|
+
|
|
39
|
+
def restart(self):
|
|
40
|
+
"""Allow to reset link with the sound card."""
|
|
41
|
+
while True:
|
|
42
|
+
try:
|
|
43
|
+
self._buff.get_nowait()
|
|
44
|
+
except queue.Empty:
|
|
45
|
+
break
|
|
46
|
+
self._restart = True
|
|
47
|
+
self._buff.put(b"")
|
|
48
|
+
while self._restart:
|
|
49
|
+
continue
|
|
50
|
+
|
|
51
|
+
def run(self):
|
|
52
|
+
"""Allow interaction with the sound card."""
|
|
53
|
+
while self._is_alive:
|
|
54
|
+
cmd = [
|
|
55
|
+
"ffmpeg",
|
|
56
|
+
"-v", "error",
|
|
57
|
+
"-f", "f32le", # means 32 bit input
|
|
58
|
+
"-acodec", "pcm_f32le", # means raw 32 bit input
|
|
59
|
+
"-ar", str(self.get_samplerate()),
|
|
60
|
+
"-ac", str(len(Layout(self.get_layout()).channels)),
|
|
61
|
+
"-i", "pipe:",
|
|
62
|
+
"-c:a", "copy", "-bufsize:a", "1024",
|
|
63
|
+
"-f", "pulse",
|
|
64
|
+
"-name", "cutcutcodec",
|
|
65
|
+
"-buffer_size", "1024", # in bytes or "-buffer_duration", "20", # in ms
|
|
66
|
+
"cutcutcodec",
|
|
67
|
+
]
|
|
68
|
+
with subprocess.Popen(
|
|
69
|
+
cmd,
|
|
70
|
+
bufsize=1024,
|
|
71
|
+
stdin=subprocess.PIPE,
|
|
72
|
+
stdout=sys.stdout,
|
|
73
|
+
stderr=sys.stderr
|
|
74
|
+
) as process:
|
|
75
|
+
with process.stdin as stdin:
|
|
76
|
+
while self._is_alive and not self._restart:
|
|
77
|
+
stdin.write(self._buff.get())
|
|
78
|
+
self._restart = False
|
|
79
|
+
|
|
80
|
+
def get_samplerate(self) -> int:
|
|
81
|
+
"""Return the audio signal sampling frequency in Hz."""
|
|
82
|
+
return self._samplerate
|
|
83
|
+
|
|
84
|
+
def set_samplerate(self, new_samplerate: int):
|
|
85
|
+
"""Update the samplerate and recreate a new ffmpeg connection."""
|
|
86
|
+
assert isinstance(new_samplerate, int), new_samplerate.__class__.__name__
|
|
87
|
+
assert new_samplerate > 0, new_samplerate
|
|
88
|
+
if new_samplerate != self.get_samplerate():
|
|
89
|
+
self._samplerate = new_samplerate
|
|
90
|
+
self.restart()
|
|
91
|
+
|
|
92
|
+
def stop(self):
|
|
93
|
+
"""Set run flag to False and waits for thread to finish."""
|
|
94
|
+
self._is_alive = False
|
|
95
|
+
self._buff.put(b"") # relunch loop in run for exit
|
|
96
|
+
self.join()
|
|
97
|
+
|
|
98
|
+
def update_frame(self, frame: FrameAudio):
|
|
99
|
+
"""Add the new samples to the buffer."""
|
|
100
|
+
audio_data = bytes(frame.numpy(force=True).astype(np.float32).ravel(order="F"))
|
|
101
|
+
self.set_layout(frame.layout.name)
|
|
102
|
+
self.set_samplerate(frame.rate)
|
|
103
|
+
self._buff.put(audio_data)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""The control bar to manage video preview."""
|
|
4
|
+
|
|
5
|
+
from fractions import Fraction
|
|
6
|
+
import math
|
|
7
|
+
|
|
8
|
+
from qtpy import QtGui, QtWidgets
|
|
9
|
+
|
|
10
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ControlBar(CutcutcodecWidget, QtWidgets.QToolBar):
|
|
14
|
+
"""Contains the buttons for the control of the video preview."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, parent):
|
|
17
|
+
super().__init__(parent)
|
|
18
|
+
self._parent = parent
|
|
19
|
+
|
|
20
|
+
self.act_start_pause = (
|
|
21
|
+
QtGui.QAction(QtGui.QIcon.fromTheme("media-playback-start"), "start", self)
|
|
22
|
+
)
|
|
23
|
+
self.act_start_pause.triggered.connect(self.set_start_pause)
|
|
24
|
+
self.act_start_pause.setShortcut("space")
|
|
25
|
+
self.addAction(self.act_start_pause)
|
|
26
|
+
|
|
27
|
+
self.addSeparator()
|
|
28
|
+
|
|
29
|
+
act_seek_backward = (
|
|
30
|
+
QtGui.QAction(QtGui.QIcon.fromTheme("media-skip-backward"), "backward big", self)
|
|
31
|
+
)
|
|
32
|
+
act_seek_backward.triggered.connect(lambda: self.jump(-10))
|
|
33
|
+
self.addAction(act_seek_backward)
|
|
34
|
+
|
|
35
|
+
act_backward = QtGui.QAction(QtGui.QIcon.fromTheme("media-seek-backward"), "backward", self)
|
|
36
|
+
act_backward.triggered.connect(lambda: self.jump(-1))
|
|
37
|
+
act_backward.setShortcut("Left")
|
|
38
|
+
self.addAction(act_backward)
|
|
39
|
+
|
|
40
|
+
act_pause = QtGui.QAction(QtGui.QIcon.fromTheme("media-playback-stop"), "stop", self)
|
|
41
|
+
act_pause.triggered.connect(self.set_stop)
|
|
42
|
+
self.addAction(act_pause)
|
|
43
|
+
|
|
44
|
+
act_forward = QtGui.QAction(QtGui.QIcon.fromTheme("media-seek-forward"), "forward", self)
|
|
45
|
+
act_forward.triggered.connect(lambda: self.jump(1))
|
|
46
|
+
act_forward.setShortcut("Right")
|
|
47
|
+
self.addAction(act_forward)
|
|
48
|
+
|
|
49
|
+
act_seek_forward = (
|
|
50
|
+
QtGui.QAction(QtGui.QIcon.fromTheme("media-skip-forward"), "forward big", self)
|
|
51
|
+
)
|
|
52
|
+
act_seek_forward.triggered.connect(lambda: self.jump(10))
|
|
53
|
+
self.addAction(act_seek_forward)
|
|
54
|
+
|
|
55
|
+
self.addSeparator()
|
|
56
|
+
|
|
57
|
+
act_zoom_fit = QtGui.QAction(QtGui.QIcon.fromTheme("zoom-fit-best"), "zoom fit best", self)
|
|
58
|
+
act_zoom_fit.triggered.connect(self.parent.set_zoom_fit)
|
|
59
|
+
self.addAction(act_zoom_fit)
|
|
60
|
+
|
|
61
|
+
act_zoom_original = QtGui.QAction(
|
|
62
|
+
QtGui.QIcon.fromTheme("zoom-original"), "zoom original", self
|
|
63
|
+
)
|
|
64
|
+
act_zoom_original.triggered.connect(self.parent.set_zoom_original)
|
|
65
|
+
self.addAction(act_zoom_original)
|
|
66
|
+
|
|
67
|
+
def jump(self, step: int):
|
|
68
|
+
"""Take a step backward or forward."""
|
|
69
|
+
curr_pos = self.parent.frame_extractor.dynamic_scheduler.position
|
|
70
|
+
curr_pos = Fraction(0) if curr_pos is None else curr_pos[0]
|
|
71
|
+
if self.parent.frame_extractor.dynamic_scheduler.state["running"]:
|
|
72
|
+
s_a = self.parent.frame_extractor.dynamic_scheduler.get_stream_audio()
|
|
73
|
+
s_v = self.parent.frame_extractor.dynamic_scheduler.get_stream_video()
|
|
74
|
+
durations = []
|
|
75
|
+
if s_a is not None:
|
|
76
|
+
durations.append(s_a.duration)
|
|
77
|
+
if s_v is not None:
|
|
78
|
+
durations.append(s_v.duration)
|
|
79
|
+
if (duration := max(durations, default=math.inf)) == math.inf:
|
|
80
|
+
delta = Fraction(6)
|
|
81
|
+
else:
|
|
82
|
+
delta = duration / 100
|
|
83
|
+
else:
|
|
84
|
+
delta = 1 / self.parent.frame_extractor.dynamic_scheduler.state["fps"]
|
|
85
|
+
self.parent.frame_extractor.set_position(curr_pos + step*delta)
|
|
86
|
+
|
|
87
|
+
def set_start_pause(self):
|
|
88
|
+
"""Switches between start and pause mode."""
|
|
89
|
+
if self.parent.frame_extractor.dynamic_scheduler.state["running"]:
|
|
90
|
+
self.parent.frame_extractor.set_pause()
|
|
91
|
+
else:
|
|
92
|
+
self.parent.frame_extractor.set_start()
|
|
93
|
+
|
|
94
|
+
def set_stop(self):
|
|
95
|
+
"""Alias to ``cutcutcodec.gui.video_preview.frame_extractor.FrameExtractor.set_stop``."""
|
|
96
|
+
self.parent.frame_extractor.set_stop()
|