mirror of
https://github.com/AxioDL/amuse.git
synced 2025-07-13 08:35:52 +00:00
Additional VST UI work
This commit is contained in:
parent
6f7a7405d7
commit
6f538dc19c
@ -10,6 +10,7 @@ if (WIN32 AND (EXISTS ${VST3_SDK_ROOT}))
|
|||||||
${VST2_DIR}/vstplugmain.cpp
|
${VST2_DIR}/vstplugmain.cpp
|
||||||
${VST2_DIR}/audioeffect.cpp
|
${VST2_DIR}/audioeffect.cpp
|
||||||
${VST2_DIR}/audioeffectx.cpp)
|
${VST2_DIR}/audioeffectx.cpp)
|
||||||
target_link_libraries(amuse-vst amuse boo soxr ${ZLIB_LIBRARIES} ${BOO_SYS_LIBS} Msimg32 logvisor athena-core)
|
target_link_libraries(amuse-vst amuse boo soxr ${ZLIB_LIBRARIES} ${BOO_SYS_LIBS}
|
||||||
|
Msimg32 logvisor athena-core)
|
||||||
set_target_properties(amuse-vst PROPERTIES LINK_FLAGS "/EXPORT:VSTPluginMain")
|
set_target_properties(amuse-vst PROPERTIES LINK_FLAGS "/EXPORT:VSTPluginMain")
|
||||||
endif()
|
endif()
|
||||||
|
@ -136,7 +136,7 @@ VSTBackend::VSTBackend(audioMasterCallback cb)
|
|||||||
setNumInputs(0);
|
setNumInputs(0);
|
||||||
setNumOutputs(2);
|
setNumOutputs(2);
|
||||||
setEditor(&m_editor);
|
setEditor(&m_editor);
|
||||||
sizeWindow(800, 520);
|
sizeWindow(600, 420);
|
||||||
|
|
||||||
m_booBackend = std::make_unique<VSTVoiceEngine>();
|
m_booBackend = std::make_unique<VSTVoiceEngine>();
|
||||||
m_voxAlloc.emplace(*m_booBackend);
|
m_voxAlloc.emplace(*m_booBackend);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
extern void* hInstance;
|
extern void* hInstance;
|
||||||
static WNDPROC OriginalListViewProc = 0;
|
static WNDPROC OriginalListViewProc = 0;
|
||||||
|
static HBRUSH gGreyBorderBrush;
|
||||||
|
|
||||||
namespace amuse
|
namespace amuse
|
||||||
{
|
{
|
||||||
@ -36,10 +37,8 @@ LRESULT CALLBACK VSTEditor::WindowProc(HWND hwnd,
|
|||||||
case NM_CLICK:
|
case NM_CLICK:
|
||||||
{
|
{
|
||||||
NMITEMACTIVATE& itemAct = *reinterpret_cast<LPNMITEMACTIVATE>(lParam);
|
NMITEMACTIVATE& itemAct = *reinterpret_cast<LPNMITEMACTIVATE>(lParam);
|
||||||
if (itemAct.hdr.hwndFrom == editor.m_collectionListView)
|
if (itemAct.hdr.hwndFrom == editor.m_collectionTree)
|
||||||
editor.selectCollection(itemAct.iItem);
|
editor.selectCollection(itemAct.iItem);
|
||||||
else if (itemAct.hdr.hwndFrom == editor.m_groupFileListView)
|
|
||||||
editor.selectGroupFile(itemAct.iItem);
|
|
||||||
else if (itemAct.hdr.hwndFrom == editor.m_groupListView)
|
else if (itemAct.hdr.hwndFrom == editor.m_groupListView)
|
||||||
editor.selectGroup(itemAct.iItem);
|
editor.selectGroup(itemAct.iItem);
|
||||||
else if (itemAct.hdr.hwndFrom == editor.m_pageListView)
|
else if (itemAct.hdr.hwndFrom == editor.m_pageListView)
|
||||||
@ -50,6 +49,13 @@ LRESULT CALLBACK VSTEditor::WindowProc(HWND hwnd,
|
|||||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
GetClientRect(hwnd, &rect);
|
||||||
|
FillRect(HDC(wParam), &rect, gGreyBorderBrush);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
@ -101,6 +107,7 @@ bool VSTEditor::open(void* ptr)
|
|||||||
{
|
{
|
||||||
AEffEditor::open(ptr);
|
AEffEditor::open(ptr);
|
||||||
HWND hostView = HWND(ptr);
|
HWND hostView = HWND(ptr);
|
||||||
|
gGreyBorderBrush = CreateSolidBrush(RGB(100,100,100));
|
||||||
|
|
||||||
WNDCLASSW notifyCls =
|
WNDCLASSW notifyCls =
|
||||||
{
|
{
|
||||||
@ -111,7 +118,7 @@ bool VSTEditor::open(void* ptr)
|
|||||||
HINSTANCE(hInstance),
|
HINSTANCE(hInstance),
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
HBRUSH(COLOR_BACKGROUND),
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
L"VSTNotify"
|
L"VSTNotify"
|
||||||
};
|
};
|
||||||
@ -130,51 +137,47 @@ bool VSTEditor::open(void* ptr)
|
|||||||
SetWindowLongPtrW(m_rootView, 0, LONG_PTR(this));
|
SetWindowLongPtrW(m_rootView, 0, LONG_PTR(this));
|
||||||
ShowWindow(m_rootView, SW_SHOW);
|
ShowWindow(m_rootView, SW_SHOW);
|
||||||
|
|
||||||
LV_COLUMN column = {};
|
LVCOLUMN column = {};
|
||||||
column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
|
column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
|
||||||
column.fmt = LVCFMT_LEFT | LVCFMT_FIXED_WIDTH;
|
column.fmt = LVCFMT_LEFT | LVCFMT_FIXED_WIDTH;
|
||||||
column.cx = 200;
|
column.cx = 200;
|
||||||
|
|
||||||
m_collectionListView = CreateWindowW(WC_LISTVIEW,
|
LVITEM item = {};
|
||||||
L"",
|
item.mask = LVIF_TEXT | LVIF_GROUPID;
|
||||||
WS_CHILD | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER,
|
item.pszText = L"Test";
|
||||||
0, 0,
|
item.iGroupId = 1;
|
||||||
201,
|
|
||||||
m_windowRect.bottom - m_windowRect.top,
|
|
||||||
m_rootView,
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
nullptr);
|
|
||||||
column.pszText = L"Collection";
|
|
||||||
HWND header = ListView_GetHeader(m_collectionListView);
|
|
||||||
SetWindowLongPtrW(header, GWLP_USERDATA, LONG_PTR(column.pszText));
|
|
||||||
OriginalListViewProc = WNDPROC(SetWindowLongPtr(header, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc)));
|
|
||||||
ListView_SetBkColor(m_collectionListView, RGB(64,64,64));
|
|
||||||
ListView_InsertColumn(m_collectionListView, 0, &column);
|
|
||||||
ShowWindow(m_collectionListView, SW_SHOW);
|
|
||||||
|
|
||||||
m_groupFileListView = CreateWindowW(WC_LISTVIEW,
|
m_collectionTree = CreateWindowW(WC_TREEVIEW,
|
||||||
L"",
|
L"",
|
||||||
WS_CHILD | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER,
|
WS_CHILD | WS_BORDER | TVS_HASLINES,
|
||||||
200, 0,
|
0, 24,
|
||||||
201,
|
201,
|
||||||
m_windowRect.bottom - m_windowRect.top,
|
m_windowRect.bottom - m_windowRect.top - 24,
|
||||||
m_rootView,
|
m_rootView,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr);
|
nullptr);
|
||||||
column.pszText = L"File";
|
TreeView_SetBkColor(m_collectionTree, RGB(64,64,64));
|
||||||
header = ListView_GetHeader(m_groupFileListView);
|
ShowWindow(m_collectionTree, SW_SHOW);
|
||||||
SetWindowLongPtrW(header, GWLP_USERDATA, LONG_PTR(column.pszText));
|
|
||||||
SetWindowLongPtr(header, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc));
|
m_collectionHeader = CreateWindowW(WC_HEADER,
|
||||||
ListView_SetBkColor(m_groupFileListView, RGB(64,64,64));
|
L"",
|
||||||
ListView_InsertColumn(m_groupFileListView, 0, &column);
|
WS_CHILD,
|
||||||
ShowWindow(m_groupFileListView, SW_SHOW);
|
1, 1,
|
||||||
|
200,
|
||||||
|
24,
|
||||||
|
m_rootView,
|
||||||
|
nullptr,
|
||||||
|
nullptr,
|
||||||
|
nullptr);
|
||||||
|
SetWindowLongPtrW(m_collectionHeader, GWLP_USERDATA, LONG_PTR(L"Collection"));
|
||||||
|
OriginalListViewProc = WNDPROC(SetWindowLongPtr(m_collectionHeader, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc)));
|
||||||
|
ShowWindow(m_collectionHeader, SW_SHOW);
|
||||||
|
|
||||||
m_groupListView = CreateWindowW(WC_LISTVIEW,
|
m_groupListView = CreateWindowW(WC_LISTVIEW,
|
||||||
L"",
|
L"",
|
||||||
WS_CHILD | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER,
|
WS_CHILD | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER,
|
||||||
400, 0,
|
200, 0,
|
||||||
201,
|
201,
|
||||||
m_windowRect.bottom - m_windowRect.top,
|
m_windowRect.bottom - m_windowRect.top,
|
||||||
m_rootView,
|
m_rootView,
|
||||||
@ -182,7 +185,7 @@ bool VSTEditor::open(void* ptr)
|
|||||||
nullptr,
|
nullptr,
|
||||||
nullptr);
|
nullptr);
|
||||||
column.pszText = L"Group";
|
column.pszText = L"Group";
|
||||||
header = ListView_GetHeader(m_groupListView);
|
HWND header = ListView_GetHeader(m_groupListView);
|
||||||
SetWindowLongPtrW(header, GWLP_USERDATA, LONG_PTR(column.pszText));
|
SetWindowLongPtrW(header, GWLP_USERDATA, LONG_PTR(column.pszText));
|
||||||
SetWindowLongPtr(header, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc));
|
SetWindowLongPtr(header, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc));
|
||||||
ListView_SetBkColor(m_groupListView, RGB(64,64,64));
|
ListView_SetBkColor(m_groupListView, RGB(64,64,64));
|
||||||
@ -192,7 +195,7 @@ bool VSTEditor::open(void* ptr)
|
|||||||
m_pageListView = CreateWindowW(WC_LISTVIEW,
|
m_pageListView = CreateWindowW(WC_LISTVIEW,
|
||||||
L"",
|
L"",
|
||||||
WS_CHILD | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER,
|
WS_CHILD | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER,
|
||||||
600, 0,
|
400, 0,
|
||||||
200,
|
200,
|
||||||
m_windowRect.bottom - m_windowRect.top,
|
m_windowRect.bottom - m_windowRect.top,
|
||||||
m_rootView,
|
m_rootView,
|
||||||
@ -226,11 +229,6 @@ void VSTEditor::selectCollection(int idx)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VSTEditor::selectGroupFile(int idx)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void VSTEditor::selectGroup(int idx)
|
void VSTEditor::selectGroup(int idx)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -15,11 +15,11 @@ class VSTBackend;
|
|||||||
class VSTEditor : public AEffEditor
|
class VSTEditor : public AEffEditor
|
||||||
{
|
{
|
||||||
VSTBackend& m_backend;
|
VSTBackend& m_backend;
|
||||||
ERect m_windowRect = {0, 0, 520, 800};
|
ERect m_windowRect = {0, 0, 420, 600};
|
||||||
|
|
||||||
HWND m_rootView;
|
HWND m_rootView;
|
||||||
HWND m_collectionListView;
|
HWND m_collectionHeader;
|
||||||
HWND m_groupFileListView;
|
HWND m_collectionTree;
|
||||||
HWND m_groupListView;
|
HWND m_groupListView;
|
||||||
HWND m_pageListView;
|
HWND m_pageListView;
|
||||||
|
|
||||||
@ -44,7 +44,6 @@ public:
|
|||||||
void update();
|
void update();
|
||||||
|
|
||||||
void selectCollection(int idx);
|
void selectCollection(int idx);
|
||||||
void selectGroupFile(int idx);
|
|
||||||
void selectGroup(int idx);
|
void selectGroup(int idx);
|
||||||
void selectPage(int idx);
|
void selectPage(int idx);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user