├── .gitattributes
├── tcax-creator
├── com
│ ├── style_sheet.cpp
│ ├── lua_helper.h
│ ├── preferences_dialog.h
│ ├── ass_helper.h
│ ├── config.h
│ ├── style_sheet.h
│ ├── preferences_dialog.cpp
│ ├── lua_helper.cpp
│ ├── preferences_dialog.ui
│ ├── tcax_helper.h
│ └── config.cpp
├── lua
│ ├── lib
│ │ └── lua5.1.lib
│ └── include
│ │ ├── lua.hpp
│ │ └── lualib.h
├── res
│ ├── buttons
│ │ ├── add.png
│ │ ├── cog.png
│ │ ├── qt.png
│ │ ├── tc.png
│ │ ├── avsp.ico
│ │ ├── cross.png
│ │ ├── disk.png
│ │ ├── erase.png
│ │ ├── font.png
│ │ ├── link.png
│ │ ├── tcax.png
│ │ ├── trash.png
│ │ ├── wand.png
│ │ ├── accept.png
│ │ ├── arrow_up.png
│ │ ├── compile.png
│ │ ├── folder.png
│ │ ├── github.png
│ │ ├── plugin.png
│ │ ├── python.png
│ │ ├── restart.png
│ │ ├── tab_go.png
│ │ ├── vsedit.png
│ │ ├── wrench.png
│ │ ├── arrow_down.png
│ │ ├── benchmark.png
│ │ ├── book_open.png
│ │ ├── bullet_go.png
│ │ ├── cross_grey.png
│ │ ├── flag_china.png
│ │ ├── flag_japan.png
│ │ ├── folder_add.png
│ │ ├── open_with.png
│ │ ├── page_paste.png
│ │ ├── properties.png
│ │ ├── world_link.png
│ │ ├── color_picker.png
│ │ ├── color_swatch.png
│ │ ├── color_wheel.png
│ │ ├── compile_error.png
│ │ ├── disk_multiple.png
│ │ ├── draw_eraser.png
│ │ ├── flag_default.png
│ │ ├── folder_link.png
│ │ ├── information.png
│ │ ├── insert_text.png
│ │ ├── page_white_go.png
│ │ ├── pause_green.png
│ │ ├── report_link.png
│ │ ├── tag_blue_edit.png
│ │ ├── text_wrapping.png
│ │ ├── application_go.png
│ │ ├── compile_warning.png
│ │ ├── eyedropper_tool.png
│ │ ├── folder_magnify.png
│ │ ├── page_white_add.png
│ │ ├── page_white_text.png
│ │ ├── plugin_disabled.png
│ │ ├── file_extension_txt.png
│ │ ├── flag_great_britain.png
│ │ ├── folder_page_white.png
│ │ ├── page_white_stack.png
│ │ ├── toggle_tag_hiding.png
│ │ ├── page_white_code_red.png
│ │ └── synchronous_scrolling.png
│ ├── icons
│ │ └── tcax.ico
│ ├── fonts
│ │ └── consola.ttf
│ ├── images
│ │ └── tcax-logo.png
│ ├── strings
│ │ ├── template
│ │ │ ├── template.avs
│ │ │ ├── template.vpy
│ │ │ ├── template.ass
│ │ │ ├── template.tcc
│ │ │ └── template.py
│ │ ├── about
│ │ └── manual.html
│ ├── svgs
│ │ ├── new-file.svg
│ │ ├── folder.svg
│ │ ├── save.svg
│ │ ├── k.svg
│ │ ├── close.svg
│ │ ├── star-heart.svg
│ │ ├── browse.svg
│ │ ├── shift.svg
│ │ └── palette.svg
│ ├── scripts
│ │ └── png2ass.py
│ └── res.qrc
├── tcax
│ ├── helper
│ │ ├── std.h
│ │ ├── hla_util.h
│ │ ├── hla_util.c
│ │ ├── rb.h
│ │ └── vector.h
│ ├── libtcc
│ │ ├── string.h
│ │ └── map.h
│ └── libmap
│ │ ├── strmap.h
│ │ └── tccmap.h
├── std
│ ├── std_manager.h
│ ├── std_manager.cpp
│ ├── std_watcher.h
│ └── std_watcher.ui
├── designer
│ ├── tcas_designer.h
│ ├── script_designer.h
│ ├── script_designer.cpp
│ ├── tcas_designer.cpp
│ ├── script_designer.ui
│ └── tcc_designer.h
├── main.cpp
├── tools
│ ├── ass_ttag_looper.h
│ ├── ass_syntax_highlighter.h
│ ├── ass_editor.h
│ ├── ass_conv.h
│ ├── ass_syntax_highlighter.cpp
│ ├── ass_ktag_typer.h
│ ├── ass_tag.h
│ ├── ass_ttag_looper.cpp
│ ├── ass_editor.cpp
│ └── ass_conv.ui
├── editor
│ ├── number_matcher.h
│ ├── script_editor.h
│ ├── py_syntax_highlighter.h
│ ├── script_editor.cpp
│ └── number_matcher.cpp
└── mainwindow.h
├── tcax-assoc
├── res
│ ├── icons
│ │ └── tcax.ico
│ └── res.qrc
├── tcax-assoc.pro
└── main.cpp
├── capture-color
├── res
│ ├── icons
│ │ ├── art.ico
│ │ └── yuv.ico
│ ├── images
│ │ ├── art.png
│ │ ├── yuv.png
│ │ ├── art_mono.png
│ │ └── blank_alpha.png
│ ├── curs
│ │ └── eyedropper.cur
│ ├── fonts
│ │ └── consola.ttf
│ ├── buttons
│ │ ├── eyedropper_tool_16.png
│ │ ├── eyedropper_tool_24.png
│ │ ├── eyedropper_tool_32.png
│ │ ├── eyedropper_tool_48.png
│ │ └── eyedropper_tool_64.png
│ ├── strings
│ │ └── about
│ ├── svgs
│ │ ├── exclamation.svg
│ │ ├── exclamation-circle.svg
│ │ ├── info-circle.svg
│ │ └── palette.svg
│ └── res.qrc
├── com
│ ├── version.h
│ ├── common.h
│ └── common.cpp
├── main.cpp
├── dialog
│ ├── color_whell_dialog.cpp
│ ├── color_whell_dialog.h
│ ├── yuv_dialog.h
│ ├── yuv_dialog.cpp
│ ├── color_whell_dialog.ui
│ └── yuv_dialog.ui
├── form
│ └── color_wheel.h
├── mainwindow.h
└── capture-color.pro
├── .gitignore
└── changelog.txt
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.h linguist-language=C++
2 |
--------------------------------------------------------------------------------
/tcax-creator/com/style_sheet.cpp:
--------------------------------------------------------------------------------
1 | #include "style_sheet.h"
2 |
--------------------------------------------------------------------------------
/tcax-assoc/res/icons/tcax.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-assoc/res/icons/tcax.ico
--------------------------------------------------------------------------------
/capture-color/res/icons/art.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/icons/art.ico
--------------------------------------------------------------------------------
/capture-color/res/icons/yuv.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/icons/yuv.ico
--------------------------------------------------------------------------------
/capture-color/res/images/art.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/images/art.png
--------------------------------------------------------------------------------
/capture-color/res/images/yuv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/images/yuv.png
--------------------------------------------------------------------------------
/tcax-creator/lua/lib/lua5.1.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/lua/lib/lua5.1.lib
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/add.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/cog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/cog.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/qt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/qt.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/tc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/tc.png
--------------------------------------------------------------------------------
/tcax-creator/res/icons/tcax.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/icons/tcax.ico
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/avsp.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/avsp.ico
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/cross.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/cross.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/disk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/disk.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/erase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/erase.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/font.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/link.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/tcax.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/tcax.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/trash.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/wand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/wand.png
--------------------------------------------------------------------------------
/tcax-creator/res/fonts/consola.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/fonts/consola.ttf
--------------------------------------------------------------------------------
/capture-color/res/curs/eyedropper.cur:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/curs/eyedropper.cur
--------------------------------------------------------------------------------
/capture-color/res/fonts/consola.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/fonts/consola.ttf
--------------------------------------------------------------------------------
/capture-color/res/images/art_mono.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/images/art_mono.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/accept.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/accept.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/arrow_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/arrow_up.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/compile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/compile.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/folder.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/github.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/plugin.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/python.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/python.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/restart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/restart.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/tab_go.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/tab_go.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/vsedit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/vsedit.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/wrench.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/wrench.png
--------------------------------------------------------------------------------
/tcax-creator/res/images/tcax-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/images/tcax-logo.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/arrow_down.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/benchmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/benchmark.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/book_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/book_open.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/bullet_go.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/bullet_go.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/cross_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/cross_grey.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/flag_china.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/flag_china.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/flag_japan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/flag_japan.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/folder_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/folder_add.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/open_with.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/open_with.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/page_paste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/page_paste.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/properties.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/world_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/world_link.png
--------------------------------------------------------------------------------
/capture-color/com/version.h:
--------------------------------------------------------------------------------
1 | #ifndef VERSION_H
2 | #define VERSION_H
3 |
4 | #define SOFT_VERSION "r2"
5 |
6 | #endif // VERSION_H
7 |
--------------------------------------------------------------------------------
/capture-color/res/images/blank_alpha.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/images/blank_alpha.png
--------------------------------------------------------------------------------
/tcax-assoc/res/res.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | icons/tcax.ico
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/color_picker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/color_picker.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/color_swatch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/color_swatch.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/color_wheel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/color_wheel.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/compile_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/compile_error.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/disk_multiple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/disk_multiple.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/draw_eraser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/draw_eraser.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/flag_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/flag_default.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/folder_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/folder_link.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/information.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/information.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/insert_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/insert_text.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/page_white_go.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/page_white_go.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/pause_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/pause_green.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/report_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/report_link.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/tag_blue_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/tag_blue_edit.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/text_wrapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/text_wrapping.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/application_go.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/application_go.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/compile_warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/compile_warning.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/eyedropper_tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/eyedropper_tool.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/folder_magnify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/folder_magnify.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/page_white_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/page_white_add.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/page_white_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/page_white_text.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/plugin_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/plugin_disabled.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/file_extension_txt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/file_extension_txt.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/flag_great_britain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/flag_great_britain.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/folder_page_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/folder_page_white.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/page_white_stack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/page_white_stack.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/toggle_tag_hiding.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/toggle_tag_hiding.png
--------------------------------------------------------------------------------
/capture-color/res/buttons/eyedropper_tool_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/buttons/eyedropper_tool_16.png
--------------------------------------------------------------------------------
/capture-color/res/buttons/eyedropper_tool_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/buttons/eyedropper_tool_24.png
--------------------------------------------------------------------------------
/capture-color/res/buttons/eyedropper_tool_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/buttons/eyedropper_tool_32.png
--------------------------------------------------------------------------------
/capture-color/res/buttons/eyedropper_tool_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/buttons/eyedropper_tool_48.png
--------------------------------------------------------------------------------
/capture-color/res/buttons/eyedropper_tool_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/capture-color/res/buttons/eyedropper_tool_64.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/page_white_code_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/page_white_code_red.png
--------------------------------------------------------------------------------
/tcax-creator/res/buttons/synchronous_scrolling.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emako/tcax-creator/HEAD/tcax-creator/res/buttons/synchronous_scrolling.png
--------------------------------------------------------------------------------
/tcax-creator/tcax/helper/std.h:
--------------------------------------------------------------------------------
1 | #ifndef TIME_SHIFT_STD
2 | #define TIME_SHIFT_STD
3 | #pragma once
4 |
5 | #include
6 | #include
7 | #include
8 | #include "hla_util.h"
9 |
10 | #endif /* STD */
11 |
12 |
--------------------------------------------------------------------------------
/capture-color/main.cpp:
--------------------------------------------------------------------------------
1 | #include "mainwindow.h"
2 | #include
3 |
4 | int main(int argc, char *argv[])
5 | {
6 | QApplication a(argc, argv);
7 | MainWindow w;
8 | w.show();
9 |
10 | return a.exec();
11 | }
12 |
--------------------------------------------------------------------------------
/tcax-creator/res/strings/template/template.avs:
--------------------------------------------------------------------------------
1 | LoadPlugin("VSFilter.dll")
2 | #LoadPlugin("VSFilterMod.dll")
3 | #LoadPlugin("tcasFilter.dll")
4 |
5 | LWLibavVideoSource("src.mp4")
6 | TextSub("src.ass")
7 | #TextSubMod("src.ass")
8 | #TcasSub("src.tcas")
9 |
--------------------------------------------------------------------------------
/tcax-creator/lua/include/lua.hpp:
--------------------------------------------------------------------------------
1 | // lua.hpp
2 | // Lua header files for C++
3 | // <> not supplied automatically because Lua also compiles as C++
4 |
5 | extern "C" {
6 | #include "lua.h"
7 | #include "lualib.h"
8 | #include "lauxlib.h"
9 | }
10 |
--------------------------------------------------------------------------------
/capture-color/res/strings/about:
--------------------------------------------------------------------------------
1 | Capture Color %1
2 |
3 | By ema(egosub)
4 | https://github.com/emako
5 | http://weibo.com/egosub
6 |
7 | This software is free and distributed under GPLv3.
8 |
9 | Software uses Qt 5 framework by The Qt Company, distributed under LGPL license.
10 | https://qt.io/
11 |
--------------------------------------------------------------------------------
/capture-color/com/common.h:
--------------------------------------------------------------------------------
1 | #ifndef COMMON_H
2 | #define COMMON_H
3 |
4 | #include
5 | #include
6 |
7 | #define DEFAULT_FONT QFont(tr("Consolas"))
8 |
9 | namespace Common
10 | {
11 | QByteArray getResource(const QString &a_filename);
12 | QString fromResource(const QString &a_filename);
13 | };
14 |
15 | #endif // COMMON_H
16 |
--------------------------------------------------------------------------------
/tcax-creator/res/strings/about:
--------------------------------------------------------------------------------
1 | TCAX Creator %1
2 |
3 | By ema(egosub)
4 | https://github.com/emako
5 | http://weibo.com/egosub
6 |
7 | Welecome to TCAX Forum
8 | http://www.tcax.org
9 |
10 | This software is free and distributed under GPLv3.
11 |
12 | Software uses Qt 5 framework by The Qt Company, distributed under LGPL license.
13 | https://qt.io
14 |
--------------------------------------------------------------------------------
/capture-color/res/svgs/exclamation.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/res/strings/template/template.vpy:
--------------------------------------------------------------------------------
1 | import vapoursynth as vs
2 | import havsfunc as haf
3 | import mvsfunc as mvf
4 |
5 | core = vs.get_core()
6 | src = core.lsmas.LWLibavSource(u'src.mp4')
7 | src = core.vsf.TextSub(src, file=u'src.ass')
8 | #src = core.vsfm.TextSubMod(src, file=u'src.ass')
9 | #src = core.tcax.TcasSub(src, file=u'src.tcas')
10 | src.set_output()
11 |
--------------------------------------------------------------------------------
/capture-color/com/common.cpp:
--------------------------------------------------------------------------------
1 | #include "common.h"
2 |
3 | QByteArray Common::getResource(const QString &a_filename)
4 | {
5 | QResource resource(a_filename);
6 |
7 | return QByteArray(reinterpret_cast(resource.data()), static_cast(resource.size()));
8 | }
9 |
10 | QString Common::fromResource(const QString &a_filename)
11 | {
12 | return QString::fromUtf8(getResource(a_filename));
13 | }
14 |
--------------------------------------------------------------------------------
/tcax-creator/std/std_manager.h:
--------------------------------------------------------------------------------
1 | #ifndef STD_MANAGER_H
2 | #define STD_MANAGER_H
3 |
4 | #include "std_watcher.h"
5 | #include
6 | #include
7 |
8 | namespace StdManager
9 | {
10 | QUuid createStdWatch(void);
11 | StdWatcher* callStdWatch(QUuid a_uid);
12 | void releaseStdWatch(QUuid a_uid);
13 | void releaseStdWatchAll(void);
14 | }
15 |
16 | extern QMap g_pStdWatch;
17 |
18 | #endif // STD_MANAGER_H
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 |
28 | # Executables
29 | *.exe
30 | *.out
31 | *.app
32 |
33 | # Qt
34 | *.user
35 | *.res
36 | *.4.8-pre1
37 |
--------------------------------------------------------------------------------
/capture-color/res/svgs/exclamation-circle.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/capture-color/res/svgs/info-circle.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/capture-color/dialog/color_whell_dialog.cpp:
--------------------------------------------------------------------------------
1 | #include "color_whell_dialog.h"
2 | #include "ui_color_whell_dialog.h"
3 |
4 | ColorWhellDialog::ColorWhellDialog(QWidget *parent) :
5 | QDialog(parent),
6 | ui(new Ui::ColorWhellDialog)
7 | {
8 | ui->setupUi(this);
9 | mColorWhell = ui->colorwhell;
10 | this->setWindowTitle("Color Whell");
11 | this->setWindowIcon(QIcon(":/icons/art.ico"));
12 | this->setFont(DEFAULT_FONT);
13 | }
14 |
15 | ColorWhellDialog::~ColorWhellDialog()
16 | {
17 | delete ui;
18 | }
19 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/new-file.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/capture-color/dialog/color_whell_dialog.h:
--------------------------------------------------------------------------------
1 | #ifndef COLORWHELLDIALOG_H
2 | #define COLORWHELLDIALOG_H
3 |
4 | #include "../form/color_wheel.h"
5 | #include "../com/common.h"
6 | #include
7 |
8 | namespace Ui {
9 | class ColorWhellDialog;
10 | }
11 |
12 | class ColorWhellDialog : public QDialog
13 | {
14 | Q_OBJECT
15 |
16 | public:
17 | explicit ColorWhellDialog(QWidget *parent = nullptr);
18 | ~ColorWhellDialog();
19 | ColorWheel *mColorWhell;
20 |
21 | private:
22 | Ui::ColorWhellDialog *ui;
23 | };
24 |
25 | #endif // COLORWHELLDIALOG_H
26 |
--------------------------------------------------------------------------------
/capture-color/res/svgs/palette.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/capture-color/dialog/yuv_dialog.h:
--------------------------------------------------------------------------------
1 | #ifndef YUVDIALOG_H
2 | #define YUVDIALOG_H
3 |
4 | #include "../com/common.h"
5 |
6 | #include
7 | #include
8 |
9 | namespace Ui {
10 | class YuvDialog;
11 | }
12 |
13 | class YuvDialog : public QDialog
14 | {
15 | Q_OBJECT
16 |
17 | public:
18 | explicit YuvDialog(QDialog *parent = nullptr);
19 | ~YuvDialog();
20 | void saveYuv(void);
21 | void setYuv(int y, int u, int v);
22 | void setGroupTitle(QString title);
23 | int y;
24 | int u;
25 | int v;
26 |
27 | private:
28 | Ui::YuvDialog *ui;
29 |
30 | };
31 | #endif // YUVDIALOG_H
32 |
--------------------------------------------------------------------------------
/tcax-creator/res/strings/template/template.ass:
--------------------------------------------------------------------------------
1 | [Script Info]
2 | ; This script is generated by TCAX Creator
3 | ; Welcome to TCAX forum http://www.tcax.org
4 | ScriptType: v4.00+
5 | PlayResX: 1280
6 | PlayResY: 720
7 | Timer: 100.0000
8 |
9 | [V4+ Styles]
10 | Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
11 | Style: default,Microsoft YaHei,36,&H00FFFFFF,&HFF000000,&H00000000,&HFF000000,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1
12 |
13 | [Events]
14 | Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
15 |
--------------------------------------------------------------------------------
/tcax-creator/com/lua_helper.h:
--------------------------------------------------------------------------------
1 | #ifndef LUA_HELPER_H
2 | #define LUA_HELPER_H
3 |
4 | #include "common.h"
5 |
6 | extern "C" {
7 | #include "lua.h"
8 | #include "lauxlib.h"
9 | #include "lualib.h"
10 | }
11 |
12 | #include
13 | #include
14 |
15 | #include
16 | #include
17 |
18 | #define LUA_QRC_ENTRY ":/strings/lua/"
19 |
20 | namespace LuaHelper
21 | {
22 | bool luaDoFile(const QString &a_luaFile, const QString &a_funcName, const QVariant &a_arg1, const QVariant &a_arg2, bool a_fromRes = true);
23 |
24 | bool lyricToAss(const QString &a_srcPath, const QString &a_tarPath);
25 | bool lyricToAssSafe(const QString &a_srcPath, const QString &a_tarPath);
26 | };
27 |
28 | #endif // LUA_HELPER_H
29 |
--------------------------------------------------------------------------------
/tcax-creator/com/preferences_dialog.h:
--------------------------------------------------------------------------------
1 | #ifndef PREFERENCES_DIALOG_H
2 | #define PREFERENCES_DIALOG_H
3 |
4 | #include "common.h"
5 | #include "config.h"
6 |
7 | #include
8 | #include
9 |
10 | namespace Ui {
11 | class Preferences;
12 | }
13 |
14 | class Preferences : public QDialog
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | explicit Preferences(QDialog *parent = nullptr);
20 | ~Preferences();
21 |
22 | private slots:
23 | void slotConfigChanged(int a_arg1);
24 | void on_buttonReset_clicked();
25 | void on_buttonClose_clicked();
26 |
27 | private:
28 | void setup(void);
29 | void loadCommonConfig(void);
30 |
31 | private:
32 | Ui::Preferences *ui;
33 | };
34 |
35 | #endif // PREFERENCES_DIALOG_H
36 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/folder.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/capture-color/res/res.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | buttons/eyedropper_tool_16.png
4 | buttons/eyedropper_tool_24.png
5 | buttons/eyedropper_tool_32.png
6 | buttons/eyedropper_tool_48.png
7 | buttons/eyedropper_tool_64.png
8 | curs/eyedropper.cur
9 | icons/art.ico
10 | strings/about
11 | svgs/exclamation.svg
12 | svgs/exclamation-circle.svg
13 | svgs/info-circle.svg
14 | svgs/palette.svg
15 | icons/yuv.ico
16 | fonts/consola.ttf
17 |
18 |
19 |
--------------------------------------------------------------------------------
/tcax-creator/designer/tcas_designer.h:
--------------------------------------------------------------------------------
1 | #ifndef TCAS_DESIGNER_H
2 | #define TCAS_DESIGNER_H
3 |
4 | #include "../com/common.h"
5 | #include "../com/tcax_helper.h"
6 |
7 | #include
8 | #include
9 |
10 | namespace Ui {
11 | class TcasDesigner;
12 | }
13 |
14 | class TcasDesigner : public QWidget
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | explicit TcasDesigner(QWidget *parent = nullptr);
20 | ~TcasDesigner();
21 | friend class MainWindow;
22 | friend class ScriptDesigner;
23 | QWidget *mainUi;
24 | void reload(const QString &a_filename);
25 |
26 | private slots:
27 | void on_buttonStartShifting_clicked();
28 |
29 | private:
30 | Ui::TcasDesigner *ui;
31 | QString m_filename;
32 | };
33 |
34 | #endif // TCAS_DESIGNER_H
35 |
--------------------------------------------------------------------------------
/tcax-creator/main.cpp:
--------------------------------------------------------------------------------
1 | #include "mainwindow.h"
2 | #include
3 | #include
4 |
5 | global Config *g_pConfig = nullptr;
6 |
7 | int main(int argc, char *argv[])
8 | {
9 | /* Application Setup */
10 | QApplication a(argc, argv);
11 |
12 | /* Application Current Path */
13 | QDir::setCurrent(QCoreApplication::applicationDirPath());
14 |
15 | /* Global Configure First */
16 | g_pConfig = new Config(); // deleted when ~MainWindow()
17 |
18 | /* Splash Screen Show */
19 | QSplashScreen screen(QPixmap(":/images/tcax-logo.png"));
20 | if(g_pConfig->isShowSplashScreen())
21 | {
22 | screen.show();
23 | }
24 |
25 | MainWindow w;
26 | screen.finish(&w);
27 | w.show();
28 |
29 | return a.exec();
30 | }
31 |
--------------------------------------------------------------------------------
/capture-color/dialog/yuv_dialog.cpp:
--------------------------------------------------------------------------------
1 | #include "yuv_dialog.h"
2 | #include "ui_yuv_dialog.h"
3 |
4 | YuvDialog::YuvDialog(QDialog *parent) :
5 | QDialog(parent),
6 | ui(new Ui::YuvDialog)
7 | {
8 | ui->setupUi(this);
9 | this->setFont(DEFAULT_FONT);
10 | this->setWindowTitle("YUV");
11 | this->setWindowIcon(QIcon(":/icons/yuv.ico"));
12 | }
13 |
14 | YuvDialog::~YuvDialog()
15 | {
16 | delete ui;
17 | }
18 |
19 | void YuvDialog::saveYuv(void)
20 | {
21 | y = ui->y_yuvBox->value();
22 | u = ui->u_yuvBox->value();
23 | v = ui->v_yuvBox->value();
24 | }
25 |
26 | void YuvDialog::setYuv(int y, int u, int v)
27 | {
28 | ui->y_yuvBox->setValue(y);
29 | ui->u_yuvBox->setValue(u);
30 | ui->v_yuvBox->setValue(v);
31 | }
32 |
33 | void YuvDialog::setGroupTitle(QString title)
34 | {
35 | ui->yuvgroupBox->setTitle(title);
36 | }
37 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/save.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/designer/script_designer.h:
--------------------------------------------------------------------------------
1 | #ifndef SCRIPT_DESIGNER_H
2 | #define SCRIPT_DESIGNER_H
3 |
4 | #include "../com/tcax_helper.h"
5 |
6 | #include
7 |
8 | namespace Ui {
9 | class ScriptDesigner;
10 | }
11 |
12 | class ScriptDesigner : public QWidget
13 | {
14 | Q_OBJECT
15 |
16 | public:
17 | explicit ScriptDesigner(QWidget *parent = nullptr);
18 | void setMainUi(QWidget *a_pWidget);
19 | ~ScriptDesigner();
20 | QWidget *mainUi;
21 | friend class MainWindow;
22 |
23 | enum DesignScriptType {
24 | TcaxDesign,
25 | TccDesign,
26 | ScriptDesignMax,
27 | };
28 |
29 | void clear(void);
30 | void reload(DesignScriptType a_type, const QString &a_filename);
31 | void reloadTcas(const QString &a_filename);
32 | void reloadTcc(const QString &a_filename);
33 |
34 | private:
35 | Ui::ScriptDesigner *ui;
36 | };
37 |
38 | #endif // SCRIPT_DESIGNER_H
39 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_ttag_looper.h:
--------------------------------------------------------------------------------
1 | #ifndef ASSTTAG_LOOPER_H
2 | #define ASSTTAG_LOOPER_H
3 |
4 | #include "ass_tag.h"
5 | #include "../com/common.h"
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | namespace Ui {
12 | class AssTtagLooper;
13 | }
14 |
15 | class AssTtagLooper : public QWidget
16 | {
17 | Q_OBJECT
18 |
19 | public:
20 | explicit AssTtagLooper(QWidget *parent = nullptr);
21 | ~AssTtagLooper();
22 |
23 | void setEndTime(QString text);
24 | QString getPrevEffectText(void);
25 | QString tt(int start_time, int end_time, int fx_time, QString tag1, QString tag2);
26 | QList range(int start, int end, int step);
27 |
28 | private slots:
29 | void on_buttonMake_clicked();
30 | void on_buttonClose_clicked();
31 |
32 | private:
33 | void setup(void);
34 |
35 | private:
36 | Ui::AssTtagLooper *ui;
37 | QString prev_calc_text;
38 | };
39 | #endif // ASSTTAG_LOOPER_H
40 |
--------------------------------------------------------------------------------
/tcax-creator/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 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/k.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/close.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/res/strings/template/template.tcc:
--------------------------------------------------------------------------------
1 | # tcc file version
2 |
3 | < tcc file version = 1.000 >
4 |
5 |
6 | # mode configuration
7 |
8 | < inherit ass header = false >
9 | < k mode = syllable >
10 | < text layout = horizontal >
11 | < tcaxpy init = false >
12 | < tcaxpy user = false >
13 | < tcaxpy fin = false >
14 |
15 |
16 | # py settings
17 |
18 | < py file = new.py > < beg line = 1 > < end line = 0 >
19 |
20 |
21 | # main settings
22 |
23 | < k-timed ass file = new.ass >
24 | < font file = msyh.ttc > < font face id = 1 > < font size = 36 >
25 | < fx width = 1280 > < fx height = 720 > < fx fps = 23.976 >
26 | < alignment = 7 >
27 | < x offset = 30 > < y offset = 15 >
28 | < spacing = 0 > < space scale = 1.000 >
29 |
30 |
31 | # style settings
32 |
33 | < font face name = "" >
34 | < bord = 1 > < shad = 0 >
35 | < primary color = FFFFFF > < secondary color = 000000 > < outline color = 000000 > < back color = 000000 >
36 | < primary alpha = 0 > < secondary alpha = 255 > < outline alpha = 0 > < back alpha = 255 >
37 |
38 |
39 | # additional settings
40 |
41 | < blur = 0.000 >
42 |
--------------------------------------------------------------------------------
/changelog.txt:
--------------------------------------------------------------------------------
1 | tcax-creator changelog
2 |
3 | version r1
4 | - init release version.
5 |
6 | version r2
7 | - added tools of png2ass.
8 | - fixed multi tcc attr with font face name.
9 | - fixed tcc font face id.
10 |
11 | version r3
12 | - removed tools of png2ass.
13 | - added convert support of png2ass.
14 | - added tcc color attr selectable button and tips shown.
15 | - added associated working of tcax-creator.
16 | - fixed tcas can be saved in editor mode.
17 | - fixed tass crash bug.
18 |
19 | version r4
20 | - fixed ui color-select button style.
21 | - added python3.7.1 supported.
22 | - updated qt framework ver to 5.12.0.
23 |
24 | version r5
25 | - added shortcut of Ctrl+R to compile the project.
26 | - added folder tree context menu of open file with sys def and copy filename.
27 | - changed folder tree context menu of remove and file will be removed really now.
28 | - changed libtcc then font name will not be saved.
29 | - rebuilded _cairo.pyd with py37 and the imp loading error will be solved.
30 |
31 | version r6
32 | - fixed crash on quit program with empty recent list.
33 | - added editor font size can be changed by ctrl+wheel.
34 |
--------------------------------------------------------------------------------
/tcax-creator/res/strings/template/template.py:
--------------------------------------------------------------------------------
1 | from tcaxPy import *
2 |
3 | def tcaxPy_Init():
4 | print('Tips: you can initialize your global variables here.')
5 | print('This function will be executed once if you set < tcaxpy init = true >')
6 | print(GetHelp())
7 |
8 |
9 | def tcaxPy_User():
10 | print('User defined function.')
11 | print('This function will be executed once if you set < tcaxpy user = true >')
12 | print('Otherwise, tcaxPy_Main will be executed (many times)')
13 |
14 |
15 | def tcaxPy_Fin():
16 | print('Tips: you can finalize your global variables here.')
17 | print('This function will be executed once if you set < tcaxpy fin = true >')
18 | print('Note: you do not need to finalize the global variables got from function GetVal()')
19 |
20 |
21 | def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
22 | ASS_BUF = [] # used for saving ASS FX lines
23 | TCAS_BUF = [] # used for saving TCAS FX raw data
24 |
25 | ###############################
26 | # TODO: write your codes here #
27 |
28 | ass_main(ASS_BUF, SubL(_start, _end), pos(_x, _y) + K(_elapk) + K(_k), _txt)
29 |
30 | ###############################
31 |
32 | return (ASS_BUF, TCAS_BUF)
33 |
--------------------------------------------------------------------------------
/tcax-creator/com/ass_helper.h:
--------------------------------------------------------------------------------
1 | #ifndef ASS_HELPER_H
2 | #define ASS_HELPER_H
3 |
4 | #include "common.h"
5 | #include "../tools/ass_tag.h"
6 |
7 | #include
8 | #include
9 |
10 | namespace AssHelper
11 | {
12 | bool lyricToAss(const QString &a_srcPath, const QString &a_tarPath);
13 | bool textToAss(const QString &a_srcPath, const QString &a_tarPath);
14 | bool assToText(const QString &a_srcPath, const QString &a_tarPath);
15 | bool assToLyric(const QString &a_srcPath, const QString &a_tarPath);
16 |
17 | QList> lyricParse(const QString &a_str);
18 | QList> assParse(const QString &a_str);
19 | QList> textParse(const QString &a_str);
20 |
21 | inline QString getAssHeader(void);
22 | inline QString getLrcHeader(void);
23 |
24 | inline QString toTimecode(qint64 a_msec, bool a_fullFormat = true);
25 | inline QString toAssEventsLine(qint64 a_startTimeMsec, qint64 a_endTimeMsec, QString text, bool a_isComment = false);
26 | inline QString stripAssTag(QString a_text);
27 | inline QStringList splitAssEvents(const QString &a_assLine);
28 | inline qint64 assTimeToLrcTime(const QString &timecode);
29 | };
30 |
31 | #endif // ASS_HELPER_H
32 |
--------------------------------------------------------------------------------
/tcax-creator/lua/include/lualib.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Lua standard libraries
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #ifndef lualib_h
9 | #define lualib_h
10 |
11 | #include "lua.h"
12 |
13 |
14 | /* Key to file-handle type */
15 | #define LUA_FILEHANDLE "FILE*"
16 |
17 |
18 | #define LUA_COLIBNAME "coroutine"
19 | LUALIB_API int (luaopen_base) (lua_State *L);
20 |
21 | #define LUA_TABLIBNAME "table"
22 | LUALIB_API int (luaopen_table) (lua_State *L);
23 |
24 | #define LUA_IOLIBNAME "io"
25 | LUALIB_API int (luaopen_io) (lua_State *L);
26 |
27 | #define LUA_OSLIBNAME "os"
28 | LUALIB_API int (luaopen_os) (lua_State *L);
29 |
30 | #define LUA_STRLIBNAME "string"
31 | LUALIB_API int (luaopen_string) (lua_State *L);
32 |
33 | #define LUA_MATHLIBNAME "math"
34 | LUALIB_API int (luaopen_math) (lua_State *L);
35 |
36 | #define LUA_DBLIBNAME "debug"
37 | LUALIB_API int (luaopen_debug) (lua_State *L);
38 |
39 | #define LUA_LOADLIBNAME "package"
40 | LUALIB_API int (luaopen_package) (lua_State *L);
41 |
42 |
43 | /* open all previous libraries */
44 | LUALIB_API void (luaL_openlibs) (lua_State *L);
45 |
46 |
47 |
48 | #ifndef lua_assert
49 | #define lua_assert(x) ((void)0)
50 | #endif
51 |
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/tcax-creator/std/std_manager.cpp:
--------------------------------------------------------------------------------
1 | #include "std_manager.h"
2 |
3 | QMap g_pStdWatch;
4 |
5 | QUuid StdManager::createStdWatch(void)
6 | {
7 | QUuid uid = QUuid::createUuid();
8 | g_pStdWatch.insert(uid, new StdWatcher());
9 | return uid;
10 | }
11 |
12 | StdWatcher *StdManager::callStdWatch(QUuid a_uid)
13 | {
14 | return g_pStdWatch[a_uid];
15 | }
16 |
17 | void StdManager::releaseStdWatch(QUuid a_uid)
18 | {
19 | /* Not recommended for be called in slot func of close event. */
20 |
21 | if(g_pStdWatch.contains(a_uid))
22 | {
23 | g_pStdWatch[a_uid]->close();
24 | g_pStdWatch[a_uid] = nullptr;
25 | g_pStdWatch.remove(a_uid);
26 | }
27 | }
28 |
29 | void StdManager::releaseStdWatchAll(void)
30 | {
31 | for(QMap::const_iterator i = g_pStdWatch.constBegin(); i != g_pStdWatch.constEnd(); ++i)
32 | {
33 | if(g_pStdWatch[i.key()]->isRunning())
34 | {
35 | if(QMessageBox::question(nullptr, MSG_QUESTION, QObject::tr("StdWatcher is running!\nDo you really want to abort the job now?"), QMessageBox::Yes | QMessageBox::Cancel) == QMessageBox::Yes)
36 | {
37 | /* Abort on y. */
38 | g_pStdWatch[i.key()]->abortJob();
39 | }
40 | else
41 | {
42 | /* Skip on n. */
43 | continue;
44 | }
45 | }
46 | g_pStdWatch[i.key()]->close();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/tcax-creator/designer/script_designer.cpp:
--------------------------------------------------------------------------------
1 | #include "script_designer.h"
2 | #include "ui_script_designer.h"
3 | #include "ui_tcas_designer.h"
4 | #include "ui_tcc_designer.h"
5 |
6 | ScriptDesigner::ScriptDesigner(QWidget *parent) :
7 | QWidget(parent),
8 | ui(new Ui::ScriptDesigner)
9 | {
10 | ui->setupUi(this);
11 | ui->tcasDesigner->hide();
12 | ui->tccDesigner->hide();
13 | }
14 |
15 | ScriptDesigner::~ScriptDesigner()
16 | {
17 | delete ui;
18 | }
19 |
20 | void ScriptDesigner::setMainUi(QWidget *a_pWidget)
21 | {
22 | this->mainUi = a_pWidget;
23 | ui->tcasDesigner->mainUi = mainUi;
24 | ui->tccDesigner->mainUi = mainUi;
25 | }
26 |
27 | void ScriptDesigner::clear(void)
28 | {
29 | ui->tcasDesigner->hide();
30 | ui->tccDesigner->hide();
31 | }
32 |
33 | void ScriptDesigner::reload(DesignScriptType a_type, const QString &a_filename)
34 | {
35 | switch(a_type)
36 | {
37 | case TcaxDesign:
38 | reloadTcas(a_filename);
39 | break;
40 | case TccDesign:
41 | reloadTcc(a_filename);
42 | break;
43 | default:
44 | break;
45 | }
46 | }
47 |
48 | void ScriptDesigner::reloadTcas(const QString &a_filename)
49 | {
50 | ui->tccDesigner->hide();
51 | ui->tcasDesigner->show();
52 | ui->tcasDesigner->reload(a_filename);
53 | }
54 |
55 | void ScriptDesigner::reloadTcc(const QString &a_filename)
56 | {
57 | ui->tccDesigner->show();
58 | ui->tcasDesigner->hide();
59 | ui->tccDesigner->reload(a_filename);
60 | }
61 |
--------------------------------------------------------------------------------
/tcax-creator/designer/tcas_designer.cpp:
--------------------------------------------------------------------------------
1 | #include "tcas_designer.h"
2 | #include "ui_tcas_designer.h"
3 |
4 | TcasDesigner::TcasDesigner(QWidget *parent) :
5 | QWidget(parent),
6 | ui(new Ui::TcasDesigner)
7 | {
8 | ui->setupUi(this);
9 | }
10 |
11 | TcasDesigner::~TcasDesigner()
12 | {
13 | delete ui;
14 | }
15 |
16 | void TcasDesigner::reload(const QString &a_filename)
17 | {
18 | m_filename = a_filename;
19 | ui->labelInfo->setText(TcaxHelper::tcasInfo(a_filename));
20 | }
21 |
22 | void TcasDesigner::on_buttonStartShifting_clicked()
23 | {
24 | QTime time = ui->editTimeShift->time();
25 | int shiftTime = time. hour() * 60 * 60 * 1000 + time.minute() * 60 * 1000 + time.second() * 1000 + time.msec();
26 | bool saveCopy = ui->checkBoxMakeCopy->isChecked();
27 |
28 | if(ui->radioButtonBackward->isChecked())
29 | {
30 | shiftTime = -shiftTime;
31 | }
32 | if(m_filename.isEmpty())
33 | {
34 | QMessageBox::critical(this, MSG_TCAX_CRITICAL, tr("File none!"));
35 | return;
36 | }
37 | else if(!QFileInfo(m_filename).isFile())
38 | {
39 | QMessageBox::critical(this, MSG_TCAX_CRITICAL, tr("\"%1\" is not a file!").arg(m_filename));
40 | return;
41 | }
42 | if(TcaxHelper::tcasShiftTime(m_filename, shiftTime, saveCopy))
43 | {
44 | QMessageBox::information(this, MSG_TCAX_INFORMATION, tr("Tcas Shift Time Completed!"));
45 | }
46 | else
47 | {
48 | QMessageBox::critical(this, MSG_TCAX_CRITICAL, tr("Tcas Shift Time Failed!"));
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/tcax-creator/designer/script_designer.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | ScriptDesigner
4 |
5 |
6 |
7 | 0
8 | 0
9 | 517
10 | 399
11 |
12 |
13 |
14 | Form
15 |
16 |
17 |
18 | 0
19 |
20 |
21 | 0
22 |
23 |
24 | 0
25 |
26 |
27 | 0
28 |
29 |
30 | 0
31 |
32 | -
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 |
42 | TccDesigner
43 | QWidget
44 |
45 | 1
46 |
47 |
48 | TcasDesigner
49 | QWidget
50 |
51 | 1
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_syntax_highlighter.h:
--------------------------------------------------------------------------------
1 | #ifndef ASS_SYNTAX_HIGHLIGHTER_H
2 | #define ASS_SYNTAX_HIGHLIGHTER_H
3 |
4 | #include "ass_tag.h"
5 |
6 | #include
7 | #include
8 |
9 | #define COLOR_KEYWORD QColor(255, 0, 161)
10 | #define COLOR_SECTION_LINE QColor(5, 40, 229)
11 | #define COLOR_COMMENT_LINE QColor(127, 127, 127)
12 | #define COLOR_FORMAT_LINE QColor(173, 86, 248)
13 |
14 | QT_BEGIN_NAMESPACE
15 | class QTextDocument;
16 | QT_END_NAMESPACE
17 |
18 | class AssSyntaxHighlighter : public QSyntaxHighlighter
19 | {
20 | Q_OBJECT
21 | public:
22 | AssSyntaxHighlighter(QTextDocument *parent = nullptr);
23 | void initSyntax(void);
24 | bool isHasRules(void);
25 | void completeSyntax(void);
26 | void clearSyntax(void);
27 |
28 | QTextCharFormat text_format;
29 | QTextCharFormat keyword_format;
30 | QTextCharFormat comment_line_format;
31 | QTextCharFormat section_line_format;
32 | QTextCharFormat format_line_format;
33 | QTextCharFormat style_line_format;
34 |
35 | public slots:
36 | void addSyntaxKeywords(const QStringList& keywords);
37 | void addSyntaxKeywords(const QStringList& keywords, const QTextCharFormat& format);
38 | void addSyntax(const QString& pattern, const QTextCharFormat& format);
39 |
40 | protected:
41 | void highlightBlock(const QString &text);
42 |
43 | private:
44 | struct HighlightingRule
45 | {
46 | QRegExp pattern;
47 | QTextCharFormat format;
48 | };
49 | QVector highlightingRules;
50 | bool isEmpty;
51 | };
52 |
53 | #endif // ASS_SYNTAX_HIGHLIGHTER_H
54 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_editor.h:
--------------------------------------------------------------------------------
1 | #ifndef ASSEDITOR_H
2 | #define ASSEDITOR_H
3 |
4 | #include
5 | #include
6 |
7 | class QPaintEvent;
8 | class QResizeEvent;
9 | class QSize;
10 | class QWidget;
11 |
12 | class LineNumberArea;
13 |
14 |
15 | class AssEditor : public QPlainTextEdit
16 | {
17 | Q_OBJECT
18 |
19 | public:
20 | AssEditor(QWidget *parent = nullptr);
21 |
22 | void lineNumberAreaPaintEvent(QPaintEvent *event);
23 | int lineNumberAreaWidth();
24 | QString getCurrentCursorText(void);
25 |
26 | protected:
27 | void resizeEvent(QResizeEvent *event) override;
28 |
29 | private slots:
30 | void updateLineNumberAreaWidth(int newBlockCount);
31 | void highlightCurrentLine();
32 | void updateLineNumberArea(const QRect &, int);
33 |
34 | private:
35 | QWidget *lineNumberArea;
36 | };
37 |
38 |
39 | class LineNumberArea : public QWidget
40 | {
41 | public:
42 | LineNumberArea(AssEditor *editor) : QWidget(editor) {
43 | AssEditor = editor;
44 | }
45 |
46 | QSize sizeHint() const override {
47 | return QSize(AssEditor->lineNumberAreaWidth(), 0);
48 | }
49 |
50 | protected:
51 | void paintEvent(QPaintEvent *event) override {
52 | AssEditor->lineNumberAreaPaintEvent(event);
53 | }
54 |
55 | private:
56 | AssEditor *AssEditor;
57 | };
58 |
59 | enum class ColorLineNumArea{
60 | r = 240,
61 | g = 240,
62 | b = 240,
63 | };
64 |
65 | enum class ColorLineNum{
66 | r = 140,
67 | g = 140,
68 | b = 140,
69 | };
70 |
71 | enum class ColorHighlight{
72 | r = 232,
73 | g = 232,
74 | b = 255,
75 | };
76 |
77 |
78 | #endif // ASSEDITOR_H
79 |
--------------------------------------------------------------------------------
/capture-color/form/color_wheel.h:
--------------------------------------------------------------------------------
1 | #ifndef COLORWHEEL_H
2 | #define COLORWHEEL_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #ifdef DEBUG_MODE
11 | #include
12 | #endif
13 |
14 | class ColorWheel : public QWidget
15 | {
16 | Q_OBJECT
17 | public:
18 | explicit ColorWheel(QWidget *parent = nullptr);
19 | ~ColorWheel();
20 |
21 | virtual QSize sizeHint () const;
22 | virtual QSize minimumSizeHint () const;
23 | QColor color();
24 |
25 | signals:
26 | void colorChange(const QColor &color);
27 |
28 | public slots:
29 | void setColor(const QColor &color);
30 |
31 | protected:
32 | void resizeEvent(QResizeEvent *event);
33 | void paintEvent(QPaintEvent *);
34 | void mousePressEvent(QMouseEvent *event);
35 | void mouseMoveEvent(QMouseEvent *event);
36 | void mouseReleaseEvent(QMouseEvent *);
37 |
38 | private:
39 | void composeWheel();
40 | QColor posColor(const QPoint &point);
41 | void drawWheelImage(const QSize &newSize);
42 | void drawSquareImage(const int &hue);
43 | void drawIndicator(const int &hue);
44 | void drawPicker(const QColor &color);
45 |
46 | QSize initSize;
47 | QImage wheelImage;
48 | QImage squareImage;
49 | QPixmap wheel;
50 | bool mouseDown;
51 | QPoint lastPos;
52 | int margin;
53 | int wheelWidth;
54 | QRegion wheelRegion;
55 | QRegion squareRegion;
56 | QColor current;
57 | bool isInWheel;
58 | bool isInSquare;
59 |
60 | private slots:
61 | void hueChanged(const int &hue);
62 | void svChanged(const QColor &newcolor);
63 | };
64 |
65 | #endif // COLORWHEEL_H
66 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/star-heart.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/helper/hla_util.h:
--------------------------------------------------------------------------------
1 | /*
2 | * hla_util.h -- High-level utility API of the 'libtcas' library
3 | * Copyright (C) 2011 milkyjing
4 | *
5 | * This software is provided 'as-is', without any express or implied
6 | * warranty. In no event will the authors be held liable for any damages
7 | * arising from the use of this software.
8 | *
9 | * Permission is granted to anyone to use this software for any purpose,
10 | * including commercial applications, and to alter it and redistribute it
11 | * freely, subject to the following restrictions:
12 | *
13 | * 1. The origin of this software must not be misrepresented; you must not
14 | * claim that you wrote the original software. If you use this software
15 | * in a product, an acknowledgment in the product documentation would be
16 | * appreciated but is not required.
17 | * 2. Altered source versions must be plainly marked as such, and must not be
18 | * misrepresented as being the original software.
19 | * 3. This notice may not be removed or altered from any source distribution.
20 | *
21 | * milkyjing
22 | *
23 | */
24 |
25 | #ifndef LIBTCAS_HLA_UTIL_H
26 | #define LIBTCAS_HLA_UTIL_H
27 | #pragma once
28 |
29 | #include "tcas.h"
30 |
31 |
32 | /* Inhibit C++ name-mangling for libtcas functions but not for system calls. */
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif /* __cplusplus */
36 |
37 | /**
38 | * shift the time-line of the TCAS file
39 | * @param filename name of the target file
40 | * @param iShiftTime the value to shift, can be minus value
41 | * @return TCAS_Error_Code
42 | */
43 | extern TCAS_Error_Code libtcas_file_shift_time(const char *filename, int iShiftTime);
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif /* __cplusplus */
48 |
49 | #endif /* LIBTCAS_HLA_UTIL_H */
50 |
51 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_conv.h:
--------------------------------------------------------------------------------
1 | #ifndef ASS_CONV_H
2 | #define ASS_CONV_H
3 |
4 | #include "ass_tag.h"
5 | #include "../com/lua_helper.h"
6 | #include "../com/common.h"
7 | #include "../com/ass_helper.h"
8 | #include "../std/std_manager.h"
9 |
10 | #include
11 | #include
12 | #include
13 |
14 | #define MESSAGE_BOX_CONVERT_FAILD(parent, src, target) QMessageBox::warning(parent, tr("Failed"), tr("Convert Failed!\nSource file: \"%1\"\nTarget file: \"%2\"").arg(src).arg(target))
15 |
16 | namespace Ui {
17 | class AssConv;
18 | }
19 |
20 | class AssConv : public QWidget
21 | {
22 | Q_OBJECT
23 |
24 | public:
25 | explicit AssConv(QWidget *parent = nullptr);
26 | ~AssConv();
27 | void reload(const QStringList &a_filelist);
28 |
29 | enum AssConvType {
30 | Ass2Lrc,
31 | Ass2Txt,
32 | Lrc2Ass,
33 | Txt2Ass,
34 | Png2Ass,
35 | };
36 |
37 | private slots:
38 | void slotContextMenuRequested(void);
39 | void dragEnterEvent(QDragEnterEvent* event);
40 | void dropEvent(QDropEvent* e);
41 | void slotContextMenu(void);
42 | void convert(void);
43 | void getOpens(void);
44 |
45 | private:
46 | void setup(void);
47 | bool isEnabledInput(const QString &a_filename, bool a_isIgnore = true);
48 | QString getOutputExt(void);
49 | void convertAssToLrc(const QString &a_srcFile, const QString &a_tarFile);
50 | void convertAssToTxt(const QString &a_srcFile, const QString &a_tarFile);
51 | void convertLrc2Ass(const QString &a_srcFile, const QString &a_tarFile);
52 | void convertTxt2Ass(const QString &a_srcFile, const QString &a_tarFile);
53 | void convertPng2Ass(const QString &a_srcFile, const QString &a_tarFile);
54 |
55 | private:
56 | Ui::AssConv *ui;
57 | QMenu *m_pContextMenu;
58 | };
59 |
60 | #endif // ASS_CONV_H
61 |
--------------------------------------------------------------------------------
/tcax-creator/com/config.h:
--------------------------------------------------------------------------------
1 | #ifndef CONFIG_H
2 | #define CONFIG_H
3 |
4 | #include "common.h"
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | class Config
15 | {
16 | public:
17 | Config();
18 |
19 | enum ECONFIG_COMMON {
20 | eCONFIG_COMMON_RECENT,
21 | eCONFIG_COMMON_SHOW_SPLASH_SCREEN,
22 | eCONFIG_COMMON_EDITOR_FILE_LIMIT_ENABLE,
23 | eCONFIG_COMMON_EDITOR_FILE_LIMIT_SIZE,
24 | eCONFIG_COMMON_STYLE_FACTORY_ENABLE,
25 | eCONFIG_COMMON_STYLE_FACTORY,
26 | eCONFIG_COMMON_EDITOR_FONT_POINT_SIZE,
27 | eCONFIG_COMMON_MAX,
28 | };
29 |
30 | bool getPortableMode(void);
31 | void getConfigFile(void);
32 | QString settingsFilePath(void);
33 | bool isShowSplashScreen(void);
34 |
35 | void initCommonConfigDefault(void);
36 | void initCommonConfig(void);
37 | void reset(void);
38 | void saveConfigAll(void);
39 |
40 | QVariant getConfig(ECONFIG_COMMON a_key);
41 | QVariant getConfigDefault(ECONFIG_COMMON a_key);
42 | void setConfig(ECONFIG_COMMON a_key, QVariant a_value);
43 |
44 | QVariant valueInGroup(const QString & a_group, const QString & a_key, const QVariant & a_defaultValue) const;
45 | bool setValueInGroup(const QString & a_group, const QString & a_key, const QVariant & a_value);
46 | bool deleteValueInGroup(const QString & a_group, const QString & a_key);
47 | QVariant value(const QString & a_key, const QVariant & a_defaultValue) const;
48 | bool setValue(const QString & a_key, const QVariant & a_value);
49 | QStringList groupKeys(const QString & a_group);
50 |
51 | public:
52 | QMap m_config_common;
53 |
54 | private:
55 | QString m_settingsFilePath;
56 | QList m_config_common_default;
57 | };
58 |
59 | extern Config *g_pConfig;
60 | extern const char *c_config_common_key[Config::eCONFIG_COMMON_MAX];
61 |
62 | #endif // CONFIG_H
63 |
--------------------------------------------------------------------------------
/capture-color/dialog/color_whell_dialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | ColorWhellDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 272
10 | 300
11 |
12 |
13 |
14 | Dialog
15 |
16 |
17 | -
18 |
19 |
20 | TextLabel
21 |
22 |
23 |
24 | -
25 |
26 |
27 | Qt::Horizontal
28 |
29 |
30 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | ColorWheel
39 | QWidget
40 |
41 |
42 |
43 |
44 |
45 |
46 | buttonBox
47 | accepted()
48 | ColorWhellDialog
49 | accept()
50 |
51 |
52 | 248
53 | 254
54 |
55 |
56 | 157
57 | 274
58 |
59 |
60 |
61 |
62 | buttonBox
63 | rejected()
64 | ColorWhellDialog
65 | reject()
66 |
67 |
68 | 316
69 | 260
70 |
71 |
72 | 286
73 | 274
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/browse.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/shift.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/editor/script_editor.h:
--------------------------------------------------------------------------------
1 | #ifndef CODEEDITOR_H
2 | #define CODEEDITOR_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | namespace EditorColor
13 | {
14 | namespace ColorLineNumArea
15 | {
16 | enum Color{
17 | r = 240,
18 | g = 240,
19 | b = 240,
20 | };
21 | };
22 |
23 | namespace ColorLineNum
24 | {
25 | enum Color{
26 | r = 140,
27 | g = 140,
28 | b = 140,
29 | };
30 | };
31 |
32 | namespace ColorHighlight
33 | {
34 | enum Color{
35 | r = 232,
36 | g = 232,
37 | b = 255,
38 | };
39 | };
40 | }
41 |
42 | using namespace EditorColor;
43 |
44 | class ScriptEditor : public QPlainTextEdit
45 | {
46 | Q_OBJECT
47 |
48 | public:
49 | ScriptEditor(QWidget *parent = nullptr);
50 |
51 | void lineNumberAreaPaintEvent(QPaintEvent *event);
52 | int lineNumberAreaWidth();
53 | QString getCurrentCursorText(void);
54 | void resizeFont(int a_pointSize);
55 |
56 | signals:
57 | void fontPointSizeUpdated(int);
58 |
59 | protected:
60 | void resizeEvent(QResizeEvent *event) override;
61 | void keyPressEvent(QKeyEvent *event) override;
62 | void keyReleaseEvent(QKeyEvent *event) override;
63 | void wheelEvent(QWheelEvent* event) override;
64 |
65 | private slots:
66 | void updateLineNumberAreaWidth(int newBlockCount);
67 | void highlightCurrentLine();
68 | void updateLineNumberArea(const QRect &, int);
69 |
70 | private:
71 | QWidget *m_pLineNumberArea;
72 | bool m_isKeyCtrlPressed;
73 | };
74 |
75 |
76 | class LineNumberArea : public QWidget
77 | {
78 | public:
79 | LineNumberArea(ScriptEditor *editor) : QWidget(editor)
80 | {
81 | m_pScriptEditor = editor;
82 | }
83 |
84 | QSize sizeHint() const override
85 | {
86 | return QSize(m_pScriptEditor->lineNumberAreaWidth(), 0);
87 | }
88 |
89 | protected:
90 | void paintEvent(QPaintEvent *event) override
91 | {
92 | m_pScriptEditor->lineNumberAreaPaintEvent(event);
93 | }
94 |
95 | private:
96 | ScriptEditor *m_pScriptEditor;
97 | };
98 |
99 | #endif
100 |
--------------------------------------------------------------------------------
/tcax-creator/res/scripts/png2ass.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import sys
3 | from tcaxPy import *
4 |
5 | try:
6 | input = sys.argv[1]
7 | output = sys.argv[2]
8 | except:
9 | print('Error: input or output file is none!')
10 | print('Usage: png2ass input output')
11 | print('')
12 | sys.exit()
13 | width = 1280
14 | height = 720
15 |
16 | ass_header = """[Script Info]\r
17 | ; This script is generated by TCAX Creator powered by TCAX 1.2.0\r
18 | ; Welcome to TCAX forum http://tcax.org\r
19 | ScriptType: v4.00+\r
20 | Collisions:Normal\r
21 | PlayResX:{width}\r
22 | PlayResY:{height}\r
23 | Timer:100.0000\r
24 | \r
25 | [V4+ Styles]\r
26 | Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding\r
27 | Style: TCMS,Arial,30,&H00FF0000,&HFFFF0000,&H000000FF,&HFF000000,0,0,0,0,100,100,0,0,0,1,0,5,15,15,10,1\r
28 | Style: TCPS,Arial,1,&HFFFFFFFF,&HFFFFFFFF,&HFFFFFFFF,&HFFFFFFFF,0,0,0,0,100,100,0,0,0,0,0,7,0,0,0,1\r
29 | \r
30 | [Events]\r
31 | Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r""".format(width=width, height=height)
32 |
33 | data = {
34 | val_AssHeader : ass_header,
35 | val_ResolutionX : width,
36 | val_ResolutionY : height,
37 | }
38 |
39 | def png2ass():
40 | file_name = output
41 | ass_header = GetVal(val_AssHeader)
42 | ASS_FILE = CreateAssFile(file_name, ass_header)
43 | ASS_BUF = []
44 | PIX = ImagePix((input))
45 | dx = (GetVal(val_ResolutionX) - PIX[1][0]) / 2 - PIX[0][0] # x middle of the screen
46 | dy = (GetVal(val_ResolutionY) - PIX[1][1]) / 2 - PIX[0][1] # y middle of the screen
47 |
48 | ## -- pix convert start
49 | initPosX = dx + PIX[0][0]
50 | initPosY = dy + PIX[0][1]
51 | for h in range(PIX[1][1]):
52 | posY = initPosY + h
53 | for w in range(PIX[1][0]):
54 | posX = initPosX + w
55 | idx = 4 * (h * PIX[1][0] + w)
56 | pixR = PIX[2][idx + 0]
57 | pixG = PIX[2][idx + 1]
58 | pixB = PIX[2][idx + 2]
59 | pixA = PIX[2][idx + 3]
60 | if pixA != 0:
61 | ass_main(ASS_BUF, SubL(0, 1000, 0, Pix_Style), pos(posX, posY) + color1(FmtRGB(pixR, pixG, pixB)) + alpha1(255 - pixA), PixPt())
62 | ## -- pix convert end
63 |
64 | WriteAssFile(ASS_FILE, ASS_BUF) # write the buffer in memory to the file
65 | FinAssFile(ASS_FILE)
66 |
67 | if __name__ == "__main__":
68 | tcaxPy_InitData(data)
69 | png2ass()
70 |
--------------------------------------------------------------------------------
/tcax-creator/res/strings/manual.html:
--------------------------------------------------------------------------------
1 | [Working]
2 | http://www.tcax.org/forum.php?mod=viewthread&tid=38
3 |
4 | [Terms Glossary]
5 | http://www.tcax.org/forum.php?mod=viewthread&tid=23
6 |
7 | [Internal Scripts]
8 | http://www.tcax.org/forum.php?mod=viewthread&tid=62
9 | http://www.tcax.org/forum.php?mod=viewthread&tid=64
10 | http://www.tcax.org/forum.php?mod=viewthread&tid=65
11 | http://www.tcax.org/forum.php?mod=viewthread&tid=67
12 | http://www.tcax.org/forum.php?mod=forumdisplay&fid=54
13 |
14 | [Custom Scripts]
15 | http://www.tcax.org/forum.php?mod=viewthread&tid=17
16 | http://www.tcax.org/forum.php?mod=viewthread&tid=29
17 |
18 | [Functions]
19 | http://www.tcax.org/forum.php?mod=viewthread&tid=31
20 |
21 | [Example]
22 | http://www.tcax.org/forum.php?mod=forumdisplay&fid=42
23 |
24 | [TCC File]
25 | http://www.tcax.org/forum.php?mod=viewthread&tid=87
26 |
27 | [TCAS Effect File]
28 | http://www.tcax.org/forum.php?mod=viewthread&tid=220
29 |
30 | [About tcaxPy]
31 | http://www.tcax.org/forum.php?mod=viewthread&tid=47
32 |
33 | [About tcaxLib.pyd]
34 | http://www.tcax.org/forum.php?mod=viewthread&tid=32
35 |
36 | [Source Code]
37 | http://code.google.com/p/tcxcore/downloads/list
38 | https://github.com/milkyjing/TCAX
--------------------------------------------------------------------------------
/tcax-creator/com/style_sheet.h:
--------------------------------------------------------------------------------
1 | #ifndef STYLE_SHEET_H
2 | #define STYLE_SHEET_H
3 |
4 | namespace StyleSheet
5 | {
6 | #define folderTree \
7 | "QTreeView" \
8 | "{" \
9 | "border: 1px solid rgb(50, 50, 50);" \
10 | "background-color: rgb(255, 255, 255);" \
11 | "}" \
12 | "QTreeView::item" \
13 | "{" \
14 | "height: 25px;" \
15 | "color: white;" \
16 | "border: none;" \
17 | "border-bottom: 1px solid rgb(255, 255, 255);" \
18 | "background-color: transparent;" \
19 | "}" \
20 | "QTreeView::item:hover" \
21 | "{" \
22 | "background-color: rgba(255, 255, 255, 40);" \
23 | "}" \
24 | "QTreeView::item:selected" \
25 | "{" \
26 | "background-color: rgb(0, 160, 230);" \
27 | "}" \
28 | "QTreeView::branch:open:has-children" \
29 | "{" \
30 | "image: url(:/qss/branch-open.png);" \
31 | "}" \
32 | "QTreeView::branch:closed:has-children" \
33 | "{" \
34 | "image: url(:/qss/branch-closed.png);" \
35 | "}" \
36 | "QTreeView::indicator" \
37 | "{" \
38 | "width: 20px;" \
39 | "height: 20px;" \
40 | "}" \
41 | "QTreeView::indicator:enabled:unchecked" \
42 | "{" \
43 | " " \
44 | "image: url(:/Images/checkBox);" \
45 | "}" \
46 | "QTreeView::indicator:enabled:unchecked:hover" \
47 | "{" \
48 | "image: url(:/Images/checkBoxHover);" \
49 | "}" \
50 | "QTreeView::indicator:enabled:unchecked:pressed" \
51 | "{" \
52 | "image: url(:/Images/checkBoxPressed);" \
53 | "}" \
54 | "QTreeView::indicator:enabled:checked" \
55 | "{" \
56 | "image: url(:/Images/checkBoxChecked);" \
57 | "}" \
58 | "QTreeView::indicator:enabled:checked:hover" \
59 | "{" \
60 | "image: url(:/Images/checkBoxCheckedHover);" \
61 | "}" \
62 | "QTreeView::indicator:enabled:checked:pressed" \
63 | "{" \
64 | "image: url(:/Images/checkBoxCheckedPressed);" \
65 | "}" \
66 | "QTableView::indicator:enabled:indeterminate" \
67 | "{" \
68 | "image: url(:/Images/checkBoxIndeterminate);" \
69 | "}" \
70 | "QTreeView::indicator:enabled:indeterminate:hover" \
71 | "{" \
72 | "image: url(:/Images/checkBoxIndeterminateHover);" \
73 | "}" \
74 | "QTreeView::indicator:enabled:indeterminate:pressed" \
75 | "{" \
76 | "image: url(:/Images/checkBoxIndeterminatePressed);" \
77 | "}"
78 |
79 | #define buttonColorSelected \
80 | "QPushButton" \
81 | "{" \
82 | "background-color:#%1;" \
83 | "border-style:outset;" \
84 | "border:1px solid #7A7A7A;" \
85 | "}"
86 | };
87 |
88 | #endif // STYLE_SHEET_H
89 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_syntax_highlighter.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "ass_syntax_highlighter.h"
3 |
4 | AssSyntaxHighlighter::AssSyntaxHighlighter(QTextDocument *parent)
5 | : QSyntaxHighlighter(parent)
6 | {
7 | this->initSyntax();
8 | }
9 |
10 | void AssSyntaxHighlighter::initSyntax(void)
11 | {
12 | isEmpty = true;
13 | keyword_format.setForeground(COLOR_KEYWORD);
14 | section_line_format.setForeground(COLOR_SECTION_LINE);
15 | section_line_format.setFontWeight(QFont::Bold);
16 | comment_line_format.setForeground(COLOR_COMMENT_LINE);
17 | format_line_format.setForeground(COLOR_FORMAT_LINE);
18 | format_line_format.setFontWeight(QFont::Bold);
19 | }
20 |
21 | void AssSyntaxHighlighter::highlightBlock(const QString &text)
22 | {
23 | for(const HighlightingRule &rule : highlightingRules)
24 | {
25 | QRegExp expression(rule.pattern);
26 | int index = expression.indexIn(text);
27 | while(index >= 0)
28 | {
29 | int length = expression.matchedLength();
30 | setFormat(index, length, rule.format);
31 | index = expression.indexIn(text, index + length);
32 | }
33 | }
34 | setCurrentBlockState(0);
35 | }
36 |
37 | void AssSyntaxHighlighter::addSyntaxKeywords(const QStringList& keywords)
38 | {
39 | HighlightingRule rule;
40 | for(QString keyword : keywords)
41 | {
42 | QString pattern = QString(ASS_TAG_KEYWORD_QSTR).arg(keyword);
43 | rule.pattern = QRegExp(pattern);
44 | rule.format = keyword_format;
45 | highlightingRules.append(rule);
46 | }
47 | this->completeSyntax();
48 | }
49 |
50 | void AssSyntaxHighlighter::addSyntaxKeywords(const QStringList& keywords, const QTextCharFormat& format)
51 | {
52 | HighlightingRule rule;
53 | for(QString keyword : keywords)
54 | {
55 | QString pattern = QString(ASS_TAG_KEYWORD_QSTR).arg(keyword);
56 | rule.pattern = QRegExp(pattern);
57 | rule.format = format;
58 | highlightingRules.append(rule);
59 | }
60 | this->completeSyntax();
61 | }
62 |
63 | void AssSyntaxHighlighter::addSyntax(const QString& pattern, const QTextCharFormat& format)
64 | {
65 | HighlightingRule rule;
66 | rule.pattern = QRegExp(pattern);
67 | rule.format = format;
68 | highlightingRules.append(rule);
69 | this->completeSyntax();
70 | }
71 |
72 | void AssSyntaxHighlighter::completeSyntax(void)
73 | {
74 | isEmpty = false;
75 | }
76 |
77 | void AssSyntaxHighlighter::clearSyntax(void)
78 | {
79 | highlightingRules.clear();
80 | isEmpty = true;
81 | }
82 |
83 | bool AssSyntaxHighlighter::isHasRules(void)
84 | {
85 | return isEmpty;
86 | }
87 |
--------------------------------------------------------------------------------
/tcax-creator/designer/tcc_designer.h:
--------------------------------------------------------------------------------
1 | #ifndef TCC_DESIGNER_H
2 | #define TCC_DESIGNER_H
3 |
4 | #include "../com/tcax_helper.h"
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | #define TCC_COLOR_LENGTH (7)
16 | #define TCC_COLOR_LAST_CHAR L'\0'
17 | #define TCC_ALIGNMENT_DEFAULT (7)
18 |
19 | #define TCC_JSON_PY_FILE "file"
20 | #define TCC_JSON_BEG_LINE "from"
21 | #define TCC_JSON_END_LINE "to"
22 |
23 | #define TCC_K_MODE_NORMAL "normal"
24 | #define TCC_K_MODE_SYLLABLE "syllable"
25 | #define TCC_K_MODE_ADVANCED "advanced"
26 |
27 | #define TCC_TEXT_LAYOUT_HOR "horizontal"
28 | #define TCC_TEXT_LAYOUT_VER "vertical"
29 |
30 | #define TCC_PROP_ALIGNMENT "tcc_alignment"
31 |
32 | #define TCC_COLOR_INIT_MOJI "#"
33 |
34 | #define TCC_PY_LIST_JSON_ARRAY_PROP "py_json_array_prop"
35 | #define TCC_PY_LIST_MENU_ADD QObject::tr("Add")
36 | #define TCC_PY_LIST_MENU_DELETE QObject::tr("Delete")
37 | #define TCC_PY_LIST_MENU_MOVE_UP QObject::tr("Move Up")
38 | #define TCC_PY_LIST_MENU_MOVE_DOWN QObject::tr("Move Down")
39 |
40 | #define TCC_INDEX_OFFSET (1)
41 |
42 | #define TCC_LIB_NEO
43 |
44 | namespace Ui {
45 | class TccDesigner;
46 | }
47 |
48 | class TccDesigner : public QWidget
49 | {
50 | Q_OBJECT
51 |
52 | public:
53 | explicit TccDesigner(QWidget *parent = nullptr);
54 | ~TccDesigner();
55 | friend class MainWindow;
56 | friend class ScriptDesigner;
57 | QWidget *mainUi;
58 | void reload(const QString &a_filename);
59 | bool save(const QString &a_filename);
60 | bool isChanged(void);
61 |
62 | void setTccMap(TccMap a_tccMap);
63 | TccMap getTccMap(void);
64 |
65 | QT_DEPRECATED void setTccAttr(TCC_Attributes a_tccAttr);
66 | QT_DEPRECATED TCC_Attributes getTccAttr(void);
67 | QT_DEPRECATED void freeTccAttr(TCC_pAttributes a_pTccAttr);
68 |
69 | private slots:
70 | void colorChanged(QString a_colorString);
71 | void lineChanged(void);
72 | void selectColor(void);
73 |
74 | void on_comboBoxFontName_activated(const QString &a_text);
75 | void on_listWidgetLine_customContextMenuRequested(const QPoint &);
76 | void on_buttonBrowseSource_clicked();
77 | void on_buttonBrowsePython_clicked();
78 |
79 | private:
80 | void addCustomActions(void);
81 | void setPythonLines(const QJsonArray &a_jsonArray);
82 | QString getSrcFilename(const QString &a_filename);
83 |
84 | private:
85 | Ui::TccDesigner *ui;
86 | QButtonGroup *m_pButtonGroupAlignment;
87 | QMenu *m_pPyListMenu;
88 | QRegExpValidator *m_pRegExpValidator;
89 | };
90 |
91 | #endif // TCC_DESIGNER_H
92 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_ktag_typer.h:
--------------------------------------------------------------------------------
1 | #ifndef KASS_H
2 | #define KASS_H
3 |
4 | #include "ass_tag.h"
5 | #include "../com/common.h"
6 | #include "ass_syntax_highlighter.h"
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 |
34 | namespace Ui {
35 | class AssKtagTyper;
36 | }
37 |
38 | class AssKtagTyper : public QWidget
39 | {
40 | Q_OBJECT
41 |
42 | public:
43 | explicit AssKtagTyper(QWidget *parent = nullptr);
44 | ~AssKtagTyper() override;
45 |
46 | void reload(const QString &path);
47 | void setEditorHighlightSynth(AssSyntaxHighlighter *highlighter);
48 | QString getSavePath(QString path);
49 | QString callAssKtagTyper(QString rv_text);
50 | float calcTextLength(QString text);
51 | QString calcAssKtagTyperValue(QString start, QString end, float length);
52 | QString stripTag(QString text);
53 | QString getAssText(QStringList events);
54 |
55 | private slots:
56 | void dragEnterEvent(QDragEnterEvent *event) override;
57 | void dropEvent(QDropEvent *event) override;
58 | void dragMoveEvent(QDragMoveEvent *event) override;
59 | void closeEvent(QCloseEvent *event) override;
60 |
61 | void saveDiskFile(void);
62 | void saveAsDiskFile(void);
63 | void save(const QString &a_path);
64 | void pasteText(void);
65 | void slotTextEditSliderVertical(int value);
66 | void slotTextEditSliderHorizontal(int value);
67 | void slotTextEditMenuRequested(void);
68 | void slotHighlight(void);
69 | void slotActions(bool a_checked);
70 |
71 | void convert();
72 | void copy();
73 | void on_karaokeComboBox_activated(int index);
74 | void on_otherTagCheckBox_stateChanged(int arg1);
75 |
76 | private:
77 | void setup(void);
78 | void initParm(void);
79 | void setActions(void);
80 | void setHighlight(void);
81 |
82 | private:
83 | Ui::AssKtagTyper *ui;
84 | QClipboard *m_clipboard;
85 | AssSyntaxHighlighter *m_input_highlighter;
86 | AssSyntaxHighlighter *m_output_highlighter;
87 | QMenu *m_pTextEditMenu;
88 | QString input_path;
89 | bool isTimeLimted;
90 | int kCount;
91 | };
92 |
93 |
94 | #endif // KASS_H
95 |
--------------------------------------------------------------------------------
/tcax-creator/editor/py_syntax_highlighter.h:
--------------------------------------------------------------------------------
1 | #ifndef PY_SYNTAX_HIGHLIGHTER_H
2 | #define PY_SYNTAX_HIGHLIGHTER_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | QT_BEGIN_NAMESPACE
9 | class QTextDocument;
10 | QT_END_NAMESPACE
11 |
12 | enum class BlockState : int
13 | {
14 | LongStringSingleStart = 81,
15 | LongStringSingleMiddle,
16 | LongStringDoubleStart,
17 | LongStringDoubleMiddle
18 | };
19 |
20 | enum class TokenType
21 | {
22 | Undecided,
23 | Keyword,
24 | Operator,
25 | String,
26 | Number,
27 | Comment,
28 | };
29 |
30 | class PySyntaxHighlighter : public QSyntaxHighlighter
31 | {
32 | Q_OBJECT
33 | public:
34 | PySyntaxHighlighter(QTextDocument *parent = nullptr);
35 | ~PySyntaxHighlighter();
36 |
37 | enum ECOMMENT_TYPE {
38 | eCOMMENT_TYPE_SHARP,
39 | eCOMMENT_TYPE_DOBULE_SLASH,
40 | eCOMMENT_TYPE_MAX,
41 | };
42 |
43 | enum EHIGHLIGHTER_COLOR : int{
44 | eHIGHLIGHTER_COLOR_KEYWORD_R = 14,
45 | eHIGHLIGHTER_COLOR_KEYWORD_G = 170,
46 | eHIGHLIGHTER_COLOR_KEYWORD_B = 149,
47 |
48 | eHIGHLIGHTER_COLOR_OPERATOR_R = 185,
49 | eHIGHLIGHTER_COLOR_OPERATOR_G = 103,
50 | eHIGHLIGHTER_COLOR_OPERATOR_B = 78,
51 |
52 | eHIGHLIGHTER_COLOR_COMMENT_R = 127,
53 | eHIGHLIGHTER_COLOR_COMMENT_G = 127,
54 | eHIGHLIGHTER_COLOR_COMMENT_B = 127,
55 |
56 | eHIGHLIGHTER_COLOR_FUNCTION_R = 6,
57 | eHIGHLIGHTER_COLOR_FUNCTION_G = 115,
58 | eHIGHLIGHTER_COLOR_FUNCTION_B = 224,
59 |
60 | eHIGHLIGHTER_COLOR_STRING_R = 140,
61 | eHIGHLIGHTER_COLOR_STRING_G = 32,
62 | eHIGHLIGHTER_COLOR_STRING_B = 140,
63 |
64 | eHIGHLIGHTER_COLOR_NUMBER_R = 63,
65 | eHIGHLIGHTER_COLOR_NUMBER_G = 131,
66 | eHIGHLIGHTER_COLOR_NUMBER_B = 0,
67 | };
68 |
69 | QStringList m_keywordsList;
70 | QStringList m_operatorsList;
71 |
72 | QTextCharFormat m_keywordFormat;
73 | QTextCharFormat m_operatorFormat;
74 | QTextCharFormat m_commentFormat;
75 | QTextCharFormat m_functionFormat;
76 | QTextCharFormat m_stringFormat;
77 | QTextCharFormat m_numberFormat;
78 |
79 | public slots:
80 | void setup(void);
81 | virtual void clear(void);
82 | void addSyntaxKeywords(const QStringList& a_keywords, const QTextCharFormat& a_format = QTextCharFormat());
83 | void addSyntaxComment(const ECOMMENT_TYPE& a_type = eCOMMENT_TYPE_SHARP, const QTextCharFormat& a_format = QTextCharFormat());
84 | void addSyntaxFunction(const QTextCharFormat& a_format = QTextCharFormat());
85 | void addSyntax(const QString& a_pattern, const QTextCharFormat& a_format);
86 |
87 | protected:
88 | void highlightBlock(const QString &a_text);
89 |
90 | private:
91 | struct HighlightingRule
92 | {
93 | QRegularExpression pattern;
94 | QTextCharFormat format;
95 | };
96 | QVector m_highlightingRules;
97 |
98 | };
99 |
100 | #endif // PY_SYNTAX_HIGHLIGHTER_H
101 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/libtcc/string.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 milkyjing
3 | *
4 | * This Program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2, or (at your option)
7 | * any later version.
8 | *
9 | * This Program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with GNU Make; see the file COPYING. If not, write to
16 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
17 | * http://www.gnu.org/copyleft/gpl.html
18 | *
19 | */
20 |
21 | #ifndef STRING_H
22 | #define STRING_H
23 | #pragma once
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | #ifdef _MSC_VER
31 | #pragma warning(disable: 4996)
32 | #endif /* _MSC_VER */
33 |
34 | /* NULL terminated string */
35 | typedef struct _string {
36 | wchar_t *buffer;
37 | unsigned long capacity;
38 | unsigned long count; /* do not include the null terminator, and max count = capacity - 1 */
39 | } String;
40 |
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif /* __cplusplus */
44 |
45 | extern void string_init(String *s, unsigned long capacity);
46 |
47 | extern unsigned long string_get_size(const String *s);
48 |
49 | extern const wchar_t *string_get_buffer(const String *s);
50 |
51 | extern void string_assign(String *s, const wchar_t *wcs, unsigned long count);
52 |
53 | extern void string_assign_from_int(String *s, int i);
54 |
55 | extern void string_assign_from_double(String *s, double f);
56 |
57 | extern void string_append(String *s, const wchar_t *wcs, unsigned long count);
58 |
59 | extern void string_append_int(String *s, int i);
60 |
61 | extern void string_append_double(String *s, double f);
62 |
63 | extern void string_push_back(String *s, wchar_t w);
64 |
65 | extern void string_reverse(String *s);
66 |
67 | extern void string_clear(String *s);
68 |
69 | extern void string_copy(String *dst, const String *src);
70 |
71 | extern void string_copy_to_buffer(const String *s, wchar_t **pBuf);
72 |
73 | extern void string_to_lower_case(String *s);
74 |
75 | extern void string_to_upper_case(String *s);
76 |
77 | extern int string_ignore_case_compare(const String *s, const wchar_t *wcs, unsigned long count);
78 |
79 | /* merge all white spaces to a single half white space between two non white space characters in the string, here white space includes half or full white space and tab */
80 | extern void string_merge_all_white_spaces(String *s);
81 |
82 | /* discard begin and end white spaces in the string, here white space includes half or full white space and tab */
83 | extern void string_discard_begin_end_white_spaces_and_quote(String *s);
84 |
85 | #ifdef __cplusplus
86 | }
87 | #endif /* __cplusplus */
88 |
89 | #endif /* STRING_H */
90 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_tag.h:
--------------------------------------------------------------------------------
1 | #ifndef ASS_TAG_H
2 | #define ASS_TAG_H
3 |
4 | /*EOL str of ASS.*/
5 | static const char ASS_TAG_HARD_EOL[] = "\\N";
6 | static const char ASS_TAG_SOFT_EOL[] = "\\n";
7 | static const char ASS_TAG_BLANK[] = "\\h";
8 | static const char ASS_TAG_BLANK2[] = " ";
9 | static const char ASS_TAG_SKIP_FLAG[] = "\\";
10 | static const int ASS_TAG_SKIP_NUM = 2;
11 |
12 | /*KARAOKE tag of ASS.*/
13 | static const char ASS_TAG_KARAOKE_K_LOWER[] = "\\k";
14 | static const char ASS_TAG_KARAOKE_K_UPPER[] = "\\K";
15 | static const char ASS_TAG_KARAOKE_KF[] = "\\kf";
16 | static const char ASS_TAG_KARAOKE_KO[] = "\\ko";
17 |
18 | /*Ext of ASS.*/
19 | static const char ASS_EXT_TYPE_A[] = "ass";
20 | static const char ASS_EXT_TYPE_B[] = "ssa";
21 | static const char ASS_EXT_TYPE_C[] = "txt";
22 |
23 | /*AssTt tool.*/
24 | static const char ASS_TAG_TT[] = "\\t";
25 | static const char ASS_TAG_STR_TT[] = "%1(%2,%3,%4)";
26 |
27 | /*Tag of LRC*/
28 | static const char LRC_TAG_TI[] = "[ti:%1]";
29 | static const char LRC_TAG_AR[] = "[ar:%1]";
30 | static const char LRC_TAG_AL[] = "[al:%1]";
31 | static const char LRC_TAG_OFFSET[] = "[offset:%1]";
32 | static const char LRC_TAG_AUTHOR[] = "[by:%1]";
33 |
34 | /*Other str of ASS.*/
35 | static const char ASS_TAG_EVENT_FORMAT_DIALOGUE[] = "Dialogue";
36 | static const char ASS_TAG_EVENT_FORMAT_COMMENT[] = "Comment";
37 | static const char ASS_TAG_FORMAT[] = "Format";
38 | static const char ASS_TAG_STYLE[] = "Style";
39 | static const char ASS_TAG_TIMECODE_FORMAT[] = "h:mm:ss.z";
40 | static const char ASS_TAG_COMMA[] = ",";
41 | static const char ASS_TAG_BRACE_REGEXP[] = "(\\{)[^}]*(\\})";
42 | static const char ASS_TAG_COMMENT_SCRIPT_REGEXP[] = "^(Comment.*)";
43 | static const char ASS_TAG_FORMAT_REGEXP[] = "^(Format.*)";
44 | static const char ASS_TAG_STYLE_REGEXP[] = "^(Style.*)";
45 | static const char ASS_TAG_COMMENT_TEXT_REGEXP[] = "^(;.*)";
46 | static const char ASS_TAG_SECTION_REGEXP[] = "^(\\[.*\\])";
47 | static const char ASS_TAG_KEYWORD_QSTR[] = "(%1)";
48 |
49 | static const int ASS_FONT_SIZE = 10;
50 |
51 | static const char QT_EMPTY[] = "";
52 | static const char QT_BLANK[] = " ";
53 | static const char QT_EXT_SPLITE[] = ".";
54 | static const char QT_PATH_SPLITE[] = ";";
55 | static const char QT_META[] = "\\b";
56 | static const char QT_STR_ARG_1[] = "%1";
57 | static const char QT_STR_ARG_2[] = "%1%2";
58 | static const char QT_STR_ARG_3[] = "%1%2%3";
59 | static const char QT_STR_TAG[] = "{%1%2}";
60 | static const char QT_STR_TAG_OTR[] = "{%1}";
61 | static const char QT_STR_TAG_TEXT[] = "{%1%2}%3";
62 | static const char QT_STR_LRC_TEXT[] = "[%1]%2";
63 |
64 | enum class AssEvents {
65 | Layer = 0,
66 | Start,
67 | End,
68 | Style,
69 | Name,
70 | MarginL,
71 | MarginR,
72 | MarginV,
73 | Effect,
74 | Text,
75 | MaxEvent,
76 | };
77 |
78 | enum class CallK {
79 | Average,
80 | Fixed,
81 | Other,
82 | MaxCallK,
83 | };
84 |
85 | #endif // ASS_TAG_H
86 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_ttag_looper.cpp:
--------------------------------------------------------------------------------
1 | #include "ass_ttag_looper.h"
2 | #include "ui_ass_ttag_looper.h"
3 |
4 | AssTtagLooper::AssTtagLooper(QWidget *parent) :
5 | QWidget(parent),
6 | ui(new Ui::AssTtagLooper)
7 | {
8 | ui->setupUi(this);
9 | this->setup();
10 | }
11 |
12 | AssTtagLooper::~AssTtagLooper()
13 | {
14 | delete ui;
15 | }
16 |
17 | void AssTtagLooper::setup(void)
18 | {
19 | ui->textEdit->setWordWrapMode(QTextOption::WordWrap);
20 | this->setAttribute(Qt::WA_DeleteOnClose, true);
21 | this->setWindowTitle(tr("ASS T-tag Looper (TASS)"));
22 | this->setAcceptDrops(true);
23 | this->setFont(DEFAULT_FONT);
24 | }
25 |
26 | void AssTtagLooper::setEndTime(QString text)
27 | {
28 | QStringList events = text.split(ASS_TAG_COMMA);
29 |
30 | prev_calc_text = text;
31 | if(events.length() < static_cast(AssEvents::MaxEvent))
32 | {
33 | return;
34 | }
35 |
36 | /* Length OK. */
37 | QString start = events.at(static_cast(AssEvents::Start));
38 | QString end = events.at(static_cast(AssEvents::End));
39 | QTime startTime = QTime::fromString(start, ASS_TAG_TIMECODE_FORMAT);
40 | QTime endTime = QTime::fromString(end, ASS_TAG_TIMECODE_FORMAT);
41 | int elapsed_msecs = startTime.msecsTo(endTime);
42 |
43 | ui->endTimeSpinBox->setValue(elapsed_msecs);
44 | }
45 |
46 | QString AssTtagLooper::getPrevEffectText(void)
47 | {
48 | return prev_calc_text;
49 | }
50 |
51 | void AssTtagLooper::on_buttonClose_clicked()
52 | {
53 | this->close();
54 | }
55 |
56 | QString AssTtagLooper::tt(int start_time, int end_time, int fx_time, QString tag1, QString tag2)
57 | {
58 | QString tags = tag1;
59 | bool change_tag = false;
60 | QList array = range(start_time, end_time, fx_time);
61 |
62 | for(int i = 0; i < array.length(); i++)
63 | {
64 | int parm1 = array[i];
65 | int parm2 = parm1 + fx_time;
66 |
67 | if(change_tag)
68 | {
69 | QString tagAt = tag1;
70 | tag1 = tag2;
71 | tag2 = tagAt;
72 | change_tag = false;
73 | }
74 | tags += QString(ASS_TAG_STR_TT).arg(ASS_TAG_TT).arg(QString::number(parm1)).arg(QString::number(parm2)).arg(tag2);
75 | change_tag = true;
76 | }
77 | return tags;
78 | }
79 |
80 | QList AssTtagLooper::range(int start, int end, int step)
81 | {
82 | QList array;
83 |
84 | for(int i = start; i <= end; i += step)
85 | {
86 | array << i;
87 | }
88 | return array;
89 | }
90 |
91 | void AssTtagLooper::on_buttonMake_clicked()
92 | {
93 | int startTime = ui->startTimeSpinBox->value();
94 | int endTime = ui->endTimeSpinBox->value();
95 | int effectTime = ui->effectTimeSpinBox->value();
96 |
97 | QString tag1 = ui->initTagLineEdit->text();
98 | QString tag2 = ui->effectTagTineEdit->text();
99 |
100 | QString tag0 = ui->constTagLineEdit->text();
101 | QString text = ui->constTextLineEdit->text();
102 |
103 | QString tags = tt(startTime, endTime, effectTime, tag1, tag2);
104 |
105 | ui->textEdit->setText(QString(QT_STR_TAG_TEXT).arg(tag0).arg(tags).arg(text));
106 | }
107 |
--------------------------------------------------------------------------------
/tcax-creator/mainwindow.h:
--------------------------------------------------------------------------------
1 | #ifndef MAINWINDOW_H
2 | #define MAINWINDOW_H
3 |
4 | #include "com/common.h"
5 | #include "com/config.h"
6 | #include "com/style_sheet.h"
7 | #include "com/tcax_helper.h"
8 | #include "com/lua_helper.h"
9 | #include "com/preferences_dialog.h"
10 | #include "std/std_manager.h"
11 | #include "tools/ass_ktag_typer.h"
12 | #include "tools/ass_ttag_looper.h"
13 | #include "tools/ass_conv.h"
14 | #include "editor/py_syntax_highlighter.h"
15 |
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | #define WEB_PAGE_PROP "web_page_prop"
27 | #define TOOLS_PROP "tools_prop"
28 |
29 | using namespace StyleSheet;
30 |
31 | namespace Ui {
32 | class MainWindow;
33 | }
34 |
35 | class MainWindow : public QMainWindow
36 | {
37 | Q_OBJECT
38 |
39 | public:
40 | explicit MainWindow(QWidget *parent = nullptr);
41 | ~MainWindow();
42 |
43 | void setFolder(const QString &a_folder);
44 | QString folder(void);
45 |
46 | void setLoadedFile(const QString &a_loadedFile);
47 | QString loadedFile(void);
48 |
49 | private slots:
50 | void openProject(void);
51 | void openProject(QString a_folder);
52 | void reloadFile(const QFileInfo &a_fileInfo);
53 |
54 | private:
55 | void execArgument(void);
56 | void loadFonts(void);
57 | void setSyntax(void);
58 | void setActions(void);
59 | void clearSyntax(void);
60 | void updateCompilerIcon(void);
61 | QFileInfoList currentFolderTcc(void);
62 | void showMessage(const QString &a_message, const QColor &a_color = Qt::red);
63 | void getConfigRecent(void);
64 | void setConfigRecent(void);
65 |
66 | private slots:
67 | void keyPressEvent(QKeyEvent *event);
68 | void closeEvent(QCloseEvent *event);
69 | void dragEnterEvent(QDragEnterEvent* event);
70 | void dropEvent(QDropEvent* event);
71 | void fontPointSizeUpdated(int a_pointSize);
72 | void clearMsg(void);
73 | void fileChanged(void);
74 | void newFile(void);
75 | void openFolder(void);
76 | void save(void);
77 | void openTools(void);
78 | void projectCompile(void);
79 | void projectClean(void);
80 | void projectExplore(void);
81 | void tcaxExplore(void);
82 | QPair selectedCompiler(void);
83 | void slotAbout(void);
84 | void openWebs(void);
85 | void slotFileSystem(void);
86 | void addRecent(const QString &a_recent);
87 | bool isSaved(void); /// unused
88 | void setSaved(bool a_isSaved); /// unused
89 |
90 | private slots:
91 | void on_folderTreeView_activated(const QModelIndex &a_index);
92 | void on_folderTreeView_customContextMenuRequested(const QPoint &a_pos);
93 |
94 | private:
95 | Ui::MainWindow *ui;
96 | QMenu *m_pFileSystemMenu;
97 | QString m_folder;
98 | QString m_loadedFile;
99 | QTimer *m_pTimerMsg;
100 | QFileSystemModel *m_model;
101 | QFileSystemWatcher *m_fsWatcher;
102 | PySyntaxHighlighter *m_pSyntaxHighlighter;
103 | QActionGroup *m_pActionGroupRecent;
104 | };
105 |
106 | #endif // MAINWINDOW_H
107 |
--------------------------------------------------------------------------------
/tcax-creator/com/preferences_dialog.cpp:
--------------------------------------------------------------------------------
1 | #include "preferences_dialog.h"
2 | #include "ui_preferences_dialog.h"
3 |
4 | Preferences::Preferences(QDialog *parent) :
5 | QDialog(parent),
6 | ui(new Ui::Preferences)
7 | {
8 | ui->setupUi(this);
9 | this->setup();
10 | }
11 |
12 | Preferences::~Preferences()
13 | {
14 | delete ui;
15 | }
16 |
17 | void Preferences::setup(void)
18 | {
19 | ui->comboBoxStyleFactory->addItems(QStyleFactory::keys());
20 | this->setWindowTitle(tr("Preferences"));
21 | this->setFont(DEFAULT_FONT);
22 | this->loadCommonConfig();
23 |
24 | connect(ui->checkBoxEditorSizeLimit, SIGNAL(stateChanged(int)), this, SLOT(slotConfigChanged(int)));
25 | connect(ui->checkBoxSetStyleFactory, SIGNAL(stateChanged(int)), this, SLOT(slotConfigChanged(int)));
26 | connect(ui->comboBoxStyleFactory, SIGNAL(currentIndexChanged(int)), this, SLOT(slotConfigChanged(int)));
27 | }
28 |
29 | void Preferences::loadCommonConfig(void)
30 | {
31 | ui->checkBoxShowSplashScreen->setChecked(g_pConfig->getConfig(Config::eCONFIG_COMMON_SHOW_SPLASH_SCREEN).toBool());
32 | ui->checkBoxEditorSizeLimit->setChecked(g_pConfig->getConfig(Config::eCONFIG_COMMON_EDITOR_FILE_LIMIT_ENABLE).toBool());
33 | ui->spinBoxFileSizeLimit->setValue(g_pConfig->getConfig(Config::eCONFIG_COMMON_EDITOR_FILE_LIMIT_SIZE).toInt());
34 | ui->spinBoxFileSizeLimit->setEnabled(ui->checkBoxEditorSizeLimit->isChecked());
35 | ui->checkBoxSetStyleFactory->setChecked(g_pConfig->getConfig(Config::eCONFIG_COMMON_STYLE_FACTORY_ENABLE).toBool());
36 | ui->comboBoxStyleFactory->setCurrentText(g_pConfig->getConfig(Config::eCONFIG_COMMON_STYLE_FACTORY).toString());
37 | ui->comboBoxStyleFactory->setEnabled(ui->checkBoxSetStyleFactory->isChecked());
38 | }
39 |
40 | void Preferences::on_buttonReset_clicked()
41 | {
42 | g_pConfig->reset();
43 | loadCommonConfig();
44 | }
45 |
46 | void Preferences::on_buttonClose_clicked()
47 | {
48 | g_pConfig->setConfig(Config::eCONFIG_COMMON_SHOW_SPLASH_SCREEN, ui->checkBoxShowSplashScreen->isChecked());
49 | g_pConfig->setConfig(Config::eCONFIG_COMMON_EDITOR_FILE_LIMIT_ENABLE, ui->checkBoxEditorSizeLimit->isChecked());
50 | g_pConfig->setConfig(Config::eCONFIG_COMMON_EDITOR_FILE_LIMIT_SIZE, ui->spinBoxFileSizeLimit->value());
51 | g_pConfig->setConfig(Config::eCONFIG_COMMON_STYLE_FACTORY_ENABLE, ui->checkBoxSetStyleFactory->isChecked());
52 | g_pConfig->setConfig(Config::eCONFIG_COMMON_STYLE_FACTORY, ui->comboBoxStyleFactory->currentText());
53 | this->accept();
54 | }
55 |
56 | void Preferences::slotConfigChanged(int a_arg1)
57 | {
58 | if(sender() == ui->checkBoxEditorSizeLimit)
59 | {
60 | ui->spinBoxFileSizeLimit->setEnabled( (a_arg1 == Qt::Unchecked) ? false : true );
61 | }
62 | else if(sender() == ui->checkBoxSetStyleFactory)
63 | {
64 | ui->comboBoxStyleFactory->setEnabled( (a_arg1 == Qt::Unchecked) ? false : true );
65 | ui->comboBoxStyleFactory->setCurrentText(g_pConfig->getConfigDefault(Config::eCONFIG_COMMON_STYLE_FACTORY).toString());
66 | QApplication::setStyle(g_pConfig->getConfigDefault(Config::eCONFIG_COMMON_STYLE_FACTORY).toString());
67 |
68 | }
69 | else if(sender() == ui->comboBoxStyleFactory)
70 | {
71 | QApplication::setStyle(ui->comboBoxStyleFactory->currentText());
72 | }
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/helper/hla_util.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 milkyjing
3 | *
4 | * This software is provided 'as-is', without any express or implied
5 | * warranty. In no event will the authors be held liable for any damages
6 | * arising from the use of this software.
7 | *
8 | * Permission is granted to anyone to use this software for any purpose,
9 | * including commercial applications, and to alter it and redistribute it
10 | * freely, subject to the following restrictions:
11 | *
12 | * 1. The origin of this software must not be misrepresented; you must not
13 | * claim that you wrote the original software. If you use this software
14 | * in a product, an acknowledgment in the product documentation would be
15 | * appreciated but is not required.
16 | * 2. Altered source versions must be plainly marked as such, and must not be
17 | * misrepresented as being the original software.
18 | * 3. This notice may not be removed or altered from any source distribution.
19 | *
20 | * milkyjing
21 | *
22 | */
23 |
24 | #include "hla_util.h"
25 |
26 |
27 | TCAS_Error_Code libtcas_file_shift_time(const char *filename, int iShiftTime) {
28 | TCAS_File file;
29 | TCAS_Header header;
30 | TCAS_Error_Code error;
31 | error = libtcas_open_file(&file, filename, tcas_file_read_write);
32 | if (tcas_error_success != error)
33 | return error;
34 | libtcas_read_header(&file, &header, tcas_false);
35 | header.minTime += iShiftTime;
36 | header.maxTime += iShiftTime;
37 | libtcas_write_header(&file, &header, tcas_false);
38 | if (TCAS_FILE_TYPE_COMPRESSED == GETHI16B(header.flag) || TCAS_FILE_TYPE_PARSED == GETHI16B(header.flag)) {
39 | tcas_u32 i;
40 | long offset;
41 | tcas_unit buf[3]; /* a temp buffer to hold startTime endTime cltp */
42 | for (i = 0; i < header.chunks; i++) {
43 | fread(buf, sizeof(tcas_unit), 3, file.fp);
44 | buf[0] += iShiftTime;
45 | buf[1] += iShiftTime;
46 | offset = -3 * (int)sizeof(tcas_unit);
47 | tcas_fseek(file.fp, offset, SEEK_CUR);
48 | fwrite(buf, sizeof(tcas_unit), 2, file.fp);
49 | tcas_fseek(file.fp, (1 + (GETCOUNT(buf[2]) << 1)) * sizeof(tcas_unit), SEEK_CUR);
50 | }
51 | } else if (TCAS_FILE_TYPE_COMPRESSED_Z == GETHI16B(header.flag) || TCAS_FILE_TYPE_PARSED_Z == GETHI16B(header.flag)) {
52 | tcas_u32 i;
53 | long offset;
54 | tcas_unit zSizePadded;
55 | tcas_unit buf[4]; /* a temp buffer to hold startTime endTime cltp zSize */
56 | for (i = 0; i < header.chunks; i++) {
57 | fread(buf, sizeof(tcas_unit), 4, file.fp);
58 | buf[0] += iShiftTime;
59 | buf[1] += iShiftTime;
60 | offset = -4 * (int)sizeof(tcas_unit);
61 | tcas_fseek(file.fp, offset, SEEK_CUR);
62 | fwrite(buf, sizeof(tcas_unit), 2, file.fp);
63 | zSizePadded = buf[3] >> 2;
64 | if ((0x00000003 & buf[3]) != 0)
65 | zSizePadded++;
66 | tcas_fseek(file.fp, (2 + zSizePadded) * sizeof(tcas_unit), SEEK_CUR);
67 | }
68 | } else {
69 | libtcas_close_file(&file);
70 | return tcas_error_file_type_not_support;
71 | }
72 | libtcas_close_file(&file);
73 | return tcas_error_success;
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/libmap/strmap.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 milkyjing
3 | *
4 | * This software is provided 'as-is', without any express or implied
5 | * warranty. In no event will the authors be held liable for any damages
6 | * arising from the use of this software.
7 | *
8 | * Permission is granted to anyone to use this software for any purpose,
9 | * including commercial applications, and to alter it and redistribute it
10 | * freely, subject to the following restrictions:
11 | *
12 | * 1. The origin of this software must not be misrepresented; you must not
13 | * claim that you wrote the original software. If you use this software
14 | * in a product, an acknowledgment in the product documentation would be
15 | * appreciated but is not required.
16 | * 2. Altered source versions must be plainly marked as such, and must not be
17 | * misrepresented as being the original software.
18 | * 3. This notice may not be removed or altered from any source distribution.
19 | *
20 | * milkyjing
21 | *
22 | */
23 |
24 | #ifndef STRMAP_H
25 | #define STRMAP_H
26 | #pragma once
27 |
28 | #include "tccmap.h"
29 |
30 | #include
31 | #include
32 |
33 | #if defined WIN32
34 | #include
35 | #else
36 | #include
37 | #endif /* WIN32 */
38 |
39 |
40 |
41 | #define SCAN_STAT_INIT 0 /**< before the '<' mark */
42 | #define SCAN_STAT_BEFORE_KEY 1 /**< between the '<' mark and the very first non-space character */
43 | #define SCAN_STAT_KEY 2 /**< parsing the key */
44 | #define SCAN_STAT_AFTER_KEY 3 /**< between the last non-space character and the '=' mark */
45 | #define SCAN_STAT_BEFORE_VALUE 4 /**< between the '=' mark and the very first non-space character */
46 | #define SCAN_STAT_VALUE 5 /**< parsing the value */
47 | #define SCAN_STAT_AFTER_VALUE 6 /**< between the last non-space character and the '>' mark */
48 | #define SCAN_STAT_FIN 7 /**< after the '>' mark */
49 |
50 | #define QUOTE_FLAG_NONE 0 /**< no quote mark */
51 | #define QUOTE_FLAG_QUOTED 1 /**< the content is quoted */
52 | #define QUOTE_FLAG_ENCLOSED 0 /**< end of the quoted content */
53 |
54 |
55 | typedef struct _str_map {
56 | wchar_t *buffer; /**< buffer of the file, in wide char mode */
57 | int count; /**< characters of buffer including the NULL terminator, and maybe the BOM */
58 | TccMapPtr map; /**< the tcc map */
59 | } StrMap, *StrMapPtr;
60 |
61 |
62 | /* Inhibit C++ name-mangling for libmap functions but not for system calls. */
63 | #ifdef __cplusplus
64 | extern "C" {
65 | #endif /* __cplusplus */
66 |
67 | /**
68 | * Read a map (plain text) file and convert to a utf-8 string.
69 | * @param filename the filename of the target map file
70 | * @param mptr a pointer to StrMap struct
71 | * @return 0 on success, -1 on failure
72 | */
73 | extern int libmap_read_map_file(const char *filename, StrMapPtr mptr);
74 |
75 | /**
76 | * Parse the buffer to map
77 | * @param mptr a pointer to StrMap struct
78 | */
79 | extern void libmap_parse(StrMapPtr mptr);
80 |
81 | /**
82 | * Polish the keys and values of the map, merge white spaces into a single space, reduce the "" to "
83 | * @param mptr a pointer to StrMap struct
84 | */
85 | extern void libmap_polish(StrMapPtr mptr);
86 |
87 | /**
88 | * Destroy the map
89 | * @param mptr a pointer to StrMap struct
90 | */
91 | extern void libmap_destroy(StrMapPtr mptr);
92 |
93 | #ifdef __cplusplus
94 | }
95 | #endif /* __cplusplus */
96 |
97 | #endif /* STRMAP_H */
98 |
99 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/helper/rb.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Red-Black Tree C Implementation, borrowed the mind of libavl
3 | * For The libtcas Project
4 | * Copyright (C) 2011 milkyjing
5 | * October 21th, 2011
6 | *
7 | * This software is provided 'as-is', without any express or implied
8 | * warranty. In no event will the authors be held liable for any damages
9 | * arising from the use of this software.
10 | *
11 | * Permission is granted to anyone to use this software for any purpose,
12 | * including commercial applications, and to alter it and redistribute it
13 | * freely, subject to the following restrictions:
14 | *
15 | * 1. The origin of this software must not be misrepresented; you must not
16 | * claim that you wrote the original software. If you use this software
17 | * in a product, an acknowledgment in the product documentation would be
18 | * appreciated but is not required.
19 | * 2. Altered source versions must be plainly marked as such, and must not be
20 | * misrepresented as being the original software.
21 | * 3. This notice may not be removed or altered from any source distribution.
22 | *
23 | * milkyjing
24 | *
25 | */
26 |
27 | #ifndef __RED_BLACK_TREE_H__
28 | #define __RED_BLACK_TREE_H__
29 | #pragma once
30 |
31 | #include
32 |
33 |
34 | #define RB_MAX_HEIGHT 48 /* large enough, since the red-black tree is well balanced */
35 |
36 | typedef void *rb_entry_ptr; /* type of the data stored in the node */
37 |
38 | typedef enum _rb_color {
39 | RB_BLACK, /* Black. */
40 | RB_RED /* Red. */
41 | } RbColor;
42 |
43 | typedef struct _rb_node {
44 | struct _rb_node *link[2]; /* to avoid the symmetric code, and should be placed as the first data member for convinent memory access reason */
45 | rb_entry_ptr data; /* Pointer to data. */
46 | unsigned char color; /* Color. */
47 | } RbNode, *RbNodePtr;
48 |
49 | typedef int (*rb_compare_func)(const rb_entry_ptr, const rb_entry_ptr, const void *); /* this function is very important, and should be specifed */
50 | typedef rb_entry_ptr (*rb_copy_func)(const rb_entry_ptr, const void *);
51 | typedef void (*rb_cleanup_func)(rb_entry_ptr, const void *); /* the parameter passed to clean_f is the address of the ith element */
52 |
53 | typedef struct _rb_tree {
54 | RbNodePtr root; /* Tree's root. */
55 | rb_compare_func compare_f; /* Comparison function. */
56 | void *param; /* extra param for comparison */
57 | int count; /* Number of items in tree. */
58 | rb_copy_func copy_f; /* copy function, can be NULL */
59 | rb_cleanup_func clean_f; /* cleanup function, can be NULL */
60 | } RbTree, *RbTreePtr;
61 |
62 | #define rbtree_count(tree) ((RbTreePtr)(tree)->count)
63 |
64 |
65 | #ifdef __cplusplus
66 | extern "C" {
67 | #endif /* __cplusplus */
68 |
69 | extern RbTreePtr rbtree_create(rb_compare_func compare_f, rb_copy_func copy_f, rb_cleanup_func clean_f, void *param);
70 |
71 | extern rb_entry_ptr rbtree_find(const RbTreePtr tree, const rb_entry_ptr key);
72 |
73 | extern rb_entry_ptr *rbtree_probe(RbTreePtr tree, const rb_entry_ptr item);
74 |
75 | extern int rbtree_insert(RbTreePtr tree, const rb_entry_ptr item);
76 |
77 | extern int rbtree_delete(RbTreePtr tree, const rb_entry_ptr key);
78 |
79 | extern rb_entry_ptr rbtree_min(const RbTreePtr tree);
80 |
81 | extern rb_entry_ptr rbtree_max(const RbTreePtr tree);
82 |
83 | extern void rbtree_destroy(RbTreePtr tree);
84 |
85 | #ifdef __cplusplus
86 | }
87 | #endif
88 |
89 | #endif /* __RED_BLACK_TREE_H__ */
90 |
91 |
--------------------------------------------------------------------------------
/tcax-creator/com/lua_helper.cpp:
--------------------------------------------------------------------------------
1 | #include "lua_helper.h"
2 |
3 | bool LuaHelper::luaDoFile(const QString &a_luaFile, const QString &a_funcName, const QVariant &a_arg1, const QVariant &a_arg2, bool a_fromRes)
4 | {
5 | bool ret = true;
6 | int retLua = eINDEX_0;
7 | QString scriptFile;
8 | QString script;
9 | lua_State *lua = nullptr;
10 |
11 | if(a_fromRes)
12 | {
13 | scriptFile = QString(":/scripts/%1").arg(a_luaFile);
14 | }
15 | else
16 | {
17 | scriptFile = Common::findFirstFilePath(a_luaFile).remove(QT_DQM);
18 | }
19 |
20 | if(!QFileInfo(scriptFile).isFile())
21 | {
22 | qDebug() << "Lua none script!";
23 | return false;
24 | }
25 |
26 | script = Common::getFileText(scriptFile);
27 | if(script.isEmpty())
28 | {
29 | qDebug() << "Lua empty script!";
30 | return false;
31 | }
32 |
33 | lua = luaL_newstate();
34 | if(lua == nullptr)
35 | {
36 | qDebug() << "Lua new state failed!";
37 | ret = false;
38 | }
39 |
40 | luaL_openlibs(lua);
41 |
42 | if(lua == nullptr)
43 | {
44 | qDebug() << "Lua open libs failed!";
45 | ret = false;
46 | }
47 |
48 | retLua = luaL_dostring(lua, script.toStdString().c_str());
49 |
50 | if(retLua)
51 | {
52 | qDebug() << "Lua dofile failed!";
53 | ret = false;
54 | }
55 |
56 | lua_getglobal(lua, a_funcName.toStdString().c_str());
57 |
58 | if(a_arg1.type() == QVariant::Double)
59 | {
60 | lua_pushnumber(lua, a_arg1.toDouble());
61 | }
62 | else if(a_arg1.type() == QVariant::Bool)
63 | {
64 | lua_pushboolean(lua, a_arg1.toInt());
65 | }
66 | else
67 | {
68 | lua_pushstring(lua, a_arg1.toString().toStdString().c_str());
69 | }
70 |
71 | if(a_arg2.type() == QVariant::Double)
72 | {
73 | lua_pushnumber(lua, a_arg2.toDouble());
74 | }
75 | else if(a_arg2.type() == QVariant::Bool)
76 | {
77 | lua_pushboolean(lua, a_arg2.toInt());
78 | }
79 | else
80 | {
81 | lua_pushstring(lua, a_arg2.toString().toStdString().c_str());
82 | }
83 |
84 | retLua = lua_pcall(lua, 2, 1, 0);
85 | ret = QVariant(lua_toboolean(lua, -1)).toBool();
86 |
87 | if(retLua)
88 | {
89 | qDebug() << "Lua pcall error occured!";
90 | ret = false;
91 | }
92 |
93 | if(!ret)
94 | {
95 | qDebug() << "Lua return value is" << ret;
96 | }
97 |
98 | lua_close(lua);
99 |
100 | return ret;
101 | }
102 |
103 | bool LuaHelper::lyricToAssSafe(const QString &a_srcPath, const QString &a_tarPath)
104 | {
105 | bool ret = false;
106 | QString tempFileSrc = Common::creatTempFilename(QFileInfo(a_srcPath).suffix());
107 | QString tempFileTar = Common::creatTempFilename(QFileInfo(a_tarPath).suffix());
108 |
109 | if(tempFileSrc.isEmpty() || tempFileTar.isEmpty())
110 | {
111 | return ret;
112 | }
113 |
114 | QFile::remove(tempFileSrc);
115 |
116 | if(QFile::copy(a_srcPath, tempFileSrc))
117 | {
118 | if(lyricToAss(tempFileSrc, tempFileTar))
119 | {
120 | QFile::remove(a_tarPath);
121 |
122 | if(QFile::copy(tempFileTar, a_tarPath))
123 | {
124 | QFile::remove(tempFileSrc);
125 | QFile::remove(tempFileTar);
126 | ret = true;
127 | }
128 | }
129 | }
130 |
131 | return ret;
132 | }
133 |
134 | bool LuaHelper::lyricToAss(const QString &a_srcPath, const QString &a_tarPath)
135 | {
136 | return luaDoFile("lyric2ass.lua", "lyric_to_ass", a_srcPath, a_tarPath, true);
137 | }
138 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_editor.cpp:
--------------------------------------------------------------------------------
1 | #include "ass_editor.h"
2 |
3 | #include
4 |
5 |
6 | AssEditor::AssEditor(QWidget *parent) : QPlainTextEdit(parent)
7 | {
8 | lineNumberArea = new LineNumberArea(this);
9 |
10 | connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
11 | connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
12 | connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));
13 |
14 | updateLineNumberAreaWidth(0);
15 | highlightCurrentLine();
16 | }
17 |
18 | int AssEditor::lineNumberAreaWidth()
19 | {
20 | int digits = 1;
21 | int max = qMax(1, blockCount());
22 | while (max >= 10)
23 | {
24 | max /= 10;
25 | ++digits;
26 | }
27 | if(digits < 2)
28 | {
29 | digits = 2;
30 | }
31 | int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits;
32 | return space;
33 | }
34 |
35 | void AssEditor::updateLineNumberAreaWidth(int /* newBlockCount */)
36 | {
37 | setViewportMargins(lineNumberAreaWidth(), 0, 0, 0);
38 | }
39 |
40 | void AssEditor::updateLineNumberArea(const QRect &rect, int dy)
41 | {
42 | if (dy)
43 | lineNumberArea->scroll(0, dy);
44 | else
45 | lineNumberArea->update(0, rect.y(), lineNumberArea->width(), rect.height());
46 |
47 | if (rect.contains(viewport()->rect()))
48 | updateLineNumberAreaWidth(0);
49 | }
50 |
51 | void AssEditor::resizeEvent(QResizeEvent *e)
52 | {
53 | QPlainTextEdit::resizeEvent(e);
54 |
55 | QRect cr = contentsRect();
56 | lineNumberArea->setGeometry(QRect(cr.left(), cr.top(), lineNumberAreaWidth(), cr.height()));
57 | }
58 |
59 | void AssEditor::highlightCurrentLine()
60 | {
61 | QList extraSelections;
62 |
63 | if (!isReadOnly())
64 | {
65 | QTextEdit::ExtraSelection selection;
66 |
67 | QColor lineColor = QColor((int)ColorHighlight::r, (int)ColorHighlight::g, (int)ColorHighlight::b);
68 |
69 | selection.format.setBackground(lineColor);
70 | selection.format.setProperty(QTextFormat::FullWidthSelection, true);
71 | selection.cursor = textCursor();
72 | selection.cursor.clearSelection();
73 | extraSelections.append(selection);
74 | }
75 |
76 | setExtraSelections(extraSelections);
77 | }
78 |
79 |
80 |
81 | void AssEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
82 | {
83 | QPainter painter(lineNumberArea);
84 | painter.fillRect(event->rect(), QColor((int)ColorLineNumArea::r, (int)ColorLineNumArea::g, (int)ColorLineNumArea::b));
85 |
86 | QTextBlock block = firstVisibleBlock();
87 | int blockNumber = block.blockNumber();
88 | int top = (int) blockBoundingGeometry(block).translated(contentOffset()).top();
89 | int bottom = top + (int) blockBoundingRect(block).height();
90 |
91 | while (block.isValid() && top <= event->rect().bottom())
92 | {
93 | if (block.isVisible() && bottom >= event->rect().top())
94 | {
95 | QString number = QString::number(blockNumber + 1);
96 | painter.setPen(QColor((int)ColorLineNum::r, (int)ColorLineNum::g, (int)ColorLineNum::b));
97 | painter.drawText(0, top, lineNumberArea->width(), fontMetrics().height(),
98 | Qt::AlignRight, number);
99 | }
100 |
101 | block = block.next();
102 | top = bottom;
103 | bottom = top + (int) blockBoundingRect(block).height();
104 | ++blockNumber;
105 | }
106 | }
107 |
108 | QString AssEditor::getCurrentCursorText(void)
109 | {
110 | QTextCursor cur = this->textCursor();
111 | return cur.block().text();
112 | }
113 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/libtcc/map.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 milkyjing
3 | *
4 | * This Program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2, or (at your option)
7 | * any later version.
8 | *
9 | * This Program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with GNU Make; see the file COPYING. If not, write to
16 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
17 | * http://www.gnu.org/copyleft/gpl.html
18 | *
19 | */
20 |
21 | #ifndef MAP_H
22 | #define MAP_H
23 | #pragma once
24 |
25 | #include
26 | #include
27 |
28 | typedef void *map_key_ptr;
29 | typedef void *map_value_ptr;
30 |
31 | typedef void (*map_key_copy_func)(map_key_ptr, const map_key_ptr);
32 | typedef void (*map_value_copy_func)(map_value_ptr, const map_value_ptr);
33 | typedef void (*map_key_cleanup_func)(map_key_ptr);
34 | typedef void (*map_value_cleanup_func)(map_value_ptr);
35 | typedef int (*map_key_compare_func)(const map_key_ptr, const map_key_ptr);
36 | typedef int (*map_value_compare_func)(const map_value_ptr, const map_value_ptr);
37 |
38 | /* one key may have multiple values, specified by offset */
39 | typedef struct _map {
40 | map_key_ptr keyBuf;
41 | map_value_ptr valueBuf;
42 | unsigned long keySize;
43 | unsigned long valueSize;
44 | unsigned long capacity;
45 | unsigned long count; /* number of elements (values) */
46 | map_key_copy_func copy_key;
47 | map_value_copy_func copy_value;
48 | map_key_cleanup_func clean_key;
49 | map_value_cleanup_func clean_value;
50 | map_key_compare_func compare_key;
51 | map_value_compare_func compare_value;
52 | int offset; /* a key may be assigned with multiple values, so offset is used to specify which value to retrieve */
53 | } Map, *MapPtr;
54 |
55 | #ifdef __cplusplus
56 | extern "C" {
57 | #endif /* __cplusplus */
58 |
59 | extern void map_create(MapPtr *pmptr, unsigned long keySize, unsigned long valueSize, unsigned long elements, map_key_copy_func copy_key, map_value_copy_func copy_value, map_key_cleanup_func clean_key, map_value_cleanup_func clean_value, map_key_compare_func compare_key, map_value_compare_func compare_value);
60 |
61 | extern unsigned long map_get_size(const MapPtr mptr);
62 |
63 | extern int map_get_offset(const MapPtr mptr);
64 |
65 | extern void map_set_offset(MapPtr mptr, int offset);
66 |
67 | extern void map_reset_offset(MapPtr mptr);
68 |
69 | extern void map_increase_offset(MapPtr mptr);
70 |
71 | /* assign the key (first one) with a new value, the key must be existed */
72 | extern int map_assign_to_key(MapPtr mptr, const map_key_ptr key, const map_value_ptr value);
73 |
74 | /* replace the key and value at position i */
75 | extern int map_assign_at(MapPtr mptr, unsigned long i, const map_key_ptr key, const map_value_ptr value);
76 |
77 | /* you can retrieve n times to get all the values of a duplicate key, offset will automatically increase, value can be NULL */
78 | extern const map_value_ptr map_retrieve(MapPtr mptr, const map_key_ptr key, map_value_ptr value);
79 |
80 | extern void map_push_back(MapPtr mptr, const map_key_ptr key, const map_value_ptr value);
81 |
82 | extern int map_pop_back(MapPtr mptr);
83 |
84 | extern void map_clear(MapPtr mptr);
85 |
86 | extern void map_destroy(MapPtr mptr);
87 |
88 | #ifdef __cplusplus
89 | }
90 | #endif /* __cplusplus */
91 |
92 | #endif /* MAP_H */
93 |
--------------------------------------------------------------------------------
/tcax-creator/res/res.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | fonts/consola.ttf
4 | icons/tcax.ico
5 | buttons/cog.png
6 | buttons/compile_error.png
7 | buttons/disk.png
8 | buttons/folder.png
9 | buttons/folder_add.png
10 | buttons/folder_magnify.png
11 | buttons/font.png
12 | buttons/github.png
13 | buttons/vsedit.png
14 | buttons/wrench.png
15 | svgs/browse.svg
16 | svgs/close.svg
17 | svgs/shift.svg
18 | buttons/page_white_text.png
19 | buttons/avsp.ico
20 | buttons/python.png
21 | buttons/tcax.png
22 | buttons/add.png
23 | buttons/folder_page_white.png
24 | buttons/arrow_down.png
25 | buttons/arrow_up.png
26 | buttons/book_open.png
27 | buttons/cross.png
28 | buttons/cross_grey.png
29 | buttons/text_wrapping.png
30 | buttons/trash.png
31 | buttons/compile.png
32 | buttons/compile_warning.png
33 | buttons/information.png
34 | strings/about
35 | strings/manual.html
36 | buttons/eyedropper_tool.png
37 | buttons/tc.png
38 | buttons/insert_text.png
39 | strings/template/template.avs
40 | strings/template/template.py
41 | strings/template/template.tcc
42 | strings/template/template.vpy
43 | strings/template/template.ass
44 | buttons/accept.png
45 | buttons/pause_green.png
46 | buttons/page_paste.png
47 | buttons/color_wheel.png
48 | buttons/disk_multiple.png
49 | buttons/page_white_add.png
50 | buttons/page_white_code_red.png
51 | buttons/plugin.png
52 | buttons/plugin_disabled.png
53 | buttons/report_link.png
54 | buttons/tab_go.png
55 | buttons/wand.png
56 | buttons/world_link.png
57 | buttons/erase.png
58 | buttons/synchronous_scrolling.png
59 | buttons/draw_eraser.png
60 | buttons/toggle_tag_hiding.png
61 | images/tcax-logo.png
62 | buttons/benchmark.png
63 | buttons/color_picker.png
64 | buttons/color_swatch.png
65 | buttons/flag_china.png
66 | buttons/flag_default.png
67 | buttons/flag_great_britain.png
68 | buttons/flag_japan.png
69 | buttons/link.png
70 | buttons/properties.png
71 | buttons/tag_blue_edit.png
72 | buttons/restart.png
73 | buttons/folder_link.png
74 | scripts/lyric2ass.lua
75 | scripts/png2ass.py
76 | buttons/file_extension_txt.png
77 | buttons/open_with.png
78 | buttons/application_go.png
79 | buttons/bullet_go.png
80 | buttons/page_white_go.png
81 | buttons/page_white_stack.png
82 | buttons/qt.png
83 |
84 |
85 |
--------------------------------------------------------------------------------
/tcax-creator/std/std_watcher.h:
--------------------------------------------------------------------------------
1 | #ifndef STD_WATCHER_H
2 | #define STD_WATCHER_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include "../com/common.h"
10 |
11 | #define StdWatcherMoudleName QObject::tr("StdWatcher")
12 |
13 | class MainWindow;
14 |
15 | namespace Ui {
16 | class StdWatcher;
17 | }
18 |
19 | class StdWatcherCmd
20 | {
21 | public:
22 | QString cmd;
23 | QString pipe;
24 | };
25 |
26 | class StdWatcher : public QWidget
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | explicit StdWatcher(QWidget *parent = nullptr);
32 | ~StdWatcher();
33 | class MainWindow *mainUi;
34 |
35 | enum EHANDLER_TYPE {
36 | eHANDLER_TYPE_STARTED,
37 | eHANDLER_TYPE_ERROR,
38 | eHANDLER_TYPE_FINISHED,
39 | eHANDLER_TYPE_MAX,
40 | };
41 |
42 | enum EDATA_TYPE {
43 | eDATA_TYPE_UTF8,
44 | eDATA_TYPE_LOCAL,
45 | eDATA_TYPE_LATIN1,
46 | };
47 |
48 | enum EJOB_LOG_TYPE {
49 | eJOB_LOG_TYPE_DEBUG,
50 | eJOB_LOG_TYPE_INFO,
51 | eJOB_LOG_TYPE_WARN,
52 | eJOB_LOG_TYPE_ERROE,
53 | eJOB_LOG_TYPE_FATAL,
54 | eJOB_LOG_TYPE_JOB_STATUS,
55 | eJOB_LOG_TYPE_JOB_STD_ERROR,
56 | eJOB_LOG_TYPE_JOB_STD_OUTPUT,
57 | eJOB_LOG_TYPE_JOB_STD_PROGRESS,
58 | eJOB_LOG_TYPE_JOB_STD_DETAILS,
59 | eJOB_LOG_TYPE_MAX,
60 | };
61 |
62 | void initJob(QUuid a_uid);
63 | void startJob(QString a_cmd);
64 | void startJob(StdWatcherCmd a_cmd);
65 | void startJob(QList a_cmds);
66 | void abortJob();
67 | QList getAllProcessID(void);
68 | void releaseJob(void);
69 | void resumeJob(void);
70 | void pauseJob(void);
71 | bool isRunning(void);
72 | bool isStarted(void);
73 | void viewLog(EJOB_LOG_TYPE a_log_type, const QString a_log);
74 | void setCloseTime(const long a_msec);
75 | void setDataType(EDATA_TYPE a_dataType);
76 |
77 | QProcess m_process_job_info;
78 | QProcess m_process_job_piper;
79 | QProcess m_process_job_encoder;
80 |
81 | private:
82 | Ui::StdWatcher *ui;
83 | void setupUi(void);
84 | void releaseCloseTimer(void);
85 | void initCloseTimerParm(void);
86 | void setInsertTextColor(QColor a_color, int a_length);
87 | inline QString fromStandard(const QByteArray &a_data) const;
88 |
89 | QUuid m_uid;
90 | QString m_cmd;
91 | QString m_pipe;
92 | QList m_cmds;
93 | long m_cmds_index;
94 | bool m_isBatch;
95 | EDATA_TYPE m_dataType;
96 |
97 | QTimer *m_pCloseTimer;
98 | QMenu *m_pContextMenu;
99 | long m_close_time;
100 | long m_close_time_min;
101 | long m_close_time_max;
102 | long m_close_time_set = eINDEX_NONE;
103 | const long c_close_time = eINDEX_30 + eINDEX_1;
104 |
105 | private slots:
106 | /*Piper Process*/
107 | virtual void slotPiperProcessStarted();
108 | virtual void slotPiperProcessReadyReadStandardOutput();
109 | virtual void slotPiperProcessReadyReadStandardError();
110 | virtual void slotPiperProcessFinished(int a_exitCode, QProcess::ExitStatus a_exitStatus);
111 | virtual void slotPiperProcessError(QProcess::ProcessError a_error);
112 | /*Encoder Process*/
113 | virtual void slotEncoderProcessStarted();
114 | virtual void slotEncoderProcessReadyReadStandardError();
115 | virtual void slotEncoderProcessReadyReadStandardOutput();
116 | virtual void slotEncoderProcessFinished(int a_exitCode, QProcess::ExitStatus a_exitStatus);
117 | virtual void slotEncoderProcessError(QProcess::ProcessError a_error);
118 | /*Close Timer*/
119 | virtual void checkClose(void);
120 | virtual void closeEvent(QCloseEvent *e);
121 | /*Context Menu*/
122 | void copyCommand(void);
123 | void setWrapped(bool a_enable);
124 |
125 | void on_btnClose_clicked();
126 | void on_btnPause_clicked(bool a_checked);
127 | void on_checkBoxExitCompleted_stateChanged(int a_state);
128 | void on_logView_customContextMenuRequested(const QPoint &a_pos);
129 | };
130 |
131 | #endif // STD_WATCHER_H
132 |
--------------------------------------------------------------------------------
/capture-color/mainwindow.h:
--------------------------------------------------------------------------------
1 | #ifndef MAINWINDOW_H
2 | #define MAINWINDOW_H
3 |
4 | #include "com/version.h"
5 | #include "com/common.h"
6 | #include "dialog/yuv_dialog.h"
7 | #include "dialog/color_whell_dialog.h"
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | enum class YuvFormat{
24 | BT709,
25 | BT601,
26 | };
27 |
28 | enum class AssColor{
29 | Blue = 1,
30 | Green,
31 | Red,
32 | };
33 |
34 | enum class ReflashItem{
35 | r_rgb, /*index:1*/
36 | g_rgb, /*index:2*/
37 | b_rgb, /*index:3*/
38 | ass_rgb, /*index:4*/
39 | html_rgb, /*index:5*/
40 | rgb_rgb, /*index:6*/
41 | h_hsv, /*index:7*/
42 | s_hsv, /*index:8*/
43 | v_hsv, /*index:9*/
44 | hsv_hsv, /*index:10*/
45 | h_hsl, /*index:11*/
46 | s_hsl, /*index:12*/
47 | l_hsl, /*index:13*/
48 | hsl_hsl, /*index:14*/
49 | y_yuv, /*index:15*/
50 | u_yuv, /*index:16*/
51 | v_yuv, /*index:17*/
52 | yuv_yuv, /*index:18*/
53 | max, /*index:19*/
54 | };
55 |
56 | namespace Ui {
57 | class MainWindow;
58 | }
59 |
60 | class MainWindow : public QMainWindow
61 | {
62 | Q_OBJECT
63 |
64 | public:
65 | explicit MainWindow(QWidget *parent = nullptr);
66 | ~MainWindow() override;
67 | void setupUi(void);
68 | void loadFonts(void);
69 | inline void updateColor(QColor color);
70 | inline QString toRgbColor(QColor color);
71 | inline QString toAssColor(QColor color);
72 | inline QString toHtmlColor(QColor color);
73 | inline QString toYuvColor(QColor color, YuvFormat format = YuvFormat::BT709);
74 | inline QColor yuvToRgbColor(YuvFormat format = YuvFormat::BT709);
75 | inline QString toHsvColor(QColor color);
76 | inline QString toHslColor(QColor color);
77 | inline QString toHexColor(QColor color);
78 | inline QString addRei2Two(QString text);
79 | void mouseMoveEvent(QMouseEvent * event) override;
80 | void mouseReleaseEvent(QMouseEvent * event) override;
81 | void mouseDoubleClickEvent(QMouseEvent * event) override;
82 |
83 | void disconnectValueChanged(void);
84 | void connectValueChanged(void);
85 | void initReflashChecker(void);
86 |
87 | private slots:
88 | void slotUpdateColor(QColor color);
89 | void on_eyedropperBt_pressed();
90 | void on_eyedropperBt_clicked();
91 | void on_selectBt_clicked();
92 | void on_aboutBt_clicked();
93 |
94 | void on_redBox_valueChanged(int arg1);
95 | void on_greenBox_valueChanged(int arg1);
96 | void on_blueBox_valueChanged(int arg1);
97 | void on_assEdit_textEdited(const QString &arg1);
98 | void on_htmlEdit_textEdited(const QString &arg1);
99 | void on_rgbEdit_textEdited(const QString &arg1);
100 | void on_h_hsvBox_valueChanged(int arg1);
101 | void on_s_hsvBox_valueChanged(int arg1);
102 | void on_v_hsvBox_valueChanged(int arg1);
103 | void on_hsvEdit_textEdited(const QString &arg1);
104 | void on_h_hslBox_valueChanged(int arg1);
105 | void on_s_hslBox_valueChanged(int arg1);
106 | void on_l_hslBox_valueChanged(int arg1);
107 | void on_hslEdit_textEdited(const QString &arg1);
108 | void on_y_yuvBox_valueChanged(int arg1);
109 | void on_u_yuvBox_valueChanged(int arg1);
110 | void on_v_yuvBox_valueChanged(int arg1);
111 | void on_yuvEdit_textEdited(const QString &arg1);
112 |
113 | private:
114 | Ui::MainWindow *ui;
115 | YuvDialog *mYuvDialog;
116 | ColorWhellDialog *mColorWhellDialog;
117 | ColorWheel *mColorWhell;
118 | bool is_eyedrop_enable;
119 | bool is_update_preview;
120 | YuvFormat yuv_format;
121 | QPixmap pixmap;
122 | int y;
123 | int u;
124 | int v;
125 | bool is_reflash[static_cast(ReflashItem::max)];
126 | };
127 |
128 | #endif // MAINWINDOW_H
129 |
--------------------------------------------------------------------------------
/tcax-assoc/tcax-assoc.pro:
--------------------------------------------------------------------------------
1 | QT += core gui widgets
2 |
3 | CONFIG += c++11
4 | TEMPLATE = app
5 | #CONFIG -= app_bundle
6 | TARGET = assoc
7 |
8 | # The following define makes your compiler emit warnings if you use
9 | # any feature of Qt which as been marked deprecated (the exact warnings
10 | # depend on your compiler). Please consult the documentation of the
11 | # deprecated API in order to know how to port your code away from it.
12 | DEFINES += QT_DEPRECATED_WARNINGS
13 | QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\"
14 |
15 | # You can also make your code fail to compile if you use deprecated APIs.
16 | # In order to do so, uncomment the following line.
17 | # You can also select to disable deprecated APIs only up to a certain version of Qt.
18 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
19 |
20 |
21 | PROJECT_DIRECTORY = $$PWD
22 | COMMON_DIRECTORY = $$PWD
23 |
24 | ARCHITECTURE_64_BIT = false
25 |
26 | CONFIG(debug, debug|release) {
27 |
28 | contains(QMAKE_COMPILER, gcc) {
29 | if($$ARCHITECTURE_64_BIT) {
30 | DESTDIR = $${PROJECT_DIRECTORY}/build/debug-64bit-gcc
31 | TARGET = ($$TARGET)-debug-64bit-gcc
32 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-64bit-gcc
33 | } else {
34 | DESTDIR = $${PROJECT_DIRECTORY}/build/debug-32bit-gcc
35 | TARGET = $${TARGET}-debug-32bit-gcc
36 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-32bit-gcc
37 | }
38 | }
39 |
40 | contains(QMAKE_COMPILER, msvc) {
41 | if($$ARCHITECTURE_64_BIT) {
42 | DESTDIR = $${PROJECT_DIRECTORY}/build/debug-64bit-msvc
43 | TARGET = $${TARGET}-debug-64bit-msvc
44 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-64bit-msvc
45 | } else {
46 | DESTDIR = $${PROJECT_DIRECTORY}/build/debug-32bit-msvc
47 | TARGET = $${TARGET}-debug-32bit-msvc
48 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-32bit-msvc
49 | }
50 | }
51 |
52 | } else {
53 |
54 | contains(QMAKE_COMPILER, gcc) {
55 | if($$ARCHITECTURE_64_BIT) {
56 | DESTDIR = $${PROJECT_DIRECTORY}/build/release-64bit-gcc
57 | TARGET = $${TARGET}
58 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-64bit-gcc
59 | } else {
60 | DESTDIR = $${PROJECT_DIRECTORY}/build/release-32bit-gcc
61 | TARGET = $${TARGET}
62 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-32bit-gcc
63 | }
64 | }
65 |
66 | contains(QMAKE_COMPILER, msvc) {
67 | if($$ARCHITECTURE_64_BIT) {
68 | DESTDIR = $${PROJECT_DIRECTORY}/build/release-64bit-msvc
69 | TARGET = $${TARGET}
70 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-64bit-msvc
71 | } else {
72 | DESTDIR = $${PROJECT_DIRECTORY}/build/release-32bit-msvc
73 | TARGET = $${TARGET}
74 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-32bit-msvc
75 | }
76 | }
77 | DEFINES += NDEBUG
78 | }
79 |
80 | S = $${DIR_SEPARATOR}
81 |
82 | D = $$DESTDIR
83 | D = $$replace(D, $$escape_expand(\\), $$S)
84 | D = $$replace(D, /, $$S)
85 |
86 | E = $$escape_expand(\n\t)
87 |
88 | win32 {
89 | QT += winextras
90 |
91 | DEPLOY_COMMAND = windeployqt
92 | DEPLOY_TARGET = $$shell_quote($$shell_path($${D}/$${TARGET}.exe))
93 | QMAKE_POST_LINK += $${DEPLOY_COMMAND} --no-translations $${DEPLOY_TARGET} $${E}
94 |
95 | if($$ARCHITECTURE_64_BIT) {
96 | message("x86_64 build")
97 | } else {
98 | message("x86 build")
99 | contains(QMAKE_COMPILER, gcc) {
100 | QMAKE_LFLAGS += -Wl,--large-address-aware
101 | }
102 | contains(QMAKE_COMPILER, msvc) {
103 | QMAKE_LFLAGS += /LARGEADDRESSAWARE
104 | }
105 | }
106 | }
107 |
108 | SOURCES += \
109 | main.cpp
110 |
111 | # Default rules for deployment.
112 | qnx: target.path = /tmp/$${TARGET}/bin
113 | else: unix:!android: target.path = /opt/$${TARGET}/bin
114 | !isEmpty(target.path): INSTALLS += target
115 |
116 | RESOURCES += \
117 | res/res.qrc
118 |
--------------------------------------------------------------------------------
/tcax-creator/std/std_watcher.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | StdWatcher
4 |
5 |
6 |
7 | 0
8 | 0
9 | 631
10 | 551
11 |
12 |
13 |
14 | StdWatcher
15 |
16 |
17 |
18 | 5
19 |
20 |
21 | 5
22 |
23 |
24 | 5
25 |
26 |
27 | 5
28 |
29 |
30 | 5
31 |
32 | -
33 |
34 |
35 |
36 | Consolas
37 |
38 |
39 |
40 | Qt::CustomContextMenu
41 |
42 |
43 |
44 | -
45 |
46 |
47 | QFrame::HLine
48 |
49 |
50 | QFrame::Sunken
51 |
52 |
53 |
54 | -
55 |
56 |
57 |
58 | 3
59 |
60 |
61 | 0
62 |
63 |
64 | 0
65 |
66 |
67 | 0
68 |
69 |
70 | 0
71 |
72 |
-
73 |
74 |
75 | Close on completed
76 |
77 |
78 | true
79 |
80 |
81 |
82 | -
83 |
84 |
85 | Qt::Horizontal
86 |
87 |
88 |
89 | 40
90 | 20
91 |
92 |
93 |
94 |
95 | -
96 |
97 |
98 |
99 | 104
100 | 0
101 |
102 |
103 |
104 | Pause
105 |
106 |
107 |
108 | :/buttons/pause_green.png:/buttons/pause_green.png
109 |
110 |
111 | true
112 |
113 |
114 |
115 | -
116 |
117 |
118 |
119 | 104
120 | 0
121 |
122 |
123 |
124 | Close
125 |
126 |
127 |
128 | :/buttons/cross_grey.png:/buttons/cross_grey.png
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/tcax-creator/res/svgs/palette.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/helper/vector.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Dynamic Allocated Array-Based Vector C Implementation
3 | * For The Teco Project
4 | * Copyright (C) 2010 milkyjing
5 | * Auguest 11th, 2010
6 | *
7 | * Modified for The RIXE Project at June 14th, 2011 by milkyjing
8 | *
9 | * This software is provided 'as-is', without any express or implied
10 | * warranty. In no event will the authors be held liable for any damages
11 | * arising from the use of this software.
12 | *
13 | * Permission is granted to anyone to use this software for any purpose,
14 | * including commercial applications, and to alter it and redistribute it
15 | * freely, subject to the following restrictions:
16 | *
17 | * 1. The origin of this software must not be misrepresented; you must not
18 | * claim that you wrote the original software. If you use this software
19 | * in a product, an acknowledgment in the product documentation would be
20 | * appreciated but is not required.
21 | * 2. Altered source versions must be plainly marked as such, and must not be
22 | * misrepresented as being the original software.
23 | * 3. This notice may not be removed or altered from any source distribution.
24 | *
25 | * milkyjing
26 | *
27 | */
28 |
29 | #ifndef VECTOR_H
30 | #define VECTOR_H
31 | #pragma once
32 |
33 | #include
34 | #include
35 |
36 | typedef void *vector_entry_ptr;
37 |
38 | typedef void (*vector_copy_func)(vector_entry_ptr, const vector_entry_ptr);
39 | typedef void (*vector_cleanup_func)(vector_entry_ptr); /* the parameter passed to clean_f is the address of the ith element */
40 |
41 | typedef struct _vector {
42 | vector_entry_ptr datap;
43 | unsigned long elementSize;
44 | unsigned long capacity;
45 | unsigned long count;
46 | vector_copy_func copy_f;
47 | vector_cleanup_func clean_f;
48 | } Vector, *VectorPtr;
49 |
50 | typedef int (*vector_compare_func)(const vector_entry_ptr, const vector_entry_ptr); /* (src, key), `> 0' - left larger, `= 0' equal, `< 0', left smaller */
51 | typedef int (*vector_compare_interval_func)(const vector_entry_ptr, const vector_entry_ptr, const vector_entry_ptr); /* (start, end, key), the last parameter is key, `> 0' - key on the left, `= 0' in the interval, `< 0', key on the right */
52 | typedef void (*vector_traverse_func)(const vector_entry_ptr);
53 |
54 | #ifdef __cplusplus
55 | extern "C" {
56 | #endif /* __cplusplus */
57 |
58 | extern void vector_create(VectorPtr *pvptr, unsigned long elementSize, unsigned long elements, vector_copy_func copy_f, vector_cleanup_func clean_f);
59 |
60 | extern unsigned long vector_get_count(const VectorPtr vptr);
61 |
62 | extern const vector_entry_ptr vector_get_buf(const VectorPtr vptr);
63 |
64 | extern int vector_assign(VectorPtr vptr, unsigned long i, const vector_entry_ptr element);
65 |
66 | /* element can be NULL, if so, we will not make a copy to element. the return value is the address of the element retrieved */
67 | extern const vector_entry_ptr vector_retrieve(const VectorPtr vptr, unsigned long i, vector_entry_ptr element);
68 |
69 | extern void vector_push_back(VectorPtr vptr, const vector_entry_ptr element);
70 |
71 | extern int vector_pop_back(VectorPtr vptr);
72 |
73 | extern void vector_clear(VectorPtr vptr);
74 |
75 | extern void vector_destroy(VectorPtr vptr);
76 |
77 | /* UTILITY FUNCTIONS */
78 |
79 | extern void vector_traverse(const VectorPtr vptr, vector_traverse_func traverse_func);
80 |
81 | extern void vector_bulbsort(VectorPtr vptr, vector_compare_func compare_func);
82 |
83 | /* s should always be 0, and l should always be vptr->count - 1, note that both s and l should be signed rather than unsigned */
84 | extern void vector_quicksort(VectorPtr vptr, long s, long l, vector_compare_func compare_func);
85 |
86 | /* if element = NULL, it won't copy the result to it, just return the index, which somehow increase performance */
87 | extern long vector_sequential_search(const VectorPtr vptr, const vector_entry_ptr key, vector_compare_func compare_func, vector_entry_ptr element);
88 |
89 | /* if element = NULL, it won't copy the result to it, just return the index, which somehow increase performance */
90 | extern long vector_binary_search(const VectorPtr vptr, const vector_entry_ptr key, vector_compare_func compare_func, vector_entry_ptr element);
91 |
92 | /* returns the left side element (start) */
93 | extern long vector_binary_search_interval(const VectorPtr vptr, const vector_entry_ptr key, vector_compare_interval_func compare_interval_func);
94 |
95 | #ifdef __cplusplus
96 | }
97 | #endif
98 |
99 | #endif /* VECTOR_H */
100 |
101 |
--------------------------------------------------------------------------------
/capture-color/capture-color.pro:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------
2 | #
3 | # Project created by QtCreator 2018-05-01T13:40:02
4 | #
5 | #-------------------------------------------------
6 |
7 | QT += core gui
8 |
9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
10 |
11 | TARGET = capture-color
12 | TEMPLATE = app
13 |
14 | # The following define makes your compiler emit warnings if you use
15 | # any feature of Qt which as been marked as deprecated (the exact warnings
16 | # depend on your compiler). Please consult the documentation of the
17 | # deprecated API in order to know how to port your code away from it.
18 | DEFINES += QT_DEPRECATED_WARNINGS
19 |
20 | # You can also make your code fail to compile if you use deprecated APIs.
21 | # In order to do so, uncomment the following line.
22 | # You can also select to disable deprecated APIs only up to a certain version of Qt.
23 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
24 |
25 | PROJECT_DIRECTORY = $$PWD
26 | COMMON_DIRECTORY = $$PWD
27 |
28 | ARCHITECTURE_64_BIT = false
29 |
30 | RC_ICONS = $${COMMON_DIRECTORY}/res/icons/art.ico
31 |
32 | CONFIG(debug, debug|release) {
33 |
34 | contains(QMAKE_COMPILER, gcc) {
35 | if($$ARCHITECTURE_64_BIT) {
36 | DESTDIR = $${COMMON_DIRECTORY}/build/debug-64bit-gcc
37 | TARGET = ($$TARGET)-debug-64bit-gcc
38 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-64bit-gcc
39 | } else {
40 | DESTDIR = $${COMMON_DIRECTORY}/build/debug-32bit-gcc
41 | TARGET = $${TARGET}-debug-32bit-gcc
42 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-32bit-gcc
43 | }
44 | }
45 |
46 | contains(QMAKE_COMPILER, msvc) {
47 | if($$ARCHITECTURE_64_BIT) {
48 | DESTDIR = $${COMMON_DIRECTORY}/build/debug-64bit-msvc
49 | TARGET = $${TARGET}-debug-64bit-msvc
50 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-64bit-msvc
51 | } else {
52 | DESTDIR = $${COMMON_DIRECTORY}/build/debug-32bit-msvc
53 | TARGET = $${TARGET}-debug-32bit-msvc
54 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-debug-32bit-msvc
55 | }
56 | }
57 |
58 | } else {
59 |
60 | contains(QMAKE_COMPILER, gcc) {
61 | if($$ARCHITECTURE_64_BIT) {
62 | DESTDIR = $${COMMON_DIRECTORY}/build/release-64bit-gcc
63 | TARGET = $${TARGET}
64 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-64bit-gcc
65 | } else {
66 | DESTDIR = $${COMMON_DIRECTORY}/build/release-32bit-gcc
67 | TARGET = $${TARGET}
68 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-32bit-gcc
69 | }
70 | }
71 |
72 | contains(QMAKE_COMPILER, msvc) {
73 | if($$ARCHITECTURE_64_BIT) {
74 | DESTDIR = $${COMMON_DIRECTORY}/build/release-64bit-msvc
75 | TARGET = $${TARGET}
76 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-64bit-msvc
77 | } else {
78 | DESTDIR = $${COMMON_DIRECTORY}/build/release-32bit-msvc
79 | TARGET = $${TARGET}
80 | OBJECTS_DIR = $${PROJECT_DIRECTORY}/generated/obj-release-32bit-msvc
81 | }
82 | }
83 | DEFINES += NDEBUG
84 | }
85 |
86 | S = $${DIR_SEPARATOR}
87 |
88 | D = $$DESTDIR
89 | D = $$replace(D, $$escape_expand(\\), $$S)
90 | D = $$replace(D, /, $$S)
91 |
92 | E = $$escape_expand(\n\t)
93 |
94 | win32 {
95 | QT += winextras
96 |
97 | DEPLOY_COMMAND = windeployqt
98 | DEPLOY_TARGET = $$shell_quote($$shell_path($${D}/$${TARGET}.exe))
99 | QMAKE_POST_LINK += $${DEPLOY_COMMAND} --no-translations $${DEPLOY_TARGET} $${E}
100 |
101 | if($$ARCHITECTURE_64_BIT) {
102 | message("x86_64 build")
103 | } else {
104 | message("x86 build")
105 | contains(QMAKE_COMPILER, gcc) {
106 | QMAKE_LFLAGS += -Wl,--large-address-aware
107 | }
108 | contains(QMAKE_COMPILER, msvc) {
109 | QMAKE_LFLAGS += /LARGEADDRESSAWARE
110 | }
111 | }
112 | }
113 |
114 | SOURCES += \
115 | main.cpp \
116 | mainwindow.cpp \
117 | dialog/yuv_dialog.cpp \
118 | form/color_wheel.cpp \
119 | dialog/color_whell_dialog.cpp \
120 | com/common.cpp
121 |
122 | HEADERS += \
123 | mainwindow.h \
124 | dialog/yuv_dialog.h \
125 | form/color_wheel.h \
126 | dialog/color_whell_dialog.h \
127 | com/version.h \
128 | com/common.h
129 |
130 | FORMS += \
131 | mainwindow.ui \
132 | dialog/yuv_dialog.ui \
133 | dialog/color_whell_dialog.ui
134 |
135 | RESOURCES += \
136 | res/res.qrc
137 |
--------------------------------------------------------------------------------
/tcax-creator/tcax/libmap/tccmap.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 milkyjing
3 | *
4 | * This software is provided 'as-is', without any express or implied
5 | * warranty. In no event will the authors be held liable for any damages
6 | * arising from the use of this software.
7 | *
8 | * Permission is granted to anyone to use this software for any purpose,
9 | * including commercial applications, and to alter it and redistribute it
10 | * freely, subject to the following restrictions:
11 | *
12 | * 1. The origin of this software must not be misrepresented; you must not
13 | * claim that you wrote the original software. If you use this software
14 | * in a product, an acknowledgment in the product documentation would be
15 | * appreciated but is not required.
16 | * 2. Altered source versions must be plainly marked as such, and must not be
17 | * misrepresented as being the original software.
18 | * 3. This notice may not be removed or altered from any source distribution.
19 | *
20 | * milkyjing
21 | *
22 | */
23 |
24 | #ifndef TCCMAP_H
25 | #define TCCMAP_H
26 | #pragma once
27 |
28 | #include
29 | #include
30 |
31 | typedef void *tcc_map_key_ptr; /**< key entry */
32 | typedef void *tcc_map_value_ptr; /**< value entry */
33 |
34 | /* copy functions */
35 | typedef void (*tcc_map_key_copy_func)(tcc_map_key_ptr, const tcc_map_key_ptr);
36 | typedef void (*tcc_map_value_copy_func)(tcc_map_value_ptr, const tcc_map_value_ptr);
37 |
38 | /* cleanup functions */
39 | typedef void (*tcc_map_key_cleanup_func)(tcc_map_key_ptr);
40 | typedef void (*tcc_map_value_cleanup_func)(tcc_map_value_ptr);
41 |
42 | /* compare functions */
43 | typedef int (*tcc_map_key_compare_func)(const tcc_map_key_ptr, const tcc_map_key_ptr);
44 | typedef int (*tcc_map_value_compare_func)(const tcc_map_value_ptr, const tcc_map_value_ptr);
45 |
46 | /* one key may have multiple values, specified by offset */
47 | typedef struct _tcc_map {
48 | tcc_map_key_ptr keyBuf;
49 | tcc_map_value_ptr valueBuf;
50 | unsigned long keySize;
51 | unsigned long valueSize;
52 | unsigned long capacity; /**< can be enlarged dynamically */
53 | unsigned long count; /**< number of elements (values) */
54 | tcc_map_key_copy_func copy_key;
55 | tcc_map_value_copy_func copy_value;
56 | tcc_map_key_cleanup_func clean_key;
57 | tcc_map_value_cleanup_func clean_value;
58 | tcc_map_key_compare_func compare_key;
59 | tcc_map_value_compare_func compare_value;
60 | int offset; /**< a key may be assigned with multiple values, so offset is used to specify which value to retrieve */
61 | } TccMap, *TccMapPtr;
62 |
63 |
64 | #ifdef __cplusplus
65 | extern "C" {
66 | #endif /* __cplusplus */
67 |
68 | extern void tcc_map_create(TccMapPtr *pmptr, unsigned long keySize, unsigned long valueSize, unsigned long elements, tcc_map_key_copy_func copy_key, tcc_map_value_copy_func copy_value, tcc_map_key_cleanup_func clean_key, tcc_map_value_cleanup_func clean_value, tcc_map_key_compare_func compare_key, tcc_map_value_compare_func compare_value);
69 |
70 | extern unsigned long tcc_map_get_size(const TccMapPtr mptr);
71 |
72 | extern int tcc_map_get_offset(const TccMapPtr mptr);
73 |
74 | extern void tcc_map_set_offset(TccMapPtr mptr, int offset);
75 |
76 | extern void tcc_map_reset_offset(TccMapPtr mptr);
77 |
78 | extern void tcc_map_increase_offset(TccMapPtr mptr);
79 |
80 | extern void tcc_map_decrease_offset(TccMapPtr mptr);
81 |
82 | /* assign the key (first one) with a new value, the key must be existed */
83 | extern int tcc_map_assign_to_key(TccMapPtr mptr, const tcc_map_key_ptr key, const tcc_map_value_ptr value);
84 |
85 | /* replace the key and value at position i */
86 | extern int tcc_map_assign_at(TccMapPtr mptr, unsigned long i, const tcc_map_key_ptr key, const tcc_map_value_ptr value);
87 |
88 | /* you can retrieve n times to get all the values of a duplicate key, offset will automatically increase, value can be NULL */
89 | extern const tcc_map_value_ptr tcc_map_retrieve(TccMapPtr mptr, const tcc_map_key_ptr key, tcc_map_value_ptr value);
90 |
91 | /* Sort the pairs by keys, this is to improve the performance of the lookup process, compare function must be specified, not complete yet */
92 | extern void tcc_map_sort(TccMapPtr mptr);
93 |
94 | extern void tcc_map_push_back(TccMapPtr mptr, const tcc_map_key_ptr key, const tcc_map_value_ptr value);
95 |
96 | extern int tcc_map_pop_back(TccMapPtr mptr);
97 |
98 | /* will only clear the elements in the map but will not free the memory occupied by the map itself */
99 | extern void tcc_map_clear(TccMapPtr mptr);
100 |
101 | extern void tcc_map_destroy(TccMapPtr mptr);
102 |
103 | #ifdef __cplusplus
104 | }
105 | #endif /* __cplusplus */
106 |
107 | #endif /* TCCMAP_H */
108 |
--------------------------------------------------------------------------------
/tcax-creator/com/preferences_dialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Preferences
4 |
5 |
6 |
7 | 0
8 | 0
9 | 388
10 | 186
11 |
12 |
13 |
14 | Preferences
15 |
16 |
17 | -
18 |
19 |
20 |
21 | 0
22 | 0
23 |
24 |
25 |
26 | Preferences
27 |
28 |
29 |
-
30 |
31 |
32 | Show splash screen
33 |
34 |
35 |
36 | -
37 |
38 |
-
39 |
40 |
41 | Editor size Limit
42 |
43 |
44 |
45 | -
46 |
47 |
48 | false
49 |
50 |
51 |
52 | 0
53 | 25
54 |
55 |
56 |
57 | mb
58 |
59 |
60 | 1
61 |
62 |
63 | 999999999
64 |
65 |
66 | 5
67 |
68 |
69 |
70 |
71 |
72 | -
73 |
74 |
-
75 |
76 |
77 | Set style factory
78 |
79 |
80 |
81 | -
82 |
83 |
84 |
85 | 0
86 | 25
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | -
97 |
98 |
-
99 |
100 |
101 | Qt::Horizontal
102 |
103 |
104 |
105 | 40
106 | 20
107 |
108 |
109 |
110 |
111 | -
112 |
113 |
114 |
115 | 110
116 | 0
117 |
118 |
119 |
120 | Reset
121 |
122 |
123 |
124 | :/buttons/restart.png:/buttons/restart.png
125 |
126 |
127 |
128 | -
129 |
130 |
131 |
132 | 110
133 | 0
134 |
135 |
136 |
137 | Close
138 |
139 |
140 |
141 | :/buttons/accept.png:/buttons/accept.png
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------
/tcax-creator/com/tcax_helper.h:
--------------------------------------------------------------------------------
1 | #ifndef TCAX_HELPER_H
2 | #define TCAX_HELPER_H
3 |
4 | #include "common.h"
5 | #include "../tcax/libtcc/tcc.h"
6 |
7 | #define L2Q(__x) QString::fromStdWString(__x)
8 |
9 | #define TCC_COMMENT_1 "# tcc file version"
10 | #define TCC_COMMENT_2 "# mode configuration"
11 | #define TCC_COMMENT_3 "# py settings"
12 | #define TCC_COMMENT_4 "# main settings"
13 | #define TCC_COMMENT_5 "# style settings"
14 | #define TCC_COMMENT_6 "# additional settings"
15 | #define TCC_LINE_SPACE " "
16 | #define TCC_TRUE "true"
17 | #define TCC_FALSE "false"
18 | #define TCC_HORI "hori"
19 | #define TCC_HORIZONTAL "horizontal"
20 | #define TCC_VERT "vert"
21 | #define TCC_VERTICAL "vertical"
22 | #define TCC_WORD "word"
23 | #define TCC_NORMAL "normal"
24 | #define TCC_SYL "syl"
25 | #define TCC_SYLLABLE "syllable"
26 | #define TCC_ADV "adv"
27 | #define TCC_ADVANCED "advanced"
28 |
29 | #define TCC_COLOR_FFFFFF "FFFFFF"
30 | #define TCC_COLOR_000000 "000000"
31 |
32 | #define TCC_TCC_VER_STR L2Q(TCC_VER_STR)
33 | /*< tcc file version */
34 | #define TCC_TCC_FILE_VERSION L2Q(TCC_FILE_VERSION)
35 | /*< mode configuration */
36 | #define TCC_INHERIT_ASS_HEADER L2Q(INHERIT_ASS_HEADER)
37 | #define TCC_K_MODE L2Q(K_MODE)
38 | #define TCC_TEXT_LAYOUT L2Q(TEXT_LAYOUT)
39 | #define TCC_TCAXPY_INIT L2Q(TCAXPY_INIT)
40 | #define TCC_TCAXPY_USER L2Q(TCAXPY_USER)
41 | #define TCC_TCAXPY_FIN L2Q(TCAXPY_FIN)
42 | /*< py settings */
43 | #define TCC_PY_FILE L2Q(PY_FILE)
44 | #define TCC_BEG_LINE L2Q(BEG_LINE)
45 | #define TCC_END_LINE L2Q(END_LINE)
46 | /*< main settings */
47 | #define TCC_K_TIMED_ASS_FILE L2Q(K_TIMED_ASS_FILE)
48 | #define TCC_FONT_FILE L2Q(FONT_FILE)
49 | #define TCC_FONT_FACE_ID L2Q(FONT_FACE_ID)
50 | #define TCC_FONT_SIZE L2Q(FONT_SIZE)
51 | #define TCC_FX_WIDTH L2Q(FX_WIDTH)
52 | #define TCC_FX_HEIGHT L2Q(FX_HEIGHT)
53 | #define TCC_FX_FPS L2Q(FX_FPS)
54 | #define TCC_ALIGNMENT L2Q(ALIGNMENT)
55 | #define TCC_X_OFFSET L2Q(X_OFFSET)
56 | #define TCC_Y_OFFSET L2Q(Y_OFFSET)
57 | #define TCC_SPACING L2Q(SPACING)
58 | #define TCC_SPACE_SCALE L2Q(SPACE_SCALE)
59 | /*< style settings */
60 | #define TCC_FONT_FACE_NAME L2Q(FONT_FACE_NAME)
61 | #define TCC_BORD L2Q(BORD)
62 | #define TCC_SHAD L2Q(SHAD)
63 | #define TCC_PRIMARY_COLOR L2Q(PRIMARY_COLOR)
64 | #define TCC_SECONDARY_COLOR L2Q(SECONDARY_COLOR)
65 | #define TCC_OUTLINE_COLOR L2Q(OUTLINE_COLOR)
66 | #define TCC_BACK_COLOR L2Q(BACK_COLOR)
67 | #define TCC_PRIMARY_ALPHA L2Q(PRIMARY_ALPHA)
68 | #define TCC_SECONDARY_ALPHA L2Q(SECONDARY_ALPHA)
69 | #define TCC_OUTLINE_ALPHA L2Q(OUTLINE_ALPHA)
70 | #define TCC_BACK_ALPHA L2Q(BACK_ALPHA)
71 | /*< additional settings */
72 | #define TCC_BLUR L2Q(BLUR)
73 |
74 | #define winFontRegRoot L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\\"
75 |
76 | #define fileTypeRaw "Raw";
77 | #define fileTypeCompressed "Compressed";
78 | #define fileTypeCompressedZ "Compressed Z";
79 | #define fileTypeParsed "Parsed";
80 | #define fileTypeParsedZ "Parsed Z";
81 | #define fileTypeUnknown "Unknown";
82 |
83 | typedef QMultiHash TccMap; /// MultiHash
84 | typedef QMap TccDefMap; /// QMap
85 | typedef QList TccMapItems; /// QList
86 | typedef QMultiHash> TccPyFileList; /// QMultiHash>
87 |
88 | namespace TcaxHelper
89 | {
90 | bool tccCheck(const QString &a_tccString);
91 | QString tccStrip(QString a_tccString);
92 | TccDefMap tccDefaultMap(void);
93 | QString tccToAttrLine(QString a_attr, QString a_attrValue);
94 | TccPyFileList tccMapParseToTccPyFileList(TccMap a_tccMap);
95 |
96 | TccMap tccParseToMap(const QString &a_filename);
97 | bool tccSave(const QString &a_filename, TccMap a_tccMap);
98 |
99 | QT_DEPRECATED bool tccCreate(const QString &a_filename);
100 | QT_DEPRECATED TCC_Attributes tccParse(const QString &a_filename);
101 | QT_DEPRECATED bool tccSave(const QString &a_filename, TCC_Attributes a_attr);
102 | QT_DEPRECATED void tccFree(TCC_pAttributes a_pAttr);
103 |
104 | bool tcasShiftTime(const QString &a_filename, int a_shiftTime, bool a_saveCopy);
105 | QString tcasInfo(const QString &a_filename);
106 |
107 | QStringList fontList(void);
108 | QString fontFile(const QString &a_fontName);
109 | QStringList fontFace(const QString &a_fontName);
110 |
111 | void tcaxW2A(const wchar_t *a_uni, char **a_ansi);
112 | };
113 | #endif // TCAX_HELPER_H
114 |
--------------------------------------------------------------------------------
/tcax-creator/tools/ass_conv.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | AssConv
4 |
5 |
6 |
7 | 0
8 | 0
9 | 504
10 | 430
11 |
12 |
13 |
14 | true
15 |
16 |
17 | true
18 |
19 |
20 | true
21 |
22 |
23 | Ass Convertor
24 |
25 |
26 |
27 | 7
28 |
29 |
30 | 7
31 |
32 |
33 | 7
34 |
35 |
36 | 7
37 |
38 | -
39 |
40 |
41 | Qt::CustomContextMenu
42 |
43 |
44 | true
45 |
46 |
47 |
48 | -
49 |
50 |
51 | 3
52 |
53 |
-
54 |
55 |
56 | Format:
57 |
58 |
59 |
60 | -
61 |
62 |
63 |
64 | 0
65 | 0
66 |
67 |
68 |
69 |
70 | 140
71 | 26
72 |
73 |
74 |
-
75 |
76 | Ass2Lrc
77 |
78 |
79 | -
80 |
81 | Ass2Txt
82 |
83 |
84 | -
85 |
86 | Lrc2Ass
87 |
88 |
89 | -
90 |
91 | Txt2Ass
92 |
93 |
94 | -
95 |
96 | Png2Ass
97 |
98 |
99 |
100 |
101 | -
102 |
103 |
104 | Qt::Horizontal
105 |
106 |
107 |
108 | 40
109 | 20
110 |
111 |
112 |
113 |
114 | -
115 |
116 |
117 |
118 | 110
119 | 0
120 |
121 |
122 |
123 | Convert
124 |
125 |
126 |
127 | :/buttons/wand.png:/buttons/wand.png
128 |
129 |
130 |
131 | -
132 |
133 |
134 |
135 | 110
136 | 0
137 |
138 |
139 |
140 | Close
141 |
142 |
143 |
144 | :/buttons/cross_grey.png:/buttons/cross_grey.png
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 | buttonClose
158 | clicked()
159 | AssConv
160 | close()
161 |
162 |
163 | 287
164 | 407
165 |
166 |
167 | 193
168 | 214
169 |
170 |
171 |
172 |
173 |
174 |
--------------------------------------------------------------------------------
/tcax-creator/editor/script_editor.cpp:
--------------------------------------------------------------------------------
1 | #include "script_editor.h"
2 |
3 | #include
4 |
5 | ScriptEditor::ScriptEditor(QWidget *parent)
6 | : QPlainTextEdit(parent),
7 | m_pLineNumberArea(new LineNumberArea(this)),
8 | m_isKeyCtrlPressed(false)
9 | {
10 | connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
11 | connect(this, SIGNAL(updateRequest(QRect, int)), this, SLOT(updateLineNumberArea(QRect, int)));
12 | connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));
13 |
14 | updateLineNumberAreaWidth(0);
15 | highlightCurrentLine();
16 | }
17 |
18 | int ScriptEditor::lineNumberAreaWidth()
19 | {
20 | int digits = 1;
21 | int max = qMax(1, blockCount());
22 | while (max >= 10)
23 | {
24 | max /= 10;
25 | ++digits;
26 | }
27 | if(digits < 2)
28 | {
29 | digits = 2;
30 | }
31 | int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits;
32 | return space;
33 | }
34 |
35 | void ScriptEditor::updateLineNumberAreaWidth(int)
36 | {
37 | setViewportMargins(lineNumberAreaWidth(), 0, 0, 0);
38 | }
39 |
40 | void ScriptEditor::updateLineNumberArea(const QRect &rect, int dy)
41 | {
42 | if (dy)
43 | m_pLineNumberArea->scroll(0, dy);
44 | else
45 | m_pLineNumberArea->update(0, rect.y(), m_pLineNumberArea->width(), rect.height());
46 |
47 | if (rect.contains(viewport()->rect()))
48 | updateLineNumberAreaWidth(0);
49 | }
50 |
51 | void ScriptEditor::resizeEvent(QResizeEvent *e)
52 | {
53 | QPlainTextEdit::resizeEvent(e);
54 |
55 | QRect cr = contentsRect();
56 | m_pLineNumberArea->setGeometry(QRect(cr.left(), cr.top(), lineNumberAreaWidth(), cr.height()));
57 | }
58 |
59 | void ScriptEditor::keyPressEvent(QKeyEvent *e)
60 | {
61 | if(e->key() == Qt::Key_Control)
62 | {
63 | m_isKeyCtrlPressed = true;
64 | }
65 | QPlainTextEdit::keyPressEvent(e);
66 | e->accept();
67 | }
68 |
69 | void ScriptEditor::keyReleaseEvent(QKeyEvent *e)
70 | {
71 | if(e->key() == Qt::Key_Control)
72 | {
73 | m_isKeyCtrlPressed = false;
74 | }
75 | QPlainTextEdit::keyReleaseEvent(e);
76 | e->accept();
77 | }
78 |
79 | void ScriptEditor::wheelEvent(QWheelEvent* e)
80 | {
81 | if(m_isKeyCtrlPressed)
82 | {
83 | auto resizeFont = [](QWidget *a_pWidget, int a_size) -> void
84 | {
85 | QFont font(a_pWidget->font());
86 |
87 | font.setPointSize(a_pWidget->font().pointSize() + a_size);
88 | a_pWidget->setFont(font);
89 | };
90 |
91 | if(e->delta() > 0)
92 | {
93 | resizeFont(this, 1);
94 | }
95 | else
96 | {
97 | resizeFont(this, -1);
98 | }
99 | emit fontPointSizeUpdated(this->font().pointSize());
100 | }
101 | QPlainTextEdit::wheelEvent(e);
102 | e->accept();
103 | }
104 |
105 | void ScriptEditor::resizeFont(int a_pointSize)
106 | {
107 | QFont font(this->font());
108 |
109 | font.setPointSize(a_pointSize);
110 | this->setFont(font);
111 | }
112 |
113 | void ScriptEditor::highlightCurrentLine()
114 | {
115 | QList extraSelections;
116 |
117 | if (!isReadOnly())
118 | {
119 | QTextEdit::ExtraSelection selection;
120 |
121 | QColor lineColor = QColor(ColorHighlight::r, ColorHighlight::g, ColorHighlight::b);
122 |
123 | selection.format.setBackground(lineColor);
124 | selection.format.setProperty(QTextFormat::FullWidthSelection, true);
125 | selection.cursor = textCursor();
126 | selection.cursor.clearSelection();
127 | extraSelections.append(selection);
128 | }
129 |
130 | setExtraSelections(extraSelections);
131 | }
132 |
133 |
134 | void ScriptEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
135 | {
136 | QPainter painter(m_pLineNumberArea);
137 | painter.fillRect(event->rect(), QColor(ColorLineNumArea::r, ColorLineNumArea::g, ColorLineNumArea::b));
138 |
139 | QTextBlock block = firstVisibleBlock();
140 | int blockNumber = block.blockNumber();
141 | int top = static_cast(blockBoundingGeometry(block).translated(contentOffset()).top());
142 | int bottom = top + static_cast(blockBoundingRect(block).height());
143 |
144 | while (block.isValid() && top <= event->rect().bottom())
145 | {
146 | if (block.isVisible() && bottom >= event->rect().top())
147 | {
148 | QString number = QString::number(blockNumber + 1);
149 | painter.setPen(QColor(ColorLineNum::r, ColorLineNum::g, ColorLineNum::b));
150 | painter.drawText(0, top, m_pLineNumberArea->width(), fontMetrics().height(), Qt::AlignRight, number);
151 | }
152 |
153 | block = block.next();
154 | top = bottom;
155 | bottom = top + static_cast(blockBoundingRect(block).height());
156 | ++blockNumber;
157 | }
158 | }
159 |
160 | QString ScriptEditor::getCurrentCursorText(void)
161 | {
162 | QTextCursor cur = this->textCursor();
163 | return cur.block().text();
164 | }
165 |
--------------------------------------------------------------------------------
/capture-color/dialog/yuv_dialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | YuvDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 203
10 | 161
11 |
12 |
13 |
14 |
15 | 203
16 | 161
17 |
18 |
19 |
20 |
21 | 16777215
22 | 16777215
23 |
24 |
25 |
26 | Dialog
27 |
28 |
29 |
30 | 2
31 |
32 |
33 | 5
34 |
35 |
36 | 5
37 |
38 |
39 | 5
40 |
41 |
42 | 5
43 |
44 | -
45 |
46 |
47 | YUV
48 |
49 |
50 |
51 | 5
52 |
53 |
54 | 5
55 |
56 |
57 | 5
58 |
59 |
60 | 5
61 |
62 |
63 | 5
64 |
65 |
-
66 |
67 |
-
68 |
69 |
70 |
71 | 80
72 | 0
73 |
74 |
75 |
76 | Luma
77 |
78 |
79 |
80 | -
81 |
82 |
83 |
84 | 60
85 | 0
86 |
87 |
88 |
89 | 255
90 |
91 |
92 |
93 |
94 |
95 | -
96 |
97 |
-
98 |
99 |
100 |
101 | 80
102 | 0
103 |
104 |
105 |
106 | ChromaU
107 |
108 |
109 |
110 | -
111 |
112 |
113 |
114 | 60
115 | 0
116 |
117 |
118 |
119 | 255
120 |
121 |
122 |
123 |
124 |
125 | -
126 |
127 |
-
128 |
129 |
130 |
131 | 80
132 | 0
133 |
134 |
135 |
136 | ChromaV
137 |
138 |
139 |
140 | -
141 |
142 |
143 |
144 | 60
145 | 0
146 |
147 |
148 |
149 | 255
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 | -
159 |
160 |
161 | Qt::Horizontal
162 |
163 |
164 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 | buttonBox
174 | accepted()
175 | YuvDialog
176 | accept()
177 |
178 |
179 | 248
180 | 254
181 |
182 |
183 | 157
184 | 274
185 |
186 |
187 |
188 |
189 | buttonBox
190 | rejected()
191 | YuvDialog
192 | reject()
193 |
194 |
195 | 316
196 | 260
197 |
198 |
199 | 286
200 | 274
201 |
202 |
203 |
204 |
205 |
206 |
--------------------------------------------------------------------------------
/tcax-assoc/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | #define OK 0
11 | #define NG -1
12 |
13 | bool assoc(void);
14 |
15 | int main(int argc, char *argv[])
16 | {
17 | QApplication a(argc, argv);
18 | QWidget mainUi;
19 | bool ret = false;
20 |
21 | mainUi.setWindowIcon(QIcon(":/icons/tcax.ico"));
22 |
23 | ret = assoc();
24 | if(ret)
25 | {
26 | QMessageBox::information(&mainUi, QObject::tr("TCAX - info"), QObject::tr("TCAX file association successfully executed.\n\nTCAX program file association successfully executed, please confirm."));
27 | }
28 | else
29 | {
30 | QMessageBox::critical(&mainUi, QObject::tr("TCAX - error"), QObject::tr("TCAX file association failed executed.\n\nTCAX program file association failed executed, please try again."));
31 | }
32 |
33 | return (ret ? OK : NG);
34 | }
35 |
36 | bool assoc(void)
37 | {
38 | int argc;
39 | LPWSTR *argv = CommandLineToArgvW(GetCommandLineW(), &argc);
40 | HKEY hKey;
41 | DWORD dwDisp;
42 | CStringW wcsPath = argv[0];
43 | WCHAR szSysDir[256];
44 | CStringW wcsSysDir;
45 |
46 | LocalFree(argv);
47 | wcsPath = wcsPath.Mid(0, wcsPath.ReverseFind(L'\\') + 1); // note: '\\' is included in the Path
48 | GetSystemDirectoryW(szSysDir, 256);
49 | wcsSysDir = szSysDir;
50 |
51 | // --- for TCC file
52 | // --- Reg ".tcc" in "HKEY_CLASSES_ROOT"
53 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L".tcc", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
54 | {
55 | return false;
56 | }
57 | RegSetValueW(hKey, nullptr, REG_SZ, L"TCC_File_Type", 0);
58 | RegCloseKey(hKey);
59 |
60 | // --- Reg "shell\open\command" of "TCC_File_Type" in "HKEY_CLASSES_ROOT"
61 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"TCC_File_Type\\shell\\open\\command", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
62 | {
63 | return false;
64 | }
65 | RegSetValueW(hKey, nullptr, REG_SZ, L"\"" + wcsPath + + L"\\tcax-creator.exe\" \"%1\"", 0);
66 | RegCloseKey(hKey);
67 |
68 | // --- Reg "shell\edit\command" of "TCC_File_Type" in "HKEY_CLASSES_ROOT"
69 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"TCC_File_Type\\shell\\edit\\command", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
70 | {
71 | return false;
72 | }
73 | RegSetValueW(hKey, nullptr, REG_SZ, L"\"" + wcsPath + + L"\\tcax-creator.exe\" \"%1\"", 0);
74 | RegCloseKey(hKey);
75 |
76 | // --- Reg "shell\parse" of "TCC_File_Type" in "HKEY_CLASSES_ROOT"
77 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"TCC_File_Type\\shell\\parse", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
78 | {
79 | return false;
80 | }
81 | RegSetValueW(hKey, nullptr, REG_SZ, L"Parse", 0);
82 | RegCloseKey(hKey);
83 |
84 | // --- Reg "shell\parse\command" of "TCC_File_Type" in "HKEY_CLASSES_ROOT"
85 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"TCC_File_Type\\shell\\parse\\command", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
86 | {
87 | return false;
88 | }
89 | RegSetValueW(hKey, nullptr, REG_SZ, L"\"" + wcsPath + L"tcax\\tcax.exe\" \"%L\" -debug", 0);
90 | RegCloseKey(hKey);
91 |
92 | // --- Reg "DefaultIcon" of "TCC_File_Type" in "HKEY_CLASSES_ROOT"
93 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"TCC_File_Type\\DefaultIcon", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
94 | {
95 | return false;
96 | }
97 | RegSetValueW(hKey, nullptr, REG_SZ, wcsPath + L"tcax\\icons\\tcc.ico", 0);
98 | RegCloseKey(hKey);
99 |
100 | // --- for ASS file
101 | // --- Reg ".ass" in "HKEY_CLASSES_ROOT"
102 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L".ass", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
103 | {
104 | return false;
105 | }
106 | RegSetValueW(hKey, nullptr, REG_SZ, L"ASS_File_Type", 0);
107 | RegCloseKey(hKey);
108 |
109 | // --- Reg "DefaultIcon" of "ASS_File_Type" in "HKEY_CLASSES_ROOT"
110 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"ASS_File_Type\\DefaultIcon", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
111 | {
112 | return false;
113 | }
114 | RegSetValueW(hKey, nullptr, REG_SZ, wcsPath + L"tcax\\icons\\ass.ico", 0);
115 | RegCloseKey(hKey);
116 |
117 | // --- for tcas file
118 | // --- Reg ".tcas" in "HKEY_CLASSES_ROOT"
119 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L".tcas", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
120 | {
121 | return false;
122 | }
123 | RegSetValueW(hKey, nullptr, REG_SZ, L"TCAS_File_Type", 0);
124 | RegCloseKey(hKey);
125 |
126 | // --- Reg "shell\open\command" of "TCAS_File_Type" in "HKEY_CLASSES_ROOT"
127 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"TCAS_File_Type\\shell\\open\\command", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
128 | {
129 | return false;
130 | }
131 | RegSetValueW(hKey, nullptr, REG_SZ, L"\"" + wcsPath + L"tcax-creator.exe\" \"%L\"", 0);
132 | RegCloseKey(hKey);
133 |
134 | // --- Reg "DefaultIcon" of "TCAS_File_Type" in "HKEY_CLASSES_ROOT"
135 | if (RegCreateKeyExW(HKEY_CLASSES_ROOT, L"TCAS_File_Type\\DefaultIcon", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, &dwDisp) != ERROR_SUCCESS)
136 | {
137 | return false;
138 | }
139 |
140 | RegSetValueW(hKey, nullptr, REG_SZ, wcsPath + L"tcax\\icons\\tcas.ico", 0);
141 | RegCloseKey(hKey);
142 | SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST | SHCNF_FLUSHNOWAIT, nullptr, nullptr);
143 |
144 | return true;
145 | }
146 |
147 |
--------------------------------------------------------------------------------
/tcax-creator/editor/number_matcher.cpp:
--------------------------------------------------------------------------------
1 | #include "number_matcher.h"
2 |
3 | //==============================================================================
4 |
5 | NumberMatcher::NumberMatcher() : m_state(Initial), m_lastValidLength(0)
6 | {
7 |
8 | }
9 |
10 | // END OF NumberMatcher::NumberMatcher()
11 | //==============================================================================
12 |
13 | bool NumberMatcher::beginsWithNumber(const QString & a_string, int a_matchFrom)
14 | {
15 | m_state = Initial;
16 | m_lastValidLength = 0;
17 | int stringLength = a_string.length();
18 |
19 | for(int i = a_matchFrom; i < stringLength; ++i)
20 | {
21 | if(m_state == Initial)
22 | {
23 | if(a_string[i] == '0')
24 | {
25 | m_state = FirstZero;
26 | m_lastValidLength = i - a_matchFrom + 1;
27 | }
28 | else if(QString("123456789").contains(a_string[i]))
29 | {
30 | m_state = Integer;
31 | m_lastValidLength = i - a_matchFrom + 1;
32 | }
33 | else if(a_string[i] == '.')
34 | m_state = FirstDot;
35 | else
36 | break;
37 | }
38 | else if(m_state == FirstZero)
39 | {
40 | if(a_string[i].toLower() == 'b')
41 | m_state = BinLiteral;
42 | else if(a_string[i].toLower() == 'x')
43 | m_state = HexLiteral;
44 | else if(a_string[i].toLower() == 'o')
45 | m_state = OctLiteral;
46 | else if(QString("0123456789").contains(a_string[i]))
47 | {
48 | m_state = Integer;
49 | m_lastValidLength = i - a_matchFrom + 1;
50 | }
51 | else if(a_string[i] == '.')
52 | {
53 | m_state = DotAfterInteger;
54 | m_lastValidLength = i - a_matchFrom + 1;
55 | }
56 | else if(a_string[i].toLower() == 'j')
57 | {
58 | m_lastValidLength = i - a_matchFrom + 1;
59 | return true;
60 | }
61 | else
62 | break;
63 | }
64 | else if(m_state == BinLiteral)
65 | {
66 | if(QString("01").contains(a_string[i]))
67 | {
68 | m_state = BinNumber;
69 | m_lastValidLength = i - a_matchFrom + 1;
70 | }
71 | else
72 | break;
73 | }
74 | else if(m_state == BinNumber)
75 | {
76 | if(QString("01").contains(a_string[i]))
77 | m_lastValidLength = i - a_matchFrom + 1;
78 | else
79 | break;
80 | }
81 | else if(m_state == OctLiteral)
82 | {
83 | if(QString("01234567").contains(a_string[i]))
84 | {
85 | m_state = OctNumber;
86 | m_lastValidLength = i - a_matchFrom + 1;
87 | }
88 | else
89 | break;
90 | }
91 | else if(m_state == OctNumber)
92 | {
93 | if(QString("01234567").contains(a_string[i]))
94 | m_lastValidLength = i - a_matchFrom + 1;
95 | else
96 | break;
97 | }
98 | else if(m_state == HexLiteral)
99 | {
100 | if(QString("0123456789abcdef").contains(a_string[i].toLower()))
101 | {
102 | m_state = HexNumber;
103 | m_lastValidLength = i - a_matchFrom + 1;
104 | }
105 | else
106 | break;
107 | }
108 | else if(m_state == HexNumber)
109 | {
110 | if(QString("0123456789abcdef").contains(a_string[i].toLower()))
111 | m_lastValidLength = i - a_matchFrom + 1;
112 | else
113 | break;
114 | }
115 | else if(m_state == Integer)
116 | {
117 | if(QString("0123456789").contains(a_string[i]))
118 | m_lastValidLength = i - a_matchFrom + 1;
119 | else if(a_string[i] == '.')
120 | {
121 | m_state = DotAfterInteger;
122 | m_lastValidLength = i - a_matchFrom + 1;
123 | }
124 | else if(a_string[i].toLower() == 'e')
125 | m_state = ExpLiteral;
126 | else if(a_string[i].toLower() == 'j')
127 | {
128 | m_lastValidLength = i - a_matchFrom + 1;
129 | return true;
130 | }
131 | else
132 | break;
133 | }
134 | else if(m_state == DotAfterInteger)
135 | {
136 | if(QString("0123456789").contains(a_string[i]))
137 | {
138 | m_state = Fraction;
139 | m_lastValidLength = i - a_matchFrom + 1;
140 | }
141 | else if(a_string[i].toLower() == 'e')
142 | m_state = ExpLiteral;
143 | else if(a_string[i].toLower() == 'j')
144 | {
145 | m_lastValidLength = i - a_matchFrom + 1;
146 | return true;
147 | }
148 | else
149 | break;
150 | }
151 | else if(m_state == FirstDot)
152 | {
153 | if(QString("0123456789").contains(a_string[i]))
154 | {
155 | m_state = Fraction;
156 | m_lastValidLength = i - a_matchFrom + 1;
157 | }
158 | else
159 | break;
160 | }
161 | else if(m_state == Fraction)
162 | {
163 | if(QString("0123456789").contains(a_string[i]))
164 | m_lastValidLength = i - a_matchFrom + 1;
165 | else if(a_string[i].toLower() == 'e')
166 | m_state = ExpLiteral;
167 | else if(a_string[i].toLower() == 'j')
168 | {
169 | m_lastValidLength = i - a_matchFrom + 1;
170 | return true;
171 | }
172 | else
173 | break;
174 | }
175 | else if(m_state == ExpLiteral)
176 | {
177 | if(QString("+-").contains(a_string[i]))
178 | m_state = ExpSign;
179 | else if(QString("0123456789").contains(a_string[i]))
180 | {
181 | m_state = ExpComplete;
182 | m_lastValidLength = i - a_matchFrom + 1;
183 | }
184 | else
185 | break;
186 | }
187 | else if(m_state == ExpSign)
188 | {
189 | if(QString("0123456789").contains(a_string[i]))
190 | {
191 | m_state = ExpComplete;
192 | m_lastValidLength = i - a_matchFrom + 1;
193 | }
194 | else
195 | break;
196 | }
197 | else if(m_state == ExpComplete)
198 | {
199 | if(QString("0123456789").contains(a_string[i]))
200 | m_lastValidLength = i - a_matchFrom + 1;
201 | else if(a_string[i].toLower() == 'j')
202 | {
203 | m_lastValidLength = i - a_matchFrom + 1;
204 | return true;
205 | }
206 | }
207 | else
208 | break;
209 | }
210 |
211 | return (m_lastValidLength != 0);
212 | }
213 |
214 | // END OF bool NumberMatcher::beginsWithNumber(const QString & a_string,
215 | // int a_matchFrom)
216 | //==============================================================================
217 |
218 | int NumberMatcher::matchedLength() const
219 | {
220 | return m_lastValidLength;
221 | }
222 |
223 |
224 | // END OF int NumberMatcher::matchedLength() const
225 | //==============================================================================
226 |
--------------------------------------------------------------------------------
/tcax-creator/com/config.cpp:
--------------------------------------------------------------------------------
1 | #include "config.h"
2 |
3 | const static char SETTINGS_FILE_NAME[] = "/tcax-creator.config";
4 | const static char COMMON_GROUP[] = "common";
5 |
6 | const char *c_config_common_key[Config::eCONFIG_COMMON_MAX] = {
7 | "recent_folder_list", /* eCONFIG_COMMON_RECENT */
8 | "show_splash_screen", /* eCONFIG_COMMON_SHOW_SPLASH_SCREEN */
9 | "editor_file_limit_enable", /* eCONFIG_COMMON_EDITOR_FILE_LIMIT_ENABLE */
10 | "editor_file_limit_size", /* eCONFIG_COMMON_EDITOR_FILE_LIMIT_SIZE */
11 | "style_factory_enable", /* eCONFIG_COMMON_STYLE_FACTORY_ENABLE */
12 | "style_factory", /* eCONFIG_COMMON_STYLE_FACTORY */
13 | "editor_font_point_size", /* eCONFIG_COMMON_EDITOR_FONT_POINT_SIZE */
14 | };
15 |
16 | Config::Config()
17 | {
18 | getConfigFile();
19 | initCommonConfig();
20 | }
21 |
22 | bool Config::getPortableMode(void)
23 | {
24 | QString applicationDir = QCoreApplication::applicationDirPath();
25 | QString settingsFilePath = applicationDir + SETTINGS_FILE_NAME;
26 | QFileInfo settingsFileInfo(settingsFilePath);
27 | bool portableMode = (settingsFileInfo.exists() && settingsFileInfo.isWritable());
28 | return portableMode;
29 | }
30 |
31 | void Config::getConfigFile(void)
32 | {
33 | QString applicationDir = QCoreApplication::applicationDirPath();
34 |
35 | if(getPortableMode())
36 | {
37 | m_settingsFilePath = applicationDir + SETTINGS_FILE_NAME;
38 | }
39 | else
40 | {
41 | m_settingsFilePath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + SETTINGS_FILE_NAME;
42 | }
43 | m_settingsFilePath = QDir::toNativeSeparators(m_settingsFilePath);
44 |
45 | qDebug() << "Config file:" << m_settingsFilePath;
46 | }
47 |
48 | QVariant Config::getConfig(ECONFIG_COMMON a_key)
49 | {
50 | return m_config_common[a_key];
51 | }
52 |
53 | QVariant Config::getConfigDefault(ECONFIG_COMMON a_key)
54 | {
55 | return m_config_common_default.at(a_key);
56 | }
57 |
58 | void Config::setConfig(ECONFIG_COMMON a_key, QVariant a_value)
59 | {
60 | if(m_config_common.contains(a_key))
61 | {
62 | m_config_common.remove(a_key);
63 | }
64 | m_config_common.insert(a_key, a_value);
65 | }
66 |
67 | QVariant Config::valueInGroup(const QString & a_group, const QString & a_key, const QVariant & a_defaultValue) const
68 | {
69 | QSettings settings(m_settingsFilePath, QSettings::IniFormat);
70 | settings.beginGroup(a_group);
71 | return settings.value(a_key, a_defaultValue);
72 | }
73 |
74 | bool Config::setValueInGroup(const QString & a_group, const QString & a_key, const QVariant & a_value)
75 | {
76 | QSettings settings(m_settingsFilePath, QSettings::IniFormat);
77 | settings.beginGroup(a_group);
78 | settings.setValue(a_key, a_value);
79 | settings.sync();
80 | bool success = (QSettings::NoError == settings.status());
81 | return success;
82 | }
83 |
84 | bool Config::deleteValueInGroup(const QString & a_group, const QString & a_key)
85 | {
86 | QSettings settings(m_settingsFilePath, QSettings::IniFormat);
87 | settings.beginGroup(a_group);
88 | settings.remove(a_key);
89 | settings.sync();
90 | bool success = (QSettings::NoError == settings.status());
91 | return success;
92 | }
93 |
94 | QVariant Config::value(const QString & a_key, const QVariant & a_defaultValue) const
95 | {
96 | return valueInGroup(COMMON_GROUP, a_key, a_defaultValue);
97 | }
98 |
99 | bool Config::setValue(const QString & a_key, const QVariant & a_value)
100 | {
101 | return setValueInGroup(COMMON_GROUP, a_key, a_value);
102 | }
103 |
104 | QStringList Config::groupKeys(const QString & a_group)
105 | {
106 | QSettings settings(m_settingsFilePath, QSettings::IniFormat);
107 | settings.beginGroup(a_group);
108 | return settings.childKeys();
109 | }
110 |
111 | QString Config::settingsFilePath(void)
112 | {
113 | return m_settingsFilePath;
114 | }
115 |
116 | bool Config::isShowSplashScreen(void)
117 | {
118 | return getConfig(eCONFIG_COMMON_SHOW_SPLASH_SCREEN).toBool();
119 | }
120 |
121 | void Config::initCommonConfigDefault(void)
122 | {
123 | m_config_common_default << QVariant(NULLSTR); /* eCONFIG_COMMON_RECENT */
124 | m_config_common_default << QVariant(true); /* eCONFIG_COMMON_SHOW_SPLASH_SCREEN */
125 | m_config_common_default << QVariant(true); /* eCONFIG_COMMON_EDITOR_FILE_LIMIT_ENABLE */
126 | m_config_common_default << QVariant(eINDEX_2); /* eCONFIG_COMMON_EDITOR_FILE_LIMIT_SIZE */
127 | m_config_common_default << QVariant(false); /* eCONFIG_COMMON_STYLE_FACTORY_ENABLE */
128 | m_config_common_default << QVariant(DEFAULT_STYLE_FACTORY); /* eCONFIG_COMMON_STYLE_FACTORY */
129 | m_config_common_default << QVariant(eINDEX_9); /* eCONFIG_COMMON_EDITOR_FONT_POINT_SIZE */
130 | }
131 |
132 | void Config::initCommonConfig(void)
133 | {
134 | initCommonConfigDefault();
135 | for(int i = eINDEX_0; i < eCONFIG_COMMON_MAX; i++)
136 | {
137 | m_config_common.insert(static_cast(i), value(c_config_common_key[static_cast(i)], m_config_common_default.at(static_cast(i))));
138 | }
139 | for(QMap::iterator i = m_config_common.begin(); i != m_config_common.end(); i++)
140 | {
141 | qDebug() << QString("%1:%2=").arg(i.key()).arg(c_config_common_key[i.key()]) << i.value();
142 | }
143 | }
144 |
145 | void Config::reset(void)
146 | {
147 | for(int i = eINDEX_0; i < m_config_common_default.length(); i++)
148 | {
149 | if(static_cast(i) != eCONFIG_COMMON_RECENT) // Recent can not be reset.
150 | {
151 | setConfig(static_cast(i), m_config_common_default.at(i));
152 | }
153 | }
154 | }
155 |
156 | void Config::saveConfigAll(void)
157 | {
158 | QString key;
159 | QVariant value;
160 |
161 | for(QMap::iterator i = m_config_common.begin(); i != m_config_common.end(); i++)
162 | {
163 | key = c_config_common_key[i.key()];
164 | value = i.value();
165 | if(key.isEmpty())
166 | {
167 | continue;
168 | }
169 | setValue(key, value);
170 | }
171 | }
172 |
--------------------------------------------------------------------------------