버전

menu_open
Wwise SDK 2019.2.15
How to Create a Resource File For your Plug-in

Resource file (with .rc as the extension) is a file format used to describe the resources used by the plug-in to create a custom graphical interface. An easy way to manage Resource files is to use the Visual Studio Editor tool, which lets you drag-and-drop widgets on a canvas to build the GUI. Here are the steps to create a Resource file for a new plug-in.

First of all, create a new plug-in with wp.py (if you're not familiar with the development tools, refer to 개발 도구 사용하기).

python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" new

Answer the prompts and when the plug-in is created, change directory to the project folder and call premake.

cd MyNewFX
python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" premake Authoring

Open the generated solution file (.sln) in Visual Studio 2019, make sure that the project folder is highlighted (do not confuse this with the solution folder, otherwise the Add New Item choices will be different) and select Add New Item... in the Project menu. In the dialog window, select Resource in the left column, and then Resource File (.rc) in the middle pane. This will create a file named Resource.rc in the WwisePlugin folder of your project.

In the Resource View, right-click on the Resource.rc file and select Add Resource. In the Add Resource window, select Dialog and click the New button.

참고: When you create a DIALOG window, make sure you set the following styles in its Properties:
  • Appearance/Border = None
  • Appearance/Clip Children = True
  • Appearance/Style = Child
  • Misc/Control = True
  • Misc/Control Parent = True

Using the Toolbox tab on the left side of the interface, you should now be able to drag-and-drop widgets on the canvas to compose the graphical interface of the plug-in. Saving the project will update the Resource file.

To include the Resource.rc file in your project, all you have to do is to call premake again. Then, the next time you build your plug-in, a file called resource.h will be automatically generated based on the Resource file:

python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" build -c Release -x x64_vc160 Authoring

To tell the plug-in to use the custom interface, you need to override a few methods provided by AK::Wwise::IAudioPlugin. In PluginNamePlugin.h, include resource.h, add the method signatures and create a private variable to store a window handle:

#pragma once
#include "MyNewFXPlugin.h"
#include "resource.h"
class MyNewFXPlugin final
{
public:
    MyNewFXPluginGUI();
    ~MyNewFXPluginGUI();
    HINSTANCE GetResourceHandle() const override;
    bool GetDialog(
        eDialog in_eDialog,
UINT& out_uiDialogID,
AK::Wwise::PopulateTableItem *& out_pTable
    ) const override;
 
    bool WindowProc(
        eDialog in_eDialog,
HWND in_hWnd,
UINT in_message,
WPARAM in_wParam,
LPARAM in_lParam,
LRESULT & out_lResult
    ) override;
private:
    HWND m_hwndPropView = nullptr;
};

In PluginNamePlugin.cpp, add the implementation of these methods:

#include <afxwin.h>
HINSTANCE MyNewFXPlugin::GetResourceHandle() const
{
    AFX_MANAGE_STATE( AfxGetStaticModuleState() );
    return AfxGetStaticModuleState()->m_hCurrentResourceHandle;
}
bool MyNewFXPluginGUI::GetDialog( AK::Wwise::Plugin::eDialog in_eDialog, UINT & out_uiDialogID, AK::Wwise::Plugin::PopulateTableItem *& out_pTable ) const
{
AKASSERT( in_eDialog == SettingsDialog );
out_uiDialogID = IDD_DIALOG1;
out_pTable = nullptr;
return true;
}
bool MyNewFXPluginGUI::WindowProc( AK::Wwise::Plugin::eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT & out_lResult )
{
switch ( in_message )
{
case WM_INITDIALOG:
m_hwndPropView = in_hWnd;
break;
case WM_DESTROY:
m_hwndPropView = NULL;
break;
}
out_lResult = 0;
return false;
}

Finally, add resource files to PremkaePlugin.lua:

Plugin.authoring.files =
{
...
"resource.h",
"Resource.rc"
}

Recompile and load the plug-in in a Wwise project. You should now see your custom graphical interface.

Audiokinetic namespace
#define NULL
Definition: AkTypes.h:49
Use this base class to quickly implement most plugin functions empty
Definition: AudioPlugin.h:627
#define AKASSERT(Condition)
Definition: AkAssert.h:76

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요