Version

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

Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise