Version

menu_open
Wwise SDK 2021.1.14
Source.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.14 Build: 6590
25  Copyright (c) 2006-2023 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /**
29  * \brief Wwise Authoring Plug-ins - API specific for source plug-in.
30  * \file AK/Wwise/Plugin/Source.h
31  */
32 
33 #pragma once
34 
35 #include "PluginInfoGenerator.h"
36 
37 /**
38  * \brief API specific for source plug-in.
39  *
40  * This must be implemented for each source plug-in that is exposed in Wwise.
41  *
42  */
44 #ifdef __cplusplus
46 #endif
47 {
48 #ifndef __cplusplus
49  ak_wwise_plugin_base_interface m_baseInterface;
50 #endif
51 
52 #ifdef __cplusplus
53  /// Base instance type for providing source-specific information.
55 
58  {}
59 #endif
60 
61  /**
62  * \brief Return the minimum and maximum duration, in seconds.
63  *
64  * \param[in] in_this Current instance of this interface.
65  * \param[out] out_dblMinDuration Minimum duration, in seconds
66  * \param[out] out_dblMaxDuration Maximum duration, in seconds
67  */
69  const struct ak_wwise_plugin_source_instance_v1* in_this,
70  double* out_dblMinDuration,
71  double* out_dblMaxDuration
72  );
73 };
74 
75 #define AK_WWISE_PLUGIN_SOURCE_V1_ID() \
76  AK_WWISE_PLUGIN_BASE_INTERFACE_FROM_ID(AK_WWISE_PLUGIN_INTERFACE_TYPE_SOURCE, 1)
77 #define AK_WWISE_PLUGIN_SOURCE_V1_CTOR(/* ak_wwise_plugin_info* */ in_pluginInfo, /* void* */ in_data) \
78 { \
79  .m_baseInterface = AK_WWISE_PLUGIN_BASE_INTERFACE_CTOR(AK_WWISE_PLUGIN_SOURCE_V1_ID(), in_pluginInfo, in_data) \
80 }
81 
82 
83 #ifdef __cplusplus
84 namespace AK::Wwise::Plugin
85 {
86  namespace V1
87  {
89 
90  /// \copydoc ak_wwise_plugin_audio_plugin_v1
91  class Source : public CSource::Instance
92  {
93  public:
94  /**
95  * \copydoc CSource::Instance
96  */
98 
99  /**
100  * \brief The interface type, as provided by this plug-in.
101  */
102  enum : InterfaceTypeValue
103  {
104  /**
105  * \brief The interface type, as provided by this plug-in.
106  */
108  };
109  /**
110  * \brief The interface version, as provided by this plug-in.
111  */
112  enum : InterfaceVersion
113  {
114  /**
115  * \brief The interface version, as provided by this plug-in.
116  */
118  };
119 
120  /**
121  * \brief The C interface, fulfilled by your plug-in.
122  */
123  struct Interface : public CSource
124  {
125  using Instance = Source;
127  {
129  const struct ak_wwise_plugin_source_instance_v1* in_this,
130  double* out_dblMinDuration,
131  double* out_dblMaxDuration)
132  {
133  return (bool)static_cast<const Instance*>(in_this)->GetSourceDuration(
134  *out_dblMinDuration,
135  *out_dblMaxDuration);
136  };
137  }
138  };
139 
141  static Interface g_interface;
142  return &g_interface;
143  }
145  return this;
146  }
148  return this;
149  }
150 
151  Source() :
152  CSource::Instance()
153  {
154  }
155 
156  virtual ~Source() {}
157 
158  /**
159  * \brief Return the minimum and maximum duration, in seconds.
160  *
161  * \param[out] out_dblMinDuration Minimum duration, in seconds
162  * \param[out] out_dblMaxDuration Maximum duration, in seconds
163  */
164  virtual bool GetSourceDuration(
165  double & out_dblMinDuration,
166  double & out_dblMaxDuration
167  ) const = 0;
168  };
169  } // of namespace V1
170 
171  /// Latest version of the C Source interface.
173  /// Latest version of the C++ Source interface.
175 
178 } // of namespace AK::Wwise::Plugin
179 
180 #endif
bool(* GetSourceDuration)(const struct ak_wwise_plugin_source_instance_v1 *in_this, double *out_dblMinDuration, double *out_dblMaxDuration)
Return the minimum and maximum duration, in seconds.
Definition: Source.h:68
ak_wwise_plugin_source_instance_v1 Instance
Base instance type for providing source-specific information.
Definition: Source.h:54
decltype(BaseInterface::m_version) InterfaceVersion
PluginInfoGenerator: Type for the m_version value in BaseInterface.
InterfacePtr GetInterfacePointer()
Definition: Source.h:140
@ k_interfaceType
The interface type, as provided by this plug-in.
Definition: Source.h:107
ak_wwise_plugin_source_v1 CSource
Definition: Source.h:88
The C interface, fulfilled by your plug-in.
Definition: Source.h:124
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_SOURCE
2021.1 Source-specific backend part. ak_wwise_plugin_source_v1
API specific for source plug-in.
Definition: Source.h:47
const CSource::Instance * GetInstancePointer() const
Definition: Source.h:147
Wwise API for general Audio Plug-in's backend.
Definition: Source.h:92
Wwise Authoring Plug-ins - C++ class helper to automatically determine the plug-in interfaces used in...
CInterfacePtr InterfacePtr
Definition: PluginDef.h:968
Base instance type for providing source-specific information, through ak_wwise_plugin_source_v1.
Definition: PluginDef.h:855
ak_wwise_plugin_source_v1()
Definition: Source.h:56
@ k_interfaceVersion
The interface version, as provided by this plug-in.
Definition: Source.h:117
std::underlying_type< InterfaceType >::type InterfaceTypeValue
PluginInfoGenerator: Underlying storage type for the m_interface value in BaseInterface.
V1::Source Source
Latest version of the C++ Source interface.
Definition: Source.h:174
CSource::Instance * GetInstancePointer()
Definition: Source.h:144
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_VERSION(AudioPlugin)
virtual bool GetSourceDuration(double &out_dblMinDuration, double &out_dblMaxDuration) const =0
Return the minimum and maximum duration, in seconds.
Interface description and base class for every Wwise Authoring plug-in interface.
virtual ~Source()
Definition: Source.h:156
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_CLASS(AudioPlugin)

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise