AAX SDK  2.4.1
Avid Audio Extensions Development Kit
AAX_UtilsNative.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3 
4  * Copyright 2013-2017 by Avid Technology, Inc.
5  * All rights reserved.
6  *
7  * CONFIDENTIAL: This document contains confidential information. Do not
8  * read or examine this document unless you are an Avid Technology employee
9  * or have signed a non-disclosure agreement with Avid Technology which protects
10  * the confidentiality of this document. DO NOT DISCLOSE ANY INFORMATION
11  * CONTAINED IN THIS DOCUMENT TO ANY THIRD-PARTY WITHOUT THE PRIOR WRITTEN CONSENT
12  * OF Avid Technology, INC.
13  *
14  */
15 
22 /*================================================================================================*/
23 
24 
25 #pragma once
26 
27 #ifndef _AAX_UTILSNATIVE_H_
28 #define _AAX_UTILSNATIVE_H_
29 
30 
31 #ifndef _TMS320C6X
32 
33 // AAX Includes
34 #include "AAX_CString.h"
35 #include "AAX_IString.h"
36 #include "AAX_Assert.h"
37 #include "AAX.h"
38 
39 // Standard Library Includes
40 #include <cmath> // for log()
41 #include <string.h>
42 
43 
44 //------------------------------------------------
45 #pragma mark Utility functions
46 
47 namespace AAX
48 {
49 
53  inline double SafeLog (double aValue) { return aValue <= 0.0 ? 0.0 : log(aValue); }
54 
58  inline float SafeLogf (float aValue) { return aValue <= 0.0f ? 0.0f : logf(aValue); }
59 
62  inline AAX_CBoolean IsParameterIDEqual ( AAX_CParamID iParam1, AAX_CParamID iParam2 ) { return static_cast<AAX_CBoolean>( strcmp ( iParam1, iParam2 ) == 0 ); }
63 
66  inline AAX_CBoolean IsEffectIDEqual ( const AAX_IString * iEffectID1, const AAX_IString * iEffectID2 ) { return static_cast<AAX_CBoolean>( strcmp ( iEffectID1->Get(), iEffectID2->Get() ) == 0 ); }
67 
70  inline AAX_CBoolean IsAvidNotification ( AAX_CTypeID inNotificationID )
71  {
72  return (AAX_CBoolean)((('A' == ((inNotificationID & 0xFF000000) >> 24)) &&
73  ('X' == ((inNotificationID & 0x00FF0000) >> 16))) ||
74  (inNotificationID == 'ASPv'));
75  }
76 
77 } // namespace AAX
78 
79 
80 #endif // #ifndef _TMS320C6X
81 
82 #endif // #ifndef _AAX_UTILSNATIVE_H_
Various utility definitions for AAX.
const char * AAX_CParamID
Parameter identifier.
Definition: AAX.h:352
uint8_t AAX_CBoolean
Cross-compiler boolean type used by AAX interfaces.
Definition: AAX.h:329
uint32_t AAX_CTypeID
Matches type of OSType used in classic plugins.
Definition: AAX.h:336
Declarations for cross-platform AAX_ASSERT, AAX_TRACE and related facilities.
A generic AAX string class with similar functionality to std::string.
An AAX string interface.
Definition: AAX_Exception.h:42
AAX_CBoolean IsAvidNotification(AAX_CTypeID inNotificationID)
Helper function to check if a notification ID is reserved for host notifications.
Definition: AAX_UtilsNative.h:70
float SafeLogf(float aValue)
Single-precision safe log function. Returns zero for input values that are <= 0.0.
Definition: AAX_UtilsNative.h:58
AAX_CBoolean IsParameterIDEqual(AAX_CParamID iParam1, AAX_CParamID iParam2)
Helper function to check if two parameter IDs are equivalent.
Definition: AAX_UtilsNative.h:62
double SafeLog(double aValue)
Double-precision safe log function. Returns zero for input values that are <= 0.0.
Definition: AAX_UtilsNative.h:53
AAX_CBoolean IsEffectIDEqual(const AAX_IString *iEffectID1, const AAX_IString *iEffectID2)
Helper function to check if two Effect IDs are equivalent.
Definition: AAX_UtilsNative.h:66
A simple string container that can be passed across a binary boundary. This class,...
Definition: AAX_IString.h:41
virtual const char * Get() const =0