├── resources ├── add.png ├── cog.png ├── disk.png ├── film.png ├── font.png ├── link.png ├── tick.png ├── zoom.png ├── cross.png ├── delete.png ├── erase.png ├── folder.png ├── vsedit.ico ├── vsedit.png ├── benchmark.png ├── disk_edit.png ├── door_in.png ├── film_save.png ├── hourglass.png ├── time_back.png ├── timeline.png ├── vsedit.icns ├── zoom_fit.png ├── zoom_in.png ├── folder_add.png ├── information.png ├── paste_plain.png ├── pause_green.png ├── play_green.png ├── zoom_actual.png ├── color_picker.png ├── color_swatch.png ├── folder_delete.png ├── picture_save.png ├── sheduled_task.png ├── time_forward.png ├── transform_crop.png ├── page_white_text.png ├── tick_light_blue.png ├── timeline_frames.png ├── timeline_marker.png ├── folder_page_white.png ├── fonts │ └── DigitalMini.ttf ├── image_to_clipboard.png ├── timeline_marker_add.png ├── timeline_marker_next.png ├── timeline_marker_previous.png ├── timeline_marker_remove.png ├── vsedit-job-server-watcher.ico ├── vsedit-job-server-watcher.qrc └── vsedit.qrc ├── pro ├── vsedit-single │ ├── vsedit-main.cpp │ ├── vsedit-job-server.cpp │ ├── vsedit-job-server-watcher.cpp │ └── full.cpp ├── single.pro ├── common.pri ├── pro.pro ├── build-msvc.bat ├── local_quirks.pri └── build-inno-setup.iss ├── common-src ├── helpers_gui.h ├── vapoursynth │ ├── vs_gray_frame_prop.h │ ├── vs_pack_rgb.h │ ├── vs_script_processor_structures.h │ ├── vs_gray_frame_prop.cpp │ ├── vs_script_processor_structures.cpp │ ├── vs_script_library.h │ ├── vs_pack_rgb.cpp │ └── vapoursynth_script_processor.h ├── chrono.h ├── libp2p │ ├── COPYING │ ├── simd │ │ ├── p2p_simd.h │ │ ├── cpuinfo_x86.h │ │ └── p2p_simd.cpp │ └── README.md ├── helpers_gui.cpp ├── application_instance_file_guard │ ├── application_instance_file_guard.h │ └── application_instance_file_guard.cpp ├── log │ ├── vs_editor_log_definitions.h │ ├── vs_editor_log.h │ ├── styled_log_view_structures.h │ ├── styled_log_view_core.h │ ├── styled_log_view_settings_dialog.h │ ├── vs_editor_log_definitions.cpp │ ├── log_styles_model.h │ ├── styled_log_view.h │ ├── styled_log_view_structures.cpp │ ├── styled_log_view_core.cpp │ ├── styled_log_view_settings_dialog.ui │ └── vs_editor_log.cpp ├── frame_header_writers │ ├── frame_header_writer_y4m.h │ ├── frame_header_writer_null.h │ ├── frame_header_writer.h │ ├── frame_header_writer.cpp │ └── frame_header_writer_null.cpp ├── jobs │ ├── job_variables.h │ └── job_variables.cpp ├── ipc_defines.h ├── aligned_vector.h ├── settings │ ├── settings_manager_core.h │ └── settings_definitions_core.h ├── helpers.h └── timeline_slider │ └── timeline_slider.h ├── TODO.txt ├── vsedit-job-server └── src │ ├── jobs │ ├── job_definitions.h │ └── jobs_manager.h │ ├── main.cpp │ └── job_server.h ├── .gitignore ├── vsedit └── src │ ├── script_editor │ ├── script_completer.h │ ├── script_completer_model.h │ ├── number_matcher.h │ ├── script_completer.cpp │ ├── syntax_highlighter.h │ └── script_completer_model.cpp │ ├── job_server_watcher_socket.h │ ├── preview │ ├── scroll_navigator.h │ ├── preview_advanced_settings_dialog.h │ ├── preview_area.h │ └── scroll_navigator.cpp │ ├── settings │ ├── clearable_key_sequence_editor.h │ ├── item_delegate_for_hotkey.h │ ├── actions_hotkey_edit_model.h │ ├── settings_dialog.h │ ├── clearable_key_sequence_editor.cpp │ ├── theme_elements_model.h │ └── item_delegate_for_hotkey.cpp │ ├── script_status_bar_widget │ ├── script_status_bar_widget.h │ └── script_status_bar_widget.cpp │ ├── vapoursynth │ ├── vapoursynth_plugins_manager.h │ ├── vs_plugin_data.h │ └── vs_script_processor_dialog.h │ ├── script_templates │ ├── drop_file_category_model.h │ └── templates_dialog.h │ ├── frame_consumers │ ├── benchmark_dialog.h │ ├── encode_dialog.h │ └── benchmark_dialog.ui │ ├── main.cpp │ ├── main_window.ui │ ├── job_server_watcher_socket.cpp │ └── main_window.h ├── README ├── vsedit-job-server-watcher └── src │ ├── jobs │ ├── job_state_delegate.h │ ├── job_dependencies_delegate.h │ ├── job_edit_dialog.h │ ├── job_state_delegate.cpp │ └── jobs_model.h │ ├── trusted_clients_addresses_dialog.h │ ├── connect_to_server_dialog.h │ ├── connect_to_server_dialog.cpp │ ├── connect_to_server_dialog.ui │ ├── main.cpp │ ├── trusted_clients_addresses_dialog.cpp │ └── trusted_clients_addresses_dialog.ui ├── LICENSE ├── BUILDING └── .github └── workflows ├── windows.yml └── qt.yml /resources/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/add.png -------------------------------------------------------------------------------- /resources/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/cog.png -------------------------------------------------------------------------------- /resources/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/disk.png -------------------------------------------------------------------------------- /resources/film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/film.png -------------------------------------------------------------------------------- /resources/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/font.png -------------------------------------------------------------------------------- /resources/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/link.png -------------------------------------------------------------------------------- /resources/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/tick.png -------------------------------------------------------------------------------- /resources/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/zoom.png -------------------------------------------------------------------------------- /pro/vsedit-single/vsedit-main.cpp: -------------------------------------------------------------------------------- 1 | #define main vsedit_main 2 | #include "../../vsedit/src/main.cpp" 3 | 4 | -------------------------------------------------------------------------------- /resources/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/cross.png -------------------------------------------------------------------------------- /resources/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/delete.png -------------------------------------------------------------------------------- /resources/erase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/erase.png -------------------------------------------------------------------------------- /resources/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/folder.png -------------------------------------------------------------------------------- /resources/vsedit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/vsedit.ico -------------------------------------------------------------------------------- /resources/vsedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/vsedit.png -------------------------------------------------------------------------------- /resources/benchmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/benchmark.png -------------------------------------------------------------------------------- /resources/disk_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/disk_edit.png -------------------------------------------------------------------------------- /resources/door_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/door_in.png -------------------------------------------------------------------------------- /resources/film_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/film_save.png -------------------------------------------------------------------------------- /resources/hourglass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/hourglass.png -------------------------------------------------------------------------------- /resources/time_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/time_back.png -------------------------------------------------------------------------------- /resources/timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/timeline.png -------------------------------------------------------------------------------- /resources/vsedit.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/vsedit.icns -------------------------------------------------------------------------------- /resources/zoom_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/zoom_fit.png -------------------------------------------------------------------------------- /resources/zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/zoom_in.png -------------------------------------------------------------------------------- /resources/folder_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/folder_add.png -------------------------------------------------------------------------------- /resources/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/information.png -------------------------------------------------------------------------------- /resources/paste_plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/paste_plain.png -------------------------------------------------------------------------------- /resources/pause_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/pause_green.png -------------------------------------------------------------------------------- /resources/play_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/play_green.png -------------------------------------------------------------------------------- /resources/zoom_actual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/zoom_actual.png -------------------------------------------------------------------------------- /resources/color_picker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/color_picker.png -------------------------------------------------------------------------------- /resources/color_swatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/color_swatch.png -------------------------------------------------------------------------------- /resources/folder_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/folder_delete.png -------------------------------------------------------------------------------- /resources/picture_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/picture_save.png -------------------------------------------------------------------------------- /resources/sheduled_task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/sheduled_task.png -------------------------------------------------------------------------------- /resources/time_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/time_forward.png -------------------------------------------------------------------------------- /resources/transform_crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/transform_crop.png -------------------------------------------------------------------------------- /pro/vsedit-single/vsedit-job-server.cpp: -------------------------------------------------------------------------------- 1 | #define main job_server_main 2 | #include "../../vsedit-job-server/src/main.cpp" 3 | -------------------------------------------------------------------------------- /resources/page_white_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/page_white_text.png -------------------------------------------------------------------------------- /resources/tick_light_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/tick_light_blue.png -------------------------------------------------------------------------------- /resources/timeline_frames.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/timeline_frames.png -------------------------------------------------------------------------------- /resources/timeline_marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/timeline_marker.png -------------------------------------------------------------------------------- /resources/folder_page_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/folder_page_white.png -------------------------------------------------------------------------------- /resources/fonts/DigitalMini.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/fonts/DigitalMini.ttf -------------------------------------------------------------------------------- /resources/image_to_clipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/image_to_clipboard.png -------------------------------------------------------------------------------- /resources/timeline_marker_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/timeline_marker_add.png -------------------------------------------------------------------------------- /pro/single.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += vsedit-single 4 | 5 | vsedit-single.file = ./vsedit-single/vsedit-single.pro 6 | -------------------------------------------------------------------------------- /resources/timeline_marker_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/timeline_marker_next.png -------------------------------------------------------------------------------- /resources/timeline_marker_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/timeline_marker_previous.png -------------------------------------------------------------------------------- /resources/timeline_marker_remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/timeline_marker_remove.png -------------------------------------------------------------------------------- /resources/vsedit-job-server-watcher.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmusementClub/VapourSynth-Editor/mod/resources/vsedit-job-server-watcher.ico -------------------------------------------------------------------------------- /pro/common.pri: -------------------------------------------------------------------------------- 1 | VER_MAJ = 19 2 | VERSION = $$VER_MAJ 3 | 4 | QMAKE_TARGET_COMPANY = 'Aleksey [Mystery Keeper] Lyashin' 5 | QMAKE_TARGET_COPYRIGHT = $$QMAKE_TARGET_COMPANY 6 | -------------------------------------------------------------------------------- /pro/vsedit-single/vsedit-job-server-watcher.cpp: -------------------------------------------------------------------------------- 1 | #define main job_watcher_main 2 | #include "../../vsedit-job-server-watcher/src/watcher_main_window.h" 3 | #include "../../vsedit-job-server-watcher/src/main.cpp" 4 | -------------------------------------------------------------------------------- /common-src/helpers_gui.h: -------------------------------------------------------------------------------- 1 | #ifndef HELPERS_GUI_H_INCLUDED 2 | #define HELPERS_GUI_H_INCLUDED 3 | 4 | #include 5 | 6 | namespace vsedit 7 | { 8 | 9 | QColor highlight(const QColor & a_color, int a_strength = 20); 10 | 11 | } 12 | 13 | #endif // HELPERS_GUI_H_INCLUDED 14 | -------------------------------------------------------------------------------- /TODO.txt: -------------------------------------------------------------------------------- 1 | - search and replace text 2 | - choose the default vsscript library load path 3 | - insert formatted data from preview window into script 4 | - functions autocompletion refinement 5 | - python error parsing and script line highlighting 6 | - multiple output nodes comparison 7 | - reference and documentation 8 | -------------------------------------------------------------------------------- /common-src/vapoursynth/vs_gray_frame_prop.h: -------------------------------------------------------------------------------- 1 | #ifndef VS_GRAY_FRAME_PROP_H_INCLUDED 2 | #define VS_GRAY_FRAME_PROP_H_INCLUDED 3 | 4 | #include 5 | #include 6 | 7 | void VS_CC grayFramePropCreate(const VSMap *in, VSMap *out, VSCore *core, const VSAPI *vsapi); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /pro/pro.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += vsedit 4 | SUBDIRS += vsedit-job-server 5 | SUBDIRS += vsedit-job-server-watcher 6 | 7 | vsedit.file = ./vsedit/vsedit.pro 8 | vsedit-job-server.file = ./vsedit-job-server/vsedit-job-server.pro 9 | vsedit-job-server-watcher.file = ./vsedit-job-server-watcher/vsedit-job-server-watcher.pro 10 | -------------------------------------------------------------------------------- /vsedit-job-server/src/jobs/job_definitions.h: -------------------------------------------------------------------------------- 1 | #ifndef JOB_DEFINITIONS_H_INCLUDED 2 | #define JOB_DEFINITIONS_H_INCLUDED 3 | 4 | #include "../../../common-src/jobs/job.h" 5 | 6 | enum class JobWantTo 7 | { 8 | Nothing, 9 | RunNext, 10 | }; 11 | 12 | struct JobTicket 13 | { 14 | vsedit::Job * pJob; 15 | JobWantTo whenDone; 16 | }; 17 | 18 | #endif // JOB_DEFINITIONS_H_INCLUDED 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !/.gitignore 2 | !*.pro 3 | !*.pri 4 | !*.bat 5 | !/common-src/ 6 | !/vsedit/src/ 7 | !/vsedit-job-server/src/ 8 | !/vsedit-job-server-watcher/src/ 9 | !/resources/ 10 | !/BUILDING 11 | !/CHANGELOG 12 | !/LICENSE 13 | !/README 14 | !/TODO.txt 15 | build 16 | pro/*/*.rc 17 | pro/*/Makefile.Release 18 | pro/*/Makefile.Debug 19 | pro/*/Makefile 20 | pro/dist 21 | pro/.qmake.stash 22 | pro/Makefile 23 | */generated -------------------------------------------------------------------------------- /common-src/vapoursynth/vs_pack_rgb.h: -------------------------------------------------------------------------------- 1 | #ifndef VS_PACK_RGB_H_INCLUDED 2 | #define VS_PACK_RGB_H_INCLUDED 3 | 4 | #include "../libp2p/p2p_api.h" 5 | #include 6 | #include 7 | 8 | void VS_CC packCreateRGB24(const VSMap *in, VSMap *out, VSCore *core, const VSAPI *vsapi); 9 | void VS_CC packCreateRGB30(const VSMap *in, VSMap *out, VSCore *core, const VSAPI *vsapi); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /common-src/chrono.h: -------------------------------------------------------------------------------- 1 | #ifndef CHRONO_H_INCLUDED 2 | #define CHRONO_H_INCLUDED 3 | 4 | #include 5 | 6 | typedef std::chrono::high_resolution_clock::time_point hr_time_point; 7 | typedef std::chrono::high_resolution_clock hr_clock; 8 | typedef std::chrono::duration > double_duration; 9 | 10 | template double duration_to_double(const T & a_duration) 11 | { 12 | return std::chrono::duration_cast(a_duration).count(); 13 | } 14 | 15 | #endif // CHRONO_H_INCLUDED 16 | -------------------------------------------------------------------------------- /pro/vsedit-single/full.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern int job_watcher_main(int argc, char *argv[]); 4 | extern int job_server_main(int argc, char *argv[]); 5 | extern int vsedit_main(int argc, char *argv[]); 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | if (argc > 1) { 10 | if (strcmp(argv[1], "--job-server") == 0) 11 | return job_server_main(argc, argv); 12 | if (strcmp(argv[1], "--job-watcher") == 0) 13 | return job_watcher_main(argc, argv); 14 | } 15 | return vsedit_main(argc, argv); 16 | } 17 | -------------------------------------------------------------------------------- /vsedit/src/script_editor/script_completer.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRIPTCOMPLETER_H 2 | #define SCRIPTCOMPLETER_H 3 | 4 | #include 5 | 6 | class ScriptCompleter : public QCompleter 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | 12 | ScriptCompleter(QAbstractItemModel * a_pModel, 13 | QObject * a_pParent = nullptr); 14 | 15 | virtual ~ScriptCompleter(); 16 | 17 | QString pathFromIndex(const QModelIndex & a_index) const; 18 | 19 | QStringList splitPath(const QString & a_path) const; 20 | }; 21 | 22 | #endif // SCRIPTCOMPLETER_H 23 | -------------------------------------------------------------------------------- /common-src/libp2p/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /resources/vsedit-job-server-watcher.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | vsedit-job-server-watcher.ico 4 | door_in.png 5 | cog.png 6 | folder.png 7 | information.png 8 | sheduled_task.png 9 | link.png 10 | add.png 11 | delete.png 12 | 13 | 14 | -------------------------------------------------------------------------------- /vsedit/src/script_editor/script_completer_model.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRIPTCOMPLETERMODEL_H 2 | #define SCRIPTCOMPLETERMODEL_H 3 | 4 | #include "../vapoursynth/vs_plugin_data.h" 5 | 6 | #include 7 | 8 | class ScriptCompleterModel : public QStandardItemModel 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | ScriptCompleterModel(QObject * a_pParent = nullptr); 15 | 16 | virtual ~ScriptCompleterModel(); 17 | 18 | void setPluginsList(const VSPluginsList & a_pluginsList); 19 | 20 | void setCoreName(const QString & a_coreName); 21 | }; 22 | 23 | #endif // SCRIPTCOMPLETERMODEL_H 24 | -------------------------------------------------------------------------------- /common-src/helpers_gui.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers_gui.h" 2 | 3 | #include "helpers.h" 4 | 5 | //============================================================================== 6 | 7 | QColor vsedit::highlight(const QColor & a_color, int a_strength) 8 | { 9 | int h = 0; 10 | int s = 0; 11 | int l = 0; 12 | a_color.getHsl(&h, &s, &l); 13 | 14 | if(l > 127) 15 | l -= a_strength; 16 | else 17 | l += a_strength; 18 | vsedit::clamp(l, 0, 255); 19 | 20 | return QColor::fromHsl(h, s, l); 21 | } 22 | 23 | // END OF QColor vsedit::highlight(const QColor & a_color, int a_strength) 24 | //============================================================================== 25 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | VapourSynth Editor r19-mod-5 2 | 3 | By Aleksey [Mystery Keeper] Lyashin 4 | mystkeeper@gmail.com 5 | http://mysterykeeper.ru 6 | 7 | Modified by YomikoR 8 | 9 | This software is free and distributed under MIT license. 10 | 11 | Software uses Qt 5 framework by The Qt Company, distributed under LGPL license. 12 | https://qt.io/ 13 | 14 | Software includes Silk icons v1.3 by Mark James, 15 | distributed under Creative Commons Attribution 2.5 License. 16 | http://www.famfamfam.com/lab/icons/silk/ 17 | 18 | Software includes FatCow free icons, 19 | distributed under Creative Commons Attribution 3.0 License. 20 | http://www.fatcow.com/free-icons 21 | 22 | For additional information see LICENSE file. 23 | -------------------------------------------------------------------------------- /common-src/application_instance_file_guard/application_instance_file_guard.h: -------------------------------------------------------------------------------- 1 | #ifndef APPLICATION_INSTANCE_FILE_GUARD_H_INCLUDED 2 | #define APPLICATION_INSTANCE_FILE_GUARD_H_INCLUDED 3 | 4 | #include 5 | #include 6 | 7 | class ApplicationInstanceFileGuard 8 | { 9 | public: 10 | 11 | ApplicationInstanceFileGuard(const QString & a_fileName = QString()); 12 | virtual ~ApplicationInstanceFileGuard(); 13 | bool lock(const QString & a_fileName); 14 | bool unlock(); 15 | bool isLocked() const; 16 | QString error() const; 17 | 18 | private: 19 | 20 | QFile m_file; 21 | QString m_error; 22 | QString m_fileName; 23 | QString m_tempDir; 24 | }; 25 | 26 | #endif // APPLICATION_INSTANCE_FILE_GUARD_H_INCLUDED 27 | -------------------------------------------------------------------------------- /vsedit/src/job_server_watcher_socket.h: -------------------------------------------------------------------------------- 1 | #ifndef JOB_SERVER_WATCHER_SOCKET_H_INCLUDED 2 | #define JOB_SERVER_WATCHER_SOCKET_H_INCLUDED 3 | 4 | #include 5 | 6 | class JobServerWatcherSocket : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | 12 | JobServerWatcherSocket(QObject * a_pParent = nullptr); 13 | virtual ~JobServerWatcherSocket(); 14 | 15 | bool sendMessage(const QByteArray & a_data); 16 | 17 | signals: 18 | 19 | void signalWriteLogMessage(const QString & a_message, 20 | const QString & a_style); 21 | 22 | private: 23 | 24 | bool connectToJobServerWatcher(); 25 | void resetSocket(); 26 | 27 | QLocalSocket * m_pSocket; 28 | }; 29 | 30 | #endif // JOB_SERVER_WATCHER_SOCKET_H_INCLUDED 31 | -------------------------------------------------------------------------------- /vsedit/src/preview/scroll_navigator.h: -------------------------------------------------------------------------------- 1 | #ifndef SCROLLNAVIGATOR_H 2 | #define SCROLLNAVIGATOR_H 3 | 4 | #include 5 | 6 | class QPaintEvent; 7 | 8 | class ScrollNavigator : public QWidget 9 | { 10 | public: 11 | 12 | ScrollNavigator(QWidget * a_pParent = 0); 13 | 14 | virtual ~ScrollNavigator(); 15 | 16 | void draw(int a_contentsWidth, int a_contentsHeight, int a_viewportX, 17 | int a_viewportY, int a_viewportWidth, int a_viewportHeight); 18 | 19 | protected: 20 | 21 | void paintEvent(QPaintEvent * a_pPaintEvent) override; 22 | 23 | private: 24 | 25 | int m_contentsHeight; 26 | int m_contentsWidth; 27 | int m_viewportX; 28 | int m_viewportY; 29 | int m_viewportHeight; 30 | int m_viewportWidth; 31 | }; 32 | 33 | #endif // SCROLLNAVIGATOR_H 34 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/jobs/job_state_delegate.h: -------------------------------------------------------------------------------- 1 | #ifndef JOB_STATE_DELEGATE_H_INCLUDED 2 | #define JOB_STATE_DELEGATE_H_INCLUDED 3 | 4 | #include "../../../common-src/settings/settings_definitions_core.h" 5 | 6 | #include 7 | 8 | class JobStateDelegate : public QStyledItemDelegate 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | JobStateDelegate(QObject * a_pParent = nullptr); 15 | virtual ~JobStateDelegate(); 16 | 17 | virtual void paint(QPainter * a_pPainter, 18 | const QStyleOptionViewItem & a_option, 19 | const QModelIndex & a_index) const override; 20 | 21 | protected: 22 | 23 | virtual QColor jobStateColor(JobState a_state, 24 | const QStyleOptionViewItem & a_option) const; 25 | }; 26 | 27 | #endif // JOB_STATE_DELEGATE_H_INCLUDED 28 | -------------------------------------------------------------------------------- /vsedit/src/settings/clearable_key_sequence_editor.h: -------------------------------------------------------------------------------- 1 | #ifndef CLEARABLE_KEY_SEQUENCE_EDITOR_H_INCLUDED 2 | #define CLEARABLE_KEY_SEQUENCE_EDITOR_H_INCLUDED 3 | 4 | #include 5 | #include 6 | 7 | class QKeySequenceEdit; 8 | class QToolButton; 9 | 10 | class ClearableKeySequenceEditor : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | 16 | ClearableKeySequenceEditor(QWidget * a_pParent); 17 | 18 | virtual ~ClearableKeySequenceEditor(); 19 | 20 | QKeySequence keySequence() const; 21 | 22 | public slots: 23 | 24 | void slotSetKeySequence(const QKeySequence & a_keySequence); 25 | 26 | signals: 27 | 28 | void editingFinished(); 29 | 30 | private: 31 | 32 | QKeySequenceEdit * m_pKeySequenceEdit; 33 | 34 | QToolButton * m_pClearKeySequenceButton; 35 | }; 36 | 37 | #endif // CLEARABLE_KEY_SEQUENCE_EDITOR_H_INCLUDED 38 | -------------------------------------------------------------------------------- /common-src/log/vs_editor_log_definitions.h: -------------------------------------------------------------------------------- 1 | #ifndef VS_EDITOR_LOG_DEFINITIONS_H_INCLUDED 2 | #define VS_EDITOR_LOG_DEFINITIONS_H_INCLUDED 3 | 4 | #include 5 | 6 | extern const char LOG_STYLE_ERROR[]; 7 | extern const char LOG_STYLE_DEBUG[]; 8 | extern const char LOG_STYLE_WARNING[]; 9 | extern const char LOG_STYLE_POSITIVE[]; 10 | 11 | extern const char LOG_STYLE_VS_DEBUG[]; 12 | extern const char LOG_STYLE_VS_WARNING[]; 13 | extern const char LOG_STYLE_VS_CRITICAL[]; 14 | extern const char LOG_STYLE_VS_FATAL[]; 15 | 16 | extern const char LOG_STYLE_QT_DEBUG[]; 17 | extern const char LOG_STYLE_QT_INFO[]; 18 | extern const char LOG_STYLE_QT_WARNING[]; 19 | extern const char LOG_STYLE_QT_CRITICAL[]; 20 | extern const char LOG_STYLE_QT_FATAL[]; 21 | 22 | QString vsMessageTypeToStyleName(int a_messageType); 23 | 24 | #endif // VS_EDITOR_LOG_DEFINITIONS_H_INCLUDED 25 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/trusted_clients_addresses_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef TRUSTED_CLIENTS_ADDRESSES_DIALOG_H_INCLUDED 2 | #define TRUSTED_CLIENTS_ADDRESSES_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | #include 7 | 8 | class TrustedClientsAddressesDialog : public QDialog 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | TrustedClientsAddressesDialog(QWidget * a_pParent = nullptr); 15 | virtual ~TrustedClientsAddressesDialog(); 16 | 17 | int call(const QStringList & a_addresses); 18 | 19 | QStringList addresses() const; 20 | 21 | private slots: 22 | 23 | void slotAddButtonClicked(); 24 | void slotRemoveButtonClicked(); 25 | 26 | private: 27 | 28 | void checkAndAddAddress(const QString & a_address); 29 | 30 | Ui::TrustedClientsAddressesDialog m_ui; 31 | }; 32 | 33 | #endif // TRUSTED_CLIENTS_ADDRESSES_DIALOG_H_INCLUDED 34 | -------------------------------------------------------------------------------- /common-src/log/vs_editor_log.h: -------------------------------------------------------------------------------- 1 | #ifndef VS_EDITOR_LOG_H_INCLUDED 2 | #define VS_EDITOR_LOG_H_INCLUDED 3 | 4 | #include "styled_log_view.h" 5 | #include "vs_editor_log_definitions.h" 6 | 7 | class SettingsManager; 8 | 9 | class VSEditorLog : public StyledLogView 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | 15 | VSEditorLog(QWidget * a_pParent = nullptr); 16 | virtual ~VSEditorLog(); 17 | 18 | virtual QString name() const; 19 | virtual void setName(const QString & a_name); 20 | 21 | virtual void setSettingsManager(SettingsManager * a_pSettingsManager); 22 | 23 | virtual bool loadSettings(); 24 | 25 | virtual bool saveSettings(); 26 | 27 | protected slots: 28 | 29 | virtual void slotLogSettingsChanged() override; 30 | 31 | protected: 32 | 33 | virtual void initializeStyles(); 34 | 35 | QString m_name; 36 | 37 | SettingsManager * m_pSettingsManager; 38 | }; 39 | 40 | #endif // VS_EDITOR_LOG_H_INCLUDED 41 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/connect_to_server_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef CONNECT_TO_SERVER_DIALOG_H_INCLUDED 2 | #define CONNECT_TO_SERVER_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | #include 7 | 8 | class SettingsManager; 9 | 10 | class ConnectToServerDialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | 16 | ConnectToServerDialog(SettingsManager * a_pSettingsManager, 17 | QWidget * a_pParent = nullptr); 18 | virtual ~ConnectToServerDialog(); 19 | 20 | int call(const QHostAddress & a_address); 21 | 22 | signals: 23 | 24 | void signalConnectToServer(const QHostAddress & a_address); 25 | 26 | private slots: 27 | 28 | void slotConnectButtonClicked(); 29 | 30 | private: 31 | 32 | void saveServersList(); 33 | 34 | Ui::ConnectToServerDialog m_ui; 35 | 36 | SettingsManager * m_pSettingsManager; 37 | }; 38 | 39 | #endif // CONNECT_TO_SERVER_DIALOG_H_INCLUDED 40 | -------------------------------------------------------------------------------- /common-src/frame_header_writers/frame_header_writer_y4m.h: -------------------------------------------------------------------------------- 1 | #ifndef FRAME_HEADER_WRITER_Y4M_H_INCLUDED 2 | #define FRAME_HEADER_WRITER_Y4M_H_INCLUDED 3 | 4 | #include "frame_header_writer.h" 5 | 6 | class FrameHeaderWriterY4M : public FrameHeaderWriter 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | 12 | FrameHeaderWriterY4M(const VSAPI * a_cpVSAPI = nullptr, 13 | const VSVideoInfo * a_cpVideoInfo = nullptr, 14 | QObject * a_pParent = nullptr); 15 | 16 | virtual bool isCompatible() override; 17 | 18 | virtual bool needVideoHeader() override; 19 | virtual QByteArray videoHeader(int a_totalFrames = -1) override; 20 | 21 | virtual bool needFramePrefix() override; 22 | virtual QByteArray framePrefix(const VSFrameRef * a_cpFrameRef) override; 23 | 24 | virtual bool needFramePostfix() override; 25 | virtual QByteArray framePostfix(const VSFrameRef * a_cpFrameRef) override; 26 | }; 27 | 28 | #endif // FRAME_HEADER_WRITER_Y4M_H_INCLUDED 29 | -------------------------------------------------------------------------------- /vsedit/src/preview/preview_advanced_settings_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef PREVIEW_ADVANCED_SETTINGS_DIALOG_H_INCLUDED 2 | #define PREVIEW_ADVANCED_SETTINGS_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | class SettingsManager; 7 | 8 | class PreviewAdvancedSettingsDialog : public QDialog 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | PreviewAdvancedSettingsDialog(SettingsManager * a_pSettingsManager, 15 | QWidget * a_pParent = nullptr); 16 | 17 | virtual ~PreviewAdvancedSettingsDialog(); 18 | 19 | public slots: 20 | 21 | void slotCall(); 22 | 23 | signals: 24 | 25 | void signalSettingsChanged(); 26 | 27 | private slots: 28 | 29 | void slotOk(); 30 | 31 | void slotApply(); 32 | 33 | void slotResetToDefault(); 34 | 35 | private: 36 | 37 | Ui::PreviewAdvancedSettingsDialog m_ui; 38 | 39 | SettingsManager * m_pSettingsManager; 40 | }; 41 | 42 | #endif // PREVIEW_ADVANCED_SETTINGS_DIALOG_H_INCLUDED 43 | -------------------------------------------------------------------------------- /common-src/frame_header_writers/frame_header_writer_null.h: -------------------------------------------------------------------------------- 1 | #ifndef FRAME_HEADER_WRITER_NULL_H_INCLUDED 2 | #define FRAME_HEADER_WRITER_NULL_H_INCLUDED 3 | 4 | #include "frame_header_writer.h" 5 | 6 | class FrameHeaderWriterNull : public FrameHeaderWriter 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | 12 | FrameHeaderWriterNull(const VSAPI * a_cpVSAPI = nullptr, 13 | const VSVideoInfo * a_cpVideoInfo = nullptr, 14 | QObject * a_pParent = nullptr); 15 | 16 | virtual bool isCompatible() override; 17 | 18 | virtual bool needVideoHeader() override; 19 | virtual QByteArray videoHeader(int a_totalFrames = -1) override; 20 | 21 | virtual bool needFramePrefix() override; 22 | virtual QByteArray framePrefix(const VSFrameRef * a_cpFrameRef) override; 23 | 24 | virtual bool needFramePostfix() override; 25 | virtual QByteArray framePostfix(const VSFrameRef * a_cpFrameRef) override; 26 | }; 27 | 28 | #endif // FRAME_HEADER_WRITER_NULL_H_INCLUDED 29 | -------------------------------------------------------------------------------- /common-src/jobs/job_variables.h: -------------------------------------------------------------------------------- 1 | #ifndef JOB_VARIABLES_H_INCLUDED 2 | #define JOB_VARIABLES_H_INCLUDED 3 | 4 | #include "../helpers.h" 5 | 6 | #include 7 | #include 8 | 9 | class JobVariables 10 | { 11 | public: 12 | 13 | JobVariables(); 14 | 15 | virtual std::vector variables() const; 16 | 17 | protected: 18 | 19 | static const QString TOKEN_WIDTH; 20 | static const QString TOKEN_HEIGHT; 21 | static const QString TOKEN_FPS_NUMERATOR; 22 | static const QString TOKEN_FPS_DENOMINATOR; 23 | static const QString TOKEN_FPS; 24 | static const QString TOKEN_BITDEPTH; 25 | static const QString TOKEN_SCRIPT_DIRECTORY; 26 | static const QString TOKEN_SCRIPT_NAME; 27 | static const QString TOKEN_FRAMES_NUMBER; 28 | static const QString TOKEN_SUBSAMPLING; 29 | 30 | virtual void fillVariables(); 31 | 32 | std::vector m_variables; 33 | }; 34 | 35 | #endif // JOB_VARIABLES_H_INCLUDED 36 | -------------------------------------------------------------------------------- /vsedit/src/script_editor/number_matcher.h: -------------------------------------------------------------------------------- 1 | #ifndef NUMBERMATCHER_H_INCLUDED 2 | #define NUMBERMATCHER_H_INCLUDED 3 | 4 | #include 5 | 6 | /// Finite state machine Python number matcher for QString. 7 | class NumberMatcher 8 | { 9 | public: 10 | 11 | NumberMatcher(); 12 | 13 | bool beginsWithNumber(const QString & a_string, int a_matchFrom); 14 | 15 | int matchedLength() const; 16 | 17 | private: 18 | 19 | enum State 20 | { 21 | Initial, 22 | FirstZero, // Valid final state 23 | BinLiteral, 24 | BinNumber, // Valid final state 25 | OctLiteral, 26 | OctNumber, // Valid final state 27 | HexLiteral, 28 | HexNumber, // Valid final state 29 | Integer, // Valid final state 30 | DotAfterInteger, // Valid final state 31 | FirstDot, 32 | Fraction, // Valid final state 33 | ExpLiteral, 34 | ExpSign, 35 | ExpComplete, // Valid final state 36 | }; 37 | 38 | State m_state; 39 | 40 | int m_lastValidLength; 41 | }; 42 | 43 | #endif // NUMBERMATCHER_H_INCLUDED 44 | -------------------------------------------------------------------------------- /vsedit/src/settings/item_delegate_for_hotkey.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMDELEGATEFORHOTKEY_H 2 | #define ITEMDELEGATEFORHOTKEY_H 3 | 4 | #include 5 | 6 | class ItemDelegateForHotkey : public QStyledItemDelegate 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | 12 | ItemDelegateForHotkey(QObject * a_pParent = nullptr); 13 | 14 | virtual ~ItemDelegateForHotkey(); 15 | 16 | QWidget * createEditor(QWidget * a_pParent, 17 | const QStyleOptionViewItem & a_option, const QModelIndex & a_index) 18 | const override; 19 | 20 | void setEditorData(QWidget * a_pEditor, const QModelIndex & a_index) 21 | const override; 22 | 23 | void updateEditorGeometry(QWidget * a_pEditor, 24 | const QStyleOptionViewItem & a_option, const QModelIndex & a_index) 25 | const override; 26 | 27 | void setModelData(QWidget * a_pEditor, QAbstractItemModel * a_model, 28 | const QModelIndex & a_index) const override; 29 | 30 | private slots: 31 | 32 | void slotCommitAndCloseEditor(); 33 | }; 34 | 35 | #endif // ITEMDELEGATEFORHOTKEY_H 36 | -------------------------------------------------------------------------------- /common-src/libp2p/simd/p2p_simd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef P2P_SIMD_H_ 4 | #define P2P_SIMD_H_ 5 | 6 | #ifdef P2P_SIMD 7 | 8 | #include "../p2p.h" 9 | 10 | namespace P2P_NAMESPACE { 11 | namespace simd { 12 | 13 | #define UNPACK(format, cpu) void unpack_##format##_##cpu(const void *, void * const *, unsigned, unsigned); 14 | #define PACK(format, cpu) \ 15 | void pack_##format##_0_##cpu(const void * const *, void *, unsigned, unsigned); \ 16 | void pack_##format##_1_##cpu(const void * const *, void *, unsigned, unsigned); 17 | 18 | #if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) 19 | UNPACK(argb32_be, sse41) 20 | UNPACK(argb32_le, sse41) 21 | UNPACK(rgba32_be, sse41) 22 | UNPACK(rgba32_le, sse41) 23 | 24 | PACK(argb32_be, sse41) 25 | PACK(argb32_le, sse41) 26 | PACK(rgba32_be, sse41) 27 | PACK(rgba32_le, sse41) 28 | #endif // x86 29 | 30 | #undef PACK 31 | #undef UNPACK 32 | 33 | } // namespace simd 34 | } // namespace p2p 35 | 36 | #endif // P2P_SIMD 37 | 38 | #endif // P2P_SIMD_H_ 39 | -------------------------------------------------------------------------------- /vsedit/src/script_status_bar_widget/script_status_bar_widget.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRIPT_STATUS_BAR_WIDGET_H_INCLUDED 2 | #define SCRIPT_STATUS_BAR_WIDGET_H_INCLUDED 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | class ScriptStatusBarWidget: public QWidget 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | 15 | ScriptStatusBarWidget(QWidget * a_pParent = nullptr); 16 | virtual ~ScriptStatusBarWidget(); 17 | 18 | virtual bool colorPickerVisible() const; 19 | 20 | public slots: 21 | 22 | virtual void setColorPickerVisible(bool a_visible = true); 23 | 24 | virtual void setColorPickerString(const QString & a_string); 25 | 26 | virtual void setQueueState(size_t a_inQueue, size_t a_inProcess, 27 | size_t a_maxThreads); 28 | 29 | virtual void setVideoInfo(const VSVideoInfo * a_cpVideoInfo); 30 | 31 | protected: 32 | 33 | Ui::ScriptStatusBarWidget m_ui; 34 | 35 | QPixmap m_readyPixmap; 36 | QPixmap m_busyPixmap; 37 | }; 38 | 39 | #endif // SCRIPT_STATUS_BAR_WIDGET_H_INCLUDED 40 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/jobs/job_dependencies_delegate.h: -------------------------------------------------------------------------------- 1 | #ifndef JOB_DEPENDENCIES_DELEGATE_H_INCLUDED 2 | #define JOB_DEPENDENCIES_DELEGATE_H_INCLUDED 3 | 4 | #include 5 | 6 | class JobDependenciesDelegate : public QStyledItemDelegate 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | 12 | JobDependenciesDelegate(QObject * a_pParent = nullptr); 13 | virtual ~JobDependenciesDelegate(); 14 | 15 | virtual QWidget * createEditor(QWidget * a_pParent, 16 | const QStyleOptionViewItem & a_option, 17 | const QModelIndex & a_index) const override; 18 | 19 | virtual void setEditorData(QWidget * a_pEditor, 20 | const QModelIndex & a_index) const override; 21 | 22 | virtual void setModelData(QWidget * a_pEditor, 23 | QAbstractItemModel * a_pModel, const QModelIndex & a_index) 24 | const override; 25 | 26 | virtual void updateEditorGeometry(QWidget * a_pEditor, 27 | const QStyleOptionViewItem & a_option, 28 | const QModelIndex & a_index) const override; 29 | 30 | }; 31 | 32 | #endif // JOB_DEPENDENCIES_DELEGATE_H_INCLUDED 33 | -------------------------------------------------------------------------------- /common-src/libp2p/README.md: -------------------------------------------------------------------------------- 1 | # libp2p 2 | Pack/unpack pixels. 3 | 4 | The "p2p" library implements conversion between packed and planar image 5 | formats. A packed format is any memory layout that stores more than one image 6 | component ("plane") in a single array. For example, the common ARGB format 7 | stores pixels as an array of DWORDs holding all components for each pixel. In 8 | contrast, a planar format stores each image component in its own array. 9 | 10 | Building 11 | ------ 12 | libp2p is intended for embedding within other libraries and applications. The 13 | header "p2p.h" contains a template library for generating packing and unpacking 14 | routines, which can be used to instantiate functions for various pixel formats. 15 | "v210.cpp" holds a special-case implementation for the Apple ProRes "v210" 16 | format. "p2p_api.h" and "p2p_api.cpp" implement a "C" wrapper for a fixed set 17 | of commonly encountered packed formats. If the "C" wrapper is used from another 18 | library, a method to control symbol visibility should be used to prevent name 19 | conflicts with other, potentially incompatible, instances of libp2p. 20 | -------------------------------------------------------------------------------- /common-src/frame_header_writers/frame_header_writer.h: -------------------------------------------------------------------------------- 1 | #ifndef FRAME_HEADER_WRITER_H_INCLUDED 2 | #define FRAME_HEADER_WRITER_H_INCLUDED 3 | 4 | #include 5 | 6 | #include 7 | 8 | class FrameHeaderWriter : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | FrameHeaderWriter(const VSAPI * a_cpVSAPI = nullptr, 15 | const VSVideoInfo * a_cpVideoInfo = nullptr, 16 | QObject * a_pParent = nullptr); 17 | virtual ~FrameHeaderWriter(); 18 | 19 | virtual void setVSAPI(const VSAPI * a_cpVSAPI); 20 | virtual void setVideoInfo(const VSVideoInfo * a_cpVideoInfo); 21 | 22 | virtual bool isCompatible() = 0; 23 | 24 | virtual bool needVideoHeader() = 0; 25 | virtual QByteArray videoHeader(int a_totalFrames = -1) = 0; 26 | 27 | virtual bool needFramePrefix() = 0; 28 | virtual QByteArray framePrefix(const VSFrameRef * a_cpFrameRef) = 0; 29 | 30 | virtual bool needFramePostfix() = 0; 31 | virtual QByteArray framePostfix(const VSFrameRef * a_cpFrameRef) = 0; 32 | 33 | protected: 34 | 35 | const VSAPI * m_cpVSAPI; 36 | const VSVideoInfo * m_cpVideoInfo; 37 | }; 38 | 39 | #endif // FRAME_HEADER_WRITER_H_INCLUDED 40 | -------------------------------------------------------------------------------- /common-src/log/styled_log_view_structures.h: -------------------------------------------------------------------------------- 1 | #ifndef STYLED_LOG_VIEW_STRUCTURES_H_INCLUDED 2 | #define STYLED_LOG_VIEW_STRUCTURES_H_INCLUDED 3 | 4 | #include "styled_log_view_core.h" 5 | 6 | #include 7 | #include 8 | 9 | //============================================================================== 10 | 11 | struct TextBlockStyle 12 | { 13 | QString name; 14 | QString title; 15 | QTextCharFormat textFormat; 16 | bool isAlias; 17 | QString originalStyleName; 18 | bool isVisible; 19 | 20 | TextBlockStyle(const QString & a_name = LOG_STYLE_DEFAULT, 21 | const QString & a_title = LOG_STYLE_TITLE_DEFAULT); 22 | TextBlockStyle(const QString & a_name, const QString & a_title, 23 | const QTextCharFormat & a_textFormat); 24 | TextBlockStyle(const QString & a_name, const QString & a_title, 25 | const QColor & a_backgroundColor, const QColor & a_textColor); 26 | TextBlockStyle(const QString & a_aliasName, const QString & a_title, 27 | const QString & a_originalStyleName); 28 | }; 29 | 30 | //============================================================================== 31 | 32 | #endif // STYLED_LOG_VIEW_STRUCTURES_H_INCLUDED 33 | -------------------------------------------------------------------------------- /pro/build-msvc.bat: -------------------------------------------------------------------------------- 1 | @ECHO THIS SCRIPT IS OUTDATED AND NO MORE MAINTAINED. USE IT AS A REFERENCE ONLY. 2 | @SET BRANCH=%1 3 | @IF "%BRANCH%"=="" ( 4 | SET GIT_BRANCH= 5 | SET NAME_BRANCH= 6 | ) 7 | @IF NOT "%BRANCH%"=="" ( 8 | SET GIT_BRANCH=-b %BRANCH% 9 | SET NAME_BRANCH=_%BRANCH% 10 | ) 11 | @SET BUILDROOT=vsedit-build 12 | 13 | @pushd "%TEMP%" 14 | @rd /q /s %BUILDROOT% 15 | @mkdir %BUILDROOT% 16 | git clone %GIT_BRANCH% https://bitbucket.org/mystery_keeper/vapoursynth-editor.git vsedit-build 17 | @cd /d %BUILDROOT%\pro 18 | 19 | @SET ORIGINAL_PATH=%PATH% 20 | 21 | :: MSVC 64 bit build 22 | @ECHO === SETTING UP ENVIRONMENT === 23 | @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" 24 | @SET PATH=%PATH%;S:\sdk\qt\5.12.0\msvc2017_64\bin\ 25 | @ECHO === RUNNING QMAKE === 26 | qmake.exe -nocache "CONFIG+=release" pro.pro 27 | @ECHO === BUILDING === 28 | nmake.exe release -f Makefile 29 | @ECHO === ARCHIVING === 30 | @cd /d ../build/release-64bit-msvc 31 | @del vc_redist.x64.exe 32 | @7z a -y -m0=LZMA -mx9 "%~dp0/vsedit%NAME_BRANCH%.7z" "*" 33 | @iscc build-inno-setup.iss 34 | 35 | :: Clean up the environment 36 | @SET PATH=%ORIGINAL_PATH% 37 | 38 | @popd -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 - 2017 Aleksey [Mystery Keeper] Lyashin 2 | mystkeeper@gmail.com 3 | Copyright (c) 2022 YomikoR 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /common-src/log/styled_log_view_core.h: -------------------------------------------------------------------------------- 1 | #ifndef STYLED_LOG_VIEW_CORE_H_INCLUDED 2 | #define STYLED_LOG_VIEW_CORE_H_INCLUDED 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | //============================================================================== 9 | 10 | extern const char LOG_STYLE_DEFAULT[]; 11 | extern const char LOG_STYLE_TITLE_DEFAULT[]; 12 | 13 | extern const char LE_IS_DIVIDER[]; 14 | extern const char LE_TIME[]; 15 | extern const char LE_TEXT[]; 16 | extern const char LE_STYLE[]; 17 | 18 | //============================================================================== 19 | 20 | struct LogEntry 21 | { 22 | bool isDivider; 23 | QDateTime time; 24 | QString text; 25 | QString style; 26 | 27 | LogEntry(bool a_isDivider = false, const QString & a_text = QString(), 28 | const QString & a_style = LOG_STYLE_DEFAULT); 29 | 30 | LogEntry(const QString & a_text, const QString & a_style = 31 | LOG_STYLE_DEFAULT); 32 | 33 | static LogEntry divider(); 34 | 35 | QJsonObject toJson() const; 36 | static LogEntry fromJson(const QJsonObject & a_object); 37 | }; 38 | 39 | //============================================================================== 40 | 41 | #endif // STYLED_LOG_VIEW_CORE_H_INCLUDED 42 | -------------------------------------------------------------------------------- /vsedit-job-server/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "job_server.h" 2 | 3 | #include "../../common-src/application_instance_file_guard/application_instance_file_guard.h" 4 | #include "../../common-src/ipc_defines.h" 5 | #include 6 | 7 | #include 8 | 9 | Q_DECLARE_OPAQUE_POINTER(const VSFrameRef *) 10 | Q_DECLARE_OPAQUE_POINTER(VSNodeRef *) 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | QCoreApplication application(argc, argv); 15 | 16 | qRegisterMetaType("const VSFrameRef *"); 17 | qRegisterMetaType("VSNodeRef *"); 18 | 19 | ApplicationInstanceFileGuard guard("vsedit_job_server_running"); 20 | if(!guard.isLocked()) 21 | { 22 | qCritical("Couldn't start the server. " 23 | "Another instance is probably already running."); 24 | return 1; 25 | } 26 | 27 | JobServer jobServer; 28 | 29 | application.connect(&jobServer, &JobServer::finish, 30 | &application, &QCoreApplication::quit); 31 | 32 | bool started = jobServer.start(); 33 | if(!started) 34 | { 35 | qCritical("Couldn't start the server."); 36 | return 1; 37 | } 38 | 39 | int exitCode = application.exec(); 40 | 41 | if(!guard.unlock()) 42 | qCritical("%s", guard.error().toLocal8Bit().data()); 43 | 44 | return exitCode; 45 | } 46 | -------------------------------------------------------------------------------- /common-src/log/styled_log_view_settings_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef STYLED_LOG_VIEW_SETTINGS_DIALOG_H_INCLUDED 2 | #define STYLED_LOG_VIEW_SETTINGS_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | #include "styled_log_view_structures.h" 7 | 8 | class LogStylesModel; 9 | 10 | class StyledLogViewSettingsDialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | 16 | StyledLogViewSettingsDialog(QWidget * a_pParent = nullptr); 17 | 18 | virtual ~StyledLogViewSettingsDialog(); 19 | 20 | virtual std::vector styles() const; 21 | 22 | virtual void setStyles(const std::vector & a_styles); 23 | 24 | signals: 25 | 26 | void signalSettingsChanged(); 27 | 28 | protected slots: 29 | 30 | virtual void slotOk(); 31 | 32 | virtual void slotApply(); 33 | 34 | virtual void slotStyleSelected(const QModelIndex & a_index); 35 | 36 | virtual void slotFontButtonClicked(); 37 | 38 | virtual void slotTextColorButtonClicked(); 39 | 40 | virtual void slotBackgroundColorButtonClicked(); 41 | 42 | protected: 43 | 44 | virtual void enableStyleSettingsControls(bool a_enable = true); 45 | 46 | Ui::StyledLogViewSettingsDialog m_ui; 47 | 48 | LogStylesModel * m_pLogStylesModel; 49 | }; 50 | 51 | #endif // STYLED_LOG_VIEW_SETTINGS_DIALOG_H_INCLUDED 52 | -------------------------------------------------------------------------------- /vsedit/src/script_editor/script_completer.cpp: -------------------------------------------------------------------------------- 1 | #include "script_completer.h" 2 | 3 | //============================================================================== 4 | 5 | ScriptCompleter::ScriptCompleter(QAbstractItemModel * a_pModel, 6 | QObject * a_pParent) : QCompleter(a_pModel, a_pParent) 7 | { 8 | 9 | } 10 | 11 | //============================================================================== 12 | 13 | ScriptCompleter::~ScriptCompleter() 14 | { 15 | 16 | } 17 | 18 | //============================================================================== 19 | 20 | QString ScriptCompleter::pathFromIndex(const QModelIndex & a_index) const 21 | { 22 | if(!a_index.isValid()) 23 | return QString(); 24 | 25 | QString path = model()->data(a_index, Qt::EditRole).toString(); 26 | QModelIndex index = a_index; 27 | while(index.parent().isValid()) 28 | { 29 | index = index.parent(); 30 | path.prepend('.'); 31 | path.prepend(model()->data(index, Qt::EditRole).toString()); 32 | } 33 | 34 | return path; 35 | } 36 | 37 | //============================================================================== 38 | 39 | QStringList ScriptCompleter::splitPath(const QString & a_path) const 40 | { 41 | return a_path.split('.'); 42 | } 43 | 44 | //============================================================================== 45 | -------------------------------------------------------------------------------- /pro/local_quirks.pri: -------------------------------------------------------------------------------- 1 | HOST_64_BIT = contains(QMAKE_HOST.arch, "x86_64") 2 | TARGET_64_BIT = contains(QMAKE_TARGET.arch, "x86_64") 3 | ARCHITECTURE_64_BIT = $$HOST_64_BIT | $$TARGET_64_BIT 4 | 5 | win32:contains(QMAKE_COMPILER, msvc) { 6 | 7 | VC_INCLUDEPATH += 'C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/shared/' 8 | VC_INCLUDEPATH += 'C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/um/' 9 | VC_INCLUDEPATH += 'C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/ucrt/' 10 | VC_INCLUDEPATH += 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/' 11 | VC_INCLUDEPATH += 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/' 12 | 13 | RC_INCLUDEPATH += $${VC_INCLUDEPATH} 14 | INCLUDEPATH += $${VC_INCLUDEPATH} 15 | 16 | if($$ARCHITECTURE_64_BIT) { 17 | QMAKE_LIBDIR += 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/lib/amd64/' 18 | QMAKE_LIBDIR += 'C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64/' 19 | QMAKE_LIBDIR += 'C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/ucrt/x64/' 20 | } else { 21 | QMAKE_LIBDIR += 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/lib/' 22 | QMAKE_LIBDIR += 'C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86/' 23 | QMAKE_LIBDIR += 'C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/ucrt/x86' 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /common-src/frame_header_writers/frame_header_writer.cpp: -------------------------------------------------------------------------------- 1 | #include "frame_header_writer.h" 2 | 3 | //============================================================================== 4 | 5 | FrameHeaderWriter::FrameHeaderWriter(const VSAPI * a_cpVSAPI, 6 | const VSVideoInfo * a_cpVideoInfo, QObject * a_pParent) : 7 | QObject(a_pParent) 8 | , m_cpVSAPI(a_cpVSAPI) 9 | , m_cpVideoInfo(a_cpVideoInfo) 10 | { 11 | } 12 | 13 | // END OF FrameHeaderWriter::FrameHeaderWriter(const VSAPI * a_cpVSAPI, 14 | // const VSVideoInfo * a_cpVideoInfo, QObject * a_pParent) 15 | //============================================================================== 16 | 17 | FrameHeaderWriter::~FrameHeaderWriter() 18 | { 19 | } 20 | 21 | // END OF FrameHeaderWriter::~FrameHeaderWriter() 22 | //============================================================================== 23 | 24 | void FrameHeaderWriter::setVSAPI(const VSAPI * a_cpVSAPI) 25 | { 26 | m_cpVSAPI = a_cpVSAPI; 27 | } 28 | 29 | // END OF void FrameHeaderWriter::setVSAPI(const VSAPI * a_cpVSAPI) 30 | //============================================================================== 31 | 32 | void FrameHeaderWriter::setVideoInfo(const VSVideoInfo * a_cpVideoInfo) 33 | { 34 | m_cpVideoInfo = a_cpVideoInfo; 35 | } 36 | 37 | // END OF void FrameHeaderWriter::setVideoInfo( 38 | // const VSVideoInfo * a_cpVideoInfo) 39 | //============================================================================== 40 | -------------------------------------------------------------------------------- /vsedit/src/settings/actions_hotkey_edit_model.h: -------------------------------------------------------------------------------- 1 | #ifndef ACTIONSHOTKEYEDITMODEL_H 2 | #define ACTIONSHOTKEYEDITMODEL_H 3 | 4 | #include "../../../common-src/settings/settings_manager.h" 5 | 6 | #include 7 | 8 | class ActionsHotkeyEditModel : public QAbstractItemModel 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | ActionsHotkeyEditModel(SettingsManager * a_pSettingsManager, 15 | QObject * a_pParent = nullptr); 16 | 17 | virtual ~ActionsHotkeyEditModel(); 18 | 19 | QModelIndex index(int a_row, int a_column, 20 | const QModelIndex & a_parent = QModelIndex()) const override; 21 | 22 | QModelIndex parent(const QModelIndex & a_child) const override; 23 | 24 | Qt::ItemFlags flags(const QModelIndex & a_index) const override; 25 | 26 | QVariant data(const QModelIndex & a_index, int a_role = Qt::DisplayRole) 27 | const override; 28 | 29 | int rowCount(const QModelIndex & a_parent = QModelIndex()) const 30 | override; 31 | 32 | int columnCount(const QModelIndex & a_parent = QModelIndex()) const 33 | override; 34 | 35 | bool setData(const QModelIndex & a_index, const QVariant & a_value, 36 | int a_role = Qt::EditRole) override; 37 | 38 | void reloadHotkeysSettings(); 39 | 40 | public slots: 41 | 42 | void slotSaveActionsHotkeys(); 43 | 44 | private: 45 | 46 | std::vector m_actions; 47 | 48 | SettingsManager * m_pSettingsManager; 49 | }; 50 | 51 | #endif // ACTIONSHOTKEYEDITMODEL_H 52 | -------------------------------------------------------------------------------- /vsedit/src/script_editor/syntax_highlighter.h: -------------------------------------------------------------------------------- 1 | #ifndef SYNTAXHIGHLIGHTER_H 2 | #define SYNTAXHIGHLIGHTER_H 3 | 4 | #include "../vapoursynth/vs_plugin_data.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class SettingsManager; 11 | 12 | class SyntaxHighlighter : public QSyntaxHighlighter 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | 18 | SyntaxHighlighter(QTextDocument * a_pDocument, 19 | VSPluginsList a_pluginsList = VSPluginsList()); 20 | virtual ~SyntaxHighlighter(); 21 | 22 | void setSettingsManager(SettingsManager * a_pSettingsManager); 23 | 24 | void setCoreName(const QString & a_coreName); 25 | 26 | void setPluginsList(VSPluginsList a_pluginsList); 27 | 28 | public slots: 29 | 30 | void slotLoadSettings(); 31 | 32 | protected: 33 | 34 | void highlightBlock(const QString & a_text); 35 | 36 | private: 37 | 38 | SettingsManager * m_pSettingsManager; 39 | 40 | QString m_coreName; 41 | 42 | VSPluginsList m_pluginsList; 43 | 44 | QStringList m_keywordsList; 45 | QStringList m_operatorsList; 46 | 47 | QTextCharFormat m_keywordFormat; 48 | QTextCharFormat m_operatorFormat; 49 | QTextCharFormat m_stringFormat; 50 | QTextCharFormat m_numberFormat; 51 | QTextCharFormat m_commentFormat; 52 | QTextCharFormat m_vsCoreFormat; 53 | QTextCharFormat m_vsNamespaceFormat; 54 | QTextCharFormat m_vsFunctionFormat; 55 | QTextCharFormat m_vsArgumentFormat; 56 | }; 57 | 58 | #endif // SYNTAXHIGHLIGHTER_H 59 | -------------------------------------------------------------------------------- /vsedit/src/settings/settings_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOG_H 2 | #define SETTINGSDIALOG_H 3 | 4 | #include 5 | 6 | #include "actions_hotkey_edit_model.h" 7 | 8 | class SettingsManager; 9 | class ItemDelegateForHotkey; 10 | class ThemeElementsModel; 11 | 12 | class SettingsDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | 18 | SettingsDialog(SettingsManager * a_pSettingsManager, 19 | QWidget * a_pParent = nullptr); 20 | 21 | virtual ~SettingsDialog(); 22 | 23 | public slots: 24 | 25 | void slotCall(); 26 | 27 | protected: 28 | 29 | signals: 30 | 31 | void signalSettingsChanged(); 32 | 33 | private: 34 | 35 | void addThemeElements(); 36 | 37 | Ui::SettingsDialog m_ui; 38 | 39 | SettingsManager * m_pSettingsManager; 40 | 41 | ActionsHotkeyEditModel * m_pActionsHotkeyEditModel; 42 | 43 | ItemDelegateForHotkey * m_pItemDelegateForHotkey; 44 | 45 | ThemeElementsModel * m_pThemeElementsModel; 46 | 47 | private slots: 48 | 49 | void slotOk(); 50 | 51 | void slotApply(); 52 | 53 | void slotAddVSLibraryPath(); 54 | 55 | void slotRemoveVSLibraryPath(); 56 | 57 | void slotSelectVSLibraryPath(); 58 | 59 | void slotAddVSPluginsPath(); 60 | 61 | void slotRemoveVSPluginsPath(); 62 | 63 | void slotSelectVSPluginsPath(); 64 | 65 | void slotAddVSDocumentationPath(); 66 | 67 | void slotRemoveVSDocumentationPath(); 68 | 69 | void slotSelectVSDocumentationPath(); 70 | 71 | void slotThemeElementSelected(const QModelIndex & a_index); 72 | 73 | void slotFontButtonClicked(); 74 | 75 | void slotColourButtonClicked(); 76 | }; 77 | 78 | #endif // SETTINGSDIALOG_H 79 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/jobs/job_edit_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef JOB_EDIT_DIALOG_H_INCLUDED 2 | #define JOB_EDIT_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | #include "../../../common-src/settings/settings_definitions_core.h" 7 | 8 | class SettingsManager; 9 | class VSScriptLibrary; 10 | 11 | class JobEditDialog : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | 17 | JobEditDialog(SettingsManager * a_pSettingsManager, 18 | VSScriptLibrary * a_pVSScriptLibrary, QWidget * a_pParent = nullptr); 19 | 20 | virtual ~JobEditDialog(); 21 | 22 | JobProperties jobProperties() const; 23 | 24 | public slots: 25 | 26 | int call(const QString & a_title, const JobProperties & a_jobProperties); 27 | 28 | private slots: 29 | 30 | void slotJobTypeChanged(int a_index); 31 | void slotEncodingScriptBrowseButtonClicked(); 32 | void slotEncodingPresetComboBoxActivated(const QString & a_text); 33 | void slotEncodingPresetSaveButtonClicked(); 34 | void slotEncodingPresetDeleteButton(); 35 | void slotEncodingExecutableBrowseButtonClicked(); 36 | void slotEncodingFramesFromVideoButtonClicked(); 37 | void slotEncodingArgumentsHelpButtonClicked(); 38 | void slotProcessExecutableBrowseButtonClicked(); 39 | 40 | private: 41 | 42 | void setUpEncodingPresets(); 43 | 44 | QString chooseExecutable(const QString & a_dialogTitle, 45 | const QString & a_initialPath = QString()); 46 | 47 | Ui::JobEditDialog m_ui; 48 | 49 | SettingsManager * m_pSettingsManager; 50 | VSScriptLibrary * m_pVSScriptLibrary; 51 | 52 | std::vector m_encodingPresets; 53 | }; 54 | 55 | #endif // JOB_EDIT_DIALOG_H_INCLUDED 56 | -------------------------------------------------------------------------------- /vsedit/src/vapoursynth/vapoursynth_plugins_manager.h: -------------------------------------------------------------------------------- 1 | #ifndef VAPOURSYNTHPLUGINSMANAGER_H 2 | #define VAPOURSYNTHPLUGINSMANAGER_H 3 | 4 | #include "vs_plugin_data.h" 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | class SettingsManager; 12 | 13 | class VapourSynthPluginsManager : public QObject 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | 19 | VapourSynthPluginsManager(SettingsManager * a_pSettingsManager, 20 | QObject * a_pParent = nullptr); 21 | 22 | virtual ~VapourSynthPluginsManager(); 23 | 24 | void getCorePlugins(); 25 | 26 | void pollPaths(const QStringList & a_pluginsPaths); 27 | 28 | QStringList functions() const; 29 | 30 | VSPluginsList pluginsList() const; 31 | 32 | static VSData::Function parseFunctionSignature(const QString & a_name, 33 | const QString & a_arguments); 34 | 35 | friend void VS_CC fakeConfigPlugin(const char * a_identifier, 36 | const char * a_defaultNamespace, const char * a_name, 37 | int a_apiVersion, int a_readonly, VSPlugin * a_pPlugin); 38 | 39 | friend void VS_CC fakeRegisterFunction(const char * a_name, 40 | const char * a_args, VSPublicFunction a_argsFunc, 41 | void * a_pFunctionData, VSPlugin * a_pPlugin); 42 | 43 | public slots: 44 | 45 | void slotClear(); 46 | 47 | void slotSort(); 48 | 49 | void slotRefill(); 50 | 51 | signals: 52 | 53 | void signalWriteLogMessage(int a_messageType, 54 | const QString & a_message); 55 | 56 | private: 57 | 58 | VSPluginsList m_pluginsList; 59 | 60 | QString m_currentPluginPath; 61 | 62 | bool m_pluginAlreadyLoaded; 63 | 64 | SettingsManager * m_pSettingsManager; 65 | }; 66 | 67 | #endif // VAPOURSYNTHPLUGINSMANAGER_H 68 | -------------------------------------------------------------------------------- /common-src/log/vs_editor_log_definitions.cpp: -------------------------------------------------------------------------------- 1 | #include "vs_editor_log_definitions.h" 2 | 3 | #include "styled_log_view_core.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | //============================================================================== 10 | 11 | const char LOG_STYLE_ERROR[] = "error"; 12 | const char LOG_STYLE_DEBUG[] = "debug"; 13 | const char LOG_STYLE_WARNING[] = "warning"; 14 | const char LOG_STYLE_POSITIVE[] = "positive"; 15 | 16 | const char LOG_STYLE_VS_DEBUG[] = "vs_debug"; 17 | const char LOG_STYLE_VS_WARNING[] = "vs_warning"; 18 | const char LOG_STYLE_VS_CRITICAL[] = "vs_critical"; 19 | const char LOG_STYLE_VS_FATAL[] = "vs_fatal"; 20 | 21 | const char LOG_STYLE_QT_DEBUG[] = "qt_debug"; 22 | const char LOG_STYLE_QT_INFO[] = "qt_info"; 23 | const char LOG_STYLE_QT_WARNING[] = "qt_warning"; 24 | const char LOG_STYLE_QT_CRITICAL[] = "qt_critical"; 25 | const char LOG_STYLE_QT_FATAL[] = "qt_fatal"; 26 | 27 | //============================================================================== 28 | 29 | QString vsMessageTypeToStyleName(int a_messageType) 30 | { 31 | QString style(LOG_STYLE_DEFAULT); 32 | 33 | std::map vsTypeToStyleMap = { 34 | {mtDebug, LOG_STYLE_VS_DEBUG}, 35 | {mtWarning, LOG_STYLE_VS_WARNING}, 36 | {mtCritical, LOG_STYLE_VS_CRITICAL}, 37 | {mtFatal, LOG_STYLE_VS_FATAL}, 38 | }; 39 | 40 | std::map::const_iterator it = 41 | vsTypeToStyleMap.find(a_messageType); 42 | if(it != vsTypeToStyleMap.end()) 43 | return it->second; 44 | 45 | return style; 46 | } 47 | 48 | // END OF QString vsMessageTypeToStyleName(int a_messageType) 49 | //============================================================================== 50 | -------------------------------------------------------------------------------- /common-src/vapoursynth/vs_script_processor_structures.h: -------------------------------------------------------------------------------- 1 | #ifndef VS_SCRIPT_PROCESSOR_STRUCTURES_H_INCLUDED 2 | #define VS_SCRIPT_PROCESSOR_STRUCTURES_H_INCLUDED 3 | 4 | #include 5 | 6 | //============================================================================== 7 | 8 | struct Frame 9 | { 10 | int number; 11 | int outputIndex; 12 | const VSFrameRef * cpOutputFrameRef; 13 | const VSFrameRef * cpPreviewFrameRef; 14 | 15 | Frame(int a_number, int a_outputIndex, 16 | const VSFrameRef * a_cpOutputFrameRef, 17 | const VSFrameRef * a_cpPreviewFrameRef = nullptr); 18 | bool operator==(const Frame & a_other) const; 19 | }; 20 | 21 | //============================================================================== 22 | 23 | struct FrameTicket 24 | { 25 | int frameNumber; 26 | int outputIndex; 27 | VSNodeRef * pOutputNode; 28 | bool needPreview; 29 | VSNodeRef * pPreviewNode; 30 | const VSFrameRef * cpOutputFrameRef; 31 | const VSFrameRef * cpPreviewFrameRef; 32 | bool discard; 33 | 34 | FrameTicket(int a_frameNumber, int a_outputIndex, 35 | VSNodeRef * a_pOutputNode, bool a_needPreview = false, 36 | VSNodeRef * a_pPreviewNode = nullptr); 37 | 38 | bool isComplete() const; 39 | }; 40 | 41 | //============================================================================== 42 | 43 | struct NodePair 44 | { 45 | int outputIndex; 46 | VSNodeRef * pOutputNode; 47 | VSNodeRef * pPreviewNode; 48 | 49 | NodePair(); 50 | NodePair(int a_outputIndex, VSNodeRef * a_pOutputNode, 51 | VSNodeRef * a_pPreviewNode); 52 | 53 | bool isNull() const; 54 | bool isValid() const; 55 | }; 56 | 57 | //============================================================================== 58 | 59 | #endif // VS_SCRIPT_PROCESSOR_STRUCTURES_H_INCLUDED 60 | -------------------------------------------------------------------------------- /vsedit/src/vapoursynth/vs_plugin_data.h: -------------------------------------------------------------------------------- 1 | #ifndef VSPLUGINDATA_H_INCLUDED 2 | #define VSPLUGINDATA_H_INCLUDED 3 | 4 | #include 5 | #include 6 | 7 | /// Data, gathered from VS core and plugins for syntax highlighting, 8 | /// autocompletion and reference. 9 | namespace VSData 10 | { 11 | 12 | struct FunctionArgument 13 | { 14 | QString name; 15 | QString type; 16 | bool optional; 17 | bool empty; 18 | 19 | FunctionArgument(); 20 | FunctionArgument(const VSData::FunctionArgument & a_other); 21 | FunctionArgument(VSData::FunctionArgument && a_other); 22 | VSData::FunctionArgument & operator=(VSData::FunctionArgument a_other); 23 | 24 | QString toString() const; 25 | bool operator<(const VSData::FunctionArgument & a_other) const; 26 | }; 27 | 28 | struct Function 29 | { 30 | QString name; 31 | std::vector arguments; 32 | 33 | Function(); 34 | Function(const VSData::Function & a_other); 35 | Function(VSData::Function && a_other); 36 | VSData::Function & operator=(VSData::Function a_other); 37 | 38 | QString toString() const; 39 | bool operator==(const VSData::Function & a_other) const; 40 | bool operator<(const VSData::Function & a_other) const; 41 | }; 42 | 43 | struct Plugin 44 | { 45 | QString filepath; 46 | QString id; 47 | QString pluginNamespace; 48 | QString name; 49 | std::vector functions; 50 | 51 | Plugin(); 52 | Plugin(const VSData::Plugin & a_other); 53 | Plugin(VSData::Plugin && a_other); 54 | VSData::Plugin & operator=(VSData::Plugin a_other); 55 | 56 | bool operator==(const VSData::Plugin & a_other) const; 57 | bool operator<(const VSData::Plugin & a_other) const; 58 | }; 59 | 60 | } 61 | 62 | typedef std::vector VSPluginsList; 63 | 64 | #endif // VSPLUGINDATA_H_INCLUDED 65 | -------------------------------------------------------------------------------- /common-src/log/log_styles_model.h: -------------------------------------------------------------------------------- 1 | #ifndef LOG_STYLES_MODEL_H_INCLUDED 2 | #define LOG_STYLES_MODEL_H_INCLUDED 3 | 4 | #include "styled_log_view_structures.h" 5 | 6 | #include 7 | 8 | class LogStylesModel : public QAbstractItemModel 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | LogStylesModel(QObject * a_pParent = nullptr); 15 | 16 | virtual ~LogStylesModel(); 17 | 18 | virtual QModelIndex index(int a_row, int a_column, 19 | const QModelIndex & a_parent = QModelIndex()) const override; 20 | 21 | virtual QModelIndex parent(const QModelIndex & a_child) const override; 22 | 23 | virtual Qt::ItemFlags flags(const QModelIndex & a_index) const override; 24 | 25 | virtual QVariant data(const QModelIndex & a_index, 26 | int a_role = Qt::DisplayRole) const override; 27 | 28 | virtual int rowCount(const QModelIndex & a_parent = QModelIndex()) const 29 | override; 30 | 31 | virtual int columnCount(const QModelIndex & a_parent = QModelIndex()) const 32 | override; 33 | 34 | virtual bool setData(const QModelIndex & a_index, const QVariant & a_value, 35 | int a_role = Qt::EditRole) override; 36 | 37 | virtual std::vector styles() const; 38 | 39 | virtual void setStyles(const std::vector & a_styles); 40 | 41 | virtual TextBlockStyle style(int a_index) const; 42 | virtual TextBlockStyle style(const QModelIndex & a_index) const; 43 | 44 | virtual bool setStyleFont(int a_index, const QFont & a_font); 45 | virtual bool setStyleTextColor(int a_index, const QColor & a_color); 46 | virtual bool setStyleBackgroundColor(int a_index, const QColor & a_color); 47 | 48 | protected: 49 | 50 | virtual bool styleIndexValid(int a_index) const; 51 | 52 | std::vector m_styles; 53 | }; 54 | 55 | #endif // LOG_STYLES_MODEL_H_INCLUDED 56 | -------------------------------------------------------------------------------- /vsedit/src/script_templates/drop_file_category_model.h: -------------------------------------------------------------------------------- 1 | #ifndef DROP_FILE_CATEGORY_MODEL_H_INCLUDED 2 | #define DROP_FILE_CATEGORY_MODEL_H_INCLUDED 3 | 4 | #include "../../../common-src/settings/settings_definitions.h" 5 | 6 | #include 7 | 8 | class DropFileCategoryModel : public QAbstractItemModel 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | DropFileCategoryModel(QObject * a_pParent = nullptr); 15 | 16 | virtual ~DropFileCategoryModel(); 17 | 18 | virtual QModelIndex index(int a_row, int a_column, 19 | const QModelIndex & a_parent = QModelIndex()) const override; 20 | 21 | virtual QModelIndex parent(const QModelIndex & a_child) const override; 22 | 23 | virtual Qt::ItemFlags flags(const QModelIndex & a_index) const override; 24 | 25 | virtual QVariant data(const QModelIndex & a_index, 26 | int a_role = Qt::DisplayRole) const override; 27 | 28 | virtual QVariant headerData(int a_section, Qt::Orientation a_orientation, 29 | int a_role = Qt::DisplayRole) const override; 30 | 31 | virtual int rowCount(const QModelIndex & a_parent = QModelIndex()) 32 | const override; 33 | 34 | virtual int columnCount(const QModelIndex & a_parent = QModelIndex()) 35 | const override; 36 | 37 | virtual bool setData(const QModelIndex & a_index, const QVariant & a_value, 38 | int a_role = Qt::EditRole) override; 39 | 40 | std::vector getCategories() const; 41 | 42 | void setCategories(const std::vector & a_categories); 43 | 44 | void addCategory(); 45 | 46 | void deleteCategory(int a_index); 47 | 48 | QString sourceTemplate(int a_index) const; 49 | 50 | void setSourceTemplate(int a_index, const QString & a_text); 51 | 52 | private: 53 | 54 | std::vector m_categories; 55 | }; 56 | 57 | #endif // DROP_FILE_CATEGORY_MODEL_H_INCLUDED 58 | -------------------------------------------------------------------------------- /vsedit/src/settings/clearable_key_sequence_editor.cpp: -------------------------------------------------------------------------------- 1 | #include "clearable_key_sequence_editor.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | //============================================================================== 8 | 9 | ClearableKeySequenceEditor::ClearableKeySequenceEditor(QWidget * a_pParent): 10 | QWidget(a_pParent) 11 | , m_pKeySequenceEdit(nullptr) 12 | , m_pClearKeySequenceButton(nullptr) 13 | { 14 | QHBoxLayout * pLayout = new QHBoxLayout(this); 15 | pLayout->setContentsMargins(0, 0, 0, 0); 16 | pLayout->setSpacing(0); 17 | setLayout(pLayout); 18 | 19 | m_pKeySequenceEdit = new QKeySequenceEdit(this); 20 | pLayout->addWidget(m_pKeySequenceEdit); 21 | 22 | connect(m_pKeySequenceEdit, SIGNAL(editingFinished()), 23 | this, SIGNAL(editingFinished())); 24 | 25 | m_pClearKeySequenceButton = new QToolButton(this); 26 | m_pClearKeySequenceButton->setToolTip(tr("Erase hotkey")); 27 | m_pClearKeySequenceButton->setIcon(QIcon(":erase.png")); 28 | pLayout->addWidget(m_pClearKeySequenceButton); 29 | 30 | connect(m_pClearKeySequenceButton, SIGNAL(clicked()), 31 | m_pKeySequenceEdit, SLOT(clear())); 32 | } 33 | 34 | //============================================================================== 35 | 36 | ClearableKeySequenceEditor::~ClearableKeySequenceEditor() 37 | { 38 | 39 | } 40 | 41 | //============================================================================== 42 | 43 | QKeySequence ClearableKeySequenceEditor::keySequence() const 44 | { 45 | return m_pKeySequenceEdit->keySequence(); 46 | } 47 | 48 | //============================================================================== 49 | 50 | void ClearableKeySequenceEditor::slotSetKeySequence( 51 | const QKeySequence & a_keySequence) 52 | { 53 | m_pKeySequenceEdit->setKeySequence(a_keySequence); 54 | } 55 | 56 | //============================================================================== 57 | -------------------------------------------------------------------------------- /vsedit/src/preview/preview_area.h: -------------------------------------------------------------------------------- 1 | #ifndef PREVIEWAREA_H 2 | #define PREVIEWAREA_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QLabel; 9 | class ScrollNavigator; 10 | class QKeyEvent; 11 | class QWheelEvent; 12 | class QMouseEvent; 13 | 14 | class PreviewArea : public QScrollArea 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | PreviewArea(QWidget * a_pParent = nullptr); 21 | 22 | virtual ~PreviewArea(); 23 | 24 | void setWidget(QWidget * a_pWidget) = delete; 25 | 26 | int pixmapWidth() const { return m_pixmapWidth; } 27 | 28 | int pixmapHeight() const { return m_pixmapHeight; } 29 | 30 | void setPixmap(const QPixmap & a_pixmap, qreal a_devicePixelRatio); 31 | 32 | void checkMouseOverPreview(const QPoint & a_globalMousePos); 33 | 34 | public slots: 35 | 36 | void slotScrollLeft(); 37 | void slotScrollRight(); 38 | void slotScrollTop(); 39 | void slotScrollBottom(); 40 | 41 | protected: 42 | 43 | void resizeEvent(QResizeEvent * a_pEvent) override; 44 | void keyPressEvent(QKeyEvent * a_pEvent) override; 45 | void wheelEvent(QWheelEvent * a_pEvent) override; 46 | void mousePressEvent(QMouseEvent * a_pEvent) override; 47 | void mouseMoveEvent(QMouseEvent * a_pEvent) override; 48 | void mouseReleaseEvent(QMouseEvent * a_pEvent) override; 49 | 50 | signals: 51 | 52 | void signalSizeChanged(); 53 | void signalCtrlWheel(QPoint a_angleDelta); 54 | void signalMouseMiddleButtonReleased(); 55 | void signalMouseRightButtonReleased(); 56 | void signalMouseOverPoint(float a_normX, float a_normY); 57 | 58 | private: 59 | 60 | void drawScrollNavigator(); 61 | 62 | QLabel * m_pPreviewLabel; 63 | 64 | ScrollNavigator * m_pScrollNavigator; 65 | 66 | bool m_draggingPreview; 67 | QPoint m_lastCursorPos; 68 | QPoint m_lastPreviewLabelPos; 69 | 70 | int m_pixmapWidth = 0; 71 | int m_pixmapHeight = 0; 72 | 73 | qreal m_devicePixelRatio = 1; 74 | }; 75 | 76 | #endif // PREVIEWAREA_H 77 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/connect_to_server_dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "connect_to_server_dialog.h" 2 | 3 | #include "../../common-src/settings/settings_manager.h" 4 | 5 | #include 6 | 7 | ConnectToServerDialog::ConnectToServerDialog( 8 | SettingsManager * a_pSettingsManager, QWidget * a_pParent) : 9 | QDialog(a_pParent) 10 | , m_pSettingsManager(a_pSettingsManager) 11 | { 12 | Q_ASSERT(m_pSettingsManager); 13 | m_ui.setupUi(this); 14 | 15 | connect(m_ui.connectButton, SIGNAL(clicked()), 16 | this, SLOT(slotConnectButtonClicked())); 17 | connect(m_ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject())); 18 | } 19 | 20 | ConnectToServerDialog::~ConnectToServerDialog() 21 | { 22 | } 23 | 24 | int ConnectToServerDialog::call(const QHostAddress & a_address) 25 | { 26 | m_ui.serverAddressComboBox->clear(); 27 | QStringList recentServers = m_pSettingsManager->getRecentJobServers(); 28 | m_ui.serverAddressComboBox->addItems(recentServers); 29 | m_ui.serverAddressComboBox->setCurrentText(a_address.toString()); 30 | return exec(); 31 | } 32 | 33 | void ConnectToServerDialog::slotConnectButtonClicked() 34 | { 35 | QString address = m_ui.serverAddressComboBox->currentText(); 36 | QHostAddress host(address); 37 | if(host.isNull()) 38 | return; 39 | int index = -1; 40 | while((index = m_ui.serverAddressComboBox->findText(address)) >= 0) 41 | { 42 | m_ui.serverAddressComboBox->removeItem(index); 43 | } 44 | m_ui.serverAddressComboBox->insertItem(0, address); 45 | saveServersList(); 46 | accept(); 47 | emit signalConnectToServer(host); 48 | } 49 | 50 | void ConnectToServerDialog::saveServersList() 51 | { 52 | QStringList recentServers; 53 | for(int i = 0; i < m_ui.serverAddressComboBox->count(); ++i) 54 | { 55 | QString address = m_ui.serverAddressComboBox->itemText(i); 56 | if(QHostAddress(address).isNull()) 57 | continue; 58 | recentServers << address; 59 | } 60 | m_pSettingsManager->setRecentJobServers(recentServers); 61 | } 62 | -------------------------------------------------------------------------------- /BUILDING: -------------------------------------------------------------------------------- 1 | THIS MANUAL IS A DRAFT. PLEASE REPORT ANY MISTAKES OR ADDITIONS AT https://github.com/YomikoR/VapourSynth-Editor/issues 2 | 3 | Building VapourSynth Editor from source: 4 | 5 | 1) make sure you meet the prerequisites explained below; 6 | 2) open the system terminal and change working directory to the "pro" directory in the source tree; 7 | 3) execute following command to generate the Makefile and other intermediate files 8 | 9 | `qmake -norecursive pro.pro CONFIG+=release` 10 | 11 | 4) "make" the Makefile with the specific make-tool: 12 | "make" if you are on Linux or using MSys on Windows; 13 | "mingw32-make" for MinGW; 14 | "nmake" for MS Visual Studio; 15 | program files will be built in compiler specific sub-directory in the "build" directory in source tree and ready to use. 16 | 17 | Each compiler you choose for build targets must specify "QT5BINPATH" custom environment variable with the directory of Qt5 toolchain executables. 18 | 19 | Prerequisites 20 | 21 | You need C++17 (or higher) compiler and Qt5 development distribution with version no less than 5.8 corresponding to the compiler. 22 | Make sure the executable directories of both tools are included in PATH system environment variable. 23 | 24 | Windows: 25 | 26 | - get compiler of your choice (MinGW and MSVC are fully supported); 27 | - if you use MSVC - you might also need to install Windows SDK. If you experience any problems during the building related to missing headers or "unresolved externals", you may consider opening the file "pro/local_quirks.pri" with text editor or your IDE and change the paths to headers and libraries to those that correspond to your MSVC and Windows SDK installation paths. 28 | - get Qt5 distribution (https://www.qt.io). 29 | 30 | Linux: 31 | 32 | - install following packages: build-essential, qtbase5-dev; also be aware that in some cases QtWebSockets is a standalone package. 33 | - if your Linux distribution has Qt4 development packages installed - you might want to install package qt5-default. 34 | 35 | MacOS: 36 | 37 | - if you are a user of brew, install qt@5. -------------------------------------------------------------------------------- /vsedit/src/frame_consumers/benchmark_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_DIALOG_H_INCLUDED 2 | #define BENCHMARK_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | #include "../vapoursynth/vs_script_processor_dialog.h" 7 | #include "../../../common-src/chrono.h" 8 | 9 | #include 10 | 11 | #ifdef Q_OS_WIN 12 | class QWinTaskbarButton; 13 | class QWinTaskbarProgress; 14 | #endif 15 | 16 | class ScriptBenchmarkDialog : public VSScriptProcessorDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | 22 | ScriptBenchmarkDialog(SettingsManager * a_pSettingsManager, 23 | VSScriptLibrary * a_pVSScriptLibrary, 24 | QWidget * a_pParent = nullptr); 25 | virtual ~ScriptBenchmarkDialog(); 26 | 27 | virtual bool initialize(const QString & a_script, 28 | const QString & a_scriptName) override; 29 | 30 | void resetSavedRange(); 31 | 32 | public slots: 33 | 34 | void call(); 35 | 36 | protected slots: 37 | 38 | virtual void slotWriteLogMessage(int a_messageType, 39 | const QString & a_message) override; 40 | 41 | virtual void slotReceiveFrame(int a_frameNumber, int a_outputIndex, 42 | const VSFrameRef * a_cpOutputFrameRef, 43 | const VSFrameRef * a_cpPreviewFrameRef) override; 44 | 45 | virtual void slotFrameRequestDiscarded(int a_frameNumber, 46 | int a_outputIndex, const QString & a_reason) override; 47 | 48 | void slotWholeVideoButtonPressed(); 49 | 50 | void slotStartStopBenchmarkButtonPressed(); 51 | 52 | protected: 53 | 54 | virtual void stopAndCleanUp() override; 55 | 56 | void stopProcessing(); 57 | 58 | void updateMetrics(); 59 | 60 | void keyPressEvent(QKeyEvent * a_pEvent); 61 | 62 | Ui::ScriptBenchmarkDialog m_ui; 63 | 64 | bool m_processing; 65 | 66 | int m_framesTotal; 67 | int m_framesProcessed; 68 | int m_framesFailed; 69 | 70 | hr_time_point m_benchmarkStartTime; 71 | 72 | int m_lastFromFrame; 73 | int m_lastToFrame; 74 | 75 | #ifdef Q_OS_WIN 76 | QWinTaskbarButton * m_pWinTaskbarButton; 77 | QWinTaskbarProgress * m_pWinTaskbarProgress; 78 | #endif 79 | }; 80 | 81 | #endif // BENCHMARK_DIALOG_H_INCLUDED 82 | -------------------------------------------------------------------------------- /common-src/vapoursynth/vs_gray_frame_prop.cpp: -------------------------------------------------------------------------------- 1 | #include "vs_gray_frame_prop.h" 2 | 3 | struct grayData 4 | { 5 | VSNodeRef *node; 6 | const VSVideoInfo *vi; 7 | }; 8 | 9 | void VS_CC grayFramePropInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) 10 | { 11 | grayData *d = reinterpret_cast(*instanceData); 12 | vsapi->setVideoInfo(d->vi, 1, node); 13 | } 14 | 15 | const VSFrameRef * VS_CC grayFramePropGetFrame(int n, int activationReason, void **instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi) 16 | { 17 | grayData *d = reinterpret_cast(*instanceData); 18 | if (activationReason == arInitial) 19 | { 20 | vsapi->requestFrameFilter(n, d->node, frameCtx); 21 | } 22 | else if (activationReason == arAllFramesReady) 23 | { 24 | const VSFrameRef *src_frame = vsapi->getFrameFilter(n, d->node, frameCtx); 25 | VSFrameRef *dst_frame = vsapi->copyFrame(src_frame, core); 26 | vsapi->freeFrame(src_frame); 27 | VSMap *props = vsapi->getFramePropsRW(dst_frame); 28 | int err; 29 | int matrix = int64ToIntS(vsapi->propGetInt(props, "_Matrix", 0, &err)); 30 | if (!err && matrix == 0) // RGB matrix 31 | { 32 | vsapi->propDeleteKey(props, "_Matrix"); 33 | } 34 | return dst_frame; 35 | } 36 | return nullptr; 37 | } 38 | 39 | void VS_CC grayFramePropFree(void *instanceData, VSCore *core, const VSAPI *vsapi) 40 | { 41 | grayData *d = reinterpret_cast(instanceData); 42 | vsapi->freeNode(d->node); 43 | delete d; 44 | } 45 | 46 | void VS_CC grayFramePropCreate(const VSMap *in, VSMap *out, VSCore *core, const VSAPI *vsapi) 47 | { 48 | grayData d; 49 | d.node = vsapi->propGetNode(in, "clip", 0, nullptr); 50 | d.vi = vsapi->getVideoInfo(d.node); 51 | grayData *data = new grayData(d); 52 | vsapi->createFilter(in, out, "GrayFrameProp", grayFramePropInit, grayFramePropGetFrame, grayFramePropFree, fmParallel, nfNoCache, data, core); 53 | } 54 | -------------------------------------------------------------------------------- /vsedit/src/frame_consumers/encode_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ENCODE_DIALOG_H_INCLUDED 2 | #define ENCODE_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | #include "../../../common-src/jobs/job.h" 7 | 8 | class SettingsManager; 9 | class VSScriptLibrary; 10 | 11 | #ifdef Q_OS_WIN 12 | class QWinTaskbarButton; 13 | class QWinTaskbarProgress; 14 | #endif 15 | 16 | class EncodeDialog : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | 22 | EncodeDialog(SettingsManager * a_pSettingsManager, 23 | VSScriptLibrary * a_pVSScriptLibrary, 24 | QWidget * a_pParent = nullptr); 25 | virtual ~EncodeDialog(); 26 | 27 | bool initialize(const QString & a_script, const QString & a_scriptName); 28 | 29 | bool busy() const; 30 | 31 | public slots: 32 | 33 | void showActive(); 34 | 35 | signals: 36 | 37 | void signalWriteLogMessage(const QString & a_style, 38 | const QString & a_message); 39 | 40 | protected: 41 | 42 | virtual void showEvent(QShowEvent * a_pEvent) override; 43 | virtual void closeEvent(QCloseEvent * a_pEvent) override; 44 | 45 | private slots: 46 | 47 | void slotWholeVideoButtonPressed(); 48 | 49 | void slotStartEncodeButtonPressed(); 50 | 51 | void slotExecutableBrowseButtonPressed(); 52 | 53 | void slotArgumentsHelpButtonPressed(); 54 | 55 | void slotEncodingPresetSaveButtonPressed(); 56 | void slotEncodingPresetDeleteButtonPressed(); 57 | void slotEncodingPresetComboBoxActivated(const QString & a_text); 58 | 59 | void slotJobStateChanged(JobState a_newState, JobState a_oldState); 60 | void slotJobProgressChanged(); 61 | void slotJobPropertiesChanged(); 62 | 63 | void slotWriteLogMessage(const QString & a_message, 64 | const QString & a_style); 65 | 66 | private: 67 | 68 | void setUpEncodingPresets(); 69 | 70 | void setUiEnabled(); 71 | 72 | Ui::EncodeDialog m_ui; 73 | 74 | SettingsManager * m_pSettingsManager; 75 | 76 | vsedit::Job * m_pJob; 77 | 78 | std::vector m_encodingPresets; 79 | 80 | #ifdef Q_OS_WIN 81 | QWinTaskbarButton * m_pWinTaskbarButton; 82 | QWinTaskbarProgress * m_pWinTaskbarProgress; 83 | #endif 84 | }; 85 | 86 | #endif // ENCODE_DIALOG_H_INCLUDED 87 | -------------------------------------------------------------------------------- /vsedit/src/script_templates/templates_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef TEMPLATES_DIALOG_H_INCLUDED 2 | #define TEMPLATES_DIALOG_H_INCLUDED 3 | 4 | #include 5 | 6 | #include "../../../common-src/settings/settings_definitions.h" 7 | 8 | #include 9 | 10 | class DropFileCategoryModel; 11 | class SettingsManager; 12 | class QAction; 13 | 14 | class TemplatesDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | TemplatesDialog(SettingsManager * a_pSettingsManager, 21 | QWidget * a_pParent = nullptr, 22 | Qt::WindowFlags a_flags = 23 | Qt::Window 24 | | Qt::CustomizeWindowHint 25 | | Qt::WindowMinimizeButtonHint 26 | | Qt::WindowMaximizeButtonHint 27 | | Qt::WindowCloseButtonHint); 28 | 29 | virtual ~TemplatesDialog(); 30 | 31 | void setPluginsList(const VSPluginsList & a_pluginsList); 32 | 33 | public slots: 34 | 35 | void call(); 36 | 37 | void slotLoadSettings(); 38 | 39 | signals: 40 | 41 | void signalPasteCodeSnippet(const QString & a_text); 42 | 43 | private slots: 44 | 45 | void slotSnippetPasteIntoScriptButtonClicked(); 46 | void slotSnippetSaveButtonClicked(); 47 | void slotSnippetDeleteButtonClicked(); 48 | void slotSnippetNameComboBoxActivated(const QString & a_text); 49 | 50 | void slotNewScriptTemplateRevertButtonClicked(); 51 | void slotNewScriptTemplateLoadDefaultButtonClicked(); 52 | void slotNewScriptTemplateSaveButtonClicked(); 53 | 54 | void slotSaveDropFileCategoriesButtonClicked(); 55 | void slotRevertDropFileCategoriesButtonClicked(); 56 | void slotAddDropFileCategoryButtonClicked(); 57 | void slotDeleteSelectedDropFileCategoryButtonClicked(); 58 | void slotDropFileCategoryViewPressed(const QModelIndex & a_index); 59 | void slotDisplayCurrentDropFileCategoryTemplate(); 60 | void slotUpdateDropFileCategories(); 61 | 62 | void slotSaveActionTriggered(); 63 | 64 | private: 65 | 66 | Ui::TemplatesDialog m_ui; 67 | 68 | SettingsManager * m_pSettingsManager; 69 | 70 | std::vector m_codeSnippets; 71 | 72 | DropFileCategoryModel * m_pDropFileCategoryModel; 73 | 74 | QAction * m_pSaveAction; 75 | 76 | std::vector m_scriptEditors; 77 | }; 78 | 79 | #endif // TEMPLATES_DIALOG_H_INCLUDED 80 | -------------------------------------------------------------------------------- /common-src/log/styled_log_view.h: -------------------------------------------------------------------------------- 1 | #ifndef STYLED_LOG_VIEW_H_INCLUDED 2 | #define STYLED_LOG_VIEW_H_INCLUDED 3 | 4 | #include "styled_log_view_structures.h" 5 | 6 | #include 7 | #include 8 | 9 | class StyledLogViewSettingsDialog; 10 | 11 | class StyledLogView : public QTextEdit 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | 17 | static const size_t DEFAULT_MAX_ENTRIES_TO_SHOW; 18 | 19 | StyledLogView(QWidget * a_pParent = nullptr); 20 | virtual ~StyledLogView(); 21 | 22 | virtual TextBlockStyle getStyle(const QString & a_styleName) const; 23 | 24 | virtual void addStyle(const TextBlockStyle & a_style, 25 | bool a_updateExisting = true); 26 | 27 | virtual void addStyle(const QString & a_aliasName, 28 | const QString & a_title, 29 | const QString & a_originalStyleName = LOG_STYLE_DEFAULT); 30 | 31 | virtual void startNewBlock(); 32 | 33 | virtual qint64 millisecondsToDivideBlocks() const; 34 | 35 | virtual bool setMillisecondsToDivideBlocks(qint64 a_value); 36 | 37 | virtual QStringList styles(bool a_excludeAliases = false) const; 38 | 39 | virtual bool saveHtml(const QString & a_filePath, 40 | bool a_excludeFiltered = false); 41 | 42 | virtual bool saveHtml(bool a_excludeFiltered = false); 43 | 44 | public slots: 45 | 46 | virtual void addEntry(const QString & a_text, 47 | const QString & a_style = LOG_STYLE_DEFAULT); 48 | 49 | virtual void addEntry(const LogEntry & a_entry); 50 | 51 | virtual void clear(); 52 | 53 | virtual void slotSaveHtml(); 54 | 55 | virtual void slotSaveHtmlFiltered(); 56 | 57 | protected slots: 58 | 59 | virtual void slotShowCustomMenu(const QPoint & a_position); 60 | 61 | virtual void slotLogSettings(); 62 | 63 | virtual void slotLogSettingsChanged(); 64 | 65 | protected: 66 | 67 | virtual void updateHtml(); 68 | 69 | virtual void createActionsAndMenus(); 70 | 71 | virtual QString realHtml(bool a_excludeFiltered = false) const; 72 | 73 | std::vector m_styles; 74 | std::vector m_entries; 75 | 76 | qint64 m_millisecondsToDivideBlocks; 77 | 78 | QMenu * m_pContextMenu; 79 | 80 | StyledLogViewSettingsDialog * m_pSettingsDialog; 81 | 82 | size_t m_maxEntriesToShow; 83 | }; 84 | 85 | #endif // STYLED_LOG_VIEW_H_INCLUDED 86 | -------------------------------------------------------------------------------- /vsedit/src/settings/theme_elements_model.h: -------------------------------------------------------------------------------- 1 | #ifndef THEME_ELEMENTS_MODEL_H_INCLUDED 2 | #define THEME_ELEMENTS_MODEL_H_INCLUDED 3 | 4 | #include "../../../common-src/settings/settings_definitions.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class SettingsManager; 11 | 12 | enum class ThemeElementType 13 | { 14 | TextCharFormat, 15 | Color 16 | }; 17 | 18 | struct ThemeElementData 19 | { 20 | ThemeElementType type; 21 | QString id; 22 | QString text; 23 | QIcon icon; 24 | QTextCharFormat textCharFormat; 25 | QColor color; 26 | }; 27 | 28 | typedef std::vector ThemeElementsList; 29 | 30 | class ThemeElementsModel : public QAbstractItemModel 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | 36 | ThemeElementsModel(SettingsManager * a_pSettingsManager, 37 | QObject * a_pParent = nullptr); 38 | 39 | virtual ~ThemeElementsModel(); 40 | 41 | QModelIndex index(int a_row, int a_column, 42 | const QModelIndex & a_parent = QModelIndex()) const override; 43 | 44 | QModelIndex parent(const QModelIndex & a_child) const override; 45 | 46 | Qt::ItemFlags flags(const QModelIndex & a_index) const override; 47 | 48 | QVariant data(const QModelIndex & a_index, int a_role = Qt::DisplayRole) 49 | const override; 50 | 51 | int rowCount(const QModelIndex & a_parent = QModelIndex()) const 52 | override; 53 | 54 | int columnCount(const QModelIndex & a_parent = QModelIndex()) const 55 | override; 56 | 57 | bool setData(const QModelIndex & a_index, const QVariant & a_value, 58 | int a_role = Qt::EditRole) override; 59 | 60 | void addThemeElement(const ThemeElementData & a_themeElementData); 61 | 62 | void addTextCharFormat(const QString & a_id, const QString & a_text); 63 | 64 | void addColor(const QString & a_id, const QString & a_text); 65 | 66 | void reloadThemeSettings(); 67 | 68 | ThemeElementData getThemeElementData(const QString & a_id); 69 | 70 | bool saveThemeElementData(const ThemeElementData & a_themeElementData); 71 | 72 | public slots: 73 | 74 | void slotSaveThemeSettings(); 75 | 76 | private: 77 | 78 | ThemeElementsList m_themeElementsList; 79 | 80 | SettingsManager * m_pSettingsManager; 81 | }; 82 | 83 | #endif // THEME_ELEMENTS_MODEL_H_INCLUDED 84 | -------------------------------------------------------------------------------- /common-src/ipc_defines.h: -------------------------------------------------------------------------------- 1 | #ifndef IPC_DEFINES_H_INCLUDED 2 | #define IPC_DEFINES_H_INCLUDED 3 | 4 | // Watcher <-> Job server communication 5 | 6 | static const char JOB_SERVER_NAME[] = "vsedit_job_server"; 7 | static const uint16_t JOB_SERVER_PORT = 3370; 8 | 9 | // Client messages 10 | static const char MSG_GET_JOBS_INFO[] = "GJI"; 11 | static const char MSG_GET_LOG[] = "GL"; 12 | static const char MSG_SUBSCRIBE[] = "SS"; 13 | static const char MSG_UNSUBSCRIBE[] = "USS"; 14 | static const char MSG_CLOSE_SERVER[] = "CS"; 15 | static const char MSG_GET_TRUSTED_CLIENTS[] = "GTC"; 16 | static const char MSG_SET_TRUSTED_CLIENTS[] = "STC"; 17 | 18 | static const char MSG_CREATE_JOB[] = "CJ"; 19 | static const char MSG_CHANGE_JOB[] = "CHJ"; 20 | static const char MSG_SET_JOB_DEPENDENCIES[] = "SJD"; 21 | static const char MSG_SWAP_JOBS[] = "SJ"; 22 | static const char MSG_RESET_JOBS[] = "RJ"; 23 | static const char MSG_DELETE_JOBS[] = "DJ"; 24 | 25 | static const char MSG_START_ALL_WAITING_JOBS[] = "SAWJ"; 26 | static const char MSG_PAUSE_ACTIVE_JOBS[] = "PACJ"; 27 | static const char MSG_RESUME_PAUSED_JOBS[] = "RPJ"; 28 | static const char MSG_ABORT_ACTIVE_JOBS[] = "AACJ"; 29 | 30 | // Server messages 31 | static const char SMSG_JOBS_INFO[] = "JI"; 32 | static const char SMSG_COMPLETE_LOG[] = "LOG"; 33 | static const char SMSG_LOG_MESSAGE[] = "LM"; 34 | static const char SMSG_JOB_CREATED[] = "JC"; 35 | static const char SMSG_JOB_UPDATE[] = "JU"; 36 | static const char SMSG_JOB_STATE_UPDATE[] = "JSU"; 37 | static const char SMSG_JOB_PROGRESS_UPDATE[] = "JPU"; 38 | static const char SMSG_JOB_START_TIME_UPDATE[] = "JSTU"; 39 | static const char SMSG_JOB_END_TIME_UPDATE[] = "JETU"; 40 | static const char SMSG_JOB_DEPENDENCIES_UPDATE[] = "JDU"; 41 | static const char SMSG_JOBS_SWAPPED[] = "JSW"; 42 | static const char SMSG_JOBS_DELETED[] = "JD"; 43 | static const char SMSG_REFUSE[] = "RF"; 44 | static const char SMSG_CLOSING_SERVER[] = "SCS"; 45 | static const char SMSG_TRUSTED_CLIENTS_INFO[] = "TCI"; 46 | 47 | // Editor <-> Watcher communication 48 | 49 | static const char JOB_SERVER_WATCHER_LOCAL_SERVER_NAME[] = 50 | "vsedit_job_server_watcher"; 51 | 52 | static const char WMSG_SHOW_WINDOW[] = "S"; 53 | static const char WMSG_CLI_ENCODE_JOB[] = "CEJ"; 54 | 55 | #endif // IPC_DEFINES_H_INCLUDED 56 | -------------------------------------------------------------------------------- /common-src/libp2p/simd/cpuinfo_x86.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef P2P_CPUINFO_X86_H_ 4 | #define P2P_CPUINFO_X86_H_ 5 | 6 | #ifdef P2P_SIMD 7 | #if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) 8 | 9 | #include "../p2p.h" 10 | 11 | namespace P2P_NAMESPACE { 12 | namespace simd { 13 | 14 | /** 15 | * Bitfield of selected x86 feature flags. 16 | */ 17 | struct X86Capabilities { 18 | unsigned sse : 1; 19 | unsigned sse2 : 1; 20 | unsigned sse3 : 1; 21 | unsigned ssse3 : 1; 22 | unsigned fma : 1; 23 | unsigned sse41 : 1; 24 | unsigned sse42 : 1; 25 | unsigned avx : 1; 26 | unsigned f16c : 1; 27 | unsigned avx2 : 1; 28 | unsigned avx512f : 1; 29 | unsigned avx512dq : 1; 30 | unsigned avx512ifma : 1; 31 | unsigned avx512cd : 1; 32 | unsigned avx512bw : 1; 33 | unsigned avx512vl : 1; 34 | unsigned avx512vbmi : 1; 35 | unsigned avx512vbmi2 : 1; 36 | unsigned avx512vnni : 1; 37 | unsigned avx512bitalg : 1; 38 | unsigned avx512vpopcntdq : 1; 39 | unsigned avx512vp2intersect : 1; 40 | unsigned avx512fp16 : 1; 41 | unsigned avx512bf16 : 1; 42 | /* AMD architectures needing workarounds. */ 43 | unsigned xop : 1; 44 | unsigned piledriver : 1; 45 | unsigned zen1 : 1; 46 | unsigned zen2 : 1; 47 | unsigned zen3 : 1; 48 | }; 49 | 50 | /** 51 | * Representation of processor cache topology. 52 | */ 53 | struct X86CacheHierarchy { 54 | unsigned long l1d; 55 | unsigned long l1d_threads; 56 | unsigned long l2; 57 | unsigned long l2_threads; 58 | unsigned long l3; 59 | unsigned long l3_threads; 60 | bool l2_inclusive; 61 | bool l3_inclusive; 62 | bool valid; 63 | }; 64 | 65 | /** 66 | * Get the x86 feature flags on the current CPU. 67 | * 68 | * @return capabilities 69 | */ 70 | X86Capabilities query_x86_capabilities() noexcept; 71 | 72 | /** 73 | * Get the cache topology of the current CPU. 74 | * 75 | * On a multi-processor system, the returned topology corresponds to the first 76 | * processor package on which the function is called. The behaviour is 77 | * undefined if the platform contains non-identical processors. 78 | * 79 | * @return cache hierarchy 80 | */ 81 | X86CacheHierarchy query_x86_cache_hierarchy() noexcept; 82 | 83 | unsigned long cpu_cache_size_x86() noexcept; 84 | 85 | } // namespace simd 86 | } // namespace p2p 87 | 88 | #endif // x86 89 | #endif // P2P_SIMD 90 | 91 | #endif // P2P_CPUINFO_X86_H_ 92 | -------------------------------------------------------------------------------- /common-src/log/styled_log_view_structures.cpp: -------------------------------------------------------------------------------- 1 | #include "styled_log_view_structures.h" 2 | 3 | #include 4 | #include 5 | 6 | //============================================================================== 7 | 8 | TextBlockStyle::TextBlockStyle(const QString & a_name, const QString & a_title): 9 | name(a_name) 10 | , title(a_title) 11 | , isAlias(false) 12 | , isVisible(true) 13 | { 14 | QPalette palette = QGuiApplication::palette(); 15 | textFormat.setBackground(palette.color(QPalette::Active, QPalette::Base)); 16 | textFormat.setForeground(palette.color(QPalette::Active, QPalette::Text)); 17 | } 18 | 19 | // END OFTextBlockStyle::TextBlockStyle(const QString & a_name, 20 | // const QString & a_title) 21 | //============================================================================== 22 | 23 | TextBlockStyle::TextBlockStyle(const QString & a_name, const QString & a_title, 24 | const QTextCharFormat & a_textFormat): 25 | name(a_name) 26 | , title(a_title) 27 | , textFormat(a_textFormat) 28 | , isAlias(false) 29 | , isVisible(true) 30 | { 31 | } 32 | 33 | // END OF TextBlockStyle::TextBlockStyle(const QString & a_name, 34 | // const QString & a_title, const QTextCharFormat & a_textFormat) 35 | //============================================================================== 36 | 37 | TextBlockStyle::TextBlockStyle(const QString & a_name, const QString & a_title, 38 | const QColor & a_backgroundColor, const QColor & a_textColor): 39 | name(a_name) 40 | , title(a_title) 41 | , isAlias(false) 42 | , isVisible(true) 43 | { 44 | textFormat.setForeground(a_textColor); 45 | textFormat.setBackground(a_backgroundColor); 46 | } 47 | 48 | // END OF TextBlockStyle::TextBlockStyle(const QString & a_name, 49 | // const QString & a_title, const QColor & a_backgroundColor, 50 | // const QColor & a_textColor) 51 | //============================================================================== 52 | 53 | TextBlockStyle::TextBlockStyle(const QString & a_aliasName, 54 | const QString & a_title, const QString & a_originalStyleName): 55 | name(a_aliasName) 56 | , title(a_title) 57 | , isAlias(true) 58 | , originalStyleName(a_originalStyleName) 59 | , isVisible(true) 60 | { 61 | } 62 | 63 | // END OF TextBlockStyle::TextBlockStyle(const QString & a_aliasName, 64 | // const QString & a_title, const QString & a_originalStyleName) 65 | //============================================================================== 66 | -------------------------------------------------------------------------------- /vsedit/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main_window.h" 2 | 3 | #include "../../common-src/log/vs_editor_log.h" 4 | 5 | #include 6 | 7 | Q_DECLARE_OPAQUE_POINTER(const VSFrameRef *) 8 | Q_DECLARE_OPAQUE_POINTER(VSNodeRef *) 9 | 10 | MainWindow * pMainWindow = nullptr; 11 | 12 | void handleQtMessage(QtMsgType a_type, const QMessageLogContext & a_context, 13 | const QString & a_message) 14 | { 15 | QString prefix = "Qt debug"; 16 | QString style = LOG_STYLE_DEFAULT; 17 | 18 | switch(a_type) 19 | { 20 | case QtDebugMsg: 21 | prefix = "Qt debug"; 22 | style = LOG_STYLE_QT_DEBUG; 23 | break; 24 | #if(QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) 25 | case QtInfoMsg: 26 | prefix = "Qt info"; 27 | style = LOG_STYLE_QT_INFO; 28 | break; 29 | #endif 30 | case QtWarningMsg: 31 | prefix = "Qt warning"; 32 | style = LOG_STYLE_QT_WARNING; 33 | break; 34 | case QtCriticalMsg: 35 | prefix = "Qt critical"; 36 | style = LOG_STYLE_QT_CRITICAL; 37 | break; 38 | case QtFatalMsg: 39 | prefix = "Qt fatal"; 40 | style = LOG_STYLE_QT_FATAL; 41 | break; 42 | default: 43 | Q_ASSERT(false); 44 | } 45 | 46 | QString fullMessage = QString("%1: %2").arg(prefix).arg(a_message); 47 | 48 | QString fileString(a_context.file); 49 | QString lineString = QString::number(a_context.line); 50 | QString functionString(a_context.function); 51 | 52 | QString lineInfo = QString("\n(%1:%2").arg(fileString).arg(lineString); 53 | if(!functionString.isEmpty()) 54 | lineInfo += QString(", %1").arg(functionString); 55 | lineInfo += QString(")"); 56 | if(!fileString.isEmpty()) 57 | fullMessage += lineInfo; 58 | 59 | pMainWindow->slotWriteLogMessage(fullMessage, style); 60 | 61 | if(a_type == QtFatalMsg) 62 | abort(); 63 | } 64 | 65 | int main(int argc, char *argv[]) 66 | { 67 | QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar); 68 | #if (QT_VERSION_MAJOR < 6) 69 | QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); 70 | #endif 71 | QApplication application(argc, argv); 72 | 73 | // Make text in message box selectable 74 | application.setStyleSheet( 75 | "QMessageBox { messagebox-text-interaction-flags: 5; }"); 76 | 77 | qRegisterMetaType("const VSFrameRef *"); 78 | qRegisterMetaType("VSNodeRef *"); 79 | 80 | pMainWindow = new MainWindow(); 81 | qInstallMessageHandler(handleQtMessage); 82 | pMainWindow->show(); 83 | int exitCode = application.exec(); 84 | delete pMainWindow; 85 | return exitCode; 86 | } 87 | -------------------------------------------------------------------------------- /common-src/aligned_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef ALIGNED_VECTOR_H_INCLUDED 2 | #define ALIGNED_VECTOR_H_INCLUDED 3 | 4 | // Based on code from 5 | // https://mastermind-strategy.googlecode.com/svn-history/r167/trunk/src/util/ 6 | // aligned_allocator.hpp 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define VSE_MEMORY_ALIGNMENT 64u 13 | 14 | namespace vsedit 15 | { 16 | 17 | template 18 | struct aligned_allocator 19 | : public std::allocator 20 | { 21 | typedef typename std::allocator::size_type size_type; 22 | typedef typename std::allocator::pointer pointer; 23 | typedef typename std::allocator::const_pointer const_pointer; 24 | 25 | 26 | template 27 | struct rebind 28 | { 29 | typedef aligned_allocator other; 30 | }; 31 | 32 | aligned_allocator() throw() 33 | { 34 | } 35 | 36 | aligned_allocator(const aligned_allocator & other) throw() : 37 | std::allocator(other) 38 | { 39 | } 40 | 41 | template 42 | aligned_allocator(const aligned_allocator &) throw() 43 | { 44 | } 45 | 46 | ~aligned_allocator() throw() 47 | { 48 | } 49 | 50 | pointer allocate(size_type n) 51 | { 52 | return allocate(n, const_pointer(0)); 53 | } 54 | 55 | pointer allocate(size_type a_size, const_pointer a_hint) 56 | { 57 | (void)a_hint; 58 | 59 | void * p; 60 | #ifndef _WIN32 61 | if(posix_memalign(&p, Alignment, a_size * sizeof(T)) != 0) 62 | p = nullptr; 63 | #else 64 | p = _aligned_malloc(a_size * sizeof(T), Alignment); 65 | #endif 66 | if(!p) 67 | throw std::bad_alloc(); 68 | return static_cast(p); 69 | } 70 | 71 | void deallocate(pointer a_p, size_type a_size) 72 | { 73 | (void)a_size; 74 | 75 | #ifndef _WIN32 76 | free(a_p); 77 | #else 78 | _aligned_free(a_p); 79 | #endif 80 | } 81 | }; 82 | 83 | template 84 | bool operator == (const aligned_allocator &, 85 | const aligned_allocator &) 86 | { 87 | return true; 88 | } 89 | 90 | template 91 | bool operator != (const aligned_allocator &, 92 | const aligned_allocator &) 93 | { 94 | return false; 95 | } 96 | 97 | template 98 | using aligned_vector = 99 | std::vector >; 100 | 101 | } 102 | 103 | #endif // ALIGNED_VECTOR_H_INCLUDED 104 | -------------------------------------------------------------------------------- /pro/build-inno-setup.iss: -------------------------------------------------------------------------------- 1 | ; https://jrsoftware.org/ishelp/index.php 2 | 3 | #define AppName "VapourSynth Editor" 4 | #define ExeName "vsedit" 5 | #define Version "r19-mod-5.1" 6 | 7 | [Setup] 8 | AppId={#AppName} 9 | AppName={#AppName} 10 | AppPublisher=YomikoR 11 | AppPublisherURL=https://github.com/YomikoR/VapourSynth-Editor 12 | AppReadmeFile=https://github.com/YomikoR/VapourSynth-Editor/blob/master/README 13 | AppSupportURL=https://github.com/YomikoR/VapourSynth-Editor/issues 14 | AppUpdatesURL=https://github.com/YomikoR/VapourSynth-Editor/blob/master/CHANGELOG 15 | AppVerName={#AppName} {#Version} 16 | AppVersion={#Version} 17 | ArchitecturesAllowed=x64 18 | ArchitecturesInstallIn64BitMode=x64 19 | ChangesAssociations=yes 20 | Compression=lzma2/max 21 | DefaultDirName={autopf}\{#AppName} 22 | DefaultGroupName={#AppName} 23 | LicenseFile=..\LICENSE 24 | OutputBaseFilename={#AppName}-{#Version}-setup 25 | OutputDir=dist 26 | OutputManifestFile={#AppName}-{#Version}-setup-manifest.txt 27 | PrivilegesRequiredOverridesAllowed=dialog commandline 28 | SetupIconFile=..\resources\{#ExeName}.ico 29 | SolidCompression=yes 30 | VersionInfoVersion=1.0.0 31 | WizardStyle=modern 32 | 33 | [Languages] 34 | Name: "english"; MessagesFile: "compiler:Default.isl" 35 | 36 | [Tasks] 37 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 38 | 39 | [Files] 40 | Source: ..\build\release-64bit-msvc\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs 41 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 42 | 43 | [Icons] 44 | Name: "{group}\{#AppName}"; Filename: "{app}\{#ExeName}.exe" 45 | Name: "{group}\VapourSynth Jobs Server Watcher"; Filename: "{app}\{#ExeName}-job-server-watcher.exe" 46 | Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#ExeName}.exe"; Tasks: desktopicon 47 | 48 | [Registry] 49 | Root: HKCR; Subkey: ".vpy"; ValueType: string; ValueName: ""; ValueData: "VapourSynthPythonScript"; Flags: uninsdeletevalue uninsdeletekeyifempty 50 | Root: HKCR; Subkey: "VapourSynthPythonScript"; ValueType: string; ValueName: ""; ValueData: "VapourSynth Python Script"; Flags: uninsdeletevalue uninsdeletekeyifempty 51 | Root: HKCR; Subkey: "VapourSynthPythonScript\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeName}.exe"" ""%1"""; Flags: uninsdeletevalue uninsdeletekeyifempty 52 | 53 | [Run] 54 | Filename: "{app}\{#ExeName}.exe"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent 55 | -------------------------------------------------------------------------------- /common-src/vapoursynth/vs_script_processor_structures.cpp: -------------------------------------------------------------------------------- 1 | #include "vs_script_processor_structures.h" 2 | 3 | //============================================================================== 4 | 5 | Frame::Frame(int a_number, int a_outputIndex, 6 | const VSFrameRef * a_cpOutputFrameRef, 7 | const VSFrameRef * a_cpPreviewFrameRef): 8 | number(a_number) 9 | , outputIndex(a_outputIndex) 10 | , cpOutputFrameRef(a_cpOutputFrameRef) 11 | , cpPreviewFrameRef(a_cpPreviewFrameRef) 12 | { 13 | } 14 | 15 | bool Frame::operator==(const Frame & a_other) const 16 | { 17 | return ((number == a_other.number) && (outputIndex == a_other.outputIndex)); 18 | } 19 | 20 | //============================================================================== 21 | 22 | FrameTicket::FrameTicket(int a_frameNumber, int a_outputIndex, 23 | VSNodeRef * a_pOutputNode, bool a_needPreview, 24 | VSNodeRef * a_pPreviewNode): 25 | frameNumber(a_frameNumber) 26 | , outputIndex(a_outputIndex) 27 | , pOutputNode(a_pOutputNode) 28 | , needPreview(a_needPreview) 29 | , pPreviewNode(a_pPreviewNode) 30 | , cpOutputFrameRef(nullptr) 31 | , cpPreviewFrameRef(nullptr) 32 | , discard(false) 33 | { 34 | } 35 | 36 | //============================================================================== 37 | 38 | bool FrameTicket::isComplete() const 39 | { 40 | bool complete = (cpOutputFrameRef != nullptr); 41 | if(needPreview) 42 | complete = complete && (cpPreviewFrameRef != nullptr); 43 | return complete; 44 | } 45 | 46 | //============================================================================== 47 | 48 | NodePair::NodePair(): 49 | outputIndex(-1) 50 | , pOutputNode(nullptr) 51 | , pPreviewNode(nullptr) 52 | { 53 | } 54 | 55 | //============================================================================== 56 | 57 | NodePair::NodePair(int a_outputIndex, VSNodeRef * a_pOutputNode, 58 | VSNodeRef * a_pPreviewNode): 59 | outputIndex(a_outputIndex) 60 | , pOutputNode(a_pOutputNode) 61 | , pPreviewNode(a_pPreviewNode) 62 | { 63 | } 64 | 65 | //============================================================================== 66 | 67 | bool NodePair::isNull() const 68 | { 69 | return ((outputIndex == -1) && (pOutputNode == nullptr) && 70 | (pPreviewNode == nullptr)); 71 | } 72 | 73 | //============================================================================== 74 | 75 | bool NodePair::isValid() const 76 | { 77 | return ((outputIndex >= 0) && (pOutputNode != nullptr) && 78 | (pPreviewNode != nullptr)); 79 | } 80 | 81 | //============================================================================== 82 | -------------------------------------------------------------------------------- /common-src/libp2p/simd/p2p_simd.cpp: -------------------------------------------------------------------------------- 1 | #ifdef P2P_SIMD 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "../p2p.h" 8 | #include "cpuinfo_x86.h" 9 | #include "p2p_simd.h" 10 | 11 | namespace P2P_NAMESPACE { 12 | namespace detail { 13 | 14 | namespace { 15 | 16 | typedef std::pair unpack_table_entry; 17 | typedef std::tuple pack_table_entry; 18 | 19 | auto populate_unpack_table() 20 | { 21 | std::array table; 22 | size_t idx = 0; 23 | 24 | #if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) 25 | simd::X86Capabilities x86 = simd::query_x86_capabilities(); 26 | 27 | if (x86.sse41) { 28 | #define ENTRY(format, cpu) table[idx++] = unpack_table_entry{ &typeid(packed_##format), simd::unpack_##format##_##cpu } 29 | ENTRY(argb32_be, sse41); 30 | ENTRY(argb32_le, sse41); 31 | ENTRY(rgba32_be, sse41); 32 | ENTRY(rgba32_le, sse41); 33 | #undef ENTRY 34 | } 35 | #endif 36 | 37 | return table; 38 | } 39 | 40 | auto populate_pack_table() 41 | { 42 | std::array table; 43 | size_t idx = 0; 44 | 45 | #if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) 46 | simd::X86Capabilities x86 = simd::query_x86_capabilities(); 47 | 48 | if (x86.sse41) { 49 | #define ENTRY(format, cpu) table[idx++] = pack_table_entry{ &typeid(packed_##format), simd::pack_##format##_0_##cpu, simd::pack_##format##_1_##cpu } 50 | ENTRY(argb32_be, sse41); 51 | ENTRY(argb32_le, sse41); 52 | ENTRY(rgba32_be, sse41); 53 | ENTRY(rgba32_le, sse41); 54 | #undef ENTRY 55 | } 56 | #endif 57 | 58 | return table; 59 | } 60 | 61 | } // namespace 62 | 63 | 64 | unpack_func search_unpack_func(const std::type_info &ti) 65 | { 66 | static const auto g_unpack_table = populate_unpack_table(); 67 | 68 | for (const auto &entry : g_unpack_table) { 69 | if (entry.first == &ti) 70 | return entry.second; 71 | if (!entry.first) 72 | break; 73 | } 74 | return nullptr; 75 | } 76 | 77 | pack_func search_pack_func(const std::type_info &ti, bool alpha_one_fill) 78 | { 79 | static const auto g_pack_table = populate_pack_table(); 80 | 81 | for (const auto &entry : g_pack_table) { 82 | if (std::get<0>(entry) == &ti) 83 | return alpha_one_fill ? std::get<2>(entry) : std::get<1>(entry); 84 | if (!std::get<0>(entry)) 85 | break; 86 | } 87 | 88 | return nullptr; 89 | } 90 | 91 | } // namespace detail 92 | } // namespace p2p 93 | 94 | #endif // P2P_SIMD 95 | -------------------------------------------------------------------------------- /resources/vsedit.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | page_white_text.png 4 | disk.png 5 | disk_edit.png 6 | folder_page_white.png 7 | film.png 8 | tick_light_blue.png 9 | door_in.png 10 | picture_save.png 11 | zoom.png 12 | zoom_actual.png 13 | zoom_in.png 14 | zoom_fit.png 15 | transform_crop.png 16 | paste_plain.png 17 | vsedit.ico 18 | cog.png 19 | folder.png 20 | folder_add.png 21 | folder_delete.png 22 | erase.png 23 | image_to_clipboard.png 24 | timeline.png 25 | timeline_frames.png 26 | time_back.png 27 | time_forward.png 28 | color_swatch.png 29 | font.png 30 | color_picker.png 31 | play_green.png 32 | pause_green.png 33 | tick.png 34 | benchmark.png 35 | film_save.png 36 | information.png 37 | hourglass.png 38 | cross.png 39 | timeline_marker.png 40 | timeline_marker_add.png 41 | timeline_marker_remove.png 42 | timeline_marker_previous.png 43 | timeline_marker_next.png 44 | sheduled_task.png 45 | 46 | ../README 47 | 48 | fonts/DigitalMini.ttf 49 | 50 | 51 | -------------------------------------------------------------------------------- /vsedit/src/script_editor/script_completer_model.cpp: -------------------------------------------------------------------------------- 1 | #include "script_completer_model.h" 2 | 3 | #include 4 | 5 | //============================================================================== 6 | 7 | const char DEFAULT_CORE_NAME[] = "core"; 8 | 9 | //============================================================================== 10 | 11 | ScriptCompleterModel::ScriptCompleterModel(QObject * a_pParent): 12 | QStandardItemModel(a_pParent) 13 | { 14 | setCoreName(DEFAULT_CORE_NAME); 15 | } 16 | 17 | // END OF ScriptCompleterModel::ScriptCompleterModel(QObject * a_pParent) 18 | //============================================================================== 19 | 20 | ScriptCompleterModel::~ScriptCompleterModel() 21 | { 22 | 23 | } 24 | 25 | // END OF ScriptCompleterModel::~ScriptCompleterModel() 26 | //============================================================================== 27 | 28 | void ScriptCompleterModel::setPluginsList(const VSPluginsList & a_pluginsList) 29 | { 30 | if(invisibleRootItem()->rowCount() < 1) 31 | setCoreName(DEFAULT_CORE_NAME); 32 | 33 | QStandardItem * pCoreItem = invisibleRootItem()->child(0, 0); 34 | pCoreItem->removeRows(0, pCoreItem->rowCount()); 35 | 36 | for(const VSData::Plugin & plugin : a_pluginsList) 37 | { 38 | QStandardItem * pPluginItem = new QStandardItem(plugin.pluginNamespace); 39 | pCoreItem->appendRow(pPluginItem); 40 | for(const VSData::Function & function : plugin.functions) 41 | { 42 | QStringList argumentsList; 43 | for(const VSData::FunctionArgument & argument : function.arguments) 44 | argumentsList << argument.name; 45 | QString signature = QString("%1(%2)").arg(function.name) 46 | .arg(argumentsList.join(", ")); 47 | 48 | QStandardItem * pFunctionItem = new QStandardItem(signature); 49 | pPluginItem->appendRow(pFunctionItem); 50 | } 51 | } 52 | } 53 | 54 | // END OF void ScriptCompleterModel::setPluginsList( 55 | // const VSPluginsList & a_pluginsList) 56 | //============================================================================== 57 | 58 | void ScriptCompleterModel::setCoreName(const QString & a_coreName) 59 | { 60 | QStandardItem * pRootItem = invisibleRootItem(); 61 | if(pRootItem->rowCount() == 0) 62 | { 63 | QStandardItem * pCoreItem = new QStandardItem(a_coreName); 64 | pRootItem->appendRow(pCoreItem); 65 | } 66 | else 67 | { 68 | QStandardItem * pCoreItem = pRootItem->child(0, 0); 69 | pCoreItem->setText(a_coreName); 70 | } 71 | } 72 | 73 | // END OF void ScriptCompleterModel::setCoreName(const QString & a_coreName) 74 | //============================================================================== 75 | -------------------------------------------------------------------------------- /common-src/frame_header_writers/frame_header_writer_null.cpp: -------------------------------------------------------------------------------- 1 | #include "frame_header_writer_null.h" 2 | 3 | //============================================================================== 4 | 5 | FrameHeaderWriterNull::FrameHeaderWriterNull(const VSAPI * a_cpVSAPI, 6 | const VSVideoInfo * a_cpVideoInfo, QObject * a_pParent) : 7 | FrameHeaderWriter(a_cpVSAPI, a_cpVideoInfo, a_pParent) 8 | { 9 | } 10 | 11 | // END OF FrameHeaderWriterNull::FrameHeaderWriterNull(const VSAPI * a_cpVSAPI, 12 | // const VSVideoInfo * a_cpVideoInfo, QObject * a_pParent) 13 | //============================================================================== 14 | 15 | bool FrameHeaderWriterNull::isCompatible() 16 | { 17 | Q_ASSERT(m_cpVideoInfo); 18 | if(!m_cpVideoInfo) 19 | return false; 20 | return true; 21 | } 22 | 23 | // END OF bool FrameHeaderWriterNull::isCompatible() 24 | //============================================================================== 25 | 26 | bool FrameHeaderWriterNull::needVideoHeader() 27 | { 28 | return false; 29 | } 30 | 31 | // END OF bool FrameHeaderWriterNull::needVideoHeader() 32 | //============================================================================== 33 | 34 | QByteArray FrameHeaderWriterNull::videoHeader(int a_totalFrames) 35 | { 36 | (void)a_totalFrames; 37 | return QByteArray(); 38 | } 39 | 40 | // END OF QByteArray FrameHeaderWriterNull::videoHeader(int a_totalFrames) 41 | //============================================================================== 42 | 43 | bool FrameHeaderWriterNull::needFramePrefix() 44 | { 45 | return false; 46 | } 47 | 48 | // END OF bool FrameHeaderWriterNull::needFramePrefix() 49 | //============================================================================== 50 | 51 | QByteArray FrameHeaderWriterNull::framePrefix(const VSFrameRef * a_cpFrameRef) 52 | { 53 | (void)a_cpFrameRef; 54 | return QByteArray(); 55 | } 56 | 57 | // END OF QByteArray FrameHeaderWriterNull::framePrefix( 58 | // const VSFrameRef * a_cpFrameRef) 59 | //============================================================================== 60 | 61 | bool FrameHeaderWriterNull::needFramePostfix() 62 | { 63 | return false; 64 | } 65 | 66 | // END OF bool FrameHeaderWriterNull::needFramePostfix() 67 | //============================================================================== 68 | 69 | QByteArray FrameHeaderWriterNull::framePostfix(const VSFrameRef * a_cpFrameRef) 70 | { 71 | (void)a_cpFrameRef; 72 | return QByteArray(); 73 | } 74 | 75 | // END OF QByteArray FrameHeaderWriterNull::framePostfix( 76 | // const VSFrameRef * a_cpFrameRef) 77 | //============================================================================== 78 | -------------------------------------------------------------------------------- /vsedit/src/settings/item_delegate_for_hotkey.cpp: -------------------------------------------------------------------------------- 1 | #include "item_delegate_for_hotkey.h" 2 | 3 | #include "clearable_key_sequence_editor.h" 4 | 5 | //============================================================================== 6 | 7 | ItemDelegateForHotkey::ItemDelegateForHotkey(QObject * a_pParent): 8 | QStyledItemDelegate(a_pParent) 9 | { 10 | 11 | } 12 | 13 | //============================================================================== 14 | 15 | ItemDelegateForHotkey::~ItemDelegateForHotkey() 16 | { 17 | 18 | } 19 | 20 | //============================================================================== 21 | 22 | QWidget * ItemDelegateForHotkey::createEditor(QWidget * a_pParent, 23 | const QStyleOptionViewItem & a_option, const QModelIndex & a_index) const 24 | { 25 | (void)a_option; 26 | (void)a_index; 27 | ClearableKeySequenceEditor * pEditor = 28 | new ClearableKeySequenceEditor(a_pParent); 29 | connect(pEditor, SIGNAL(editingFinished()), 30 | this, SLOT(slotCommitAndCloseEditor())); 31 | return pEditor; 32 | } 33 | 34 | //============================================================================== 35 | 36 | void ItemDelegateForHotkey::setEditorData(QWidget * a_pEditor, 37 | const QModelIndex & a_index) const 38 | { 39 | ClearableKeySequenceEditor * pEditor = 40 | static_cast(a_pEditor); 41 | QVariant newValue = a_index.model()->data(a_index, Qt::EditRole); 42 | pEditor->slotSetKeySequence(newValue.value()); 43 | } 44 | 45 | //============================================================================== 46 | 47 | void ItemDelegateForHotkey::updateEditorGeometry(QWidget * a_pEditor, 48 | const QStyleOptionViewItem & a_option, const QModelIndex & a_index) const 49 | { 50 | (void)a_option; 51 | (void)a_index; 52 | a_pEditor->setGeometry(a_option.rect); 53 | return; 54 | } 55 | 56 | //============================================================================== 57 | 58 | void ItemDelegateForHotkey::setModelData(QWidget * a_pEditor, 59 | QAbstractItemModel * a_model, const QModelIndex & a_index) const 60 | { 61 | ClearableKeySequenceEditor * pEditor = 62 | static_cast(a_pEditor); 63 | a_model->setData(a_index, pEditor->keySequence(), Qt::EditRole); 64 | return; 65 | } 66 | 67 | //============================================================================== 68 | 69 | void ItemDelegateForHotkey::slotCommitAndCloseEditor() 70 | { 71 | ClearableKeySequenceEditor * pEditor = 72 | qobject_cast(sender()); 73 | emit commitData(pEditor); 74 | emit closeEditor(pEditor); 75 | } 76 | 77 | //============================================================================== 78 | -------------------------------------------------------------------------------- /common-src/log/styled_log_view_core.cpp: -------------------------------------------------------------------------------- 1 | #include "styled_log_view_core.h" 2 | 3 | #include 4 | 5 | //============================================================================== 6 | 7 | const char LOG_STYLE_DEFAULT[] = "default"; 8 | const char LOG_STYLE_TITLE_DEFAULT[] = "Common message"; 9 | 10 | const char LE_IS_DIVIDER[] = "isDivider"; 11 | const char LE_TIME[] = "time"; 12 | const char LE_TEXT[] = "text"; 13 | const char LE_STYLE[] = "style"; 14 | 15 | //============================================================================== 16 | 17 | LogEntry::LogEntry(bool a_isDivider, const QString & a_text, 18 | const QString & a_style) : 19 | isDivider(a_isDivider) 20 | , time(QDateTime::currentDateTime()) 21 | , text(a_text) 22 | , style(a_style) 23 | { 24 | } 25 | 26 | // END OF LogEntry::LogEntry(bool a_isDivider, const QString & a_text, 27 | // const QString & a_style) 28 | //============================================================================== 29 | 30 | LogEntry::LogEntry(const QString & a_text, const QString & a_style) : 31 | isDivider(false) 32 | , time(QDateTime::currentDateTime()) 33 | , text(a_text) 34 | , style(a_style) 35 | { 36 | } 37 | 38 | // END OF LogEntry::LogEntry(const QString & a_text, const QString & a_style) 39 | //============================================================================== 40 | 41 | LogEntry LogEntry::divider() 42 | { 43 | return LogEntry(true, QString(), QString()); 44 | } 45 | 46 | // END OF LogEntry LogEntry::divider() 47 | //============================================================================== 48 | 49 | QJsonObject LogEntry::toJson() const 50 | { 51 | QJsonObject jsLogEntry; 52 | jsLogEntry[LE_IS_DIVIDER] = isDivider; 53 | jsLogEntry[LE_TIME] = time.toMSecsSinceEpoch(); 54 | if(isDivider) 55 | return jsLogEntry; 56 | jsLogEntry[LE_TEXT] = text; 57 | jsLogEntry[LE_STYLE] = style; 58 | return jsLogEntry; 59 | } 60 | 61 | // END OF QJsonObject LogEntry::toJson() const 62 | //============================================================================== 63 | 64 | LogEntry LogEntry::fromJson(const QJsonObject & a_object) 65 | { 66 | LogEntry entry; 67 | if(a_object.contains(LE_IS_DIVIDER)) 68 | entry.isDivider = a_object[LE_IS_DIVIDER].toBool(); 69 | if(a_object.contains(LE_TIME)) 70 | entry.time = QDateTime::fromMSecsSinceEpoch( 71 | a_object[LE_TIME].toVariant().toLongLong()); 72 | if(a_object.contains(LE_TEXT)) 73 | entry.text = a_object[LE_TEXT].toString(); 74 | if(a_object.contains(LE_STYLE)) 75 | entry.style = a_object[LE_STYLE].toString(); 76 | return entry; 77 | } 78 | 79 | // END OF LogEntry LogEntry::fromJson(const QJsonObject & a_object) 80 | //============================================================================== 81 | -------------------------------------------------------------------------------- /common-src/vapoursynth/vs_script_library.h: -------------------------------------------------------------------------------- 1 | #ifndef VS_SCRIPT_LIBRARY_H_INCLUDED 2 | #define VS_SCRIPT_LIBRARY_H_INCLUDED 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | class SettingsManagerCore; 10 | 11 | //============================================================================== 12 | 13 | typedef int (VS_CC *FNP_vssInit)(void); 14 | typedef const VSAPI * (VS_CC *FNP_vssGetVSApi)(void); 15 | typedef int (VS_CC *FNP_vssEvaluateScript)(VSScript ** a_ppScript, 16 | const char * a_scriptText, const char * a_scriptFilename, int a_flags); 17 | typedef const char * (VS_CC *FNP_vssGetError)(VSScript * a_pScript); 18 | typedef VSCore * (VS_CC *FNP_vssGetCore)(VSScript * a_pScript); 19 | typedef VSNodeRef * (VS_CC *FNP_vssGetOutput)(VSScript * a_pScript, 20 | int a_index); 21 | typedef void (VS_CC *FNP_vssFreeScript)(VSScript * a_pScript); 22 | typedef int (VS_CC *FNP_vssFinalize)(void); 23 | 24 | //============================================================================== 25 | 26 | class VSScriptLibrary : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | 32 | VSScriptLibrary(SettingsManagerCore * a_pSettingsManager, 33 | QObject * a_pParent = nullptr); 34 | 35 | virtual ~VSScriptLibrary(); 36 | 37 | bool initialize(); 38 | 39 | bool finalize(); 40 | 41 | bool isInitialized() const; 42 | 43 | const VSAPI * getVSAPI(); 44 | 45 | int evaluateScript(VSScript ** a_ppScript, const char * a_scriptText, 46 | const char * a_scriptFilename, int a_flags); 47 | 48 | const char * getError(VSScript * a_pScript); 49 | 50 | VSCore * getCore(VSScript * a_pScript); 51 | 52 | VSNodeRef * getOutput(VSScript * a_pScript, int a_index); 53 | 54 | bool freeScript(VSScript * a_pScript); 55 | 56 | signals: 57 | 58 | void signalWriteLogMessage(int a_messageType, const QString & a_message); 59 | 60 | private: 61 | 62 | bool initLibrary(); 63 | 64 | void freeLibrary(); 65 | 66 | void handleVSMessage(int a_messageType, const QString & a_message); 67 | 68 | friend void VS_CC vsMessageHandler(int a_msgType, 69 | const char * a_message, void * a_pUserData); 70 | 71 | SettingsManagerCore * m_pSettingsManager; 72 | 73 | QLibrary m_vsScriptLibrary; 74 | 75 | FNP_vssInit vssInit; 76 | FNP_vssGetVSApi vssGetVSApi; 77 | FNP_vssEvaluateScript vssEvaluateScript; 78 | FNP_vssGetError vssGetError; 79 | FNP_vssGetCore vssGetCore; 80 | FNP_vssGetOutput vssGetOutput; 81 | FNP_vssFreeScript vssFreeScript; 82 | FNP_vssFinalize vssFinalize; 83 | 84 | bool m_vsScriptInitialized; 85 | 86 | bool m_initialized; 87 | 88 | const VSAPI * m_cpVSAPI; 89 | }; 90 | 91 | //============================================================================== 92 | 93 | #endif // VS_SCRIPT_LIBRARY_H_INCLUDED 94 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: Build Windows 2 | 3 | on: 4 | push: 5 | workflow_dispatch: 6 | inputs: 7 | tag: 8 | description: 'which tag to upload to' 9 | default: '' 10 | 11 | jobs: 12 | build-windows: 13 | runs-on: windows-2019 14 | 15 | defaults: 16 | run: 17 | shell: cmd 18 | 19 | steps: 20 | - name: Checkout repo 21 | uses: actions/checkout@v2 22 | with: 23 | fetch-depth: 0 24 | 25 | - name: Setup MSVC 26 | uses: ilammy/msvc-dev-cmd@v1 27 | 28 | - name: Download VapourSynth headers 29 | shell: bash 30 | run: | 31 | curl -s -o vs.zip -L https://github.com/vapoursynth/vapoursynth/archive/refs/tags/R57.zip 32 | unzip -q vs.zip 33 | mv vapoursynth-*/ vapoursynth/ 34 | mkdir -p "C:/Program Files/VapourSynth/sdk/include/" 35 | mv vapoursynth/include "C:/Program Files/VapourSynth/sdk/include/vapoursynth" 36 | 37 | - name: Download Qt 38 | shell: cmd 39 | run: | 40 | curl -Lo d:\qt.7z https://github.com/AmusementClub/VapourSynth-Editor/releases/download/qt-6.2.3/qt-install.7z 41 | curl -Lo d:\jom.zip https://qt.mirror.constant.com/official_releases/jom/jom_1_1_3.zip 42 | mkdir d:\qt-install 43 | cd d:\qt-install 44 | 7z x ../qt.7z 45 | unzip -d bin d:\jom.zip 46 | 47 | - name: Build 48 | shell: cmd 49 | run: | 50 | set PATH=d:\qt-install\bin;%PATH% 51 | cd pro 52 | echo QMAKE_LFLAGS += '/LTCG' > local_quirks.pri 53 | qmake.exe -nocache "CONFIG+=release" single.pro 54 | jom.exe release -f Makefile 55 | 56 | - name: Set portable mode 57 | shell: bash 58 | run: | 59 | cd build 60 | mv release-64bit-msvc release 61 | cd release 62 | #echo "[common]" > vsedit.config 63 | #echo "vapoursynth_library_paths=.." >> vsedit.config 64 | 65 | - name: Upload 66 | uses: actions/upload-artifact@v2 67 | with: 68 | name: artifact 69 | path: build/release 70 | 71 | - name: Compress artifact for release 72 | if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' 73 | run: | 74 | cd build\release 75 | 7z a -t7z -mx=7 ../../vsedit-windows-x64.${{ github.event.inputs.tag }}.7z . 76 | 77 | - name: Release 78 | uses: softprops/action-gh-release@v1 79 | if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' 80 | with: 81 | tag_name: ${{ github.event.inputs.tag }} 82 | files: vsedit-windows-x64.${{ github.event.inputs.tag }}.7z 83 | fail_on_unmatched_files: true 84 | generate_release_notes: false 85 | prerelease: true 86 | -------------------------------------------------------------------------------- /vsedit-job-server/src/job_server.h: -------------------------------------------------------------------------------- 1 | #ifndef WEB_SOCKET_JOB_SERVER_H_INCLUDED 2 | #define WEB_SOCKET_JOB_SERVER_H_INCLUDED 3 | 4 | #include "../../common-src/settings/settings_manager_core.h" 5 | #include "../../common-src/log/styled_log_view_core.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | class SettingsManagerCore; 15 | class JobsManager; 16 | class QWebSocketServer; 17 | class QWebSocket; 18 | class QHostAddress; 19 | 20 | class JobServer : public QObject 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | 26 | JobServer(QObject * a_pParent = nullptr); 27 | virtual ~JobServer(); 28 | 29 | bool start(); 30 | 31 | signals: 32 | 33 | void finish(); 34 | 35 | private slots: 36 | 37 | void slotNewConnection(); 38 | void slotBinaryMessageReceived(const QByteArray & a_message); 39 | void slotTextMessageReceived(const QString & a_message); 40 | void slotSocketDisconnected(); 41 | 42 | void slotLogMessage(const QString & a_message, const QString & a_style); 43 | void slotJobCreated(const JobProperties & a_properties); 44 | void slotJobChanged(const JobProperties & a_properties); 45 | void slotJobStateChanged(const QUuid & a_jobID, JobState a_state); 46 | void slotJobProgressChanged(const QUuid & a_jobID, int a_progress, 47 | double a_fps); 48 | void slotJobStartTimeChanged(const QUuid & a_jobID, 49 | const QDateTime & a_time); 50 | void slotJobEndTimeChanged(const QUuid & a_jobID, 51 | const QDateTime & a_time); 52 | void slotJobDependenciesChanged(const QUuid & a_jobID, 53 | const std::vector & a_dependencies); 54 | void slotJobsSwapped(const QUuid & a_jobID1, const QUuid & a_jobID2); 55 | void slotJobsDeleted(const std::vector & a_ids); 56 | 57 | private: 58 | 59 | void processMessage(QWebSocket * a_pClient, const QString & a_message); 60 | QByteArray jobsInfoMessage() const; 61 | QByteArray completeLogMessage() const; 62 | 63 | void broadcastMessage(const QString & a_message, 64 | bool a_includeNonSubscribers = false, bool a_trustedOnly = false); 65 | void broadcastMessage(const char * a_message, 66 | bool a_includeNonSubscribers = false, bool a_trustedOnly = false); 67 | void broadcastMessage(const QByteArray & a_message, 68 | bool a_includeNonSubscribers = false, bool a_trustedOnly = false); 69 | 70 | bool trustedClientAddress(const QHostAddress & a_address); 71 | 72 | SettingsManagerCore * m_pSettingsManager; 73 | JobsManager * m_pJobsManager; 74 | QWebSocketServer * m_pWebSocketServer; 75 | 76 | std::vector m_logEntries; 77 | 78 | std::list m_clients; 79 | std::list m_subscribers; 80 | 81 | QStringList m_trustedClientsAddresses; 82 | }; 83 | 84 | #endif // WEB_SOCKET_JOB_SERVER_H_INCLUDED 85 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/connect_to_server_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ConnectToServerDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 462 10 | 67 11 | 12 | 13 | 14 | Connect to server 15 | 16 | 17 | 18 | :/link.png:/link.png 19 | 20 | 21 | 22 | 4 23 | 24 | 25 | 4 26 | 27 | 28 | 4 29 | 30 | 31 | 4 32 | 33 | 34 | 4 35 | 36 | 37 | 38 | 39 | Server address: 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 0 48 | 0 49 | 50 | 51 | 52 | Connect 53 | 54 | 55 | 56 | 57 | 58 | 59 | true 60 | 61 | 62 | QComboBox::InsertAtTop 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 0 71 | 0 72 | 73 | 74 | 75 | Cancel 76 | 77 | 78 | true 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /.github/workflows/qt.yml: -------------------------------------------------------------------------------- 1 | name: Build Qt 2 | 3 | on: 4 | push: 5 | workflow_dispatch: 6 | inputs: 7 | tag: 8 | description: 'which tag to upload to' 9 | default: '' 10 | 11 | jobs: 12 | build-windows: 13 | runs-on: windows-2019 14 | 15 | defaults: 16 | run: 17 | shell: cmd 18 | 19 | steps: 20 | - name: Setup MSVC 21 | uses: ilammy/msvc-dev-cmd@v1 22 | 23 | - name: Cache Qt 24 | id: cache-qt 25 | uses: actions/cache@v2 26 | with: 27 | path: d:/qt-install 28 | key: ${{ runner.os }}-qt6-static 29 | 30 | - name: Setup cmake 31 | uses: jwlawson/actions-setup-cmake@v1.9 32 | with: 33 | cmake-version: '3.22.1' 34 | 35 | - name: Setup Ninja 36 | uses: ashutoshvarma/setup-ninja@master 37 | 38 | - name: Download Qt 39 | shell: bash 40 | run: | 41 | curl -Lo qt.zip https://download.qt.io/archive/qt/6.2/6.2.2/single/qt-everywhere-src-6.2.2.zip 42 | unzip -q qt.zip 43 | mv qt-everywhere-src-6* qt-src 44 | 45 | - name: Build Qt 46 | shell: cmd 47 | run: | 48 | cmake --version 49 | ninja --version 50 | mkdir qt-build 51 | cd qt-build 52 | call ../qt-src/configure.bat --prefix=d:\qt-install -static -static-runtime -no-opengl -release -ltcg -qt-zlib -qt-sqlite -no-sql-odbc -qt-libpng -qt-libjpeg -skip qt3d -skip qtactiveqt -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtmultimedia -skip qtwayland -skip qtscxml -skip qtwebview -skip qtwebengine -skip qttranslations -skip qtlottie -skip qtmqtt -skip qtopcua -skip qtserialport -skip qtserialbus -skip qtvirtualkeyboard -skip qtwebchannel -skip qtpositioning -skip qtquick3d -skip qtsensors -skip qtcoap -skip qtnetworkauth -skip qtquicktimeline -skip qtremoteobjects -skip qtshadertools -feature-windeployqt -no-feature-linguist -no-feature-designer -no-feature-pixeltool -no-feature-assistant -no-feature-distancefieldgenerator -no-feature-qtattributionsscanner -no-feature-qtplugininfo -no-feature-macdeployqt -no-feature-qdbus -no-feature-qtdiag 53 | ninja install 54 | 55 | - name: Upload 56 | uses: actions/upload-artifact@v2 57 | with: 58 | name: qt6-static 59 | path: d:\qt-install 60 | retention-days: 1 61 | 62 | - name: Compress artifact for release 63 | if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' 64 | run: | 65 | cd d:\qt-install 66 | 7z a -t7z -mx=7 ../qt6-static.${{ github.event.inputs.tag }}.7z . 67 | 68 | - name: Release 69 | uses: softprops/action-gh-release@v1 70 | if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' 71 | with: 72 | tag_name: ${{ github.event.inputs.tag }} 73 | files: qt6-install.${{ github.event.inputs.tag }}.7z 74 | fail_on_unmatched_files: true 75 | generate_release_notes: false 76 | prerelease: true 77 | -------------------------------------------------------------------------------- /common-src/settings/settings_manager_core.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_MANAGER_CORE_H_INCLUDED 2 | #define SETTINGS_MANAGER_CORE_H_INCLUDED 3 | 4 | #include "settings_definitions_core.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | /// Base class that manages non-GUI related settings 11 | class SettingsManagerCore : public QObject 12 | { 13 | public: 14 | 15 | SettingsManagerCore(QObject * a_pParent); 16 | virtual ~SettingsManagerCore(); 17 | 18 | //---------------------------------------------------------------------- 19 | 20 | bool getPortableMode() const; 21 | 22 | bool setPortableMode(bool a_portableMod); 23 | 24 | //---------------------------------------------------------------------- 25 | 26 | QStringList getVapourSynthLibraryPaths() const; 27 | 28 | bool setVapourSynthLibraryPaths(const QStringList & a_pathsList); 29 | 30 | QStringList getVapourSynthPluginsPaths() const; 31 | 32 | bool setVapourSynthPluginsPaths(const QStringList & a_pathsList); 33 | 34 | ResamplingFilter getChromaResamplingFilter() const; 35 | 36 | bool setChromaResamplingFilter(ResamplingFilter a_filter); 37 | 38 | YuvMatrixCoefficients getYuvMatrixCoefficients() const; 39 | 40 | bool setYuvMatrixCoefficients(YuvMatrixCoefficients a_matrix); 41 | 42 | ChromaPlacement getChromaPlacement() const; 43 | 44 | bool setChromaPlacement(ChromaPlacement a_placement); 45 | 46 | double getBicubicFilterParameterB() const; 47 | 48 | bool setBicubicFilterParameterB(double a_parameterB); 49 | 50 | double getBicubicFilterParameterC() const; 51 | 52 | bool setBicubicFilterParameterC(double a_parameterC); 53 | 54 | int getLanczosFilterTaps() const; 55 | 56 | bool setLanczosFilterTaps(int a_taps); 57 | 58 | std::vector getAllEncodingPresets() const; 59 | 60 | EncodingPreset getEncodingPreset(const QString & a_name) const; 61 | 62 | bool saveEncodingPreset(const EncodingPreset & a_preset); 63 | 64 | bool deleteEncodingPreset(const QString & a_name); 65 | 66 | std::vector getJobs() const; 67 | 68 | bool setJobs(const std::vector & a_jobs); 69 | 70 | QStringList getRecentJobServers() const; 71 | 72 | bool setRecentJobServers(const QStringList & a_servers); 73 | 74 | QStringList getTrustedClientsAddresses() const; 75 | 76 | bool setTrustedClientsAddresses(const QStringList & a_addresses); 77 | 78 | protected: 79 | 80 | QVariant valueInGroup(const QString & a_group, const QString & a_key, 81 | const QVariant & a_defaultValue = QVariant()) const; 82 | 83 | bool setValueInGroup(const QString & a_group, const QString & a_key, 84 | const QVariant & a_value); 85 | 86 | bool deleteValueInGroup(const QString & a_group, const QString & a_key); 87 | 88 | QVariant value(const QString & a_key, const QVariant & a_defaultValue = 89 | QVariant()) const; 90 | 91 | bool setValue(const QString & a_key, const QVariant & a_value); 92 | 93 | QString m_settingsFilePath; 94 | }; 95 | 96 | #endif // SETTINGS_MANAGER_CORE_H_INCLUDED 97 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/jobs/job_state_delegate.cpp: -------------------------------------------------------------------------------- 1 | #include "job_state_delegate.h" 2 | 3 | #include "jobs_model.h" 4 | 5 | #include "../../../common-src/helpers.h" 6 | 7 | #include 8 | 9 | JobStateDelegate::JobStateDelegate(QObject * a_pParent) : 10 | QStyledItemDelegate(a_pParent) 11 | { 12 | } 13 | 14 | JobStateDelegate::~JobStateDelegate() 15 | { 16 | } 17 | 18 | void JobStateDelegate::paint(QPainter * a_pPainter, 19 | const QStyleOptionViewItem & a_option, const QModelIndex & a_index) const 20 | { 21 | a_pPainter->save(); 22 | const JobsModel * cpModel = 23 | qobject_cast(a_index.model()); 24 | Q_ASSERT(cpModel); 25 | Q_ASSERT(a_index.column() == JobsModel::STATE_COLUMN); 26 | JobProperties properties = cpModel->jobProperties(a_index.row()); 27 | JobState state = properties.jobState; 28 | QColor cellColor = jobStateColor(state, a_option); 29 | 30 | JobState noProgressBarStates[] = {JobState::Waiting, 31 | JobState::DependencyNotMet}; 32 | bool drawProgress = (properties.type == JobType::EncodeScriptCLI) && 33 | (!vsedit::contains(noProgressBarStates, state)); 34 | 35 | a_pPainter->setPen(cellColor); 36 | a_pPainter->setBrush(cellColor); 37 | 38 | QRect innerRect = a_option.rect; 39 | innerRect.setWidth(a_option.rect.width() - 1); 40 | innerRect.setHeight(a_option.rect.height() - 1); 41 | 42 | if(drawProgress) 43 | { 44 | int progressWidth = properties.framesProcessed * innerRect.width() / 45 | properties.framesTotal(); 46 | QRect progressRect = innerRect; 47 | progressRect.setWidth(progressWidth); 48 | a_pPainter->drawRect(progressRect); 49 | QRect blankRect = innerRect; 50 | blankRect.setWidth(innerRect.width() - progressWidth); 51 | blankRect.translate(progressWidth, 0); 52 | a_pPainter->setBrush(a_option.palette.color(QPalette::Base)); 53 | a_pPainter->drawRect(blankRect); 54 | } 55 | else 56 | a_pPainter->drawRect(innerRect); 57 | 58 | QString stateText = cpModel->data(a_index).toString(); 59 | if(drawProgress) 60 | { 61 | stateText += QString(" %1 / %2").arg(properties.framesProcessed) 62 | .arg(properties.framesTotal()); 63 | } 64 | 65 | a_pPainter->setPen(a_option.palette.color(QPalette::Text)); 66 | a_pPainter->setFont(a_option.font); 67 | a_pPainter->drawText(innerRect, Qt::AlignCenter | Qt::TextWordWrap, 68 | stateText); 69 | 70 | a_pPainter->restore(); 71 | } 72 | 73 | QColor JobStateDelegate::jobStateColor(JobState a_state, 74 | const QStyleOptionViewItem & a_option) const 75 | { 76 | switch(a_state) 77 | { 78 | case JobState::Aborted: 79 | case JobState::Failed: 80 | case JobState::DependencyNotMet: 81 | return QColor("#ffcccc"); 82 | case JobState::Aborting: 83 | case JobState::FailedCleanUp: 84 | return QColor("#ffeeee"); 85 | case JobState::Pausing: 86 | case JobState::Paused: 87 | return QColor("#fffddd"); 88 | case JobState::CompletedCleanUp: 89 | case JobState::Completed: 90 | return QColor("#ddffdd"); 91 | case JobState::Running: 92 | return QColor("#ddeeff"); 93 | default: 94 | return a_option.palette.color(QPalette::Base); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /common-src/jobs/job_variables.cpp: -------------------------------------------------------------------------------- 1 | #include "job_variables.h" 2 | 3 | #include 4 | 5 | //============================================================================== 6 | 7 | const QString JobVariables::TOKEN_WIDTH = "{w}"; 8 | const QString JobVariables::TOKEN_HEIGHT = "{h}"; 9 | const QString JobVariables::TOKEN_FPS_NUMERATOR = "{fpsn}"; 10 | const QString JobVariables::TOKEN_FPS_DENOMINATOR = "{fpsd}"; 11 | const QString JobVariables::TOKEN_FPS = "{fps}"; 12 | const QString JobVariables::TOKEN_BITDEPTH = "{bits}"; 13 | const QString JobVariables::TOKEN_SCRIPT_DIRECTORY = "{sd}"; 14 | const QString JobVariables::TOKEN_SCRIPT_NAME = "{sn}"; 15 | const QString JobVariables::TOKEN_FRAMES_NUMBER = "{f}"; 16 | const QString JobVariables::TOKEN_SUBSAMPLING = "{ss}"; 17 | 18 | //============================================================================== 19 | 20 | JobVariables::JobVariables() 21 | { 22 | fillVariables(); 23 | } 24 | 25 | // END OF JobVariables::JobVariables() 26 | //============================================================================== 27 | 28 | std::vector JobVariables::variables() const 29 | { 30 | std::vector cutVariables; 31 | for(const vsedit::VariableToken & variable : m_variables) 32 | { 33 | vsedit::VariableToken cutVariable = 34 | {variable.token, variable.description, std::function()}; 35 | cutVariables.push_back(cutVariable); 36 | } 37 | return cutVariables; 38 | } 39 | 40 | // END OF std::vector JobVariables::variables() const 41 | //============================================================================== 42 | 43 | void JobVariables::fillVariables() 44 | { 45 | m_variables = 46 | { 47 | {TOKEN_WIDTH, QObject::tr("video width"), 48 | std::function()}, 49 | {TOKEN_HEIGHT, QObject::tr("video height"), 50 | std::function()}, 51 | {TOKEN_FPS_NUMERATOR, QObject::tr("video framerate numerator"), 52 | std::function()}, 53 | {TOKEN_FPS_DENOMINATOR, QObject::tr("video framerate denominator"), 54 | std::function()}, 55 | {TOKEN_FPS, QObject::tr("video framerate as fraction"), 56 | std::function()}, 57 | {TOKEN_BITDEPTH, QObject::tr("video colour bitdepth"), 58 | std::function()}, 59 | {TOKEN_SCRIPT_DIRECTORY, QObject::tr("script directory"), 60 | std::function()}, 61 | {TOKEN_SCRIPT_NAME, QObject::tr("script name without extension"), 62 | std::function()}, 63 | {TOKEN_FRAMES_NUMBER, QObject::tr("total frames number"), 64 | std::function()}, 65 | {TOKEN_SUBSAMPLING, QObject::tr("subsampling string (like 420)"), 66 | std::function()}, 67 | }; 68 | 69 | std::sort(m_variables.begin(), m_variables.end(), 70 | [&](const vsedit::VariableToken & a_first, 71 | const vsedit::VariableToken & a_second) -> bool 72 | { 73 | return (a_first.token.length() > a_second.token.length()); 74 | }); 75 | } 76 | 77 | // END OF void JobVariables::fillVariables() 78 | //============================================================================== 79 | -------------------------------------------------------------------------------- /vsedit/src/script_status_bar_widget/script_status_bar_widget.cpp: -------------------------------------------------------------------------------- 1 | #include "script_status_bar_widget.h" 2 | 3 | #include "../../../common-src/helpers.h" 4 | 5 | #include 6 | 7 | //============================================================================== 8 | 9 | ScriptStatusBarWidget::ScriptStatusBarWidget(QWidget * a_pParent) : 10 | QWidget(a_pParent) 11 | , m_readyPixmap(":tick.png") 12 | , m_busyPixmap(":busy.png") 13 | { 14 | m_ui.setupUi(this); 15 | m_ui.colorPickerWidget->setVisible(false); 16 | m_ui.colorPickerIconLabel->setPixmap(QPixmap(":color_picker.png")); 17 | m_ui.colorPickerLabel->clear(); 18 | m_ui.scriptProcessorQueueLabel->clear(); 19 | m_ui.videoInfoLabel->clear(); 20 | 21 | m_ui.scriptProcessorQueueIconLabel->setPixmap(m_readyPixmap); 22 | setQueueState(0, 0, 0); 23 | } 24 | 25 | // END OF ScriptStatusBarWidget::ScriptStatusBarWidget(QWidget * a_pParent) 26 | //============================================================================== 27 | 28 | ScriptStatusBarWidget::~ScriptStatusBarWidget() 29 | { 30 | } 31 | 32 | // END OF ScriptStatusBarWidget::~ScriptStatusBarWidget() 33 | //============================================================================== 34 | 35 | bool ScriptStatusBarWidget::colorPickerVisible() const 36 | { 37 | return m_ui.colorPickerWidget->isVisible(); 38 | } 39 | 40 | // END OF bool ScriptStatusBarWidget::colorPickerVisible() const 41 | //============================================================================== 42 | 43 | void ScriptStatusBarWidget::setColorPickerVisible(bool a_visible) 44 | { 45 | m_ui.colorPickerWidget->setVisible(a_visible); 46 | } 47 | 48 | // END OF void ScriptStatusBarWidget::setColorPickerVisible(bool a_visible) 49 | //============================================================================== 50 | 51 | void ScriptStatusBarWidget::setColorPickerString(const QString & a_string) 52 | { 53 | m_ui.colorPickerLabel->setText(a_string); 54 | } 55 | 56 | // END OF void ScriptStatusBarWidget::setColorPickerString( 57 | // const QString & a_string) 58 | //============================================================================== 59 | 60 | void ScriptStatusBarWidget::setQueueState(size_t a_inQueue, size_t a_inProcess, 61 | size_t a_maxThreads) 62 | { 63 | if((a_inProcess + a_inQueue) > 0) 64 | m_ui.scriptProcessorQueueIconLabel->setPixmap(m_busyPixmap); 65 | else 66 | m_ui.scriptProcessorQueueIconLabel->setPixmap(m_readyPixmap); 67 | 68 | m_ui.scriptProcessorQueueLabel->setText( 69 | tr("Script processor queue: %1:%2(%3)") 70 | .arg(a_inQueue).arg(a_inProcess).arg(a_maxThreads)); 71 | } 72 | 73 | // END OF void ScriptStatusBarWidget::setQueueState(size_t a_inQueue, 74 | // size_t a_inProcess, size_t a_maxThreads) 75 | //============================================================================== 76 | 77 | void ScriptStatusBarWidget::setVideoInfo(const VSVideoInfo * a_cpVideoInfo) 78 | { 79 | QString infoString = vsedit::videoInfoString(a_cpVideoInfo); 80 | m_ui.videoInfoLabel->setText(infoString); 81 | } 82 | 83 | // END OF void ScriptStatusBarWidget::setVideoInfo( 84 | // const VSVideoInfo * a_cpVideoInfo) 85 | //============================================================================== 86 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "watcher_main_window.h" 2 | 3 | #include "../../common-src/log/vs_editor_log.h" 4 | #include "../../common-src/application_instance_file_guard/application_instance_file_guard.h" 5 | #include "../../common-src/ipc_defines.h" 6 | 7 | #include 8 | #include 9 | 10 | MainWindow * pMainWindow = nullptr; 11 | 12 | static void handleQtMessage(QtMsgType a_type, const QMessageLogContext & a_context, 13 | const QString & a_message) 14 | { 15 | QString prefix = "Qt debug"; 16 | QString style = LOG_STYLE_DEFAULT; 17 | 18 | switch(a_type) 19 | { 20 | case QtDebugMsg: 21 | prefix = "Qt debug"; 22 | style = LOG_STYLE_QT_DEBUG; 23 | break; 24 | #if(QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) 25 | case QtInfoMsg: 26 | prefix = "Qt info"; 27 | style = LOG_STYLE_QT_INFO; 28 | break; 29 | #endif 30 | case QtWarningMsg: 31 | prefix = "Qt warning"; 32 | style = LOG_STYLE_QT_WARNING; 33 | break; 34 | case QtCriticalMsg: 35 | prefix = "Qt critical"; 36 | style = LOG_STYLE_QT_CRITICAL; 37 | break; 38 | case QtFatalMsg: 39 | prefix = "Qt fatal"; 40 | style = LOG_STYLE_QT_FATAL; 41 | break; 42 | default: 43 | Q_ASSERT(false); 44 | } 45 | 46 | QString fullMessage = QString("%1: %2").arg(prefix).arg(a_message); 47 | 48 | QString fileString(a_context.file); 49 | QString lineString = QString::number(a_context.line); 50 | QString functionString(a_context.function); 51 | 52 | QString lineInfo = QString("\n(%1:%2").arg(fileString).arg(lineString); 53 | if(!functionString.isEmpty()) 54 | lineInfo += QString(", %1").arg(functionString); 55 | lineInfo += QString(")"); 56 | if(!fileString.isEmpty()) 57 | fullMessage += lineInfo; 58 | 59 | pMainWindow->slotWriteLogMessage(fullMessage, style); 60 | 61 | if(a_type == QtFatalMsg) 62 | abort(); 63 | } 64 | 65 | int main(int argc, char *argv[]) 66 | { 67 | QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar); 68 | #if (QT_VERSION_MAJOR < 6) 69 | QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); 70 | #endif 71 | QApplication application(argc, argv); 72 | application.setQuitOnLastWindowClosed(false); 73 | 74 | ApplicationInstanceFileGuard guard("vsedit_job_server_watcher_running"); 75 | if(!guard.isLocked()) 76 | { 77 | QLocalSocket socket; 78 | socket.connectToServer(JOB_SERVER_WATCHER_LOCAL_SERVER_NAME, 79 | QIODevice::WriteOnly); 80 | bool connected = socket.waitForConnected(5000); 81 | if(connected) 82 | { 83 | socket.write(WMSG_SHOW_WINDOW); 84 | socket.waitForBytesWritten(5000); 85 | } 86 | else 87 | qCritical("Couldn't start the server watcher."); 88 | return 1; 89 | } 90 | 91 | // Make text in message box selectable 92 | application.setStyleSheet( 93 | "QMessageBox { messagebox-text-interaction-flags: 5; }"); 94 | 95 | pMainWindow = new MainWindow(); 96 | qInstallMessageHandler(handleQtMessage); 97 | pMainWindow->showAndConnect(); 98 | int exitCode = application.exec(); 99 | 100 | delete pMainWindow; 101 | if(!guard.unlock()) 102 | qCritical("%s", guard.error().toLocal8Bit().data()); 103 | 104 | return exitCode; 105 | } 106 | -------------------------------------------------------------------------------- /common-src/application_instance_file_guard/application_instance_file_guard.cpp: -------------------------------------------------------------------------------- 1 | #include "application_instance_file_guard.h" 2 | 3 | #include 4 | #include 5 | 6 | #ifndef Q_OS_WIN 7 | #include 8 | #endif 9 | 10 | //============================================================================== 11 | 12 | ApplicationInstanceFileGuard::ApplicationInstanceFileGuard( 13 | const QString & a_fileName) 14 | { 15 | m_tempDir = 16 | QStandardPaths::writableLocation(QStandardPaths::TempLocation); 17 | if(!a_fileName.isEmpty()) 18 | lock(a_fileName); 19 | } 20 | 21 | //============================================================================== 22 | 23 | ApplicationInstanceFileGuard::~ApplicationInstanceFileGuard() 24 | { 25 | if(m_file.isOpen()) 26 | unlock(); 27 | } 28 | 29 | //============================================================================== 30 | 31 | bool ApplicationInstanceFileGuard::lock(const QString & a_fileName) 32 | { 33 | if(m_file.isOpen()) 34 | { 35 | if(a_fileName == m_fileName) 36 | return true; 37 | 38 | bool unlocked = unlock(); 39 | if(!unlocked) 40 | return false; 41 | } 42 | 43 | QString filePath = m_tempDir + "/" + a_fileName; 44 | 45 | #ifdef Q_OS_WIN 46 | if(QFile::exists(filePath)) 47 | { 48 | bool deleted = QFile::remove(filePath); 49 | if(!deleted) 50 | { 51 | m_error = QObject::tr("Could not delete file %1") 52 | .arg(filePath); 53 | return false; 54 | } 55 | } 56 | #endif 57 | 58 | m_fileName = a_fileName; 59 | m_file.setFileName(filePath); 60 | bool opened = m_file.open(QIODevice::ReadWrite); 61 | if(!opened) 62 | { 63 | m_error = QObject::tr("Could not open file %1").arg(filePath); 64 | return false; 65 | } 66 | 67 | #ifndef Q_OS_WIN 68 | int result = flock(m_file.handle(), LOCK_EX | LOCK_NB); 69 | if(result != 0) 70 | { 71 | m_error = QObject::tr("Could not lock file %1").arg(filePath); 72 | m_file.close(); 73 | return false; 74 | } 75 | #endif 76 | 77 | return true; 78 | } 79 | 80 | //============================================================================== 81 | 82 | bool ApplicationInstanceFileGuard::unlock() 83 | { 84 | if(m_file.isOpen()) 85 | { 86 | #ifndef Q_OS_WIN 87 | flock(m_file.handle(), LOCK_UN | LOCK_NB); 88 | #endif 89 | m_file.close(); 90 | } 91 | 92 | QString filePath = m_file.fileName(); 93 | 94 | if(filePath.isEmpty()) 95 | { 96 | m_error = QObject::tr("File name is empty."); 97 | return false; 98 | } 99 | 100 | if(!QFile::exists(filePath)) 101 | return true; 102 | 103 | bool deleted = QFile::remove(filePath); 104 | if(!deleted) 105 | m_error = QObject::tr("Could not delete file %1").arg(filePath); 106 | return deleted; 107 | } 108 | 109 | //============================================================================== 110 | 111 | bool ApplicationInstanceFileGuard::isLocked() const 112 | { 113 | return m_file.isOpen(); 114 | } 115 | 116 | //============================================================================== 117 | 118 | QString ApplicationInstanceFileGuard::error() const 119 | { 120 | return m_error; 121 | } 122 | 123 | //============================================================================== 124 | -------------------------------------------------------------------------------- /vsedit/src/vapoursynth/vs_script_processor_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef VS_SCRIPT_PROCESSOR_DIALOG_H_INCLUDED 2 | #define VS_SCRIPT_PROCESSOR_DIALOG_H_INCLUDED 3 | 4 | #include "../../../common-src/vapoursynth/vs_script_processor_structures.h" 5 | #include "../script_status_bar_widget/script_status_bar_widget.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class QCloseEvent; 12 | class QStatusBar; 13 | class QLabel; 14 | class SettingsManager; 15 | class VSScriptLibrary; 16 | class VapourSynthScriptProcessor; 17 | struct VSAPI; 18 | struct VSVideoInfo; 19 | struct VSFrameRef; 20 | 21 | class VSScriptProcessorDialog : public QDialog 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | 27 | VSScriptProcessorDialog(SettingsManager * a_pSettingsManager, 28 | VSScriptLibrary * a_pVSScriptLibrary, QWidget * a_pParent = nullptr, 29 | Qt::WindowFlags a_flags = 30 | Qt::Window 31 | | Qt::CustomizeWindowHint 32 | | Qt::WindowMinimizeButtonHint 33 | | Qt::WindowMaximizeButtonHint 34 | | Qt::WindowCloseButtonHint); 35 | 36 | virtual ~VSScriptProcessorDialog(); 37 | 38 | virtual bool initialize(const QString & a_script, 39 | const QString & a_scriptName); 40 | 41 | virtual bool busy(int a_outputIndex = 0) const; 42 | 43 | virtual const QString & script() const; 44 | 45 | virtual const QString & scriptName() const; 46 | 47 | virtual void setScriptName(const QString & a_scriptName); 48 | 49 | protected slots: 50 | 51 | virtual void slotWriteLogMessage(int a_messageType, 52 | const QString & a_message); 53 | 54 | virtual void slotFrameQueueStateChanged(size_t a_inQueue, 55 | size_t a_inProcess, size_t a_maxThreads); 56 | 57 | virtual void slotScriptProcessorFinalized(); 58 | 59 | virtual void slotReceiveFrame(int a_frameNumber, int a_outputIndex, 60 | const VSFrameRef * a_cpOutputFrameRef, 61 | const VSFrameRef * a_cpPreviewFrameRef) = 0; 62 | 63 | virtual void slotFrameRequestDiscarded(int a_frameNumber, 64 | int a_outputIndex, const QString & a_reason) = 0; 65 | 66 | signals: 67 | 68 | void signalWriteLogMessage(int a_messageType, 69 | const QString & a_message); 70 | 71 | protected: 72 | 73 | virtual void closeEvent(QCloseEvent * a_pEvent) override; 74 | 75 | virtual void stopAndCleanUp(); 76 | 77 | virtual void clearFramesCache(); 78 | 79 | /// Adds status bar to the dialog. 80 | /// Relies on dialog having a layout. 81 | /// Call in derived class after GUI is created. 82 | virtual void createStatusBar(); 83 | 84 | SettingsManager * m_pSettingsManager; 85 | 86 | VSScriptLibrary * m_pVSScriptLibrary; 87 | 88 | VapourSynthScriptProcessor * m_pVapourSynthScriptProcessor; 89 | 90 | const VSAPI * m_cpVSAPI; 91 | 92 | const VSVideoInfo * m_cpVideoInfo[10]; 93 | 94 | size_t m_framesInQueue[10]; 95 | size_t m_framesInProcess[10]; 96 | size_t m_maxThreads; 97 | 98 | int m_outputIndex; 99 | 100 | bool m_wantToFinalize; 101 | bool m_wantToClose; 102 | 103 | QStatusBar * m_pStatusBar; 104 | ScriptStatusBarWidget * m_pStatusBarWidget; 105 | 106 | QPixmap m_readyPixmap; 107 | QPixmap m_busyPixmap; 108 | QPixmap m_errorPixmap; 109 | 110 | std::list m_framesCache[10]; 111 | size_t m_cachedFramesLimit; 112 | }; 113 | 114 | #endif // VS_SCRIPT_PROCESSOR_DIALOG_H_INCLUDED 115 | -------------------------------------------------------------------------------- /vsedit/src/main_window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 847 10 | 721 11 | 12 | 13 | 14 | VapourSynth Editor 15 | 16 | 17 | 18 | 19 | 0 20 | 21 | 22 | 0 23 | 24 | 25 | 0 26 | 27 | 28 | 0 29 | 30 | 31 | 0 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 0 42 | 0 43 | 847 44 | 21 45 | 46 | 47 | 48 | 49 | 50 | 51 | QDockWidget::NoDockWidgetFeatures 52 | 53 | 54 | Qt::BottomDockWidgetArea 55 | 56 | 57 | Log 58 | 59 | 60 | 8 61 | 62 | 63 | 64 | 65 | 0 66 | 67 | 68 | 0 69 | 70 | 71 | 0 72 | 73 | 74 | 0 75 | 76 | 77 | 0 78 | 79 | 80 | 81 | 82 | Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | ScriptEditor 93 | QPlainTextEdit 94 |
../../src/script_editor/script_editor.h
95 |
96 | 97 | VSEditorLog 98 | QTextEdit 99 |
../../common-src/log/vs_editor_log.h
100 |
101 |
102 | 103 | 104 |
105 | -------------------------------------------------------------------------------- /common-src/vapoursynth/vs_pack_rgb.cpp: -------------------------------------------------------------------------------- 1 | #include "vs_pack_rgb.h" 2 | 3 | struct packData 4 | { 5 | VSNodeRef *node = nullptr; 6 | const VSVideoInfo *vi = nullptr; 7 | enum p2p_packing packing_fmt; 8 | }; 9 | 10 | void VS_CC packInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) 11 | { 12 | packData *d = reinterpret_cast(*instanceData); 13 | VSVideoInfo new_vi = (VSVideoInfo) * (d->vi); 14 | new_vi.format = vsapi->registerFormat(cmGray, stInteger, 8, 0, 0, core); 15 | new_vi.width = d->vi->width * 4; 16 | new_vi.height = d->vi->height; 17 | vsapi->setVideoInfo(&new_vi, 1, node); 18 | } 19 | 20 | const VSFrameRef * VS_CC packGetFrame(int n, int activationReason, void **instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi) 21 | { 22 | packData *d = reinterpret_cast(*instanceData); 23 | 24 | if (activationReason == arInitial) 25 | { 26 | vsapi->requestFrameFilter(n, d->node, frameCtx); 27 | } 28 | else if (activationReason == arAllFramesReady) 29 | { 30 | const VSFrameRef *src_frame = vsapi->getFrameFilter(n, d->node, frameCtx); 31 | int width = vsapi->getFrameWidth(src_frame, 0); 32 | int height = vsapi->getFrameHeight(src_frame, 0); 33 | const VSFormat *dstfmt = vsapi->registerFormat(cmGray, stInteger, 8, 0, 0, core); 34 | VSFrameRef *dst_frame = vsapi->newVideoFrame(dstfmt, width * 4, height, nullptr, core); 35 | 36 | p2p_buffer_param p = {}; 37 | p.width = width; 38 | p.height = height; 39 | p.packing = d->packing_fmt; 40 | for (int plane = 0; plane < 3; ++plane) 41 | { 42 | p.src[plane] = vsapi->getReadPtr(src_frame, plane); 43 | p.src_stride[plane] = vsapi->getStride(src_frame, plane); 44 | } 45 | p.dst[0] = vsapi->getWritePtr(dst_frame, 0); 46 | p.dst_stride[0] = vsapi->getStride(dst_frame, 0); 47 | p2p_pack_frame(&p, P2P_ALPHA_SET_ONE); 48 | 49 | VSMap *props = vsapi->getFramePropsRW(dst_frame); 50 | vsapi->propSetInt(props, "PackingFormat", static_cast(d->packing_fmt), paReplace); 51 | vsapi->freeFrame(src_frame); 52 | return dst_frame; 53 | } 54 | return nullptr; 55 | } 56 | 57 | void VS_CC packFree(void *instanceData, VSCore *core, const VSAPI *vsapi) 58 | { 59 | packData *d = reinterpret_cast(instanceData); 60 | vsapi->freeNode(d->node); 61 | delete d; 62 | } 63 | 64 | void VS_CC packCreateRGB24(const VSMap *in, VSMap *out, VSCore *core, const VSAPI *vsapi) 65 | { 66 | packData d; 67 | d.node = vsapi->propGetNode(in, "clip", 0, nullptr); 68 | d.vi = vsapi->getVideoInfo(d.node); 69 | d.packing_fmt = p2p_argb32; 70 | packData *data = new packData(d); 71 | vsapi->createFilter(in, out, "PackRGB24", packInit, packGetFrame, packFree, fmParallel, 0, data, core); 72 | } 73 | 74 | void VS_CC packCreateRGB30(const VSMap *in, VSMap *out, VSCore *core, const VSAPI *vsapi) 75 | { 76 | packData d; 77 | d.node = vsapi->propGetNode(in, "clip", 0, nullptr); 78 | d.vi = vsapi->getVideoInfo(d.node); 79 | d.packing_fmt = p2p_rgb30; 80 | packData *data = new packData(d); 81 | vsapi->createFilter(in, out, "PackRGB30", packInit, packGetFrame, packFree, fmParallel, 0, data, core); 82 | } 83 | -------------------------------------------------------------------------------- /vsedit-job-server/src/jobs/jobs_manager.h: -------------------------------------------------------------------------------- 1 | #ifndef JOBS_MANAGER_H_INCLUDED 2 | #define JOBS_MANAGER_H_INCLUDED 3 | 4 | #include "../../../common-src/jobs/job.h" 5 | #include "job_definitions.h" 6 | #include "../../../common-src/log/vs_editor_log_definitions.h" 7 | 8 | #include 9 | #include 10 | 11 | class SettingsManagerCore; 12 | class VSScriptLibrary; 13 | 14 | class JobsManager : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | JobsManager(SettingsManagerCore * a_pSettingsManager, 21 | QObject * a_pParent = nullptr); 22 | virtual ~JobsManager(); 23 | 24 | std::vector jobsProperties() const; 25 | 26 | int createJob(const JobProperties & a_jobProperties = JobProperties()); 27 | 28 | bool swapJobs(const QUuid & a_jobID1, const QUuid & a_jobID2); 29 | 30 | bool setJobState(const QUuid & a_jobID, JobState a_state); 31 | bool setJobDependsOnIds(const QUuid & a_jobID, 32 | const std::vector & a_dependencies); 33 | bool changeJob(const JobProperties & a_jobProperties); 34 | 35 | bool loadJobs(); 36 | bool saveJobs(); 37 | 38 | bool hasActiveJobs(); 39 | 40 | void startWaitingJobs(); 41 | void abortActiveJobs(); 42 | void pauseActiveJobs(); 43 | void resumePausedJobs(); 44 | void resetJobs(const std::vector & a_ids); 45 | void deleteJobs(const std::vector & a_ids); 46 | 47 | signals: 48 | 49 | void signalLogMessage(const QString & a_message, 50 | const QString & a_style = LOG_STYLE_DEFAULT); 51 | void signalJobCreated(const JobProperties & a_properties); 52 | void signalJobChanged(const JobProperties & a_properties); 53 | void signalJobStateChanged(const QUuid & a_jobID, JobState a_state); 54 | void signalJobProgressChanged(const QUuid & a_jobID, int a_progress, 55 | double a_fps); 56 | void signalJobStartTimeChanged(const QUuid & a_jobID, 57 | const QDateTime & a_time); 58 | void signalJobEndTimeChanged(const QUuid & a_jobID, 59 | const QDateTime & a_time); 60 | void signalJobDependenciesChanged(const QUuid & a_jobID, 61 | const std::vector & a_dependencies); 62 | void signalJobsSwapped(const QUuid & a_jobID1, const QUuid & a_jobID2); 63 | void signalJobsDeleted(const std::vector & a_ids); 64 | 65 | private slots: 66 | 67 | void slotLogMessage(const QString & a_message, 68 | const QString & a_style = LOG_STYLE_DEFAULT); 69 | void slotLogMessage(int a_type, const QString & a_message); 70 | 71 | void slotJobPropertiesChanged(); 72 | void slotJobStateChanged(JobState a_newState, JobState a_oldState); 73 | void slotJobProgressChanged(); 74 | void slotJobStartTimeChanged(); 75 | void slotJobEndTimeChanged(); 76 | 77 | private: 78 | 79 | enum class DependenciesState 80 | { 81 | Incomplete, 82 | Complete, 83 | Failed, 84 | }; 85 | 86 | bool canModifyJob(int a_index) const; 87 | 88 | int indexOfJob(const QUuid & a_uuid) const; 89 | 90 | void clearJobs(); 91 | 92 | bool checkCanModifyJobAndNotify(int a_index); 93 | 94 | DependenciesState dependenciesState(int a_index); 95 | 96 | void connectJob(vsedit::Job * a_pJob); 97 | 98 | void startFirstReadyJob(int a_fromIndex = 0); 99 | 100 | std::vector m_tickets; 101 | 102 | SettingsManagerCore * m_pSettingsManager; 103 | VSScriptLibrary * m_pVSScriptLibrary; 104 | }; 105 | 106 | #endif // JOBS_MANAGER_H_INCLUDED 107 | -------------------------------------------------------------------------------- /common-src/helpers.h: -------------------------------------------------------------------------------- 1 | #ifndef HELPERS_H_INCLUDED 2 | #define HELPERS_H_INCLUDED 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace vsedit 18 | { 19 | struct VariableToken 20 | { 21 | QString token; 22 | QString description; 23 | std::function evaluate; 24 | }; 25 | 26 | QString timeToString(double a_seconds, bool a_fullFormat = false); 27 | 28 | int mod(int a_value); 29 | 30 | QString videoInfoString(const VSVideoInfo * a_cpVideoInfo); 31 | 32 | double qtimeToSeconds(const QTime & a_qtime); 33 | 34 | QTime secondsToQTime(double a_seconds); 35 | 36 | void wait(int a_msec); 37 | 38 | QString subsamplingString(int a_subsamplingW, int a_subsamplingH); 39 | 40 | QString subsamplingString(const VSFormat * a_cpFormat); 41 | 42 | QString resolvePathFromApplication(const QString & a_relativePath); 43 | 44 | QByteArray jsonMessage(const QString & a_command, 45 | const QJsonObject & a_jsonObject); 46 | QByteArray jsonMessage(const QString & a_command, 47 | const QJsonArray & a_jsonArray); 48 | QByteArray jsonMessage(const QString & a_command, 49 | const QJsonDocument & a_jsonDocument); 50 | 51 | template 52 | void clamp(T1& a_value, const T2& a_low, const T3& a_high) 53 | { 54 | Q_ASSERT(a_high > a_low); 55 | if(a_value < a_low) 56 | a_value = a_low; 57 | else if(a_value > a_high) 58 | a_value = a_high; 59 | } 60 | 61 | template 62 | bool contains(const Container_T & a_container, const Value_T & a_value) 63 | { 64 | return (std::find(std::begin(a_container), std::end(a_container), 65 | a_value) != std::end(a_container)); 66 | } 67 | 68 | template 69 | T roundUp(T a_number, T a_multiple) 70 | { 71 | if(a_multiple == 0) 72 | return a_number; 73 | 74 | T remainder = a_number % a_multiple; 75 | if(remainder == 0) 76 | return a_number; 77 | 78 | return a_number + a_multiple - remainder; 79 | } 80 | 81 | template 82 | QByteArray toByteArray(const T & a_data) 83 | { 84 | QByteArray buf; 85 | QDataStream stream(&buf, QIODevice::WriteOnly); 86 | stream << a_data; 87 | return buf; 88 | } 89 | 90 | template 91 | T fromByteArray(const QByteArray & a_array) 92 | { 93 | QDataStream stream(a_array); 94 | T data; 95 | stream >> data; 96 | return data; 97 | } 98 | 99 | //------------------------------------------------------------------------------ 100 | // Half to single precision float conversion 101 | // by Fabian "ryg" Giesen. 102 | 103 | union FP32 104 | { 105 | uint32_t u; 106 | float f; 107 | struct 108 | { 109 | unsigned int Mantissa : 23; 110 | unsigned int Exponent : 8; 111 | unsigned int Sign : 1; 112 | } parts; 113 | }; 114 | 115 | union FP16 116 | { 117 | uint16_t u; 118 | struct 119 | { 120 | unsigned int Mantissa : 10; 121 | unsigned int Exponent : 5; 122 | unsigned int Sign : 1; 123 | } parts; 124 | }; 125 | 126 | FP32 halfToSingle(FP16 a_half); 127 | 128 | //------------------------------------------------------------------------------ 129 | 130 | } 131 | 132 | #endif // HELPERS_H_INCLUDED 133 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/trusted_clients_addresses_dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "trusted_clients_addresses_dialog.h" 2 | 3 | #include 4 | 5 | //============================================================================== 6 | 7 | TrustedClientsAddressesDialog::TrustedClientsAddressesDialog( 8 | QWidget * a_pParent) : QDialog(a_pParent) 9 | { 10 | m_ui.setupUi(this); 11 | 12 | connect(m_ui.addButton, &QToolButton::clicked, 13 | this, &TrustedClientsAddressesDialog::slotAddButtonClicked); 14 | connect(m_ui.removeButton, &QToolButton::clicked, 15 | this, &TrustedClientsAddressesDialog::slotRemoveButtonClicked); 16 | connect(m_ui.okButton, &QPushButton::clicked, 17 | this, &TrustedClientsAddressesDialog::accept); 18 | connect(m_ui.cancelButton, &QPushButton::clicked, 19 | this, &TrustedClientsAddressesDialog::reject); 20 | } 21 | 22 | // END OF TrustedClientsAddressesDialog::TrustedClientsAddressesDialog( 23 | // QWidget * a_pParent) 24 | //============================================================================== 25 | 26 | TrustedClientsAddressesDialog::~TrustedClientsAddressesDialog() 27 | { 28 | } 29 | 30 | // END OF TrustedClientsAddressesDialog::~TrustedClientsAddressesDialog() 31 | //============================================================================== 32 | 33 | int TrustedClientsAddressesDialog::call(const QStringList & a_addresses) 34 | { 35 | m_ui.addressesList->clear(); 36 | 37 | QStringList clientAddresses = a_addresses; 38 | clientAddresses.removeDuplicates(); 39 | 40 | for(const QString & address : clientAddresses) 41 | checkAndAddAddress(address); 42 | 43 | return exec(); 44 | } 45 | 46 | // END OF int TrustedClientsAddressesDialog::call( 47 | // const QStringList & a_addresses) 48 | //============================================================================== 49 | 50 | QStringList TrustedClientsAddressesDialog::addresses() const 51 | { 52 | QStringList clientAddresses; 53 | for(int i = 0; i < m_ui.addressesList->count(); ++i) 54 | clientAddresses << m_ui.addressesList->item(i)->text(); 55 | return clientAddresses; 56 | } 57 | 58 | // END OF QStringList TrustedClientsAddressesDialog::addresses() const 59 | //============================================================================== 60 | 61 | void TrustedClientsAddressesDialog::slotAddButtonClicked() 62 | { 63 | checkAndAddAddress(m_ui.addressEdit->text()); 64 | } 65 | 66 | // END OF void TrustedClientsAddressesDialog::slotAddButtonClicked() 67 | //============================================================================== 68 | 69 | void TrustedClientsAddressesDialog::slotRemoveButtonClicked() 70 | { 71 | QList items = m_ui.addressesList->selectedItems(); 72 | for(QListWidgetItem * pItem : items) 73 | delete pItem; 74 | } 75 | 76 | // END OF void TrustedClientsAddressesDialog::slotRemoveButtonClicked() 77 | //============================================================================== 78 | 79 | void TrustedClientsAddressesDialog::checkAndAddAddress( 80 | const QString & a_address) 81 | { 82 | QHostAddress hostAddress(a_address); 83 | if(hostAddress.isLoopback() || (hostAddress.protocol() == 84 | QAbstractSocket::UnknownNetworkLayerProtocol)) 85 | return; 86 | m_ui.addressesList->addItem(a_address); 87 | m_ui.addressesList->sortItems(); 88 | } 89 | 90 | // END OF void TrustedClientsAddressesDialog::checkAndAddAddress( 91 | // const QString & a_address) 92 | //============================================================================== 93 | -------------------------------------------------------------------------------- /vsedit/src/job_server_watcher_socket.cpp: -------------------------------------------------------------------------------- 1 | #include "job_server_watcher_socket.h" 2 | 3 | #include "../../common-src/helpers.h" 4 | #include "../../common-src/ipc_defines.h" 5 | #include "../../common-src/log/vs_editor_log_definitions.h" 6 | 7 | #include 8 | 9 | //============================================================================== 10 | 11 | JobServerWatcherSocket::JobServerWatcherSocket(QObject * a_pParent): 12 | QObject(a_pParent) 13 | , m_pSocket(nullptr) 14 | { 15 | } 16 | 17 | // END OF JobServerWatcherSocket::JobServerWatcherSocket(QObject * a_pParent) 18 | //============================================================================== 19 | 20 | JobServerWatcherSocket::~JobServerWatcherSocket() 21 | { 22 | } 23 | 24 | // END OF JobServerWatcherSocket::~JobServerWatcherSocket() 25 | //============================================================================== 26 | 27 | bool JobServerWatcherSocket::sendMessage(const QByteArray & a_data) 28 | { 29 | bool connected = connectToJobServerWatcher(); 30 | if(!connected) 31 | return false; 32 | 33 | m_pSocket->write(a_data); 34 | return true; 35 | } 36 | 37 | // END OF bool JobServerWatcherSocket::sendMessage(const QByteArray & a_data) 38 | //============================================================================== 39 | 40 | bool JobServerWatcherSocket::connectToJobServerWatcher() 41 | { 42 | // In Linux QLocalSocket wouldn't reconnect once disconnected. 43 | // So we recreate it before each connection attempt. 44 | resetSocket(); 45 | 46 | // Must connect in Read/Write mode, or named pipe won't disconnect. 47 | const QIODevice::OpenMode openMode = QIODevice::ReadWrite; 48 | 49 | m_pSocket->connectToServer(openMode); 50 | bool connected = m_pSocket->waitForConnected(1000); 51 | if(connected) 52 | return true; 53 | 54 | QString watcherPath = vsedit::resolvePathFromApplication( 55 | #ifdef SINGLE_EXE 56 | "./vsedit" 57 | #else 58 | "./vsedit-job-server-watcher" 59 | #endif 60 | ); 61 | QString thisDir = vsedit::resolvePathFromApplication("."); 62 | QProcess watcherProcess; 63 | 64 | #ifdef SINGLE_EXE 65 | QStringList arguments; 66 | arguments << "--job-watcher"; 67 | #endif 68 | 69 | bool started = watcherProcess.startDetached(watcherPath, arguments, 70 | thisDir); 71 | if(!started) 72 | { 73 | emit signalWriteLogMessage(tr("Could not start " 74 | "job server watcher."), LOG_STYLE_ERROR); 75 | return false; 76 | } 77 | 78 | for(int i = 0; i < 10; ++i) 79 | { 80 | resetSocket(); 81 | m_pSocket->connectToServer(openMode); 82 | connected = m_pSocket->waitForConnected(1000); 83 | if(connected) 84 | break; 85 | vsedit::wait(1000); 86 | } 87 | 88 | if(!connected) 89 | { 90 | emit signalWriteLogMessage(tr("Started job server watcher, " 91 | "but could not connect."), LOG_STYLE_ERROR); 92 | return false; 93 | } 94 | 95 | return true; 96 | } 97 | 98 | // END OF bool JobServerWatcherSocket::connectToJobServerWatcher() 99 | //============================================================================== 100 | 101 | void JobServerWatcherSocket::resetSocket() 102 | { 103 | if(m_pSocket) 104 | delete m_pSocket; 105 | 106 | m_pSocket = new QLocalSocket(this); 107 | m_pSocket->setServerName(JOB_SERVER_WATCHER_LOCAL_SERVER_NAME); 108 | } 109 | 110 | // END OF void JobServerWatcherSocket::resetSocket() 111 | //============================================================================== 112 | -------------------------------------------------------------------------------- /common-src/timeline_slider/timeline_slider.h: -------------------------------------------------------------------------------- 1 | #ifndef TIMELINESLIDER_H 2 | #define TIMELINESLIDER_H 3 | 4 | #include 5 | #include 6 | 7 | class QKeyEvent; 8 | class QMouseEvent; 9 | class QPaintEvent; 10 | class QWheelEvent; 11 | 12 | class TimeLineSlider : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | 18 | TimeLineSlider(QWidget * a_pParent = nullptr); 19 | 20 | virtual ~TimeLineSlider(); 21 | 22 | enum DisplayMode 23 | { 24 | Time, 25 | Frames, 26 | }; 27 | 28 | enum ColorRole 29 | { 30 | SlideLine, 31 | ActiveFrame, 32 | InactiveFrame, 33 | CurrentFramePointer, 34 | SlidingPointer, 35 | Bookmark, 36 | }; 37 | 38 | int frame() const; 39 | 40 | void setFrame(int a_frame); 41 | 42 | void setFramesNumber(int a_framesNumber); 43 | 44 | void setFPS(double a_fps); 45 | 46 | DisplayMode displayMode() const; 47 | 48 | void setDisplayMode(DisplayMode a_displayMode); 49 | 50 | void setBigStep(int a_bigStep); 51 | 52 | void setLabelsFont(const QFont & a_font); 53 | void setColor(ColorRole a_role, const QColor & a_color); 54 | 55 | void addBookmark(int a_bookmark); 56 | void removeBookmark(int a_bookmark); 57 | std::set bookmarks() const; 58 | void setBookmarks(const std::set & a_bookmarks); 59 | void clearBookmarks(); 60 | int getClosestBookmark(int a_frame) const; 61 | 62 | public slots: 63 | 64 | void slotStepUp(); 65 | void slotStepDown(); 66 | void slotBigStepUp(); 67 | void slotBigStepDown(); 68 | void slotStepBy(int a_step); 69 | void slotStepBySeconds(double a_seconds); 70 | 71 | void slotBookmarkCurrentFrame(); 72 | void slotUnbookmarkCurrentFrame(); 73 | void slotGoToPreviousBookmark(); 74 | void slotGoToNextBookmark(); 75 | 76 | signals: 77 | 78 | void signalSliderMoved(int a_frame); 79 | 80 | void signalFrameChanged(int a_frame); 81 | 82 | void signalSliderPressed(); 83 | void signalSliderReleased(); 84 | 85 | protected: 86 | 87 | void keyPressEvent(QKeyEvent * a_pEvent); 88 | 89 | void mouseMoveEvent(QMouseEvent * a_pEvent); 90 | 91 | void mousePressEvent(QMouseEvent * a_pEvent); 92 | 93 | void mouseReleaseEvent(QMouseEvent * a_pEvent); 94 | 95 | void paintEvent(QPaintEvent * a_pEvent); 96 | 97 | void wheelEvent(QWheelEvent * a_pEvent); 98 | 99 | private: 100 | 101 | int slideLineInnerWidth() const; 102 | 103 | int frameToPos(int a_frame) const; 104 | 105 | int posToFrame(int a_pos) const; 106 | 107 | QRect slideLineRect() const; 108 | 109 | QRect slideLineActiveRect() const; 110 | 111 | void recalculateMinimumSize(); 112 | 113 | void setPointerAtFrame(const QMouseEvent * a_pEvent); 114 | 115 | int m_maxFrame; 116 | double m_fps; 117 | 118 | int m_currentFrame; 119 | int m_pointerAtFrame; 120 | 121 | DisplayMode m_displayMode; 122 | 123 | int m_bigStep; 124 | 125 | int m_sideMargin; 126 | int m_bottomMargin; 127 | int m_slideLineHeight; 128 | int m_slideLineFrameWidth; 129 | int m_slideLineTicksSpacing; 130 | int m_shortTickHeight; 131 | int m_mediumTickHeight; 132 | int m_longTickHeight; 133 | int m_tickTextSpacing; 134 | int m_textHeight; 135 | int m_topMargin; 136 | int m_minimumTicksSpacing; 137 | 138 | bool m_sliderPressed; 139 | 140 | QFont m_labelsFont; 141 | QColor m_slideLineColor; 142 | QColor m_activeFrameColor; 143 | QColor m_inactiveFrameColor; 144 | QColor m_currentFramePointerColor; 145 | QColor m_slidingPointerColor; 146 | QColor m_bookmarkColor; 147 | 148 | std::set m_bookmarks; 149 | }; 150 | 151 | #endif // TIMELINESLIDER_H 152 | -------------------------------------------------------------------------------- /common-src/vapoursynth/vapoursynth_script_processor.h: -------------------------------------------------------------------------------- 1 | #ifndef VAPOURSYNTHSCRIPTPROCESSOR_H 2 | #define VAPOURSYNTHSCRIPTPROCESSOR_H 3 | 4 | #include "vs_script_processor_structures.h" 5 | #include "../settings/settings_manager_core.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class VSScriptLibrary; 13 | 14 | //============================================================================== 15 | 16 | class VapourSynthScriptProcessor : public QObject 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | 22 | VapourSynthScriptProcessor(SettingsManagerCore * a_pSettingsManager, 23 | VSScriptLibrary * a_pVSScriptLibrary, QObject * a_pParent = nullptr); 24 | 25 | virtual ~VapourSynthScriptProcessor(); 26 | 27 | bool initialize(const QString& a_script, const QString& a_scriptName, 28 | int a_outputIndex); 29 | 30 | bool finalize(); 31 | 32 | bool isInitialized() const; 33 | 34 | QString error() const; 35 | 36 | const VSVideoInfo * videoInfo(int a_outputIndex = 0); 37 | 38 | bool requestFrameAsync(int a_frameNumber, int a_outputIndex = 0, 39 | bool a_needPreview = false); 40 | 41 | bool flushFrameTicketsQueue(); 42 | 43 | const QString & script() const; 44 | 45 | const QString & scriptName() const; 46 | 47 | void setScriptName(const QString & a_scriptName); 48 | 49 | public slots: 50 | 51 | void slotResetSettings(); 52 | 53 | signals: 54 | 55 | void signalWriteLogMessage(int a_messageType, const QString & a_message); 56 | 57 | void signalDistributeFrame(int a_frameNumber, int a_outputIndex, 58 | const VSFrameRef * a_cpOutputFrameRef, 59 | const VSFrameRef * a_cpPreviewFrameRef); 60 | 61 | void signalFrameRequestDiscarded(int a_frameNumber, int a_outputIndex, 62 | const QString & a_reason); 63 | 64 | void signalFrameQueueStateChanged(size_t a_inQueue, size_t a_inProcess, 65 | size_t a_maxThreads); 66 | 67 | void signalFinalized(); 68 | 69 | private slots: 70 | 71 | void slotReceiveFrameAndProcessQueue( 72 | const VSFrameRef * a_cpFrameRef, int a_frameNumber, 73 | VSNodeRef * a_pNodeRef, QString a_errorMessage); 74 | 75 | private: 76 | 77 | void receiveFrame(const VSFrameRef * a_cpFrameRef, int a_frameNumber, 78 | VSNodeRef * a_pNodeRef, const QString & a_errorMessage); 79 | 80 | void processFrameTicketsQueue(); 81 | 82 | void sendFrameQueueChangeSignal(); 83 | 84 | bool recreatePreviewNode(NodePair & a_nodePair); 85 | 86 | void freeFrameTicket(FrameTicket & a_ticket); 87 | 88 | NodePair & getNodePair(int a_outputIndex, bool a_needPreview); 89 | 90 | QString framePropsString(const VSFrameRef * a_cpFrame) const; 91 | 92 | void printFrameProps(const VSFrameRef * a_cpFrame); 93 | 94 | SettingsManagerCore * m_pSettingsManager; 95 | 96 | VSScriptLibrary * m_pVSScriptLibrary; 97 | 98 | QString m_script; 99 | 100 | QString m_scriptName; 101 | 102 | QString m_error; 103 | 104 | bool m_initialized; 105 | 106 | const VSAPI * m_cpVSAPI; 107 | 108 | VSScript * m_pVSScript; 109 | 110 | const VSVideoInfo * m_cpVideoInfo; 111 | VSCoreInfo m_cpCoreInfo; 112 | 113 | std::deque m_frameTicketsQueue; 114 | std::vector m_frameTicketsInProcess; 115 | std::map m_nodePairForOutputIndex; 116 | 117 | ResamplingFilter m_chromaResamplingFilter; 118 | ChromaPlacement m_chromaPlacement; 119 | double m_resamplingFilterParameterA; 120 | double m_resamplingFilterParameterB; 121 | YuvMatrixCoefficients m_yuvMatrix; 122 | 123 | bool m_finalizing; 124 | }; 125 | 126 | //============================================================================== 127 | 128 | #endif // VAPOURSYNTHSCRIPTPROCESSOR_H 129 | -------------------------------------------------------------------------------- /vsedit/src/main_window.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | class SettingsManager; 9 | class VapourSynthPluginsManager; 10 | class VSScriptLibrary; 11 | class PreviewDialog; 12 | class SettingsDialog; 13 | class ScriptBenchmarkDialog; 14 | class EncodeDialog; 15 | class TemplatesDialog; 16 | class JobServerWatcherSocket; 17 | class QTimer; 18 | 19 | class MainWindow : public QMainWindow 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | 25 | MainWindow(); 26 | 27 | virtual ~MainWindow(); 28 | 29 | public slots: 30 | 31 | void slotWriteLogMessage(int a_messageType, const QString & a_message); 32 | void slotWriteLogMessage(const QString & a_message, 33 | const QString & a_style = LOG_STYLE_DEFAULT); 34 | 35 | void slotInsertTextIntoScriptAtNewLine(const QString & a_text); 36 | void slotInsertTextIntoScriptAtCursor(const QString & a_text); 37 | 38 | protected: 39 | 40 | void closeEvent(QCloseEvent * a_pEvent) override; 41 | 42 | void moveEvent(QMoveEvent * a_pEvent) override; 43 | 44 | void resizeEvent(QResizeEvent * a_pEvent) override; 45 | 46 | void changeEvent(QEvent * a_pEvent) override; 47 | 48 | private slots: 49 | 50 | void slotNewScript(); 51 | bool slotSaveScript(); 52 | bool slotSaveScriptAs(); 53 | bool slotOpenScript(); 54 | 55 | void slotTemplates(); 56 | 57 | void slotPreview(); 58 | void slotCheckScript(); 59 | void slotBenchmark(); 60 | void slotEncode(); 61 | void slotEnqueueEncodeJob(); 62 | void slotJobs(); 63 | 64 | void slotAbout(); 65 | 66 | void slotChangeWindowTitle(); 67 | 68 | void slotEditorTextChanged(); 69 | 70 | void slotOpenRecentScriptActionTriggered(); 71 | 72 | void slotSettingsChanged(); 73 | 74 | void slotScriptFileDropped(const QString & a_filePath, bool * a_pHandled); 75 | 76 | void slotSaveGeometry(); 77 | 78 | private: 79 | 80 | void createActionsAndMenus(); 81 | 82 | void fillRecentScriptsMenu(); 83 | 84 | bool saveScriptToFile(const QString& a_filePath); 85 | 86 | bool loadScriptFromFile(const QString& a_filePath); 87 | 88 | bool safeToCloseFile(); 89 | 90 | void setCurrentScriptFilePath(const QString & a_filePath); 91 | 92 | void loadStartUpScript(); 93 | 94 | void loadFonts(); 95 | 96 | void destroyOrphanQObjects(); 97 | 98 | void saveGeometryDelayed(); 99 | 100 | void reloadTexts(); 101 | 102 | Ui::MainWindow m_ui; 103 | 104 | SettingsManager * m_pSettingsManager; 105 | VapourSynthPluginsManager * m_pVapourSynthPluginsManager; 106 | VSScriptLibrary * m_pVSScriptLibrary; 107 | 108 | QAction * m_pActionNewScript; 109 | QAction * m_pActionOpenScript; 110 | QAction * m_pActionSaveScript; 111 | QAction * m_pActionSaveScriptAs; 112 | QAction * m_pActionTemplates; 113 | QAction * m_pActionSettings; 114 | QAction * m_pActionPreview; 115 | QAction * m_pActionCheckScript; 116 | QAction * m_pActionBenchmark; 117 | QAction * m_pActionEncode; 118 | QAction * m_pActionEnqueueEncodeJob; 119 | QAction * m_pActionJobs; 120 | QAction * m_pActionExit; 121 | QAction * m_pActionAbout; 122 | 123 | std::vector m_settableActionsList; 124 | 125 | QMenu * m_pMenuRecentScripts; 126 | 127 | PreviewDialog * m_pPreviewDialog; 128 | SettingsDialog * m_pSettingsDialog; 129 | ScriptBenchmarkDialog * m_pBenchmarkDialog; 130 | EncodeDialog * m_pEncodeDialog; 131 | TemplatesDialog * m_pTemplatesDialog; 132 | 133 | QString m_scriptFilePath; 134 | QString m_lastSavedText; 135 | 136 | std::vector m_orphanQObjects; 137 | 138 | JobServerWatcherSocket * m_pJobServerWatcherSocket; 139 | 140 | QTimer * m_pGeometrySaveTimer; 141 | QByteArray m_windowGeometry; 142 | }; 143 | 144 | #endif // MAINWINDOW_H 145 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/jobs/jobs_model.h: -------------------------------------------------------------------------------- 1 | #ifndef JOBS_MODEL_H_INCLUDED 2 | #define JOBS_MODEL_H_INCLUDED 3 | 4 | #include "../../../common-src/settings/settings_definitions_core.h" 5 | #include "../../../common-src/log/styled_log_view_core.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class SettingsManager; 12 | 13 | class JobsModel : public QAbstractItemModel 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | 19 | static const int NAME_COLUMN; 20 | static const int TYPE_COLUMN; 21 | static const int SUBJECT_COLUMN; 22 | static const int STATE_COLUMN; 23 | static const int DEPENDS_ON_COLUMN; 24 | static const int TIME_START_COLUMN; 25 | static const int TIME_END_COLUMN; 26 | static const int FPS_COLUMN; 27 | static const int COLUMNS_NUMBER; 28 | 29 | JobsModel(SettingsManager * a_pSettingsManager, 30 | QObject * a_pParent = nullptr); 31 | virtual ~JobsModel(); 32 | 33 | virtual QModelIndex index(int a_row, int a_column, 34 | const QModelIndex & a_parent = QModelIndex()) const override; 35 | 36 | virtual QModelIndex parent(const QModelIndex & a_child) const override; 37 | 38 | virtual Qt::ItemFlags flags(const QModelIndex & a_index) const override; 39 | 40 | virtual QVariant headerData(int a_section, Qt::Orientation a_orientation, 41 | int a_role = Qt::DisplayRole) const override; 42 | 43 | virtual QVariant data(const QModelIndex & a_index, 44 | int a_role = Qt::DisplayRole) const override; 45 | 46 | virtual int rowCount(const QModelIndex & a_parent = QModelIndex()) const 47 | override; 48 | 49 | virtual int columnCount(const QModelIndex & a_parent = QModelIndex()) const 50 | override; 51 | 52 | virtual bool setData(const QModelIndex & a_index, const QVariant & a_value, 53 | int a_role = Qt::EditRole) override; 54 | 55 | void clear(); 56 | 57 | std::vector jobs() const; 58 | bool setJobs(const std::vector & a_jobs); 59 | 60 | JobProperties jobProperties(int a_index) const; 61 | 62 | int createJob(const JobProperties & a_jobProperties); 63 | 64 | bool swapJobs(const QUuid & a_id1, const QUuid & a_id2); 65 | 66 | bool deleteJobs(std::vector a_ids); 67 | 68 | bool updateJobProperties(const JobProperties & a_jobProperties); 69 | bool setJobDependsOnIds(const QUuid & a_id, 70 | const std::vector & a_dependencies); 71 | void requestJobDependsOnIds(const QUuid & a_id, 72 | const std::vector & a_dependencies); 73 | bool setJobProgress(const QUuid & a_id, int a_progress, double a_fps); 74 | bool setJobState(const QUuid & a_id, JobState a_state); 75 | bool setJobStartTime(const QUuid & a_id, const QDateTime & a_time); 76 | bool setJobEndTime(const QUuid & a_id, const QDateTime & a_time); 77 | 78 | bool canModifyJob(int a_index) const; 79 | 80 | bool hasActiveJobs(); 81 | bool hasWaitingJobs(); 82 | 83 | std::vector indexesFromSelection(const QItemSelection & a_selection); 84 | std::vector idsFromSelection(const QItemSelection & a_selection); 85 | 86 | signals: 87 | 88 | void signalLogMessage(const QString & a_message, 89 | const QString & a_style = LOG_STYLE_DEFAULT); 90 | 91 | void signalStateChanged(int a_job, JobState a_state); 92 | 93 | void signalProgressChanged(int a_job, int a_progress, int a_progressMax); 94 | 95 | void signalSetDependencies(const QUuid & a_id, 96 | std::vector a_dependencies); 97 | 98 | private: 99 | 100 | int indexOfJob(const QUuid & a_id) const; 101 | 102 | void notifyJobUpdated(int a_index, int a_column = -1); 103 | 104 | std::vector m_jobs; 105 | 106 | SettingsManager * m_pSettingsManager; 107 | 108 | int m_fpsDisplayPrecision; 109 | }; 110 | 111 | #endif // JOBS_MODEL_H_INCLUDED 112 | -------------------------------------------------------------------------------- /vsedit/src/frame_consumers/benchmark_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ScriptBenchmarkDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 191 11 | 12 | 13 | 14 | Script benchmark 15 | 16 | 17 | 18 | 4 19 | 20 | 21 | 4 22 | 23 | 24 | 4 25 | 26 | 27 | 4 28 | 29 | 30 | 4 31 | 32 | 33 | 34 | 35 | true 36 | 37 | 38 | Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse 39 | 40 | 41 | 42 | 43 | 44 | 45 | true 46 | 47 | 48 | 49 | 50 | 51 | 52 | Qt::AlignCenter 53 | 54 | 55 | %v / %m 56 | 57 | 58 | 59 | 60 | 61 | 62 | 4 63 | 64 | 65 | 66 | 67 | Frames: 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | to 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | Whole video 88 | 89 | 90 | 91 | 92 | 93 | 94 | Qt::Horizontal 95 | 96 | 97 | 98 | 13 99 | 20 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | Start 108 | 109 | 110 | true 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | VSEditorLog 121 | QTextEdit 122 |
../../common-src/log/vs_editor_log.h
123 |
124 |
125 | 126 | 127 |
128 | -------------------------------------------------------------------------------- /vsedit/src/preview/scroll_navigator.cpp: -------------------------------------------------------------------------------- 1 | #include "scroll_navigator.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | //============================================================================== 9 | 10 | ScrollNavigator::ScrollNavigator(QWidget * a_pParent) : QWidget(a_pParent) 11 | , m_contentsHeight(0) 12 | , m_contentsWidth(0) 13 | , m_viewportX(0) 14 | , m_viewportY(0) 15 | , m_viewportHeight(0) 16 | , m_viewportWidth(0) 17 | { 18 | setAttribute(Qt::WA_NoSystemBackground); 19 | setAttribute(Qt::WA_TransparentForMouseEvents); 20 | setGeometry(0, 0, 100, 100); 21 | } 22 | 23 | // END OF ScrollNavigator::ScrollNavigator(QWidget * a_pParent) 24 | //============================================================================== 25 | 26 | ScrollNavigator::~ScrollNavigator() 27 | { 28 | 29 | } 30 | 31 | // END OF ScrollNavigator::~ScrollNavigator() 32 | //============================================================================== 33 | 34 | void ScrollNavigator::draw(int a_contentsWidth, int a_contentsHeight, 35 | int a_viewportX, int a_viewportY, int a_viewportWidth, 36 | int a_viewportHeight) 37 | { 38 | m_contentsHeight = a_contentsHeight; 39 | m_contentsWidth = a_contentsWidth; 40 | m_viewportX = a_viewportX; 41 | m_viewportY = a_viewportY; 42 | m_viewportHeight = a_viewportHeight; 43 | m_viewportWidth = a_viewportWidth; 44 | repaint(); 45 | } 46 | 47 | // END OF void ScrollNavigator::draw(int a_contentsWidth, int a_contentsHeight, 48 | // int a_viewportX, int a_viewportY, int a_viewportWidth, 49 | // int a_viewportHeight) 50 | //============================================================================== 51 | 52 | void ScrollNavigator::paintEvent(QPaintEvent * a_pPaintEvent) 53 | { 54 | if((m_contentsWidth == 0) || (m_contentsHeight == 0) || 55 | (m_viewportWidth == 0) || (m_viewportHeight == 0) || 56 | (m_viewportX >= m_contentsWidth) || (m_viewportY >= m_contentsHeight)) 57 | { 58 | a_pPaintEvent->ignore(); 59 | return; 60 | } 61 | 62 | int measures[] = {m_contentsWidth, m_contentsHeight, m_viewportWidth, 63 | m_viewportHeight}; 64 | int maxMeasure = 0; 65 | for(int m : measures) 66 | if(m > maxMeasure) 67 | maxMeasure = m; 68 | 69 | int normalizedContentsWidth = int((double)m_contentsWidth * 100.0 / 70 | (double)maxMeasure); 71 | int normalizedContentsHeight = int((double)m_contentsHeight * 100.0 / 72 | (double)maxMeasure); 73 | int normalizedVieportX = int((double)m_viewportX * 100.0 / 74 | (double)maxMeasure); 75 | int normalizedViwportY = int((double)m_viewportY * 100.0 / 76 | (double)maxMeasure); 77 | int normalizedViewportWidth = int((double)m_viewportWidth * 100.0 / 78 | (double)maxMeasure); 79 | int normalizedViewportHeight = int((double)m_viewportHeight * 100.0 / 80 | (double)maxMeasure); 81 | 82 | int cX1 = 0; 83 | int cY1 = 0; 84 | int cX2 = normalizedContentsWidth - 1; 85 | int cY2 = normalizedContentsHeight - 1; 86 | 87 | int vX1 = normalizedVieportX; 88 | int vY1 = normalizedViwportY; 89 | int vX2 = normalizedVieportX + normalizedViewportWidth - 1; 90 | int vY2 = normalizedViwportY + normalizedViewportHeight - 1; 91 | 92 | QPainter painter(this); 93 | 94 | // Draw contents rectangle. 95 | painter.setPen(QColor::fromRgb(255, 0, 255)); 96 | painter.drawLine(cX1, cY1, cX2, cY1); 97 | painter.drawLine(cX2, cY1, cX2, cY2); 98 | painter.drawLine(cX2, cY2, cX1, cY2); 99 | painter.drawLine(cX1, cY2, cX1, cY1); 100 | 101 | // Draw viewport rectangle. 102 | painter.setPen(QColor::fromRgb(0, 255, 0)); 103 | painter.drawLine(vX1, vY1, vX2, vY1); 104 | painter.drawLine(vX2, vY1, vX2, vY2); 105 | painter.drawLine(vX2, vY2, vX1, vY2); 106 | painter.drawLine(vX1, vY2, vX1, vY1); 107 | 108 | a_pPaintEvent->accept(); 109 | } 110 | 111 | // END OF void ScrollNavigator::paintEvent(QPaintEvent * a_pPaintEvent) 112 | //============================================================================== 113 | -------------------------------------------------------------------------------- /common-src/log/styled_log_view_settings_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | StyledLogViewSettingsDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 306 10 | 497 11 | 12 | 13 | 14 | Log settings 15 | 16 | 17 | 18 | 4 19 | 20 | 21 | 2 22 | 23 | 24 | 2 25 | 26 | 27 | 2 28 | 29 | 30 | 2 31 | 32 | 33 | 34 | 35 | true 36 | 37 | 38 | QAbstractItemView::SingleSelection 39 | 40 | 41 | QAbstractItemView::SelectRows 42 | 43 | 44 | false 45 | 46 | 47 | true 48 | 49 | 50 | false 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 0 59 | 0 60 | 61 | 62 | 63 | QFrame::Box 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 4 74 | 75 | 76 | 77 | 78 | Font 79 | 80 | 81 | 82 | 83 | 84 | 85 | Text color 86 | 87 | 88 | 89 | 90 | 91 | 92 | Background color 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 4 102 | 103 | 104 | 105 | 106 | OK 107 | 108 | 109 | 110 | 111 | 112 | 113 | Apply 114 | 115 | 116 | 117 | 118 | 119 | 120 | Cancel 121 | 122 | 123 | true 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /vsedit-job-server-watcher/src/trusted_clients_addresses_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TrustedClientsAddressesDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 525 10 | 484 11 | 12 | 13 | 14 | Trusted clients addresses 15 | 16 | 17 | 18 | 4 19 | 20 | 21 | 4 22 | 23 | 24 | 4 25 | 26 | 27 | 4 28 | 29 | 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | :/delete.png:/delete.png 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | :/add.png:/add.png 51 | 52 | 53 | 54 | 55 | 56 | 57 | background-color: rgb(0, 0, 0); 58 | color: rgb(255, 0, 0); 59 | font-size: 24px; 60 | font-weight: bold; 61 | 62 | 63 | WARNING! Adding any address to this list opens your PC for a full control and makes it vulnerable for potential hacker attack! 64 | 65 | 66 | true 67 | 68 | 69 | 4 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Qt::Horizontal 82 | 83 | 84 | 85 | 308 86 | 20 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | OK 95 | 96 | 97 | 98 | 99 | 100 | 101 | Cancel 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | Qt::Vertical 111 | 112 | 113 | 114 | 20 115 | 40 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /common-src/log/vs_editor_log.cpp: -------------------------------------------------------------------------------- 1 | #include "vs_editor_log.h" 2 | 3 | #include "../settings/settings_manager.h" 4 | 5 | //============================================================================== 6 | 7 | VSEditorLog::VSEditorLog(QWidget * a_pParent) : 8 | StyledLogView(a_pParent) 9 | , m_pSettingsManager(nullptr) 10 | { 11 | initializeStyles(); 12 | } 13 | 14 | // END OF VSEditorLog::VSEditorLog(QWidget * a_pParent) 15 | //============================================================================== 16 | 17 | VSEditorLog::~VSEditorLog() 18 | { 19 | } 20 | 21 | // END OF VSEditorLog::~VSEditorLog() 22 | //============================================================================== 23 | 24 | QString VSEditorLog::name() const 25 | { 26 | return m_name; 27 | } 28 | 29 | // END OF QString VSEditorLog::name() const 30 | //============================================================================== 31 | 32 | void VSEditorLog::setName(const QString & a_name) 33 | { 34 | m_name = a_name; 35 | } 36 | 37 | // END OF void VSEditorLog::setName(const QString & a_name) 38 | //============================================================================== 39 | 40 | void VSEditorLog::setSettingsManager(SettingsManager * a_pSettingsManager) 41 | { 42 | m_pSettingsManager = a_pSettingsManager; 43 | } 44 | 45 | // END OF void VSEditorLog::setSettingsManager( 46 | // SettingsManager * a_pSettingsManager) 47 | //============================================================================== 48 | 49 | bool VSEditorLog::loadSettings() 50 | { 51 | if(!m_pSettingsManager) 52 | return false; 53 | 54 | if(m_name.isEmpty()) 55 | return false; 56 | 57 | const std::vector styles = 58 | m_pSettingsManager->getLogStyles(m_name); 59 | 60 | for(TextBlockStyle & style : m_styles) 61 | { 62 | std::vector::const_iterator it = 63 | std::find_if(styles.begin(), styles.end(), 64 | [&](const TextBlockStyle & a_style) -> bool 65 | { 66 | return (a_style.name == style.name); 67 | }); 68 | 69 | if(it != styles.end()) 70 | style = *it; 71 | } 72 | 73 | return true; 74 | } 75 | 76 | // END OF bool VSEditorLog::loadSettings() 77 | //============================================================================== 78 | 79 | bool VSEditorLog::saveSettings() 80 | { 81 | if(!m_pSettingsManager) 82 | return false; 83 | 84 | if(m_name.isEmpty()) 85 | return false; 86 | 87 | return m_pSettingsManager->setLogStyles(m_name, m_styles); 88 | } 89 | 90 | // END OF bool VSEditorLog::saveSettings() 91 | //============================================================================== 92 | 93 | void VSEditorLog::slotLogSettingsChanged() 94 | { 95 | StyledLogView::slotLogSettingsChanged(); 96 | saveSettings(); 97 | } 98 | 99 | // END OF void VSEditorLog::slotLogSettingsChanged() 100 | //============================================================================== 101 | 102 | void VSEditorLog::initializeStyles() 103 | { 104 | TextBlockStyle stylesToCreate[] = { 105 | {LOG_STYLE_ERROR, tr("Error"), QColor("#ffeeee"), Qt::darkRed}, 106 | {LOG_STYLE_DEBUG, tr("Debug message"), 107 | palette().color(QPalette::Active, QPalette::Base), 108 | palette().color(QPalette::Active, QPalette::Dark)}, 109 | {LOG_STYLE_WARNING, tr("Warning"), QColor("#eeeeff"), Qt::darkBlue}, 110 | {LOG_STYLE_POSITIVE, tr("Positive message"), QColor("#eeffee"), 111 | Qt::darkGreen}, 112 | 113 | // Aliases 114 | {LOG_STYLE_VS_DEBUG, tr("VapourSynth debug message"), 115 | LOG_STYLE_DEBUG}, 116 | {LOG_STYLE_VS_WARNING, tr("VapourSynth warning"), 117 | LOG_STYLE_WARNING}, 118 | {LOG_STYLE_VS_CRITICAL, tr("VapourSynth error"), LOG_STYLE_ERROR}, 119 | {LOG_STYLE_VS_FATAL, tr("VapourSynth fatal error"), 120 | LOG_STYLE_ERROR}, 121 | {LOG_STYLE_QT_DEBUG, tr("Qt debug message"), LOG_STYLE_DEBUG}, 122 | {LOG_STYLE_QT_INFO, tr("Qt info"), LOG_STYLE_DEFAULT}, 123 | {LOG_STYLE_QT_WARNING, tr("Qt warning"), LOG_STYLE_WARNING}, 124 | {LOG_STYLE_QT_CRITICAL, tr("Qt critical error"), LOG_STYLE_ERROR}, 125 | {LOG_STYLE_QT_FATAL, tr("Qt fatal error"), LOG_STYLE_ERROR}, 126 | }; 127 | 128 | for(TextBlockStyle & styleToCreate : stylesToCreate) 129 | addStyle(styleToCreate); 130 | } 131 | 132 | // END OF void VSEditorLog::initializeStyles() 133 | //============================================================================== 134 | -------------------------------------------------------------------------------- /common-src/settings/settings_definitions_core.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_DEFINITIONS_CORE_H_INCLUDED 2 | #define SETTINGS_DEFINITIONS_CORE_H_INCLUDED 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | //============================================================================== 11 | 12 | enum class ResamplingFilter : int 13 | { 14 | Point, 15 | Bilinear, 16 | Bicubic, 17 | Spline16, 18 | Spline36, 19 | Spline64, 20 | Lanczos, 21 | }; 22 | 23 | enum class YuvMatrixCoefficients : int 24 | { 25 | m709, 26 | m470BG, 27 | m170M, 28 | m2020_NCL, 29 | m2020_CL, 30 | }; 31 | 32 | enum class ChromaPlacement : int 33 | { 34 | LEFT, 35 | CENTER, 36 | TOP_LEFT, 37 | }; 38 | 39 | enum class EncodingType 40 | { 41 | CLI, 42 | Raw, 43 | VfW, 44 | }; 45 | 46 | enum class EncodingHeaderType 47 | { 48 | NoHeader, 49 | Y4M, 50 | }; 51 | 52 | enum class JobType 53 | { 54 | EncodeScriptCLI, 55 | RunProcess, 56 | RunShellCommand, 57 | }; 58 | 59 | enum class JobState 60 | { 61 | Waiting, 62 | Running, 63 | Pausing, 64 | Paused, 65 | Aborting, 66 | Aborted, 67 | FailedCleanUp, 68 | Failed, 69 | DependencyNotMet, 70 | CompletedCleanUp, 71 | Completed, 72 | }; 73 | 74 | extern const std::vector ACTIVE_JOB_STATES; 75 | 76 | extern const char JP_ID[]; 77 | extern const char JP_TYPE[]; 78 | extern const char JP_JOB_STATE[]; 79 | extern const char JP_DEPENDS_ON_JOB_IDS[]; 80 | extern const char JP_TIME_STARTED[]; 81 | extern const char JP_TIME_ENDED[]; 82 | extern const char JP_SCRIPT_NAME[]; 83 | extern const char JP_ENCODING_TYPE[]; 84 | extern const char JP_ENCODING_HEADER_TYPE[]; 85 | extern const char JP_EXECUTABLE_PATH[]; 86 | extern const char JP_ARGUMENTS[]; 87 | extern const char JP_SHELL_COMMAND[]; 88 | extern const char JP_FIRST_FRAME[]; 89 | extern const char JP_FIRST_FRAME_REAL[]; 90 | extern const char JP_LAST_FRAME[]; 91 | extern const char JP_LAST_FRAME_REAL[]; 92 | extern const char JP_FRAMES_PROCESSED[]; 93 | extern const char JP_FPS[]; 94 | 95 | struct JobProperties 96 | { 97 | QUuid id; 98 | JobType type; 99 | JobState jobState; 100 | std::vector dependsOnJobIds; 101 | QDateTime timeStarted; 102 | QDateTime timeEnded; 103 | QString scriptName; 104 | QString scriptText; 105 | EncodingType encodingType; 106 | EncodingHeaderType encodingHeaderType; 107 | QString executablePath; 108 | QString arguments; 109 | QString shellCommand; 110 | int firstFrame; 111 | int firstFrameReal; 112 | int lastFrame; 113 | int lastFrameReal; 114 | int framesProcessed; 115 | double fps; 116 | 117 | JobProperties(); 118 | JobProperties(const JobProperties &) = default; 119 | JobProperties(JobProperties &&) = default; 120 | JobProperties & operator=(const JobProperties &) = default; 121 | JobProperties & operator=(JobProperties &&) = default; 122 | 123 | static QString typeName(JobType a_type); 124 | static QString stateName(JobState a_state); 125 | 126 | QString subject() const; 127 | int framesTotal() const; 128 | 129 | QJsonObject toJson() const; 130 | static JobProperties fromJson(const QJsonObject & a_object); 131 | }; 132 | 133 | struct EncodingPreset 134 | { 135 | QString name; 136 | EncodingType type; 137 | EncodingHeaderType headerType; 138 | QString executablePath; 139 | QString arguments; 140 | 141 | EncodingPreset(const QString & a_name = QString()); 142 | bool operator==(const EncodingPreset & a_other) const; 143 | bool operator<(const EncodingPreset & a_other) const; 144 | bool isEmpty() const; 145 | }; 146 | 147 | //============================================================================== 148 | 149 | extern const ResamplingFilter DEFAULT_CHROMA_RESAMPLING_FILTER; 150 | extern const YuvMatrixCoefficients DEFAULT_YUV_MATRIX_COEFFICIENTS; 151 | extern const ChromaPlacement DEFAULT_CHROMA_PLACEMENT; 152 | extern const double DEFAULT_BICUBIC_FILTER_PARAMETER_B; 153 | extern const double DEFAULT_BICUBIC_FILTER_PARAMETER_C; 154 | extern const int DEFAULT_LANCZOS_FILTER_TAPS; 155 | extern const EncodingType DEFAULT_ENCODING_TYPE; 156 | extern const EncodingHeaderType DEFAULT_ENCODING_HEADER_TYPE; 157 | extern const JobType DEFAULT_JOB_TYPE; 158 | extern const JobState DEFAULT_JOB_STATE; 159 | extern const int DEFAULT_JOB_FIRST_FRAME; 160 | extern const int DEFAULT_JOB_LAST_FRAME; 161 | extern const int DEFAULT_JOB_FRAMES_PROCESSED; 162 | extern const double DEFAULT_JOB_FPS; 163 | extern const int DEFAULT_RECENT_JOB_SERVERS_NUMBER; 164 | extern const int DEFAULT_WINDOW_GEOMETRY_SAVE_DELAY; 165 | 166 | //============================================================================== 167 | 168 | #endif // SETTINGS_DEFINITIONS_CORE_H_INCLUDED 169 | --------------------------------------------------------------------------------