{"id":4907,"date":"2019-06-18T01:24:19","date_gmt":"2019-06-17T23:24:19","guid":{"rendered":"https:\/\/demdlx704as001.ad.harman.com\/index.php\/section\/audioobject-example-template-h\/"},"modified":"2024-05-13T12:48:09","modified_gmt":"2024-05-13T10:48:09","slug":"audioobject-example-template-h","status":"publish","type":"post","link":"https:\/\/audioworx.transfunnel.co\/old\/?p=4907","title":{"rendered":"Example 4 &#8211; AwxAudioObjExt.h"},"content":{"rendered":"<pre>\/\/ ============================================================\r\n\/\/ (C) 2017 Harman International Industries, Incorporated.\r\n\/\/ Confidential &amp; Proprietary. All Rights Reserved.\r\n\/\/ ============================================================\r\n\r\n\/**\r\n*   \\file       AwxAudioObjExt.h\r\n*   \\brief      Simple demo object Audio object to start a development of a new audio object- Header file\r\n*   \\details    Project    Extendable Audio Framework\r\n*   \\copyright  Harman\/Becker Automotive Systems GmbH\r\n*   \r\n        2017\r\n*   \r\n        All rights reserved\r\n*   \\author     xAF Team\r\n*   \\date       Nov 28, 2023\r\n*\/\r\n\r\n#ifndef AWXAUDIOOBJEXT_H\r\n#define AWXAUDIOOBJEXT_H\r\n\r\n\/*!\r\n*   xaf mandataory includes\r\n*\/\r\n#include \"AudioObject.h\"\r\n\r\n#define AWXAUDIOOBJEXT_VERSION_MAJOR             (0x01)\r\n#define AWXAUDIOOBJEXT_VERSION_MINOR             (0x01)\r\n#define AWXAUDIOOBJEXT_VERSION_REVISION          (0x06)\r\n#define AWXAUDIOOBJEXT_TUNING_VERSION_MAJOR      (0x01)\r\n#define AWXAUDIOOBJEXT_TUNING_VERSION_MINOR      (0x00)\r\n\r\n\/** here you can add all required include files required for    \r\n    the core functionality of your objects\r\n**\/\r\n\r\n#define AWX_AUDIO_OBJ_EXT_NUM_PARAMS         1\r\n#define FLOAT_ARRAY_SIZE                     10\r\n#define NUM_DIMENSION_VAR                    1\r\n\r\n\/**\r\n*    \\brief Simple example object to provide a starting point for a new audio object \r\n*\/\r\nclass CAwxAudioObjExt : public CAudioObject\r\n{\r\npublic:\r\n    static AOVersion version;\r\n    CAwxAudioObjExt();\r\n    virtual ~CAwxAudioObjExt();\r\n\r\n    \/**\r\n    *   Refer AudioObject.h for description\r\n    *\/\r\n\r\n\t\/*\r\n     *   It returns the class size of the given audio object.\r\n     *\/\r\n    xUInt32 getSize() const OVERRIDE;\r\n\r\n\t\/*\r\n     This function initializes all the object variables and parameters. In this method, the object shall initialize all its memory to appropriate values.\r\n    *\/\r\n    void init() OVERRIDE;\r\n    void calc(xAFAudio** inputs, xAFAudio** outputs) OVERRIDE;\r\n\r\n\t\/**\r\n     *    \\brief  This method is called when an object receives updated tuning data.\r\n     *    \\param  subblock               index selects the subblock\r\n     *    \\param  offsetBytes               points the offset in param memory (bytes)\r\n     *    \\param  sizeBytes                   number of parameters to be updated (bytes)\r\n     *    \\param  shouldAttemptRamp      whether or not this data should be attempt to apply instantly, or AO should attempt ramping\r\n     *\/\r\n    void tuneXTP(xSInt32 subblock, xSInt32 adrBytes, xSInt32 sizeBytes, xBool shouldAttemptRamp) OVERRIDE;\r\n\r\n\t\/**\r\n\t*    \\brief  Retrieves pointer to the start of the subblock\r\n\t*    \\param  subBlock subblock number\r\n\t*    \\return start address of the subblock\r\n\t*\/\r\n    xInt8* getSubBlockPtr(xUInt16 subBlock) OVERRIDE;\r\n\r\n\t\/**\r\n\t*    Returns the size of the sub block indicated by 'subBlock'\r\n\t*    \\param  subBlock the ID of the state subBlock we want to get the size of\r\n\t*    \\return size of subBlock\r\n\t*\/\r\n\r\n    xSInt32 getSubBlockSize(xUInt16 subblock) OVERRIDE;\r\n\r\n\t\/**\r\n    *   Assigns the additional configuration as the object requires.\r\n    *\/\r\n\tvoid assignAdditionalConfig() OVERRIDE;\r\n\r\n\t\/**\r\n     *    Control method to set the new value\r\n     *    \\param index - pin index of the object's control input we are writing to\r\n     *    \\param value - value we are writing\r\n     *\/\r\n\txSInt32 controlSet(xSInt32 index, xFloat32 param) OVERRIDE;\r\n\r\n\t\/**\r\n     *    \\brief  It reads the array of applied gain values through additional configuration \"Max Gain per channel\" for each channel.\r\n     *    \\param    index  denotes the channel index\r\n     *    \\return   Gain value read for each channel.\r\n     *\/\r\n    xFloat32 getMaxGain(xSInt32 index);\r\n\r\n\tenum AddnlVars {MAX_GAIN_PER_CHANNEL, THIRD_PARTY_MEM_BLK , AWX_EXT_NUM_ADD_VARS };\r\n\tenum Modes { GAIN, GAIN_WITH_CONTROL, AWX_EXT_NUM_MODES };\r\n\tenum MemAccess { DISABLE_BLOCK, ENABLE_BLOCK };\r\n\tenum memoryRecords { PARAM, COEFF, FLOATARRAY, NUM_MEM_RECORDS } memRecs;\r\n    enum PARAMS { NUM_PARAMS_PER_CHANNEL = 2 };\r\n\txInt8 m_EnMemory;\r\n\r\nprotected:\r\n    xFloat32* m_Coeffs;                                         \/\/\/&lt; internal pointer to COEFF memrec\r\n    xFloat32* m_Params;                                         \/\/\/&lt; internal pointer to PARAM memrec\r\n\txFloat32* m_MemBlock;                                       \/\/\/&lt; internal pointer to FLOATARRAY memrec\r\n\r\nprivate:\r\n\t\/**\r\n     *    \\brief  for each channel, checks the gain limits and calculates gain coefficient\r\n     *    \\param    channel     channel index\r\n     *    \\param    gainIndB    gain in dB\r\n     *\/\r\n    void calcGain(xSInt32 channelIndex, xFloat32 gainIndB);\r\n};\r\n#endif \/\/AWXAUDIOOBJEXT_H\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ ============================================================ \/\/ (C) 2017 Harman International Industries, Incorporated. \/\/ Confidential &amp; Proprietary. All Rights Reserved. \/\/ ============================================================ \/** * \\file AwxAudioObjExt.h * \\brief Simple demo object Audio object to start a development of a new audio object- Header file * \\details Project Extendable Audio Framework * \\copyright Harman\/Becker Automotive Systems GmbH * 2017 * [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","footnotes":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[]},"categories":[353],"tags":[],"coauthors":[165],"_links":{"self":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4907"}],"collection":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4907"}],"version-history":[{"count":11,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4907\/revisions"}],"predecessor-version":[{"id":28068,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4907\/revisions\/28068"}],"wp:attachment":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4907"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcoauthors&post=4907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}