Wwise Version
Wwise SDK 2021.1.5
Notifications.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Version: v2021.1.5 Build: 7749
25  Copyright (c) 2006-2021 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /**
29  * \brief Wwise Authoring Plug-ins - APIs for different host notifications.
30  * \file AK/Wwise/Plugin/Notifications.h
31  *
32  * These are notifications not fitting in the other host services. For every host service, there is usually
33  * a notification to tell your plug-in something changed and to update data.
34  *
35  * These are independent notifications, not linked on other services.
36  */
37 
38 #pragma once
39 
40 #include "PluginInfoGenerator.h"
41 
42 /**
43  * \brief API for Sound Engine's Monitor Data notification.
44  */
46 #ifdef __cplusplus
48 #endif
49 {
50 #ifndef __cplusplus
51  ak_wwise_plugin_base_interface m_baseInterface;
52 #endif
53 
54 #ifdef __cplusplus
55  /// Base instance type for receiving Sound Engine's monitoring data.
57 
60  {}
61 #endif
62 
63  /**
64  * \brief Received a new Monitor Data blob.
65  *
66  * Called when an instance of the run-time component of the plug-in sends data using
67  * \c AK::IAkEffectPluginContext::PostMonitorData(), and this plug-in's settings are being displayed
68  * in a window. Because multiple run-time instances may exist for a single authoring tool plug-in,
69  * the data is batched together and passed at the end of the frame.
70  *
71  * \param[in] in_this Current instance of this interface.
72  * \param[in] in_iTimeStamp Timestamp of the data (in milliseconds).
73  * \param[in] in_pMonitorDataArray Array of blobs of data.
74  * \param[in] in_uMonitorDataArraySize Number of elements in array 'in_pMonitorDataArray'.
75  * \param[in] in_bIsRealtime true if monitoring in real time, false if scrubbing through profiler history.
76  */
79  AkTimeMs in_iTimeStamp,
80  const AK::Wwise::Plugin::MonitorData * in_pMonitorDataArray,
81  unsigned int in_uMonitorDataArraySize,
82  bool in_bIsRealtime
83  );
84 };
85 
86 #define AK_WWISE_PLUGIN_NOTIFICATIONS_MONITOR_V1_ID() \
87  AK_WWISE_PLUGIN_BASE_INTERFACE_FROM_ID(AK_WWISE_PLUGIN_INTERFACE_TYPE_NOTIFICATIONS_MONITOR, 1)
88 #define AK_WWISE_PLUGIN_NOTIFICATIONS_MONITOR_V1_CTOR(/* ak_wwise_plugin_info* */ in_pluginInfo, /* void* */ in_data) \
89 { \
90  .m_baseInterface = AK_WWISE_PLUGIN_BASE_INTERFACE_CTOR(AK_WWISE_PLUGIN_NOTIFICATIONS_MONITOR_V1_ID(), in_pluginInfo, in_data) \
91 }
92 
93 
94 #ifdef __cplusplus
95 namespace AK::Wwise::Plugin
96 {
97  namespace V1
98  {
99  /// Notifications namespace
100  namespace Notifications
101  {
103 
104  /// \copydoc ak_wwise_plugin_notifications_monitor_v1
105  class Monitor : public CMonitor::Instance
106  {
107  public:
108  /**
109  * \copydoc CMonitor::Instance
110  */
112 
113  /**
114  * \brief The interface type, as provided by this plug-in.
115  */
116  enum : InterfaceTypeValue
117  {
118  /**
119  * \brief The interface type, as provided by this plug-in.
120  */
122  };
123  /**
124  * \brief The interface version, as provided by this plug-in.
125  */
126  enum : InterfaceVersion
127  {
128  /**
129  * \brief The interface version, as provided by this plug-in.
130  */
132  };
133 
134  /**
135  * \brief The C interface, fulfilled by your plug-in.
136  */
137  struct Interface : public CMonitor
138  {
139  using Instance = Monitor;
141  {
144  AkTimeMs in_iTimeStamp,
145  const MonitorData * in_pMonitorDataArray,
146  unsigned int in_uMonitorDataArraySize,
147  bool in_bIsRealtime)
148  {
149  static_cast<Instance*>(in_this)->NotifyMonitorData(
150  in_iTimeStamp,
151  in_pMonitorDataArray,
152  in_uMonitorDataArraySize,
153  in_bIsRealtime);
154  };
155  }
156  };
157 
159  static Interface g_interface;
160  return &g_interface;
161  }
163  return this;
164  }
166  return this;
167  }
168 
170  CMonitor::Instance()
171  {
172  }
173 
174  virtual ~Monitor() {}
175 
176  /**
177  * \brief Received a new Monitor Data blob.
178  *
179  * Called when an instance of the run-time component of the plug-in sends data using
180  * \c AK::IAkEffectPluginContext::PostMonitorData(), and this plug-in's settings are being displayed
181  * in a window. Because multiple run-time instances may exist for a single authoring tool plug-in,
182  * the data is batched together and passed at the end of the frame.
183  *
184  * \param[in] in_iTimeStamp Timestamp of the data (in milliseconds).
185  * \param[in] in_pMonitorDataArray Array of blobs of data.
186  * \param[in] in_uMonitorDataArraySize Number of elements in array 'in_pMonitorDataArray'.
187  * \param[in] in_bIsRealtime true if monitoring in real time, false if scrubbing through profiler history.
188  */
189  virtual void NotifyMonitorData(
190  AkTimeMs in_iTimeStamp,
191  const MonitorData* in_pMonitorDataArray,
192  unsigned int in_uMonitorDataArraySize,
193  bool in_bIsRealtime
194  ) = 0;
195  };
196  } // of namespace Notifications
197  } // of namespace V1
198 
199  namespace Notifications
200  {
201  /// Latest version of the C Monitor notification interface.
203  /// Latest version of the C++ Monitor notification interface.
205  }
206 
209 } // of namespace AK::Wwise::Plugin
210 
211 #endif
AkInt32 AkTimeMs
Time in ms.
Definition: AkTypes.h:61
V1::Notifications::Monitor Monitor
Latest version of the C++ Monitor notification interface.
Definition: Notifications.h:204
void(* NotifyMonitorData)(struct ak_wwise_plugin_notifications_monitor_instance_v1 *in_this, AkTimeMs in_iTimeStamp, const AK::Wwise::Plugin::MonitorData *in_pMonitorDataArray, unsigned int in_uMonitorDataArraySize, bool in_bIsRealtime)
Received a new Monitor Data blob.
Definition: Notifications.h:77
decltype(BaseInterface::m_version) InterfaceVersion
PluginInfoGenerator: Type for the m_version value in BaseInterface.
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_NOTIFICATIONS_MONITOR
2021.1 Monitor data notification. ak_wwise_plugin_notifications_monitor_v1
const CMonitor::Instance * GetInstancePointer() const
Definition: Notifications.h:165
ak_wwise_plugin_notifications_monitor_v1 CMonitor
Definition: Notifications.h:102
The C interface, fulfilled by your plug-in.
Definition: Notifications.h:138
@ k_interfaceType
The interface type, as provided by this plug-in.
Definition: Notifications.h:121
Wwise Authoring Plug-ins - C++ class helper to automatically determine the plug-in interfaces used in...
API for Sound Engine's Monitor Data notification.
Definition: Notifications.h:49
CInterfacePtr InterfacePtr
Definition: PluginDef.h:968
std::underlying_type< InterfaceType >::type InterfaceTypeValue
PluginInfoGenerator: Underlying storage type for the m_interface value in BaseInterface.
Base instance type for receiving Sound Engine's monitoring data.
Definition: PluginDef.h:809
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_VERSION(AudioPlugin)
API for Sound Engine's Monitor Data notification.
Definition: Notifications.h:106
Interface description and base class for every Wwise Authoring plug-in interface.
virtual void NotifyMonitorData(AkTimeMs in_iTimeStamp, const MonitorData *in_pMonitorDataArray, unsigned int in_uMonitorDataArraySize, bool in_bIsRealtime)=0
Received a new Monitor Data blob.
@ k_interfaceVersion
The interface version, as provided by this plug-in.
Definition: Notifications.h:131
ak_wwise_plugin_notifications_monitor_instance_v1 Instance
Base instance type for receiving Sound Engine's monitoring data.
Definition: Notifications.h:56
CMonitor::Instance * GetInstancePointer()
Definition: Notifications.h:162
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_CLASS(AudioPlugin)