├── InProcess ├── pch.cpp ├── InProcess.def ├── InProcess_Hook.h ├── framework.h ├── pch.h ├── InProcess.h ├── InProcess_Hook.cpp ├── InProcess.vcxproj.filters ├── InProcessFilter.cpp ├── InProcess.cpp └── InProcess.vcxproj ├── OutProcess ├── pch.cpp ├── OutProcess.rc ├── res │ ├── OutProcess.ico │ └── OutProcess.rc2 ├── targetver.h ├── pch.h ├── Resource.h ├── framework.h ├── MainFrame.h ├── OutProcess.h ├── MainFrame_Save.cpp ├── OutProcess.cpp ├── EaseWindow.h ├── MainFrame_Load.cpp ├── OutProcess.vcxproj.filters ├── EaseWindow_Save.cpp ├── EaseWindow_Load.cpp ├── MainFrame.cpp ├── OutProcess.vcxproj └── EaseWindow.cpp ├── CREDITS.md ├── Common └── SelectEasing.h ├── Common.props ├── LICENSE ├── SelectEasing.sln ├── .gitattributes ├── README.md └── .gitignore /InProcess/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /OutProcess/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /InProcess/InProcess.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | GetFilterTable @1 3 | -------------------------------------------------------------------------------- /CREDITS.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hebiiro/AviUtl-Plugin-SelectEasing/HEAD/CREDITS.md -------------------------------------------------------------------------------- /OutProcess/OutProcess.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hebiiro/AviUtl-Plugin-SelectEasing/HEAD/OutProcess/OutProcess.rc -------------------------------------------------------------------------------- /OutProcess/res/OutProcess.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hebiiro/AviUtl-Plugin-SelectEasing/HEAD/OutProcess/res/OutProcess.ico -------------------------------------------------------------------------------- /OutProcess/res/OutProcess.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hebiiro/AviUtl-Plugin-SelectEasing/HEAD/OutProcess/res/OutProcess.rc2 -------------------------------------------------------------------------------- /InProcess/InProcess_Hook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //--------------------------------------------------------------------- 4 | 5 | DECLARE_HOOK_PROC(BOOL, CDECL, GetParamSmallExternal, (int index)); 6 | 7 | //--------------------------------------------------------------------- 8 | -------------------------------------------------------------------------------- /InProcess/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | #include 5 | #include 6 | #pragma comment(lib, "shlwapi.lib") 7 | #include 8 | #pragma comment(lib, "winmm.lib") 9 | 10 | #include 11 | #include 12 | -------------------------------------------------------------------------------- /OutProcess/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // SDKDDKVer.h をインクルードすると、利用できる最も上位の Windows プラットフォームが定義されます。 4 | 5 | // 以前の Windows プラットフォーム用にアプリケーションをビルドする場合は、WinSDKVer.h をインクルードし、 6 | // SDKDDKVer.h をインクルードする前に、サポート対象とするプラットフォームを示すように _WIN32_WINNT マクロを設定します。 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /Common/SelectEasing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //--------------------------------------------------------------------- 4 | 5 | #define WM_SELECT_EASING_NOTIFY (WM_APP + 1) 6 | #define WM_SELECT_EASING_UPDATE (WM_APP + 2) 7 | 8 | //--------------------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /InProcess/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "framework.h" 4 | 5 | #include "AviUtl/aviutl_exedit_sdk/aviutl.hpp" 6 | #include "AviUtl/aviutl_exedit_sdk/exedit.hpp" 7 | #include "Common/Tracer.h" 8 | #include "Common/Hook.h" 9 | #include "Common/AviUtlInternal.h" 10 | #include "Common/SelectEasing.h" 11 | -------------------------------------------------------------------------------- /OutProcess/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "framework.h" 4 | 5 | #define SELECT_EASING_CHECK_MAIN_PROCESS 6 | 7 | #include "Common/Tracer.h" 8 | #include "Common/MSXML.h" 9 | #include "Common/Gdiplus.h" 10 | #include "Common/MFC.h" 11 | #include "Common/WinUtility.h" 12 | #include "Common/FileUpdateChecker.h" 13 | #include "Common/SelectEasing.h" 14 | -------------------------------------------------------------------------------- /OutProcess/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ で生成されたインクルード ファイル。 3 | // OutProcess.rc で使用されます 4 | // 5 | #define IDD_ABOUTBOX 100 6 | #define IDR_MAINFRAME 128 7 | #define IDR_OutProcessTYPE 130 8 | 9 | // 新しいオブジェクトの次の既定値 10 | // 11 | #ifdef APSTUDIO_INVOKED 12 | #ifndef APSTUDIO_READONLY_SYMBOLS 13 | #define _APS_NEXT_RESOURCE_VALUE 310 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 310 16 | #define _APS_NEXT_COMMAND_VALUE 32771 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /Common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(SolutionDir)_bin\ 7 | $(SolutionDir)_obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ 8 | 9 | 10 | 11 | $(IntDir) 12 | 13 | 14 | 15 | 16 | $(IntDir) 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /InProcess/InProcess.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CInProcessApp 4 | { 5 | public: 6 | 7 | HINSTANCE m_instance; 8 | HWND m_hwnd; 9 | PROCESS_INFORMATION m_pi; 10 | 11 | AviUtlInternal m_auin; 12 | int* m_trackTable = 0; 13 | int* m_trackOffsets = 0; 14 | int m_trackIndex = 0; 15 | 16 | public: 17 | 18 | CInProcessApp(); 19 | ~CInProcessApp(); 20 | 21 | BOOL dllMain(HINSTANCE instance, DWORD reason, LPVOID reserved); 22 | BOOL init(AviUtl::FilterPlugin* fp); 23 | BOOL exit(AviUtl::FilterPlugin* fp); 24 | BOOL proc(AviUtl::FilterPlugin* fp, AviUtl::FilterProcInfo* fpip); 25 | BOOL WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, AviUtl::EditHandle* editp, AviUtl::FilterPlugin* fp); 26 | 27 | BOOL createSubProcess(); 28 | 29 | void initHook(); 30 | void termHook(); 31 | 32 | void update(int value); 33 | }; 34 | 35 | extern CInProcessApp theApp; 36 | -------------------------------------------------------------------------------- /InProcess/InProcess_Hook.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "InProcess.h" 3 | #include "InProcess_Hook.h" 4 | 5 | //-------------------------------------------------------------------- 6 | 7 | IMPLEMENT_HOOK_PROC_NULL(BOOL, CDECL, GetParamSmallExternal, (int index)) 8 | { 9 | __asm { MOV theApp.m_trackOffsets, ESI } 10 | theApp.m_trackIndex = index; 11 | 12 | MY_TRACE(_T("GetParamSmallExternal(%d)\n"), index); 13 | 14 | int oldValue = theApp.m_trackTable[index]; 15 | BOOL retValue = true_GetParamSmallExternal(index); 16 | int newValue = theApp.m_trackTable[index]; 17 | 18 | if (!retValue && newValue != oldValue) 19 | { 20 | MY_TRACE(_T("値を復元します\n")); 21 | 22 | // 値を確定せずにダイアログを閉じたにも関わらず、 23 | // 値が変更されているので元の値を復元する。 24 | theApp.update(oldValue); 25 | } 26 | 27 | theApp.m_trackOffsets = 0; 28 | theApp.m_trackIndex = 0; 29 | 30 | return retValue; 31 | } 32 | 33 | //-------------------------------------------------------------------- 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 hebiiro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OutProcess/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef VC_EXTRALEAN 4 | #define VC_EXTRALEAN // Windows ヘッダーから使用されていない部分を除外します。 5 | #endif 6 | 7 | #include "targetver.h" 8 | 9 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 一部の CString コンストラクターは明示的です。 10 | #define _AFX_ALL_WARNINGS // 一般的で無視しても安全な MFC の警告メッセージの一部の非表示を解除します。 11 | #include // MFC のコアおよび標準コンポーネント 12 | #include // MFC の拡張部分 13 | #include // MFC オートメーション クラス 14 | #ifndef _AFX_NO_OLE_SUPPORT 15 | #include // MFC の Internet Explorer 4 コモン コントロール サポート 16 | #endif 17 | #ifndef _AFX_NO_AFXCMN_SUPPORT 18 | #include // MFC の Windows コモン コントロール サポート 19 | #endif // _AFX_NO_AFXCMN_SUPPORT 20 | #include // MFC におけるリボンとコントロール バーのサポート 21 | 22 | #include 23 | #pragma comment(lib, "shlwapi.lib") 24 | #include 25 | #pragma comment(lib, "winmm.lib") 26 | #include 27 | #pragma comment(lib, "gdiplus.lib") 28 | using namespace Gdiplus; 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #import 38 | -------------------------------------------------------------------------------- /InProcess/InProcess.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {79bae488-39c4-4741-beda-1e2ee6428bed} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Common 14 | 15 | 16 | 17 | Common 18 | 19 | 20 | Common 21 | 22 | 23 | Common 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /InProcess/InProcessFilter.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "InProcess.h" 3 | 4 | //-------------------------------------------------------------------- 5 | 6 | BOOL func_init(AviUtl::FilterPlugin* fp) 7 | { 8 | MY_TRACE(_T("func_init()\n")); 9 | 10 | return theApp.init(fp); 11 | } 12 | 13 | BOOL func_exit(AviUtl::FilterPlugin* fp) 14 | { 15 | MY_TRACE(_T("func_exit()\n")); 16 | 17 | return theApp.exit(fp); 18 | } 19 | 20 | BOOL func_proc(AviUtl::FilterPlugin* fp, AviUtl::FilterProcInfo* fpip) 21 | { 22 | // MY_TRACE(_T("func_proc()\n")); 23 | 24 | return theApp.proc(fp, fpip); 25 | } 26 | 27 | BOOL func_WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, AviUtl::EditHandle* editp, AviUtl::FilterPlugin* fp) 28 | { 29 | return theApp.WndProc(hwnd, message, wParam, lParam, editp, fp); 30 | } 31 | 32 | BOOL APIENTRY DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) 33 | { 34 | return theApp.dllMain(instance, reason, reserved); 35 | } 36 | 37 | EXTERN_C AviUtl::FilterPluginDLL* CALLBACK GetFilterTable() 38 | { 39 | LPCSTR name = "イージング簡単選択"; 40 | LPCSTR information = "イージング簡単選択 4.5.0 by 蛇色"; 41 | 42 | static AviUtl::FilterPluginDLL filter = 43 | { 44 | .flag = 45 | AviUtl::detail::FilterPluginFlag::AlwaysActive | 46 | AviUtl::detail::FilterPluginFlag::DispFilter | 47 | // AviUtl::detail::FilterPluginFlag::WindowThickFrame | 48 | // AviUtl::detail::FilterPluginFlag::WindowSize | 49 | AviUtl::detail::FilterPluginFlag::ExInformation, 50 | .name = name, 51 | .func_init = func_init, 52 | .func_exit = func_exit, 53 | .func_WndProc = func_WndProc, 54 | .information = information, 55 | }; 56 | 57 | return &filter; 58 | } 59 | 60 | //-------------------------------------------------------------------- 61 | -------------------------------------------------------------------------------- /OutProcess/MainFrame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EaseWindow.h" 4 | 5 | //-------------------------------------------------------------------- 6 | 7 | class CMainFrame : public CFrameWnd 8 | { 9 | public: 10 | 11 | typedef std::vector CParts; 12 | 13 | public: 14 | 15 | CEaseWindow m_easeWindow; 16 | 17 | FileUpdateChecker m_fileUpdateChecker; 18 | BOOL m_isSettingsFileLoaded; 19 | 20 | int m_imageVersion; 21 | BOOL m_clamp; 22 | _bstr_t m_horz; 23 | _bstr_t m_vert; 24 | int m_alpha; 25 | int m_scale; 26 | Color m_selectedColor; 27 | Color m_hotColor; 28 | CImage m_image; 29 | CParts m_parts; 30 | int m_currentPart; 31 | int m_hotPart; 32 | 33 | public: 34 | 35 | CMainFrame() noexcept; 36 | virtual ~CMainFrame(); 37 | 38 | HRESULT loadSettings(); 39 | HRESULT loadEasing(const MSXML2::IXMLDOMElementPtr& element); 40 | HRESULT saveSettings(); 41 | HRESULT saveEasing(const MSXML2::IXMLDOMElementPtr& element); 42 | void loadImage(); 43 | void setRect(int number, int x, int y); 44 | void setHotPart(int index); 45 | HWND getTarget(); 46 | int getEasing(); 47 | void setEasing(int index); 48 | void show(HWND target); 49 | void hide(); 50 | 51 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 52 | 53 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 54 | afx_msg void OnDestroy(); 55 | afx_msg void OnPaint(); 56 | afx_msg void OnTimer(UINT_PTR nIDEvent); 57 | afx_msg BOOL OnNcActivate(BOOL bActive); 58 | afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); 59 | afx_msg LRESULT OnNcHitTest(CPoint point); 60 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 61 | DECLARE_MESSAGE_MAP() 62 | }; 63 | 64 | //-------------------------------------------------------------------- 65 | -------------------------------------------------------------------------------- /OutProcess/OutProcess.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | 5 | //-------------------------------------------------------------------- 6 | 7 | const UINT_PTR TIMER_ID = 1; 8 | 9 | //-------------------------------------------------------------------- 10 | 11 | inline HRESULT WINAPI getPrivateProfileColor( 12 | const MSXML2::IXMLDOMElementPtr& element, Color& outValue) 13 | { 14 | BYTE A = outValue.GetA(); 15 | BYTE R = outValue.GetR(); 16 | BYTE G = outValue.GetG(); 17 | BYTE B = outValue.GetB(); 18 | getPrivateProfileInt(element, L"A", A); 19 | getPrivateProfileInt(element, L"R", R); 20 | getPrivateProfileInt(element, L"G", G); 21 | getPrivateProfileInt(element, L"B", B); 22 | outValue = Color(A, R, G, B); 23 | 24 | return S_OK; 25 | } 26 | 27 | inline HRESULT WINAPI setPrivateProfileColor( 28 | const MSXML2::IXMLDOMElementPtr& element, const Color& value) 29 | { 30 | setPrivateProfileInt(element, L"A", value.GetA()); 31 | setPrivateProfileInt(element, L"R", value.GetR()); 32 | setPrivateProfileInt(element, L"G", value.GetG()); 33 | setPrivateProfileInt(element, L"B", value.GetB()); 34 | 35 | return S_OK; 36 | } 37 | 38 | //-------------------------------------------------------------------- 39 | 40 | class COutProcessApp : public CWinApp 41 | { 42 | public: 43 | 44 | HWND m_mainProcessWindow; 45 | DWORD m_mainProcessId; 46 | 47 | public: 48 | 49 | COutProcessApp() noexcept; 50 | virtual ~COutProcessApp(); 51 | 52 | virtual BOOL InitInstance(); 53 | virtual int ExitInstance(); 54 | virtual int Run(); 55 | 56 | afx_msg void OnSelectEasingNotify(WPARAM wParam, LPARAM lParam); 57 | DECLARE_MESSAGE_MAP() 58 | }; 59 | 60 | //-------------------------------------------------------------------- 61 | 62 | extern COutProcessApp theApp; 63 | 64 | //-------------------------------------------------------------------- 65 | -------------------------------------------------------------------------------- /OutProcess/MainFrame_Save.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "OutProcess.h" 3 | #include "MainFrame.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | HRESULT CMainFrame::saveSettings() 10 | { 11 | MY_TRACE(_T("CMainFrame::saveSettings()\n")); 12 | 13 | // 設定ファイルを読み込めていない場合は、保存処理をするとファイルの中の設定値がすべて初期値に戻ってしまう。 14 | // よって、フラグを確認して設定ファイルを読み込めていない場合は保存処理をしないようにする。 15 | if (!m_isSettingsFileLoaded) 16 | return S_FALSE; 17 | 18 | try 19 | { 20 | // ドキュメントを作成する。 21 | MSXML2::IXMLDOMDocumentPtr document(__uuidof(MSXML2::DOMDocument)); 22 | 23 | // ドキュメントエレメントを作成する。 24 | MSXML2::IXMLDOMElementPtr element = appendElement(document, document, L"settings"); 25 | 26 | // を作成する。 27 | saveEasing(element); 28 | 29 | // を作成する。 30 | m_easeWindow.saveEase(element); 31 | 32 | return saveXMLDocument(document, m_fileUpdateChecker.getFilePath(), L"UTF-16"); 33 | } 34 | catch (_com_error& e) 35 | { 36 | MY_TRACE(_T("%s\n"), e.ErrorMessage()); 37 | return e.Error(); 38 | } 39 | } 40 | 41 | // を作成する。 42 | HRESULT CMainFrame::saveEasing(const MSXML2::IXMLDOMElementPtr& element) 43 | { 44 | MY_TRACE(_T("CMainFrame::saveEasing()\n")); 45 | 46 | // を作成する。 47 | MSXML2::IXMLDOMElementPtr easingElement = appendElement(element, L"easing"); 48 | 49 | // のアトリビュートを作成する。 50 | setPrivateProfileInt(easingElement, L"imageVersion", m_imageVersion); 51 | setPrivateProfileBool(easingElement, L"clamp", m_clamp); 52 | setPrivateProfileString(easingElement, L"horz", m_horz); 53 | setPrivateProfileString(easingElement, L"vert", m_vert); 54 | setPrivateProfileInt(easingElement, L"alpha", m_alpha); 55 | setPrivateProfileInt(easingElement, L"scale", m_scale); 56 | 57 | { 58 | MSXML2::IXMLDOMElementPtr selectedElement = appendElement(easingElement, L"selected"); 59 | 60 | setPrivateProfileColor(selectedElement, m_selectedColor); 61 | } 62 | 63 | { 64 | MSXML2::IXMLDOMElementPtr hotElement = appendElement(easingElement, L"hot"); 65 | 66 | setPrivateProfileColor(hotElement, m_hotColor); 67 | } 68 | 69 | return S_OK; 70 | } 71 | -------------------------------------------------------------------------------- /OutProcess/OutProcess.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "OutProcess.h" 3 | #include "MainFrame.h" 4 | #include "Common/Tracer2.h" 5 | 6 | #ifdef _DEBUG 7 | #define new DEBUG_NEW 8 | #endif 9 | 10 | COutProcessApp theApp; 11 | 12 | BEGIN_MESSAGE_MAP(COutProcessApp, CWinApp) 13 | ON_THREAD_MESSAGE(WM_SELECT_EASING_NOTIFY, OnSelectEasingNotify) 14 | END_MESSAGE_MAP() 15 | 16 | COutProcessApp::COutProcessApp() noexcept 17 | { 18 | trace_init(0, 0); 19 | 20 | m_mainProcessWindow = 0; 21 | m_mainProcessId = 0; 22 | } 23 | 24 | COutProcessApp::~COutProcessApp() 25 | { 26 | trace_term(); 27 | } 28 | 29 | BOOL COutProcessApp::InitInstance() 30 | { 31 | { 32 | m_mainProcessWindow = (HWND)_tcstoul(::GetCommandLine(), 0, 0); 33 | ::GetWindowThreadProcessId(m_mainProcessWindow, &m_mainProcessId); 34 | 35 | MY_TRACE_HWND(m_mainProcessWindow); 36 | HWND parent = ::GetParent(m_mainProcessWindow); 37 | MY_TRACE_HWND(parent); 38 | 39 | #ifdef SELECT_EASING_CHECK_MAIN_PROCESS 40 | if (!::IsWindow(m_mainProcessWindow)) 41 | return FALSE; 42 | #endif 43 | } 44 | 45 | CWinApp::InitInstance(); 46 | 47 | if (!AfxOleInit()) 48 | return -1; 49 | 50 | EnableTaskbarInteraction(FALSE); 51 | 52 | CFrameWnd* pFrame = new CMainFrame; 53 | m_pMainWnd = pFrame; 54 | pFrame->LoadFrame(IDR_MAINFRAME, 0, nullptr, nullptr); 55 | 56 | return TRUE; 57 | } 58 | 59 | int COutProcessApp::ExitInstance() 60 | { 61 | AfxOleTerm(FALSE); 62 | 63 | return CWinApp::ExitInstance(); 64 | } 65 | 66 | int COutProcessApp::Run() 67 | { 68 | GdiplusStartupInput gdiSI; 69 | GdiplusStartupOutput gdiSO; 70 | ULONG_PTR gdiToken = 0; 71 | ULONG_PTR gdiHookToken = 0; 72 | 73 | gdiSI.SuppressBackgroundThread = TRUE; 74 | GdiplusStartup(&gdiToken, &gdiSI, &gdiSO); 75 | gdiSO.NotificationHook(&gdiHookToken); 76 | 77 | int result = CWinApp::Run(); 78 | 79 | gdiSO.NotificationUnhook(gdiHookToken); 80 | GdiplusShutdown(gdiToken); 81 | 82 | return result; 83 | } 84 | 85 | void COutProcessApp::OnSelectEasingNotify(WPARAM wParam, LPARAM lParam) 86 | { 87 | MY_TRACE(_T("COutProcessApp::OnSelectEasingNotify(0x%08X, 0x%08X)\n"), wParam, lParam); 88 | #if 1 89 | m_pMainWnd->PostMessageA(WM_TIMER, TIMER_ID, 0); 90 | #else 91 | CMainFrame* mainFrame = (CMainFrame*)m_pMainWnd; 92 | mainFrame->OnTimer(TIMER_ID); 93 | #endif 94 | } 95 | -------------------------------------------------------------------------------- /SelectEasing.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InProcess", "InProcess\InProcess.vcxproj", "{8E583504-3780-4129-BCC2-BA590DBD0D0E}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OutProcess", "OutProcess\OutProcess.vcxproj", "{79A65FCE-E082-4886-9F4D-78E8D08A8186}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{737400BB-41C3-4196-B182-92E27B21AE03}" 11 | ProjectSection(SolutionItems) = preProject 12 | CREDITS.md = CREDITS.md 13 | LICENSE = LICENSE 14 | README.md = README.md 15 | EndProjectSection 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | Debug|x64 = Debug|x64 20 | Debug|x86 = Debug|x86 21 | Release|x64 = Release|x64 22 | Release|x86 = Release|x86 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Debug|x64.ActiveCfg = Debug|x64 26 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Debug|x64.Build.0 = Debug|x64 27 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Debug|x86.ActiveCfg = Debug|Win32 28 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Debug|x86.Build.0 = Debug|Win32 29 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Release|x64.ActiveCfg = Release|x64 30 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Release|x64.Build.0 = Release|x64 31 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Release|x86.ActiveCfg = Release|Win32 32 | {8E583504-3780-4129-BCC2-BA590DBD0D0E}.Release|x86.Build.0 = Release|Win32 33 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Debug|x64.ActiveCfg = Debug|x64 34 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Debug|x64.Build.0 = Debug|x64 35 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Debug|x86.ActiveCfg = Debug|Win32 36 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Debug|x86.Build.0 = Debug|Win32 37 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Release|x64.ActiveCfg = Release|x64 38 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Release|x64.Build.0 = Release|x64 39 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Release|x86.ActiveCfg = Release|Win32 40 | {79A65FCE-E082-4886-9F4D-78E8D08A8186}.Release|x86.Build.0 = Release|Win32 41 | EndGlobalSection 42 | GlobalSection(SolutionProperties) = preSolution 43 | HideSolutionNode = FALSE 44 | EndGlobalSection 45 | GlobalSection(ExtensibilityGlobals) = postSolution 46 | SolutionGuid = {483B1548-7CEB-4168-9525-A4CC4E5C6250} 47 | EndGlobalSection 48 | EndGlobal 49 | -------------------------------------------------------------------------------- /OutProcess/EaseWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-------------------------------------------------------------------- 4 | 5 | class CEaseWindow : public CWnd 6 | { 7 | public: 8 | 9 | struct Points 10 | { 11 | static const int first = 0; 12 | static const int second= 1; 13 | static const int maxSize = 2; 14 | static const int none = -1; 15 | }; 16 | 17 | struct Position 18 | { 19 | static const int startBase = 25; 20 | static const int endBase = 75; 21 | 22 | static const int startX = 0; 23 | static const int startY = 0; 24 | static const int endX = 99; 25 | static const int endY = 99; 26 | }; 27 | 28 | CPoint m_points[2]; 29 | int m_hot; 30 | 31 | BOOL m_enable; 32 | _bstr_t m_origin; 33 | BOOL m_clamp; 34 | _bstr_t m_horz; 35 | _bstr_t m_vert; 36 | int m_alpha; 37 | int m_margin; 38 | int m_hitDistance; 39 | CSize m_windowSize; 40 | Color m_backgroundColor; 41 | Color m_borderColor; 42 | REAL m_borderWidth; 43 | Color m_curveColor; 44 | REAL m_curveWidth; 45 | Color m_invalidCurveColor; 46 | REAL m_invalidCurveWidth; 47 | Color m_handleColor; 48 | REAL m_handleWidth; 49 | Color m_pointColor; 50 | Color m_hotPointColor; 51 | int m_pointRadius; 52 | int m_segmentCount; 53 | BOOL m_hideCursor; 54 | BOOL m_immediately; 55 | 56 | CEaseWindow(); 57 | virtual ~CEaseWindow(); 58 | 59 | HRESULT loadEase(const MSXML2::IXMLDOMElementPtr& element); 60 | HRESULT saveEase(const MSXML2::IXMLDOMElementPtr& element); 61 | void getWorkarea(LPRECT rc); 62 | POINT LPToClient(POINT point); 63 | POINT LPToClient(POINT point, LPCRECT rc); 64 | POINT ClientToLP(POINT point); 65 | POINT ClientToLP(POINT point, LPCRECT rc); 66 | int hitTest(POINT point); 67 | void outputEaseText(); 68 | void receiveNumber(); 69 | void sendNumber(); 70 | void show(HWND numberWindow, HWND easingWindow); 71 | void hide(); 72 | 73 | public: 74 | 75 | virtual BOOL Create(CWnd* parent); 76 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 77 | 78 | afx_msg void OnClose(); 79 | afx_msg void OnPaint(); 80 | afx_msg BOOL OnNcActivate(BOOL bActive); 81 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 82 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 83 | afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 84 | afx_msg void OnRButtonDown(UINT nFlags, CPoint point); 85 | afx_msg void OnRButtonUp(UINT nFlags, CPoint point); 86 | afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point); 87 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 88 | afx_msg void OnMouseLeave(); 89 | afx_msg void OnCaptureChanged(CWnd* pWnd); 90 | afx_msg void OnSize(UINT nType, int cx, int cy); 91 | DECLARE_MESSAGE_MAP() 92 | }; 93 | 94 | //-------------------------------------------------------------------- 95 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /OutProcess/MainFrame_Load.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "OutProcess.h" 3 | #include "MainFrame.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | //-------------------------------------------------------------------- 10 | 11 | HRESULT CMainFrame::loadSettings() 12 | { 13 | MY_TRACE(_T("CMainFrame::loadSettings()\n")); 14 | 15 | try 16 | { 17 | m_isSettingsFileLoaded = FALSE; 18 | 19 | LPCWSTR fileName = m_fileUpdateChecker.getFilePath(); 20 | 21 | // MSXML を使用する。 22 | MSXML2::IXMLDOMDocumentPtr document(__uuidof(MSXML2::DOMDocument)); 23 | 24 | // 設定ファイルを開く。 25 | if (document->load(fileName) == VARIANT_FALSE) 26 | { 27 | MY_TRACE(_T("%s を開けませんでした\n"), fileName); 28 | 29 | return S_FALSE; 30 | } 31 | 32 | MSXML2::IXMLDOMElementPtr element = document->documentElement; 33 | 34 | // を読み込む。 35 | loadEasing(element); 36 | 37 | // を読み込む。 38 | m_easeWindow.loadEase(element); 39 | 40 | MY_TRACE(_T("設定ファイルの読み込みに成功しました\n")); 41 | 42 | // 設定ファイルを読み込めたのでフラグを立てておく。 43 | m_isSettingsFileLoaded = TRUE; 44 | 45 | loadImage(); 46 | 47 | return S_OK; 48 | } 49 | catch (_com_error& e) 50 | { 51 | MY_TRACE(_T("設定ファイルの読み込みに失敗しました\n")); 52 | MY_TRACE(_T("%s\n"), e.ErrorMessage()); 53 | return e.Error(); 54 | } 55 | } 56 | 57 | // を読み込む。 58 | HRESULT CMainFrame::loadEasing(const MSXML2::IXMLDOMElementPtr& element) 59 | { 60 | MY_TRACE(_T("CMainFrame::loadEasing()\n")); 61 | 62 | // を取得する。 63 | MSXML2::IXMLDOMNodeListPtr nodeList = element->getElementsByTagName(L"easing"); 64 | int c = nodeList->length; 65 | for (int i = 0; i < c; i++) 66 | { 67 | MSXML2::IXMLDOMElementPtr easingElement = nodeList->item[i]; 68 | 69 | // のアトリビュートを取得する。 70 | getPrivateProfileInt(easingElement, L"imageVersion", m_imageVersion); 71 | getPrivateProfileBool(easingElement, L"clamp", m_clamp); 72 | getPrivateProfileString(easingElement, L"horz", m_horz); 73 | getPrivateProfileString(easingElement, L"vert", m_vert); 74 | getPrivateProfileInt(easingElement, L"alpha", m_alpha); 75 | getPrivateProfileInt(easingElement, L"scale", m_scale); 76 | 77 | { 78 | // を取得する。 79 | MSXML2::IXMLDOMNodeListPtr nodeList = easingElement->getElementsByTagName(L"selected"); 80 | int c = nodeList->length; 81 | for (int i = 0; i < c; i++) 82 | { 83 | MSXML2::IXMLDOMElementPtr selectedElement = nodeList->item[i]; 84 | 85 | getPrivateProfileColor(selectedElement, m_selectedColor); 86 | } 87 | } 88 | 89 | { 90 | // を取得する。 91 | MSXML2::IXMLDOMNodeListPtr nodeList = easingElement->getElementsByTagName(L"hot"); 92 | int c = nodeList->length; 93 | for (int i = 0; i < c; i++) 94 | { 95 | MSXML2::IXMLDOMElementPtr hotElement = nodeList->item[i]; 96 | 97 | getPrivateProfileColor(hotElement, m_hotColor); 98 | } 99 | } 100 | } 101 | 102 | return S_OK; 103 | } 104 | 105 | //-------------------------------------------------------------------- 106 | -------------------------------------------------------------------------------- /OutProcess/OutProcess.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 7 | 8 | 9 | {1848e9de-a1aa-4270-81c7-17b4b0add8ed} 10 | 11 | 12 | 13 | 14 | リソース ファイル 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Common 23 | 24 | 25 | Common 26 | 27 | 28 | Common 29 | 30 | 31 | Common 32 | 33 | 34 | Common 35 | 36 | 37 | Common 38 | 39 | 40 | Common 41 | 42 | 43 | Common 44 | 45 | 46 | Common 47 | 48 | 49 | Common 50 | 51 | 52 | Common 53 | 54 | 55 | 56 | Common 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | リソース ファイル 72 | 73 | 74 | 75 | 76 | リソース ファイル 77 | 78 | 79 | 80 | 81 | リソース ファイル 82 | 83 | 84 | -------------------------------------------------------------------------------- /OutProcess/EaseWindow_Save.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "OutProcess.h" 3 | #include "EaseWindow.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | //-------------------------------------------------------------------- 10 | 11 | // を作成する。 12 | HRESULT CEaseWindow::saveEase(const MSXML2::IXMLDOMElementPtr& element) 13 | { 14 | MY_TRACE(_T("CEaseWindow::saveEase()\n")); 15 | 16 | // を作成する。 17 | MSXML2::IXMLDOMElementPtr easeElement = appendElement(element, L"ease"); 18 | 19 | // のアトリビュートを作成する。 20 | setPrivateProfileBool(easeElement, L"enable", m_enable); 21 | setPrivateProfileString(easeElement, L"origin", m_origin); 22 | setPrivateProfileBool(easeElement, L"clamp", m_clamp); 23 | setPrivateProfileString(easeElement, L"horz", m_horz); 24 | setPrivateProfileString(easeElement, L"vert", m_vert); 25 | setPrivateProfileInt(easeElement, L"alpha", m_alpha); 26 | setPrivateProfileInt(easeElement, L"margin", m_margin); 27 | setPrivateProfileInt(easeElement, L"hitDistance", m_hitDistance); 28 | setPrivateProfileInt(easeElement, L"segmentCount", m_segmentCount); 29 | setPrivateProfileBool(easeElement, L"hideCursor", m_hideCursor); 30 | setPrivateProfileBool(easeElement, L"immediately", m_immediately); 31 | 32 | { 33 | MSXML2::IXMLDOMElementPtr windowElement = appendElement(easeElement, L"window"); 34 | 35 | setPrivateProfileInt(windowElement, L"w", m_windowSize.cx); 36 | setPrivateProfileInt(windowElement, L"h", m_windowSize.cy); 37 | } 38 | 39 | { 40 | MSXML2::IXMLDOMElementPtr backgroundElement = appendElement(easeElement, L"background"); 41 | 42 | setPrivateProfileColor(backgroundElement, m_backgroundColor); 43 | } 44 | 45 | { 46 | MSXML2::IXMLDOMElementPtr borderElement = appendElement(easeElement, L"border"); 47 | 48 | setPrivateProfileColor(borderElement, m_borderColor); 49 | setPrivateProfileInt(borderElement, L"width", m_borderWidth); 50 | } 51 | 52 | { 53 | MSXML2::IXMLDOMElementPtr curveElement = appendElement(easeElement, L"curve"); 54 | 55 | setPrivateProfileColor(curveElement, m_curveColor); 56 | setPrivateProfileInt(curveElement, L"width", m_curveWidth); 57 | } 58 | 59 | { 60 | MSXML2::IXMLDOMElementPtr invalidCurveElement = appendElement(easeElement, L"invalidCurve"); 61 | 62 | setPrivateProfileColor(invalidCurveElement, m_invalidCurveColor); 63 | setPrivateProfileInt(invalidCurveElement, L"width", m_invalidCurveWidth); 64 | } 65 | 66 | { 67 | MSXML2::IXMLDOMElementPtr handleElement = appendElement(easeElement, L"handle"); 68 | 69 | setPrivateProfileColor(handleElement, m_handleColor); 70 | setPrivateProfileInt(handleElement, L"width", m_handleWidth); 71 | } 72 | 73 | { 74 | MSXML2::IXMLDOMElementPtr pointElement = appendElement(easeElement, L"point"); 75 | 76 | setPrivateProfileColor(pointElement, m_pointColor); 77 | setPrivateProfileInt(pointElement, L"radius", m_pointRadius); 78 | } 79 | 80 | { 81 | MSXML2::IXMLDOMElementPtr hotPointElement = appendElement(easeElement, L"hotPoint"); 82 | 83 | setPrivateProfileColor(hotPointElement, m_hotPointColor); 84 | } 85 | 86 | return S_OK; 87 | } 88 | 89 | //-------------------------------------------------------------------- 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AviUtl プラグイン - イージング簡単選択 2 | 3 | イージング番号を画像から選択できるようにします。 4 | [最新バージョンをダウンロード](../../releases/latest/) 5 | 6 | ## 導入方法 7 | 8 | 以下のファイルとフォルダを AviUtl の Plugins フォルダに入れてください。 9 | * SelectEasing.auf 10 | * SelectEasing (フォルダ) 11 | 12 | ## 使用方法 13 | 14 | 1. イージング番号を入力するダイアログを出します。 15 | 2. その横にイージング画像が表示されるので、その中からイージング番号を選びます。 16 | 17 | ### ease の場合 18 | 19 | 1. ベジェ曲線の制御点を左ドラッグして移動します。 20 | 2. ベジェ曲線ウィンドウ内をダブルクリック、または右上の閉じるボタンを押して確定します。 21 | 22 | ## 設定方法 23 | 24 | SelectEasing フォルダ内の SelectEasing.xml をテキストエディタで編集します。AviUtl 起動中でも変更が反映されます。 25 | 26 | * `````` 27 | * ```imageVersion``` 画像のバージョンを指定します。```1``` ```2``` は easing 用、```3``` は ease 用です。 28 | * ```clamp``` YES の場合は画像がモニターからはみ出ないように表示位置を調整します。 29 | * ```horz``` left の場合はダイアログの左側に画像を表示します。right の場合は右側に表示します。それ以外の場合は中央に表示します。 30 | * ```vert``` top の場合はダイアログの上側に画像を表示します。bottom の場合は下側に表示します。それ以外の場合は中央に表示します。 31 | * ```alpha``` 画像のアルファ値を指定します。 32 | * ```scale``` 画像の表示倍率を指定します。 33 | * `````` 選択状態の色を指定します。 34 | * `````` ホット状態の色を指定します。 35 | * `````` 36 | * ```enable``` YES を指定すると数値が負数になります。例えばイージング番号 41 を選択すると数値は -41 になります。さらにベジェ曲線を編集するウィンドウが表示されます。 37 | * ```origin``` ウィンドウを表示する基準を指定します。number を指定すると数値入力ダイアログが基準になります。easing を指定するとイージング画像ウィンドウが基準になります。 38 | * ```clamp``` YES の場合は画像がモニターからはみ出ないように表示位置を調整します。 39 | * ```horz``` left の場合は origin の左側に画像を表示します。right の場合は右側に表示します。それ以外の場合は中央に表示します。 40 | * ```vert``` top の場合は origin の上側に画像を表示します。bottom の場合は下側に表示します。それ以外の場合は中央に表示します。 41 | * ```alpha``` ウィンドウのアルファ値を指定します。 42 | * ```margin``` 外枠までのマージンを指定します。 43 | * ```hitDistance``` 追加の当たり判定範囲を指定します。描画を小さくすると当たり判定も小さくなるので、その場合はこの値を大きくします。 44 | * ```segmentCount``` ベジェ曲線の有効性をチェックするための分割数を指定します。大きくするとチェックが厳密になりますが、その分重くなります。 45 | * ```hideCursor``` YES を指定するとドラッグ時にマウスカーソルを非表示にします。 46 | * ```immediately``` YES を指定するとベジェ曲線編集時、フレーム画像を即時更新します。(その代わりベジェ曲線の描画にラグが発生するようになります) 47 | * `````` ウィンドウのクライアント領域のサイズを指定します。 48 | * `````` 背景色を指定します。 49 | * `````` 外枠の色と太さを指定します。 50 | * `````` ベジェ曲線の色と太さを指定します。 51 | * `````` ベジェ曲線が無効になったときの色と太さを指定します。 52 | * `````` ベジェハンドルの色と太さを指定します。 53 | * `````` 制御点の色と半径を指定します。 54 | * `````` ホット状態の制御点の色を指定します。 55 | 56 | ## 更新履歴 57 | 58 | * 4.5.0 - 2022/07/28 ease 用に imageVersion="3" を追加 59 | * 4.4.0 - 2022/06/08 ease に immediately オプションを追加 60 | * 4.3.0 - 2022/06/07 ドキュメントを整理 61 | * 4.2.0 - 2022/05/15 ベジェ曲線の X 座標を 00~99 まで拡張 62 | * 4.1.0 - 2022/05/15 ベジェ曲線の Y 座標を 00~99 まで拡張 63 | * 4.0.0 - 2022/05/15 「ease」のベジェ曲線に対応 64 | * 3.0.0 - 2022/03/19 clamp、horz、vert オプションを追加 65 | * 2.0.0 - 2022/03/19 画像を選択できるように修正 66 | * 1.1.0 - 2022/03/18 負数も使えるように修正 67 | * 1.0.0 - 2022/03/18 初版 68 | 69 | ## 動作確認 70 | 71 | * (必須) AviUtl 1.10 & 拡張編集 0.92 http://spring-fragrance.mints.ne.jp/aviutl/ 72 | * (共存確認) patch.aul r41 https://scrapbox.io/ePi5131/patch.aul 73 | 74 | ## クレジット 75 | 76 | * Microsoft Research Detours Package https://github.com/microsoft/Detours 77 | * aviutl_exedit_sdk https://github.com/ePi5131/aviutl_exedit_sdk 78 | * Common Library https://github.com/hebiiro/Common-Library 79 | 80 | ## 作成者情報 81 | 82 | * 作成者 - 蛇色 (へびいろ) 83 | * GitHub - https://github.com/hebiiro 84 | * Twitter - https://twitter.com/io_hebiiro 85 | 86 | ## 免責事項 87 | 88 | この作成物および同梱物を使用したことによって生じたすべての障害・損害・不具合等に関しては、私と私の関係者および私の所属するいかなる団体・組織とも、一切の責任を負いません。各自の責任においてご使用ください。 89 | -------------------------------------------------------------------------------- /OutProcess/EaseWindow_Load.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "OutProcess.h" 3 | #include "EaseWindow.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | 10 | //-------------------------------------------------------------------- 11 | 12 | // を読み込む。 13 | HRESULT CEaseWindow::loadEase(const MSXML2::IXMLDOMElementPtr& element) 14 | { 15 | MY_TRACE(_T("CEaseWindow::loadEase()\n")); 16 | 17 | // を取得する。 18 | MSXML2::IXMLDOMNodeListPtr nodeList = element->getElementsByTagName(L"ease"); 19 | int c = nodeList->length; 20 | for (int i = 0; i < c; i++) 21 | { 22 | MSXML2::IXMLDOMElementPtr easeElement = nodeList->item[i]; 23 | 24 | // のアトリビュートを取得する。 25 | getPrivateProfileBool(easeElement, L"enable", m_enable); 26 | getPrivateProfileString(easeElement, L"origin", m_origin); 27 | getPrivateProfileBool(easeElement, L"clamp", m_clamp); 28 | getPrivateProfileString(easeElement, L"horz", m_horz); 29 | getPrivateProfileString(easeElement, L"vert", m_vert); 30 | getPrivateProfileInt(easeElement, L"alpha", m_alpha); 31 | getPrivateProfileInt(easeElement, L"segmentCount", m_segmentCount); 32 | getPrivateProfileBool(easeElement, L"hideCursor", m_hideCursor); 33 | getPrivateProfileBool(easeElement, L"immediately", m_immediately); 34 | 35 | { 36 | // を取得する。 37 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"window"); 38 | int c = nodeList->length; 39 | for (int i = 0; i < c; i++) 40 | { 41 | MSXML2::IXMLDOMElementPtr windowElement = nodeList->item[i]; 42 | 43 | getPrivateProfileInt(windowElement, L"w", m_windowSize.cx); 44 | getPrivateProfileInt(windowElement, L"h", m_windowSize.cy); 45 | } 46 | } 47 | 48 | { 49 | // を取得する。 50 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"background"); 51 | int c = nodeList->length; 52 | for (int i = 0; i < c; i++) 53 | { 54 | MSXML2::IXMLDOMElementPtr backgroundElement = nodeList->item[i]; 55 | 56 | getPrivateProfileColor(backgroundElement, m_backgroundColor); 57 | } 58 | } 59 | 60 | { 61 | // を取得する。 62 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"border"); 63 | int c = nodeList->length; 64 | for (int i = 0; i < c; i++) 65 | { 66 | MSXML2::IXMLDOMElementPtr borderElement = nodeList->item[i]; 67 | 68 | getPrivateProfileColor(borderElement, m_borderColor); 69 | getPrivateProfileInt(borderElement, L"width", m_borderWidth); 70 | } 71 | } 72 | 73 | { 74 | // を取得する。 75 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"curve"); 76 | int c = nodeList->length; 77 | for (int i = 0; i < c; i++) 78 | { 79 | MSXML2::IXMLDOMElementPtr curveElement = nodeList->item[i]; 80 | 81 | getPrivateProfileColor(curveElement, m_curveColor); 82 | getPrivateProfileInt(curveElement, L"width", m_curveWidth); 83 | } 84 | } 85 | 86 | { 87 | // を取得する。 88 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"invalidCurve"); 89 | int c = nodeList->length; 90 | for (int i = 0; i < c; i++) 91 | { 92 | MSXML2::IXMLDOMElementPtr invalidCurveElement = nodeList->item[i]; 93 | 94 | getPrivateProfileColor(invalidCurveElement, m_invalidCurveColor); 95 | getPrivateProfileInt(invalidCurveElement, L"width", m_invalidCurveWidth); 96 | } 97 | } 98 | 99 | { 100 | // を取得する。 101 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"handle"); 102 | int c = nodeList->length; 103 | for (int i = 0; i < c; i++) 104 | { 105 | MSXML2::IXMLDOMElementPtr handleElement = nodeList->item[i]; 106 | 107 | getPrivateProfileColor(handleElement, m_handleColor); 108 | getPrivateProfileInt(handleElement, L"width", m_handleWidth); 109 | } 110 | } 111 | 112 | { 113 | // を取得する。 114 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"point"); 115 | int c = nodeList->length; 116 | for (int i = 0; i < c; i++) 117 | { 118 | MSXML2::IXMLDOMElementPtr pointElement = nodeList->item[i]; 119 | 120 | getPrivateProfileColor(pointElement, m_pointColor); 121 | getPrivateProfileInt(pointElement, L"radius", m_pointRadius); 122 | } 123 | } 124 | 125 | { 126 | // を取得する。 127 | MSXML2::IXMLDOMNodeListPtr nodeList = easeElement->getElementsByTagName(L"hotPoint"); 128 | int c = nodeList->length; 129 | for (int i = 0; i < c; i++) 130 | { 131 | MSXML2::IXMLDOMElementPtr hotPointElement = nodeList->item[i]; 132 | 133 | getPrivateProfileColor(hotPointElement, m_hotPointColor); 134 | } 135 | } 136 | } 137 | 138 | return S_OK; 139 | } 140 | 141 | //-------------------------------------------------------------------- 142 | -------------------------------------------------------------------------------- /InProcess/InProcess.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "InProcess.h" 3 | #include "InProcess_Hook.h" 4 | 5 | CInProcessApp theApp; 6 | 7 | void ___outputLog(LPCTSTR text, LPCTSTR output) 8 | { 9 | ::OutputDebugString(output); 10 | } 11 | 12 | CInProcessApp::CInProcessApp() 13 | { 14 | m_instance = 0; 15 | m_hwnd = 0; 16 | ::ZeroMemory(&m_pi, sizeof(m_pi)); 17 | } 18 | 19 | CInProcessApp::~CInProcessApp() 20 | { 21 | } 22 | 23 | BOOL CInProcessApp::dllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) 24 | { 25 | switch (reason) 26 | { 27 | case DLL_PROCESS_ATTACH: 28 | { 29 | MY_TRACE(_T("DLL_PROCESS_ATTACH\n")); 30 | 31 | m_instance = instance; 32 | MY_TRACE_HEX(m_instance); 33 | 34 | break; 35 | } 36 | case DLL_PROCESS_DETACH: 37 | { 38 | MY_TRACE(_T("DLL_PROCESS_DETACH\n")); 39 | 40 | break; 41 | } 42 | } 43 | 44 | return TRUE; 45 | } 46 | 47 | BOOL CInProcessApp::init(AviUtl::FilterPlugin* fp) 48 | { 49 | MY_TRACE(_T("CInProcessApp::init()\n")); 50 | 51 | m_hwnd = fp->hwnd; 52 | 53 | if (!createSubProcess()) 54 | return FALSE; 55 | 56 | m_auin.initExEditAddress(); 57 | 58 | initHook(); 59 | 60 | return TRUE; 61 | } 62 | 63 | BOOL CInProcessApp::exit(AviUtl::FilterPlugin* fp) 64 | { 65 | MY_TRACE(_T("CInProcessApp::exit()\n")); 66 | 67 | ::CloseHandle(m_pi.hThread); 68 | ::CloseHandle(m_pi.hProcess); 69 | 70 | termHook(); 71 | 72 | return TRUE; 73 | } 74 | 75 | BOOL CInProcessApp::proc(AviUtl::FilterPlugin* fp, AviUtl::FilterProcInfo* fpip) 76 | { 77 | MY_TRACE(_T("CInProcessApp::proc()\n")); 78 | 79 | return TRUE; 80 | } 81 | 82 | BOOL CInProcessApp::WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, AviUtl::EditHandle* editp, AviUtl::FilterPlugin* fp) 83 | { 84 | // MY_TRACE(_T("CInProcessApp::WndProc(0x%08X, 0x%08X, 0x%08X)\n"), message, wParam, lParam); 85 | 86 | switch (message) 87 | { 88 | case WM_SELECT_EASING_UPDATE: 89 | { 90 | MY_TRACE(_T("CInProcessApp::WndProc(WM_SELECT_EASING_UPDATE, 0x%08X, 0x%08X)\n"), wParam, lParam); 91 | 92 | update(wParam); 93 | 94 | break; 95 | } 96 | case WM_WINDOWPOSCHANGING: 97 | { 98 | MY_TRACE(_T("CInProcessApp::WndProc(WM_WINDOWPOSCHANGING, 0x%08X, 0x%08X)\n"), wParam, lParam); 99 | 100 | ::PostThreadMessage(m_pi.dwThreadId, WM_SELECT_EASING_NOTIFY, 0, 0); 101 | 102 | break; 103 | } 104 | } 105 | 106 | return FALSE; 107 | } 108 | 109 | BOOL CInProcessApp::createSubProcess() 110 | { 111 | MY_TRACE(_T("CInProcessApp::createSubProcess()\n")); 112 | 113 | TCHAR fileSpec[MAX_PATH] = {}; 114 | ::GetModuleFileName(m_instance, fileSpec, MAX_PATH); 115 | ::PathStripPath(fileSpec); 116 | MY_TRACE_TSTR(fileSpec); 117 | 118 | TCHAR path[MAX_PATH] = {}; 119 | ::GetModuleFileName(m_instance, path, MAX_PATH); 120 | ::PathRemoveExtension(path); 121 | ::PathAppend(path, fileSpec); 122 | ::PathRenameExtension(path, _T(".exe")); 123 | MY_TRACE_STR(path); 124 | 125 | TCHAR args[MAX_PATH] = {}; 126 | ::StringCbPrintf(args, sizeof(args), _T("0x%08p"), m_hwnd); 127 | MY_TRACE_STR(args); 128 | 129 | STARTUPINFO si = { sizeof(si) }; 130 | if (!::CreateProcess( 131 | path, // No module name (use command line) 132 | args, // Command line 133 | NULL, // Process handle not inheritable 134 | NULL, // Thread handle not inheritable 135 | FALSE, // Set handle inheritance to FALSE 136 | 0, // No creation flags 137 | NULL, // Use parent's environment block 138 | NULL, // Use parent's starting directory 139 | &si, // Pointer to STARTUPINFO structure 140 | &m_pi)) // Pointer to PROCESS_INFORMATION structur 141 | { 142 | MY_TRACE(_T("::CreateProcess() が失敗しました\n")); 143 | 144 | return FALSE; 145 | } 146 | 147 | return TRUE; 148 | } 149 | 150 | //-------------------------------------------------------------------- 151 | 152 | // フックをセットする。 153 | void CInProcessApp::initHook() 154 | { 155 | MY_TRACE(_T("CInProcessApp::initHook()\n")); 156 | 157 | DWORD exedit = theApp.m_auin.GetExEdit(); 158 | m_trackTable = (int*)(exedit + 0x14E900); 159 | true_GetParamSmallExternal = hookCall(exedit + 0x2DBB1, hook_GetParamSmallExternal); 160 | } 161 | 162 | // フックを解除する。 163 | void CInProcessApp::termHook() 164 | { 165 | MY_TRACE(_T("CInProcessApp::termHook()\n")); 166 | } 167 | 168 | //-------------------------------------------------------------------- 169 | 170 | void CInProcessApp::update(int value) 171 | { 172 | MY_TRACE(_T("update(%d)\n"), value); 173 | 174 | if (!m_trackOffsets) 175 | return; 176 | 177 | m_trackTable[m_trackIndex] = value; 178 | 179 | { 180 | int offset = m_trackOffsets[0]; 181 | if (offset) m_trackTable[m_trackIndex + offset] = value; 182 | } 183 | 184 | { 185 | int offset = m_trackOffsets[1]; 186 | if (offset) m_trackTable[m_trackIndex + offset] = value; 187 | } 188 | 189 | ::SendMessage(m_auin.GetExEditWindow(), 0x111, 0x3EB, m_trackIndex | 0x00080000); 190 | } 191 | 192 | //-------------------------------------------------------------------- 193 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | _bin/ 36 | _obj/ 37 | 38 | # Visual Studio 2015/2017 cache/options directory 39 | .vs/ 40 | # Uncomment if you have tasks that create the project's static files in wwwroot 41 | #wwwroot/ 42 | 43 | # Visual Studio 2017 auto generated files 44 | Generated\ Files/ 45 | 46 | # MSTest test Results 47 | [Tt]est[Rr]esult*/ 48 | [Bb]uild[Ll]og.* 49 | 50 | # NUnit 51 | *.VisualState.xml 52 | TestResult.xml 53 | nunit-*.xml 54 | 55 | # Build Results of an ATL Project 56 | [Dd]ebugPS/ 57 | [Rr]eleasePS/ 58 | dlldata.c 59 | 60 | # Benchmark Results 61 | BenchmarkDotNet.Artifacts/ 62 | 63 | # .NET Core 64 | project.lock.json 65 | project.fragment.lock.json 66 | artifacts/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.vspscc 97 | *.vssscc 98 | .builds 99 | *.pidb 100 | *.svclog 101 | *.scc 102 | 103 | # Chutzpah Test files 104 | _Chutzpah* 105 | 106 | # Visual C++ cache files 107 | ipch/ 108 | *.aps 109 | *.ncb 110 | *.opendb 111 | *.opensdf 112 | *.sdf 113 | *.cachefile 114 | *.VC.db 115 | *.VC.VC.opendb 116 | 117 | # Visual Studio profiler 118 | *.psess 119 | *.vsp 120 | *.vspx 121 | *.sap 122 | 123 | # Visual Studio Trace Files 124 | *.e2e 125 | 126 | # TFS 2012 Local Workspace 127 | $tf/ 128 | 129 | # Guidance Automation Toolkit 130 | *.gpState 131 | 132 | # ReSharper is a .NET coding add-in 133 | _ReSharper*/ 134 | *.[Rr]e[Ss]harper 135 | *.DotSettings.user 136 | 137 | # TeamCity is a build add-in 138 | _TeamCity* 139 | 140 | # DotCover is a Code Coverage Tool 141 | *.dotCover 142 | 143 | # AxoCover is a Code Coverage Tool 144 | .axoCover/* 145 | !.axoCover/settings.json 146 | 147 | # Coverlet is a free, cross platform Code Coverage Tool 148 | coverage*.json 149 | coverage*.xml 150 | coverage*.info 151 | 152 | # Visual Studio code coverage results 153 | *.coverage 154 | *.coveragexml 155 | 156 | # NCrunch 157 | _NCrunch_* 158 | .*crunch*.local.xml 159 | nCrunchTemp_* 160 | 161 | # MightyMoose 162 | *.mm.* 163 | AutoTest.Net/ 164 | 165 | # Web workbench (sass) 166 | .sass-cache/ 167 | 168 | # Installshield output folder 169 | [Ee]xpress/ 170 | 171 | # DocProject is a documentation generator add-in 172 | DocProject/buildhelp/ 173 | DocProject/Help/*.HxT 174 | DocProject/Help/*.HxC 175 | DocProject/Help/*.hhc 176 | DocProject/Help/*.hhk 177 | DocProject/Help/*.hhp 178 | DocProject/Help/Html2 179 | DocProject/Help/html 180 | 181 | # Click-Once directory 182 | publish/ 183 | 184 | # Publish Web Output 185 | *.[Pp]ublish.xml 186 | *.azurePubxml 187 | # Note: Comment the next line if you want to checkin your web deploy settings, 188 | # but database connection strings (with potential passwords) will be unencrypted 189 | *.pubxml 190 | *.publishproj 191 | 192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 193 | # checkin your Azure Web App publish settings, but sensitive information contained 194 | # in these scripts will be unencrypted 195 | PublishScripts/ 196 | 197 | # NuGet Packages 198 | *.nupkg 199 | # NuGet Symbol Packages 200 | *.snupkg 201 | # The packages folder can be ignored because of Package Restore 202 | **/[Pp]ackages/* 203 | # except build/, which is used as an MSBuild target. 204 | !**/[Pp]ackages/build/ 205 | # Uncomment if necessary however generally it will be regenerated when needed 206 | #!**/[Pp]ackages/repositories.config 207 | # NuGet v3's project.json files produces more ignorable files 208 | *.nuget.props 209 | *.nuget.targets 210 | 211 | # Microsoft Azure Build Output 212 | csx/ 213 | *.build.csdef 214 | 215 | # Microsoft Azure Emulator 216 | ecf/ 217 | rcf/ 218 | 219 | # Windows Store app package directories and files 220 | AppPackages/ 221 | BundleArtifacts/ 222 | Package.StoreAssociation.xml 223 | _pkginfo.txt 224 | *.appx 225 | *.appxbundle 226 | *.appxupload 227 | 228 | # Visual Studio cache files 229 | # files ending in .cache can be ignored 230 | *.[Cc]ache 231 | # but keep track of directories ending in .cache 232 | !?*.[Cc]ache/ 233 | 234 | # Others 235 | ClientBin/ 236 | ~$* 237 | *~ 238 | *.dbmdl 239 | *.dbproj.schemaview 240 | *.jfm 241 | *.pfx 242 | *.publishsettings 243 | orleans.codegen.cs 244 | 245 | # Including strong name files can present a security risk 246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 247 | #*.snk 248 | 249 | # Since there are multiple workflows, uncomment next line to ignore bower_components 250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 251 | #bower_components/ 252 | 253 | # RIA/Silverlight projects 254 | Generated_Code/ 255 | 256 | # Backup & report files from converting an old project file 257 | # to a newer Visual Studio version. Backup files are not needed, 258 | # because we have git ;-) 259 | _UpgradeReport_Files/ 260 | Backup*/ 261 | UpgradeLog*.XML 262 | UpgradeLog*.htm 263 | ServiceFabricBackup/ 264 | *.rptproj.bak 265 | 266 | # SQL Server files 267 | *.mdf 268 | *.ldf 269 | *.ndf 270 | 271 | # Business Intelligence projects 272 | *.rdl.data 273 | *.bim.layout 274 | *.bim_*.settings 275 | *.rptproj.rsuser 276 | *- [Bb]ackup.rdl 277 | *- [Bb]ackup ([0-9]).rdl 278 | *- [Bb]ackup ([0-9][0-9]).rdl 279 | 280 | # Microsoft Fakes 281 | FakesAssemblies/ 282 | 283 | # GhostDoc plugin setting file 284 | *.GhostDoc.xml 285 | 286 | # Node.js Tools for Visual Studio 287 | .ntvs_analysis.dat 288 | node_modules/ 289 | 290 | # Visual Studio 6 build log 291 | *.plg 292 | 293 | # Visual Studio 6 workspace options file 294 | *.opt 295 | 296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 297 | *.vbw 298 | 299 | # Visual Studio LightSwitch build output 300 | **/*.HTMLClient/GeneratedArtifacts 301 | **/*.DesktopClient/GeneratedArtifacts 302 | **/*.DesktopClient/ModelManifest.xml 303 | **/*.Server/GeneratedArtifacts 304 | **/*.Server/ModelManifest.xml 305 | _Pvt_Extensions 306 | 307 | # Paket dependency manager 308 | .paket/paket.exe 309 | paket-files/ 310 | 311 | # FAKE - F# Make 312 | .fake/ 313 | 314 | # CodeRush personal settings 315 | .cr/personal 316 | 317 | # Python Tools for Visual Studio (PTVS) 318 | __pycache__/ 319 | *.pyc 320 | 321 | # Cake - Uncomment if you are using it 322 | # tools/** 323 | # !tools/packages.config 324 | 325 | # Tabs Studio 326 | *.tss 327 | 328 | # Telerik's JustMock configuration file 329 | *.jmconfig 330 | 331 | # BizTalk build output 332 | *.btp.cs 333 | *.btm.cs 334 | *.odx.cs 335 | *.xsd.cs 336 | 337 | # OpenCover UI analysis results 338 | OpenCover/ 339 | 340 | # Azure Stream Analytics local run output 341 | ASALocalRun/ 342 | 343 | # MSBuild Binary and Structured Log 344 | *.binlog 345 | 346 | # NVidia Nsight GPU debugger configuration file 347 | *.nvuser 348 | 349 | # MFractors (Xamarin productivity tool) working folder 350 | .mfractor/ 351 | 352 | # Local History for Visual Studio 353 | .localhistory/ 354 | 355 | # BeatPulse healthcheck temp database 356 | healthchecksdb 357 | 358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 359 | MigrationBackup/ 360 | 361 | # Ionide (cross platform F# VS Code tools) working folder 362 | .ionide/ 363 | 364 | # Fody - auto-generated XML schema 365 | FodyWeavers.xsd -------------------------------------------------------------------------------- /InProcess/InProcess.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {8e583504-3780-4129-bcc2-ba590dbd0d0e} 25 | InProcess 26 | 10.0 27 | InProcess 28 | 29 | 30 | 31 | DynamicLibrary 32 | true 33 | v142 34 | MultiByte 35 | 36 | 37 | DynamicLibrary 38 | false 39 | v142 40 | true 41 | MultiByte 42 | 43 | 44 | DynamicLibrary 45 | true 46 | v142 47 | MultiByte 48 | 49 | 50 | DynamicLibrary 51 | false 52 | v142 53 | true 54 | MultiByte 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | true 80 | 81 | 82 | false 83 | 84 | 85 | true 86 | 87 | 88 | false 89 | 90 | 91 | 92 | Level3 93 | true 94 | WIN32;_DEBUG;MULTIVIEWANCIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 95 | true 96 | Use 97 | pch.h 98 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 99 | Default 100 | stdcpplatest 101 | 102 | 103 | Windows 104 | true 105 | false 106 | InProcess.def 107 | ../../ 108 | 109 | 110 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing.auf" 111 | 112 | 113 | 114 | 115 | Level3 116 | true 117 | true 118 | true 119 | WIN32;NDEBUG;MULTIVIEWANCIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 120 | true 121 | Use 122 | pch.h 123 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 124 | Default 125 | stdcpplatest 126 | 127 | 128 | Windows 129 | true 130 | true 131 | true 132 | false 133 | InProcess.def 134 | ../../ 135 | 136 | 137 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing.auf" 138 | 139 | 140 | 141 | 142 | Level3 143 | true 144 | _DEBUG;MULTIVIEWANCIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 145 | true 146 | Use 147 | pch.h 148 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 149 | Default 150 | stdcpplatest 151 | 152 | 153 | Windows 154 | true 155 | false 156 | InProcess.def 157 | ../../ 158 | 159 | 160 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing.auf" 161 | 162 | 163 | 164 | 165 | Level3 166 | true 167 | true 168 | true 169 | NDEBUG;MULTIVIEWANCIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 170 | true 171 | Use 172 | pch.h 173 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 174 | Default 175 | stdcpplatest 176 | 177 | 178 | Windows 179 | true 180 | true 181 | true 182 | false 183 | InProcess.def 184 | ../../ 185 | 186 | 187 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing.auf" 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | Create 206 | Create 207 | Create 208 | Create 209 | 210 | 211 | 212 | 213 | {79a65fce-e082-4886-9f4d-78e8d08a8186} 214 | 215 | 216 | 217 | 218 | 219 | -------------------------------------------------------------------------------- /OutProcess/MainFrame.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "OutProcess.h" 3 | #include "MainFrame.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | //-------------------------------------------------------------------- 10 | 11 | CMainFrame::CMainFrame() noexcept 12 | { 13 | WCHAR fileName[MAX_PATH] = {}; 14 | ::GetModuleFileNameW(AfxGetInstanceHandle(), fileName, MAX_PATH); 15 | ::PathRenameExtensionW(fileName, L".xml"); 16 | MY_TRACE_WSTR(fileName); 17 | 18 | m_fileUpdateChecker.init(fileName); 19 | m_isSettingsFileLoaded = FALSE; 20 | 21 | m_imageVersion = 1; 22 | m_clamp = FALSE; 23 | m_horz = _T("left"); 24 | m_vert = _T("center"); 25 | m_alpha = 255; 26 | m_scale = 100; 27 | m_selectedColor = Color(0x80, 0xff, 0x00, 0x00); 28 | m_hotColor = Color(0x80, 0x00, 0xff, 0x00); 29 | 30 | m_currentPart = -1; 31 | m_hotPart = -1; 32 | } 33 | 34 | CMainFrame::~CMainFrame() 35 | { 36 | } 37 | 38 | void CMainFrame::loadImage() 39 | { 40 | MY_TRACE(_T("CMainFrame::loadImage()\n")); 41 | 42 | if (!m_image.IsNull()) m_image.Destroy(); 43 | m_parts.clear(); 44 | 45 | TCHAR path[MAX_PATH] = {}; 46 | ::GetModuleFileName(AfxGetInstanceHandle(), path, _countof(path)); 47 | ::PathRemoveFileSpec(path); 48 | 49 | switch (m_imageVersion) 50 | { 51 | case 3: 52 | { 53 | ::PathAppend(path, _T("easing3.png")); 54 | MY_TRACE_TSTR(path); 55 | 56 | m_image.Load(path); 57 | 58 | if (!m_image.IsNull()) 59 | { 60 | int w = m_image.GetWidth() * m_scale / 100; 61 | int h = m_image.GetHeight() * m_scale / 100; 62 | 63 | SetWindowPos(0, 0, 0, w, h, 64 | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); 65 | } 66 | 67 | m_parts.resize(41); 68 | 69 | // (1) の位置。 70 | int x = 20; 71 | int y = 100; 72 | 73 | setRect(1, x, y); 74 | 75 | for (int i = 0; i < 5; i++) 76 | { 77 | y += 160; 78 | 79 | // (2) と (6) の位置。 80 | int x1 = 20; 81 | int x2 = 735; 82 | 83 | for (int j = 0; j < 4; j++) 84 | { 85 | setRect((i * 8) + j + 2 + 0, x1, y); 86 | setRect((i * 8) + j + 2 + 4, x2, y); 87 | 88 | x1 += 175; 89 | x2 += 175; 90 | } 91 | } 92 | 93 | break; 94 | } 95 | case 2: 96 | { 97 | ::PathAppend(path, _T("easing2.png")); 98 | MY_TRACE_TSTR(path); 99 | 100 | m_image.Load(path); 101 | 102 | if (!m_image.IsNull()) 103 | { 104 | int w = m_image.GetWidth() * m_scale / 100; 105 | int h = m_image.GetHeight() * m_scale / 100; 106 | 107 | SetWindowPos(0, 0, 0, w, h, 108 | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); 109 | } 110 | 111 | m_parts.resize(41); 112 | 113 | int x = 20; 114 | int y = 98; 115 | 116 | setRect(1, x, y); 117 | 118 | for (int i = 0; i < 5; i++) 119 | { 120 | y += 155; 121 | 122 | int x1 = 20; 123 | int x2 = 695; 124 | 125 | for (int j = 0; j < 4; j++) 126 | { 127 | setRect((i * 8) + j + 2 + 0, x1, y); 128 | setRect((i * 8) + j + 2 + 4, x2, y); 129 | 130 | x1 += 163; 131 | x2 += 163; 132 | } 133 | } 134 | 135 | break; 136 | } 137 | default: 138 | { 139 | ::PathAppend(path, _T("easing.png")); 140 | MY_TRACE_TSTR(path); 141 | 142 | m_image.Load(path); 143 | 144 | if (!m_image.IsNull()) 145 | { 146 | int w = m_image.GetWidth() * m_scale / 100; 147 | int h = m_image.GetHeight() * m_scale / 100; 148 | 149 | SetWindowPos(0, 0, 0, w, h, 150 | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); 151 | } 152 | 153 | m_parts.resize(41); 154 | 155 | int x = 103; 156 | int y = 40; 157 | 158 | setRect(1, x, y); 159 | 160 | for (int i = 0; i < 5; i++) 161 | { 162 | y += 178; 163 | 164 | int x1 = 103; 165 | int x2 = 649; 166 | 167 | for (int j = 0; j < 4; j++) 168 | { 169 | setRect((i * 8) + j + 2 + 0, x1, y); 170 | setRect((i * 8) + j + 2 + 4, x2, y); 171 | 172 | x1 += 125; 173 | x2 += 125; 174 | } 175 | } 176 | 177 | break; 178 | } 179 | } 180 | } 181 | 182 | void CMainFrame::setRect(int number, int _x, int _y) 183 | { 184 | // MY_TRACE(_T("CMainFrame::setRect(%d, %d, %d)\n"), number, _x, _y); 185 | 186 | switch (m_imageVersion) 187 | { 188 | case 3: 189 | { 190 | int x = ::MulDiv(_x, m_scale, 100); 191 | int y = ::MulDiv(_y, m_scale, 100); 192 | int w = ::MulDiv(_x + 160, m_scale, 100); 193 | int h = ::MulDiv(_y + 120, m_scale, 100); 194 | 195 | m_parts[number - 1].SetRect(x, y, w, h); 196 | 197 | break; 198 | } 199 | case 2: 200 | { 201 | int x = ::MulDiv(_x, m_scale, 100); 202 | int y = ::MulDiv(_y, m_scale, 100); 203 | int w = ::MulDiv(_x + 140, m_scale, 100); 204 | int h = ::MulDiv(_y + 108, m_scale, 100); 205 | 206 | m_parts[number - 1].SetRect(x, y, w, h); 207 | 208 | break; 209 | } 210 | default: 211 | { 212 | int x = ::MulDiv(_x, m_scale, 100); 213 | int y = ::MulDiv(_y, m_scale, 100); 214 | int w = ::MulDiv(_x + 121, m_scale, 100); 215 | int h = ::MulDiv(_y + 101, m_scale, 100); 216 | 217 | m_parts[number - 1].SetRect(x, y, w, h); 218 | 219 | break; 220 | } 221 | } 222 | } 223 | 224 | void CMainFrame::setHotPart(int index) 225 | { 226 | if (m_hotPart == index) 227 | return; 228 | 229 | m_hotPart = index; 230 | Invalidate(FALSE); 231 | } 232 | 233 | HWND CMainFrame::getTarget() 234 | { 235 | HWND hwnd = ::GetForegroundWindow(); 236 | DWORD pid = 0; 237 | DWORD tid = ::GetWindowThreadProcessId(hwnd, &pid); 238 | 239 | // MY_TRACE_HWND(hwnd); 240 | // MY_TRACE_HEX(pid); 241 | // MY_TRACE_HEX(theApp.m_mainProcessId); 242 | 243 | if (pid != theApp.m_mainProcessId) 244 | return 0; 245 | 246 | TCHAR text[MAX_PATH]; 247 | ::GetWindowText(hwnd, text, _countof(text)); 248 | 249 | // MY_TRACE_TSTR(text); 250 | 251 | if (::lstrcmp(text, _T("移動フレーム間隔")) != 0) 252 | return 0; 253 | 254 | return hwnd; 255 | } 256 | 257 | int CMainFrame::getEasing() 258 | { 259 | MY_TRACE(_T("CMainFrame::getEasing()\n")); 260 | 261 | HWND target = ::GetForegroundWindow(); 262 | if (!target) return -1; 263 | MY_TRACE_HWND(target); 264 | 265 | HWND child = ::GetWindow(target, GW_CHILD); 266 | if (!child) return -1; 267 | MY_TRACE_HWND(child); 268 | MY_TRACE_INT(::GetDlgCtrlID(child)); 269 | 270 | TCHAR text[MAX_PATH] = {}; 271 | ::SendMessage(child, WM_GETTEXT, _countof(text), (LPARAM)text); 272 | 273 | int easing = _ttoi(text); 274 | if (m_easeWindow.m_enable) 275 | easing = -easing - 1; 276 | else 277 | easing = easing - 1; 278 | MY_TRACE_INT(easing); 279 | 280 | return easing; 281 | } 282 | 283 | void CMainFrame::setEasing(int index) 284 | { 285 | MY_TRACE(_T("CMainFrame::setEasing(%d)\n"), index); 286 | 287 | HWND target = ::GetForegroundWindow(); 288 | if (!target) return; 289 | MY_TRACE_HWND(target); 290 | 291 | int easing = index; 292 | if (m_easeWindow.m_enable) 293 | easing = -easing - 1; 294 | else 295 | easing = easing + 1; 296 | MY_TRACE_INT(easing); 297 | 298 | HWND child = ::GetWindow(target, GW_CHILD); 299 | if (!child) return; 300 | MY_TRACE_HWND(child); 301 | MY_TRACE_INT(::GetDlgCtrlID(child)); 302 | 303 | TCHAR text[MAX_PATH] = {}; 304 | _itot_s(easing, text, 10); 305 | ::SendMessage(child, WM_SETTEXT, 0, (LPARAM)text); 306 | ::PostMessage(target, WM_COMMAND, IDOK, 0); 307 | } 308 | 309 | void CMainFrame::show(HWND target) 310 | { 311 | if (IsWindowVisible()) 312 | return; 313 | 314 | m_currentPart = getEasing(); 315 | m_hotPart = -1; 316 | 317 | CRect rc; GetWindowRect(&rc); 318 | CRect rcTarget; ::GetWindowRect(target, &rcTarget); 319 | 320 | int x, y; 321 | 322 | if (::lstrcmpi(m_horz, _T("left")) == 0) 323 | { 324 | x = rcTarget.left - rc.Width(); 325 | } 326 | else if (::lstrcmpi(m_horz, _T("right")) == 0) 327 | { 328 | x = rcTarget.right; 329 | } 330 | else 331 | { 332 | x = rcTarget.CenterPoint().x - rc.Width() / 2; 333 | } 334 | 335 | if (::lstrcmpi(m_vert, _T("top")) == 0) 336 | { 337 | y = rcTarget.top - rc.Height(); 338 | } 339 | else if (::lstrcmpi(m_vert, _T("bottom")) == 0) 340 | { 341 | y = rcTarget.bottom; 342 | } 343 | else 344 | { 345 | y = rcTarget.CenterPoint().y - rc.Height() / 2; 346 | } 347 | 348 | if (m_clamp) 349 | { 350 | HMONITOR monitor = ::MonitorFromWindow(target, MONITOR_DEFAULTTONEAREST); 351 | MONITORINFO mi = { sizeof(mi) }; ::GetMonitorInfo(monitor, &mi); 352 | 353 | if (x < mi.rcWork.left) 354 | x = mi.rcWork.left; 355 | else if (x + rc.Width() > mi.rcWork.right) 356 | x = mi.rcWork.right - rc.Width(); 357 | 358 | if (y < mi.rcWork.top) 359 | y = mi.rcWork.top; 360 | else if (y + rc.Height() > mi.rcWork.bottom) 361 | y = mi.rcWork.bottom - rc.Height(); 362 | } 363 | 364 | SetLayeredWindowAttributes(0, m_alpha, LWA_ALPHA); 365 | SetWindowPos(&wndTopMost, x, y, 0, 0, 366 | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW); 367 | Invalidate(FALSE); 368 | } 369 | 370 | void CMainFrame::hide() 371 | { 372 | if (!IsWindowVisible()) 373 | return; 374 | 375 | ShowWindow(SW_HIDE); 376 | } 377 | 378 | //-------------------------------------------------------------------- 379 | 380 | BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 381 | { 382 | if (!CFrameWnd::PreCreateWindow(cs)) 383 | return FALSE; 384 | 385 | cs.style = WS_POPUP | FWS_ADDTOTITLE; 386 | cs.dwExStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST | WS_EX_NOACTIVATE | WS_EX_LAYERED; 387 | cs.lpszClass = AfxRegisterWndClass(0); 388 | 389 | return TRUE; 390 | } 391 | 392 | BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) 393 | ON_WM_CREATE() 394 | ON_WM_DESTROY() 395 | ON_WM_PAINT() 396 | ON_WM_TIMER() 397 | ON_WM_NCACTIVATE() 398 | ON_WM_NCCALCSIZE() 399 | ON_WM_NCHITTEST() 400 | ON_WM_LBUTTONDOWN() 401 | END_MESSAGE_MAP() 402 | 403 | int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 404 | { 405 | MY_TRACE(_T("CMainFrame::OnCreate()\n")); 406 | 407 | if (CFrameWnd::OnCreate(lpCreateStruct) == -1) 408 | return -1; 409 | 410 | if (!m_easeWindow.Create(this)) 411 | { 412 | AfxMessageBox(_T("EaseWindow の作成に失敗しました\n")); 413 | return -1; 414 | } 415 | 416 | if (loadSettings() != S_OK) 417 | { 418 | AfxMessageBox(_T("設定ファイルの読み込みに失敗しました\n")); 419 | return -1; 420 | } 421 | 422 | SetTimer(TIMER_ID, 1000, 0); 423 | 424 | return 0; 425 | } 426 | 427 | void CMainFrame::OnDestroy() 428 | { 429 | MY_TRACE(_T("CMainFrame::OnDestroy()\n")); 430 | 431 | KillTimer(TIMER_ID); 432 | 433 | m_image.Destroy(); 434 | 435 | saveSettings(); 436 | 437 | CFrameWnd::OnDestroy(); 438 | } 439 | 440 | void CMainFrame::OnPaint() 441 | { 442 | CPaintDC paintDC(this); 443 | 444 | CUxDC dc(paintDC); 445 | if (!dc.isValid()) return; 446 | 447 | CRect rc; GetClientRect(&rc); 448 | 449 | if (!m_image.IsNull()) 450 | { 451 | int w = m_image.GetWidth(); 452 | int h = m_image.GetHeight(); 453 | m_image.AlphaBlend(dc, rc.left, rc.top, rc.Width(), rc.Height(), 0, 0, w, h); 454 | } 455 | 456 | Graphics g(dc); 457 | g.SetSmoothingMode(SmoothingModeAntiAlias); 458 | // g.SetCompositingMode(CompositingModeSourceOver); 459 | g.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit); 460 | g.SetInterpolationMode(InterpolationModeHighQualityBicubic); 461 | g.TranslateTransform(-0.5f, -0.5f); 462 | 463 | if (m_currentPart >= 0 && m_currentPart < (int)m_parts.size()) 464 | { 465 | SolidBrush brush(m_selectedColor); 466 | REAL x = (REAL)m_parts[m_currentPart].left; 467 | REAL y = (REAL)m_parts[m_currentPart].top; 468 | REAL w = (REAL)m_parts[m_currentPart].Width(); 469 | REAL h = (REAL)m_parts[m_currentPart].Height(); 470 | 471 | g.FillRectangle(&brush, x, y, w, h); 472 | } 473 | 474 | if (m_hotPart >= 0 && m_hotPart < (int)m_parts.size()) 475 | { 476 | SolidBrush brush(m_hotColor); 477 | REAL x = (REAL)m_parts[m_hotPart].left; 478 | REAL y = (REAL)m_parts[m_hotPart].top; 479 | REAL w = (REAL)m_parts[m_hotPart].Width(); 480 | REAL h = (REAL)m_parts[m_hotPart].Height(); 481 | 482 | g.FillRectangle(&brush, x, y, w, h); 483 | } 484 | } 485 | 486 | void CMainFrame::OnTimer(UINT_PTR timerId) 487 | { 488 | if (timerId == TIMER_ID) 489 | { 490 | #ifdef SELECT_EASING_CHECK_MAIN_PROCESS 491 | if (!::IsWindow(theApp.m_mainProcessWindow)) 492 | { 493 | KillTimer(TIMER_ID); 494 | PostMessage(WM_CLOSE); 495 | } 496 | #endif 497 | HWND target = getTarget(); 498 | 499 | if (target) 500 | { 501 | show(target); 502 | m_easeWindow.show(target, GetSafeHwnd()); 503 | } 504 | else 505 | { 506 | m_easeWindow.hide(); 507 | hide(); 508 | } 509 | 510 | if (m_fileUpdateChecker.isFileUpdated()) 511 | loadSettings(); 512 | } 513 | 514 | CFrameWnd::OnTimer(timerId); 515 | } 516 | 517 | BOOL CMainFrame::OnNcActivate(BOOL bActive) 518 | { 519 | return CFrameWnd::OnNcActivate(bActive); 520 | } 521 | 522 | void CMainFrame::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp) 523 | { 524 | // CFrameWnd::OnNcCalcSize(bCalcValidRects, lpncsp); 525 | } 526 | 527 | LRESULT CMainFrame::OnNcHitTest(CPoint point) 528 | { 529 | ScreenToClient(&point); 530 | 531 | for (size_t i = 0; i < m_parts.size(); i++) 532 | { 533 | if (m_parts[i].PtInRect(point)) 534 | { 535 | setHotPart(i); 536 | return HTCLIENT; 537 | } 538 | } 539 | 540 | setHotPart(-1); 541 | return HTCAPTION; 542 | // return CFrameWnd::OnNcHitTest(point); 543 | } 544 | 545 | void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point) 546 | { 547 | for (size_t i = 0; i < m_parts.size(); i++) 548 | { 549 | if (m_parts[i].PtInRect(point)) 550 | { 551 | setEasing(i); 552 | 553 | return; 554 | } 555 | } 556 | 557 | CFrameWnd::OnLButtonDown(nFlags, point); 558 | } 559 | 560 | //-------------------------------------------------------------------- 561 | -------------------------------------------------------------------------------- /OutProcess/OutProcess.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | {79A65FCE-E082-4886-9F4D-78E8D08A8186} 24 | MFCProj 25 | OutProcess 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | MultiByte 34 | Dynamic 35 | 36 | 37 | Application 38 | false 39 | v142 40 | true 41 | MultiByte 42 | Dynamic 43 | 44 | 45 | Application 46 | true 47 | v142 48 | MultiByte 49 | Dynamic 50 | 51 | 52 | Application 53 | false 54 | v142 55 | true 56 | MultiByte 57 | Dynamic 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | true 83 | 84 | 85 | true 86 | 87 | 88 | false 89 | 90 | 91 | false 92 | 93 | 94 | 95 | Use 96 | Level3 97 | true 98 | _WINDOWS;_DEBUG;%(PreprocessorDefinitions) 99 | pch.h 100 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 101 | stdcpplatest 102 | 103 | 104 | Windows 105 | ../../ 106 | 107 | 108 | false 109 | true 110 | _DEBUG;%(PreprocessorDefinitions) 111 | 112 | 113 | 0x0411 114 | _DEBUG;%(PreprocessorDefinitions) 115 | $(IntDir);%(AdditionalIncludeDirectories) 116 | 117 | 118 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing\SelectEasing.exe" 119 | 120 | 121 | 122 | 123 | Use 124 | Level3 125 | true 126 | WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) 127 | pch.h 128 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 129 | stdcpplatest 130 | 131 | 132 | Windows 133 | ../../ 134 | 135 | 136 | false 137 | true 138 | _DEBUG;%(PreprocessorDefinitions) 139 | 140 | 141 | 0x0411 142 | _DEBUG;%(PreprocessorDefinitions) 143 | $(IntDir);%(AdditionalIncludeDirectories) 144 | 145 | 146 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing\SelectEasing.exe" 147 | 148 | 149 | 150 | 151 | Use 152 | Level3 153 | true 154 | true 155 | true 156 | WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) 157 | pch.h 158 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 159 | stdcpplatest 160 | 161 | 162 | Windows 163 | true 164 | true 165 | ../../ 166 | 167 | 168 | false 169 | true 170 | NDEBUG;%(PreprocessorDefinitions) 171 | 172 | 173 | 0x0411 174 | NDEBUG;%(PreprocessorDefinitions) 175 | $(IntDir);%(AdditionalIncludeDirectories) 176 | 177 | 178 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing\SelectEasing.exe" 179 | 180 | 181 | 182 | 183 | Use 184 | Level3 185 | true 186 | true 187 | true 188 | _WINDOWS;NDEBUG;%(PreprocessorDefinitions) 189 | pch.h 190 | ../;../../;../../AviUtl/aviutl_exedit_sdk/ 191 | stdcpplatest 192 | 193 | 194 | Windows 195 | true 196 | true 197 | ../../ 198 | 199 | 200 | false 201 | true 202 | NDEBUG;%(PreprocessorDefinitions) 203 | 204 | 205 | 0x0411 206 | NDEBUG;%(PreprocessorDefinitions) 207 | $(IntDir);%(AdditionalIncludeDirectories) 208 | 209 | 210 | copy /B /Y "$(TargetDir)$(TargetFileName)" "C:\AviUtl110_test\Plugins\SelectEasing\SelectEasing.exe" 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | Create 244 | Create 245 | Create 246 | Create 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | -------------------------------------------------------------------------------- /OutProcess/EaseWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "OutProcess.h" 3 | #include "EaseWindow.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | //-------------------------------------------------------------------- 10 | 11 | inline int clamp(int n, int min, int max) 12 | { 13 | if (n < min) return min; 14 | if (n > max) return max; 15 | return n; 16 | } 17 | 18 | inline double bezier(double p0, double p1, double p2, double p3, double t) 19 | { 20 | double s = 1 - t; 21 | return 22 | 1 * s * s * s * p0 + 23 | 3 * s * s * t * p1 + 24 | 3 * s * t * t * p2 + 25 | 1 * t * t * t * p3; 26 | } 27 | 28 | //-------------------------------------------------------------------- 29 | 30 | CEaseWindow::CEaseWindow() 31 | { 32 | m_points[Points::first].x = Position::endBase; 33 | m_points[Points::first].y = Position::startBase; 34 | m_points[Points::second].x = Position::startBase; 35 | m_points[Points::second].y = Position::endBase; 36 | m_hot = Points::none; 37 | 38 | m_enable = TRUE; 39 | m_origin = _T("easing"); 40 | m_clamp = TRUE; 41 | m_horz = _T("left"); 42 | m_vert = _T("center"); 43 | m_alpha = 255; 44 | m_margin = 16; 45 | m_hitDistance = 0; 46 | m_windowSize.cx = 400; 47 | m_windowSize.cy = 400; 48 | m_backgroundColor = Color(255, 255, 255, 255); 49 | m_borderColor = Color(255, 224, 224, 224); 50 | m_borderWidth = 4.0f; 51 | m_curveColor = Color(255, 0, 0, 0); 52 | m_curveWidth = 4.0f; 53 | m_invalidCurveColor = Color(255, 255, 0, 0); 54 | m_invalidCurveWidth = 4.0f; 55 | m_handleColor = Color(255, 128, 192, 255); 56 | m_handleWidth = 4.0f; 57 | m_pointColor = Color(255, 0, 128, 255); 58 | m_hotPointColor = Color(255, 224, 0, 0); 59 | m_pointRadius = 16; 60 | m_segmentCount = 100; 61 | m_hideCursor = FALSE; 62 | m_immediately = FALSE; 63 | } 64 | 65 | CEaseWindow::~CEaseWindow() 66 | { 67 | } 68 | 69 | void CEaseWindow::getWorkarea(LPRECT rc) 70 | { 71 | GetClientRect(rc); 72 | ::InflateRect(rc, -m_margin, -m_margin); 73 | } 74 | 75 | POINT CEaseWindow::LPToClient(POINT point) 76 | { 77 | CRect rc; getWorkarea(&rc); 78 | return LPToClient(point, &rc); 79 | } 80 | 81 | POINT CEaseWindow::LPToClient(POINT point, LPCRECT rc) 82 | { 83 | int cw = rc->right - rc->left; 84 | int ch = rc->bottom - rc->top; 85 | int lw = Position::endX - Position::startX; 86 | int lh = Position::endY - Position::startY; 87 | 88 | double fx = (double)(point.x - Position::startX) / lw; 89 | double fy = (double)(point.y - Position::startY) / lh; 90 | 91 | fy = 1.0 - fy; 92 | 93 | return CPoint( 94 | rc->left + (int)(cw * fx), 95 | rc->top + (int)(ch * fy)); 96 | } 97 | 98 | POINT CEaseWindow::ClientToLP(POINT point) 99 | { 100 | CRect rc; getWorkarea(&rc); 101 | return ClientToLP(point, &rc); 102 | } 103 | 104 | POINT CEaseWindow::ClientToLP(POINT point, LPCRECT rc) 105 | { 106 | int cw = rc->right - rc->left; 107 | int ch = rc->bottom - rc->top; 108 | int lw = Position::endX - Position::startX; 109 | int lh = Position::endY - Position::startY; 110 | 111 | double fx = (double)(point.x - rc->left) / cw; 112 | double fy = (double)(point.y - rc->top) / ch; 113 | 114 | fy = 1.0 - fy; 115 | 116 | CPoint retValue( 117 | Position::startX + (int)round(lw * fx), 118 | Position::startY + (int)round(lh * fy)); 119 | 120 | retValue.x = clamp(retValue.x, Position::startX, Position::endX); 121 | retValue.y = clamp(retValue.y, Position::startY, Position::endY); 122 | 123 | return retValue; 124 | } 125 | 126 | int CEaseWindow::hitTest(POINT point) 127 | { 128 | CRect rc; getWorkarea(&rc); 129 | 130 | for (int i = 0; i < Points::maxSize; i++) 131 | { 132 | CPoint point2 = LPToClient(m_points[i], &rc); 133 | 134 | if (abs(point.x - point2.x) <= m_hitDistance + m_pointRadius && 135 | abs(point.y - point2.y) <= m_hitDistance + m_pointRadius) 136 | { 137 | return i; 138 | } 139 | } 140 | 141 | return Points::none; 142 | } 143 | 144 | void CEaseWindow::outputEaseText() 145 | { 146 | CString text; 147 | text.Format(_T("(%d, %d) (%d, %d) - %02d%02d%02d%02d"), 148 | m_points[Points::first].x, 149 | m_points[Points::first].y, 150 | m_points[Points::second].x, 151 | m_points[Points::second].y, 152 | m_points[Points::first].x, 153 | m_points[Points::first].y, 154 | m_points[Points::second].x, 155 | m_points[Points::second].y); 156 | 157 | SetWindowText(text); 158 | } 159 | 160 | void CEaseWindow::receiveNumber() 161 | { 162 | MY_TRACE(_T("CEaseWindow::receiveNumber()\n")); 163 | 164 | HWND target = ::GetForegroundWindow(); 165 | if (!target) return; 166 | MY_TRACE_HWND(target); 167 | 168 | HWND child = ::GetWindow(target, GW_CHILD); 169 | if (!child) return; 170 | MY_TRACE_HWND(child); 171 | MY_TRACE_INT(::GetDlgCtrlID(child)); 172 | 173 | TCHAR text[MAX_PATH] = {}; 174 | ::SendMessage(child, WM_GETTEXT, _countof(text), (LPARAM)text); 175 | MY_TRACE_TSTR(text); 176 | 177 | int n = _ttoi(text); 178 | if (n < 0) return; 179 | 180 | m_points[Points::first].x = clamp(n / 100 / 100 / 100 % 100, Position::startX, Position::endX); 181 | m_points[Points::first].y = clamp(n / 100 / 100 % 100, Position::startY, Position::endY); 182 | m_points[Points::second].x = clamp(n / 100 % 100, Position::startX, Position::endX); 183 | m_points[Points::second].y = clamp(n % 100, Position::startY, Position::endY); 184 | } 185 | 186 | void CEaseWindow::sendNumber() 187 | { 188 | MY_TRACE(_T("CEaseWindow::sendNumber()\n")); 189 | 190 | HWND target = ::GetForegroundWindow(); 191 | if (!target) 192 | return; 193 | 194 | MY_TRACE_HWND(target); 195 | 196 | HWND child = ::GetWindow(target, GW_CHILD); 197 | if (!child) 198 | return; 199 | 200 | MY_TRACE_HWND(child); 201 | MY_TRACE_INT(::GetDlgCtrlID(child)); 202 | 203 | TCHAR text[MAX_PATH] = {}; 204 | ::StringCbPrintf(text, sizeof(text), _T("%02d%02d%02d%02d"), 205 | m_points[Points::first].x, m_points[Points::first].y, 206 | m_points[Points::second].x, m_points[Points::second].y); 207 | ::SendMessage(child, WM_SETTEXT, 0, (LPARAM)text); 208 | ::PostMessage(target, WM_COMMAND, IDOK, 0); 209 | } 210 | 211 | void CEaseWindow::show(HWND numberWindow, HWND easingWindow) 212 | { 213 | MY_TRACE(_T("CEaseWindow::show(0x%08X, 0x%08X)\n"), numberWindow, easingWindow); 214 | 215 | if (!m_enable) return; 216 | if (IsWindowVisible()) return; 217 | 218 | // ターゲットを取得する。 219 | HWND target = numberWindow; 220 | if (::lstrcmpi(m_origin, _T("easing")) == 0) 221 | target = easingWindow; 222 | MY_TRACE_HWND(target); 223 | 224 | // 現在値を受け取る。 225 | receiveNumber(); 226 | outputEaseText(); 227 | 228 | // ホット状態を初期化する。 229 | m_hot = Points::none; 230 | 231 | // 幅と高さを取得する。 232 | int w, h; 233 | { 234 | // クライアントサイズを設定する。 235 | CRect rc(0, 0, m_windowSize.cx, m_windowSize.cy); 236 | clientToWindow(GetSafeHwnd(), &rc); 237 | w = rc.Width(); 238 | h = rc.Height(); 239 | } 240 | 241 | // x と y を取得する。 242 | int x, y; 243 | { 244 | CRect rcTarget; ::GetWindowRect(target, &rcTarget); 245 | 246 | if (::lstrcmpi(m_horz, _T("left")) == 0) 247 | { 248 | x = rcTarget.left - w; 249 | } 250 | else if (::lstrcmpi(m_horz, _T("right")) == 0) 251 | { 252 | x = rcTarget.right; 253 | } 254 | else 255 | { 256 | x = rcTarget.CenterPoint().x - w / 2; 257 | } 258 | 259 | if (::lstrcmpi(m_vert, _T("top")) == 0) 260 | { 261 | y = rcTarget.top - h; 262 | } 263 | else if (::lstrcmpi(m_vert, _T("bottom")) == 0) 264 | { 265 | y = rcTarget.bottom; 266 | } 267 | else 268 | { 269 | y = rcTarget.CenterPoint().y - h / 2; 270 | } 271 | 272 | if (m_clamp) 273 | { 274 | HMONITOR monitor = ::MonitorFromWindow(target, MONITOR_DEFAULTTONEAREST); 275 | MONITORINFO mi = { sizeof(mi) }; ::GetMonitorInfo(monitor, &mi); 276 | 277 | if (x < mi.rcWork.left) 278 | x = mi.rcWork.left; 279 | else if (x + w > mi.rcWork.right) 280 | x = mi.rcWork.right - w; 281 | 282 | if (y < mi.rcWork.top) 283 | y = mi.rcWork.top; 284 | else if (y + h > mi.rcWork.bottom) 285 | y = mi.rcWork.bottom - h; 286 | } 287 | } 288 | 289 | SetLayeredWindowAttributes(0, m_alpha, LWA_ALPHA); 290 | SetWindowPos(&wndTopMost, x, y, w, h, SWP_NOACTIVATE); 291 | ShowWindow(SW_SHOWNA); 292 | Invalidate(FALSE); 293 | } 294 | 295 | void CEaseWindow::hide() 296 | { 297 | MY_TRACE(_T("CEaseWindow::hide()\n")); 298 | 299 | if (!IsWindowVisible()) return; 300 | 301 | ShowWindow(SW_HIDE); 302 | } 303 | 304 | //-------------------------------------------------------------------- 305 | 306 | BOOL CEaseWindow::Create(CWnd* parent) 307 | { 308 | MY_TRACE(_T("CEaseWindow::Create(0x%08X)\n"), parent); 309 | 310 | return CWnd::CreateEx(0, 0, 0, WS_POPUP, CRect(0, 0, 0, 0), parent, 0); 311 | } 312 | 313 | BOOL CEaseWindow::PreCreateWindow(CREATESTRUCT& cs) 314 | { 315 | MY_TRACE(_T("CEaseWindow::PreCreateWindow()\n")); 316 | 317 | cs.style = WS_POPUP | WS_CAPTION | WS_THICKFRAME | WS_SYSMENU | 318 | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; 319 | cs.dwExStyle = WS_EX_TOPMOST | WS_EX_NOACTIVATE | WS_EX_LAYERED; 320 | cs.lpszClass = AfxRegisterWndClass( 321 | CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, 322 | ::LoadCursor(0, IDC_ARROW)); 323 | 324 | if (!CWnd::PreCreateWindow(cs)) 325 | return FALSE; 326 | 327 | return TRUE; 328 | } 329 | 330 | BEGIN_MESSAGE_MAP(CEaseWindow, CWnd) 331 | ON_WM_CLOSE() 332 | ON_WM_PAINT() 333 | ON_WM_NCACTIVATE() 334 | ON_WM_LBUTTONDOWN() 335 | ON_WM_LBUTTONUP() 336 | ON_WM_LBUTTONDBLCLK() 337 | ON_WM_RBUTTONDOWN() 338 | ON_WM_RBUTTONUP() 339 | ON_WM_RBUTTONDBLCLK() 340 | ON_WM_MOUSEMOVE() 341 | ON_WM_MOUSELEAVE() 342 | ON_WM_CAPTURECHANGED() 343 | ON_WM_SIZE() 344 | END_MESSAGE_MAP() 345 | 346 | void CEaseWindow::OnClose() 347 | { 348 | sendNumber(); 349 | 350 | // CWnd::OnClose(); 351 | } 352 | 353 | void CEaseWindow::OnPaint() 354 | { 355 | CDoubleBufferPaintDC dc(this); 356 | 357 | Graphics g(dc); 358 | 359 | g.SetSmoothingMode(SmoothingModeAntiAlias); 360 | // g.SetCompositingMode(CompositingModeSourceOver); 361 | // g.SetTextRenderingHint(TextRenderingHintAntiAlias); 362 | g.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit); 363 | // g.SetTextRenderingHint(TextRenderingHintClearTypeGridFit); 364 | g.SetInterpolationMode(InterpolationModeHighQualityBicubic); 365 | // g.TranslateTransform(-0.5f, -0.5f); 366 | 367 | g.Clear(m_backgroundColor); 368 | 369 | CRect rc; getWorkarea(&rc); 370 | CRect rcPaint = rc; 371 | rcPaint.right--; rcPaint.bottom--; 372 | #if 0 373 | { 374 | CRect rc; GetClientRect(&rc); 375 | 376 | Gdiplus::FontFamily fontFamily(L"Segoe UI"); 377 | Gdiplus::Font font(&fontFamily, 24, FontStyleRegular, UnitPixel); 378 | Gdiplus::SolidBrush brush(Color(255, 0, 0, 255)); 379 | 380 | StringFormat format; 381 | format.SetAlignment(Gdiplus::StringAlignmentFar); 382 | format.SetLineAlignment(Gdiplus::StringAlignmentNear); 383 | 384 | LPCWSTR text = L"確定↑"; 385 | 386 | g.DrawString(text, ::lstrlenW(text), &font, MyRectF(rc), &format, &brush); 387 | } 388 | #endif 389 | MyPoint start(LPToClient(CPoint(Position::startBase, Position::startBase), &rcPaint)); 390 | MyPoint end(LPToClient(CPoint(Position::endBase, Position::endBase), &rcPaint)); 391 | MyPoint first(LPToClient(m_points[Points::first], &rcPaint)); 392 | MyPoint second(LPToClient(m_points[Points::second], &rcPaint)); 393 | 394 | { 395 | // 外枠を描画する。 396 | 397 | Pen pen(m_borderColor, m_borderWidth); 398 | Rect rect; 399 | rect.X = start.X; 400 | rect.Y = end.Y; 401 | rect.Width = end.X - start.X; 402 | rect.Height = start.Y - end.Y; 403 | g.DrawRectangle(&pen, rect); 404 | } 405 | 406 | { 407 | // ハンドルを描画する。 408 | 409 | Pen pen(m_handleColor, m_handleWidth); 410 | g.DrawLine(&pen, start, first); 411 | g.DrawLine(&pen, second, end); 412 | } 413 | 414 | { 415 | // 制御点を描画する。 416 | 417 | SolidBrush brush(m_pointColor); 418 | SolidBrush hotBrush(m_hotPointColor); 419 | 420 | for (int i = 0; i < Points::maxSize; i++) 421 | { 422 | CPoint point = LPToClient(m_points[i]); 423 | 424 | Rect rect; 425 | rect.X = point.x - m_pointRadius; 426 | rect.Y = point.y - m_pointRadius; 427 | rect.Width = m_pointRadius * 2; 428 | rect.Height = m_pointRadius * 2; 429 | 430 | if (i == m_hot) 431 | g.FillEllipse(&hotBrush, rect); 432 | else 433 | g.FillEllipse(&brush, rect); 434 | } 435 | } 436 | 437 | BOOL invalid = FALSE; 438 | 439 | { 440 | // ベジェ曲線が有効かチェックする。 441 | 442 | double prev = start.X; 443 | 444 | for (int i = 1; i < m_segmentCount; i++) 445 | { 446 | double t = (double)i / m_segmentCount; 447 | double x = bezier(start.X, first.X, second.X, end.X, t); 448 | 449 | if (x <= prev) // x が前回より小さかったら無効。 450 | { 451 | invalid = TRUE; 452 | break; 453 | } 454 | 455 | prev = x; 456 | } 457 | } 458 | 459 | { 460 | // ベジェ曲線を描画する。 461 | 462 | Color color = m_curveColor; 463 | REAL width = m_curveWidth; 464 | 465 | if (invalid) 466 | { 467 | color = m_invalidCurveColor; 468 | width = m_invalidCurveWidth; 469 | } 470 | 471 | Pen pen(color, width); 472 | g.DrawBezier(&pen, start, first, second, end); 473 | } 474 | } 475 | 476 | BOOL CEaseWindow::OnNcActivate(BOOL bActive) 477 | { 478 | MY_TRACE(_T("CEaseWindow::OnNcActivate(%d)\n"), bActive); 479 | 480 | return CWnd::OnNcActivate(bActive); 481 | } 482 | 483 | void CEaseWindow::OnLButtonDown(UINT nFlags, CPoint point) 484 | { 485 | MY_TRACE(_T("CEaseWindow::OnLButtonDown(0x%08X, %d, %d)\n"), nFlags, point.x, point.y); 486 | 487 | m_hot = hitTest(point); 488 | if (m_hot != Points::none) 489 | { 490 | MY_TRACE(_T("ドラッグを開始します\n")); 491 | 492 | SetCapture(); 493 | if (m_hideCursor) ::ShowCursor(FALSE); 494 | Invalidate(FALSE); 495 | } 496 | 497 | CWnd::OnLButtonDown(nFlags, point); 498 | } 499 | 500 | void CEaseWindow::OnLButtonUp(UINT nFlags, CPoint point) 501 | { 502 | MY_TRACE(_T("CEaseWindow::OnLButtonUp(0x%08X, %d, %d)\n"), nFlags, point.x, point.y); 503 | 504 | if (GetCapture() == this) 505 | { 506 | MY_TRACE(_T("ドラッグを終了します\n")); 507 | 508 | m_hot = Points::none; 509 | ReleaseCapture(); 510 | Invalidate(FALSE); 511 | } 512 | 513 | CWnd::OnLButtonUp(nFlags, point); 514 | } 515 | 516 | void CEaseWindow::OnLButtonDblClk(UINT nFlags, CPoint point) 517 | { 518 | MY_TRACE(_T("CEaseWindow::OnLButtonDblClk(0x%08X, %d, %d)\n"), nFlags, point.x, point.y); 519 | 520 | sendNumber(); 521 | 522 | CWnd::OnLButtonDblClk(nFlags, point); 523 | } 524 | 525 | void CEaseWindow::OnRButtonDown(UINT nFlags, CPoint point) 526 | { 527 | MY_TRACE(_T("CEaseWindow::OnRButtonDown(0x%08X, %d, %d)\n"), nFlags, point.x, point.y); 528 | 529 | CWnd::OnRButtonDown(nFlags, point); 530 | } 531 | 532 | void CEaseWindow::OnRButtonUp(UINT nFlags, CPoint point) 533 | { 534 | MY_TRACE(_T("CEaseWindow::OnRButtonUp(0x%08X, %d, %d)\n"), nFlags, point.x, point.y); 535 | 536 | CWnd::OnRButtonUp(nFlags, point); 537 | } 538 | 539 | void CEaseWindow::OnRButtonDblClk(UINT nFlags, CPoint point) 540 | { 541 | MY_TRACE(_T("CEaseWindow::OnRButtonDblClk(0x%08X, %d, %d)\n"), nFlags, point.x, point.y); 542 | 543 | CWnd::OnRButtonDblClk(nFlags, point); 544 | } 545 | 546 | void CEaseWindow::OnMouseMove(UINT nFlags, CPoint point) 547 | { 548 | if (GetCapture() == this) 549 | { 550 | // ドラッグ中。 551 | 552 | if (m_hot >= 0 && m_hot < Points::maxSize) 553 | { 554 | m_points[m_hot] = ClientToLP(point); 555 | Invalidate(FALSE); 556 | 557 | outputEaseText(); 558 | 559 | if (m_immediately) 560 | { 561 | // フレーム画像を更新する。 562 | int value = 0; 563 | value += m_points[Points::first].x; value *= 100; 564 | value += m_points[Points::first].y; value *= 100; 565 | value += m_points[Points::second].x; value *= 100; 566 | value += m_points[Points::second].y; 567 | MY_TRACE_POINT(m_points[Points::first]); 568 | MY_TRACE_POINT(m_points[Points::second]); 569 | MY_TRACE_INT(value); 570 | 571 | ::SendMessage(theApp.m_mainProcessWindow, WM_SELECT_EASING_UPDATE, value, 0); 572 | } 573 | } 574 | } 575 | else 576 | { 577 | // ドラッグ中ではない。 578 | 579 | int hot = hitTest(point); 580 | if (m_hot != hot) 581 | { 582 | m_hot = hot; 583 | Invalidate(FALSE); 584 | 585 | TRACKMOUSEEVENT tme = { sizeof(tme) }; 586 | tme.dwFlags = TME_LEAVE; 587 | tme.hwndTrack = GetSafeHwnd(); 588 | ::TrackMouseEvent(&tme); 589 | } 590 | } 591 | 592 | CWnd::OnMouseMove(nFlags, point); 593 | } 594 | 595 | void CEaseWindow::OnMouseLeave() 596 | { 597 | MY_TRACE(_T("CEaseWindow::OnMouseLeave()\n")); 598 | 599 | // ホット状態を解除する。 600 | m_hot = Points::none; 601 | Invalidate(FALSE); 602 | 603 | CWnd::OnMouseLeave(); 604 | } 605 | 606 | void CEaseWindow::OnCaptureChanged(CWnd* pWnd) 607 | { 608 | MY_TRACE(_T("CEaseWindow::OnCaptureChanged()\n")); 609 | 610 | if (m_hideCursor) ::ShowCursor(TRUE); 611 | 612 | CWnd::OnCaptureChanged(pWnd); 613 | } 614 | 615 | void CEaseWindow::OnSize(UINT nType, int cx, int cy) 616 | { 617 | CWnd::OnSize(nType, cx, cy); 618 | 619 | Invalidate(FALSE); 620 | } 621 | 622 | //-------------------------------------------------------------------- 623 | --------------------------------------------------------------------------------