@@ -1624,6 +1624,58 @@ endfunction()
1624
1624
1625
1625
# ==================================================================================================
1626
1626
1627
+ # Only sets result if the categories list contains valid entries
1628
+ function (_juce_aax_categories_to_int categories_list result)
1629
+ set (aax_category_strings
1630
+ None
1631
+ EQ
1632
+ Dynamics
1633
+ PitchShift
1634
+ Reverb
1635
+ Delay
1636
+ Modulation
1637
+ Harmonic
1638
+ NoiseReduction
1639
+ Dither
1640
+ SoundField
1641
+ HWGenerators
1642
+ SWGenerators
1643
+ WrappedPlugin
1644
+ Effect
1645
+ placeholder # These placeholders are because there's a gap between Effect
1646
+ placeholder # and MIDIEffect in the definition of AAX_EPlugInCategory.
1647
+ MIDIEffect)
1648
+
1649
+ unset (aax_category_int)
1650
+
1651
+ foreach (category_string IN LISTS categories_list)
1652
+ string (REGEX REPLACE "^AAX_[eE]PlugInCategory_" "" category_string "${category_string} " )
1653
+ list (FIND aax_category_strings ${category_string} aax_index)
1654
+
1655
+ if (aax_index GREATER_EQUAL 0)
1656
+ if (aax_index EQUAL 0)
1657
+ set (aax_category_bit 0)
1658
+ else ()
1659
+ set (aax_category_bit "1 << (${aax_index} - 1)" )
1660
+ endif ()
1661
+
1662
+ if (NOT DEFINED aax_category_int)
1663
+ set (aax_category_int 0)
1664
+ endif ()
1665
+
1666
+ math (EXPR aax_category_int "${aax_category_int} | (${aax_category_bit} )" )
1667
+ else ()
1668
+ message (WARNING "Unrecognised AAX category: '${category_string} '. See the `CMake API.md` entry for `AAX_CATEGORY` for valid values." )
1669
+ endif ()
1670
+ endforeach ()
1671
+
1672
+ if (DEFINED aax_category_int)
1673
+ set (${result} "${aax_category_int} " PARENT_SCOPE)
1674
+ endif ()
1675
+ endfunction ()
1676
+
1677
+ # ==================================================================================================
1678
+
1627
1679
function (_juce_set_generic_property_if_not_set target property)
1628
1680
list (LENGTH ARGN num_extra_args)
1629
1681
@@ -1803,57 +1855,20 @@ function(_juce_set_fallback_properties target)
1803
1855
1804
1856
# AAX category
1805
1857
1806
- # The order of these strings is important, as the index of each string
1807
- # will be used to set an appropriate bit in the category bitfield.
1808
- set (aax_category_strings
1809
- ePlugInCategory_None
1810
- ePlugInCategory_EQ
1811
- ePlugInCategory_Dynamics
1812
- ePlugInCategory_PitchShift
1813
- ePlugInCategory_Reverb
1814
- ePlugInCategory_Delay
1815
- ePlugInCategory_Modulation
1816
- ePlugInCategory_Harmonic
1817
- ePlugInCategory_NoiseReduction
1818
- ePlugInCategory_Dither
1819
- ePlugInCategory_SoundField
1820
- ePlugInCategory_HWGenerators
1821
- ePlugInCategory_SWGenerators
1822
- ePlugInCategory_WrappedPlugin
1823
- ePlugInCategory_Effect)
1824
-
1825
- if (is_synth)
1826
- set (default_aax_category ePlugInCategory_SWGenerators)
1858
+ if (is_midi_effect)
1859
+ set (default_aax_category AAX_ePlugInCategory_MIDIEffect)
1860
+ elseif (is_synth)
1861
+ set (default_aax_category AAX_ePlugInCategory_SWGenerators)
1827
1862
else ()
1828
- set (default_aax_category ePlugInCategory_None )
1863
+ set (default_aax_category AAX_ePlugInCategory_None )
1829
1864
endif ()
1830
1865
1831
1866
_juce_set_property_if_not_set(${target} AAX_CATEGORY ${default_aax_category} )
1832
1867
1833
- # Replace AAX category string with its integral representation
1834
1868
get_target_property (actual_aax_category ${target} JUCE_AAX_CATEGORY)
1869
+ _juce_aax_categories_to_int("${actual_aax_category} " aax_category_int)
1835
1870
1836
- set (aax_category_int "" )
1837
-
1838
- foreach (category_string IN LISTS actual_aax_category)
1839
- list (FIND aax_category_strings ${category_string} aax_index)
1840
-
1841
- if (aax_index GREATER_EQUAL 0)
1842
- if (aax_index EQUAL 0)
1843
- set (aax_category_bit 0)
1844
- else ()
1845
- set (aax_category_bit "1 << (${aax_index} - 1)" )
1846
- endif ()
1847
-
1848
- if (aax_category_int STREQUAL "" )
1849
- set (aax_category_int 0)
1850
- endif ()
1851
-
1852
- math (EXPR aax_category_int "${aax_category_int} | (${aax_category_bit} )" )
1853
- endif ()
1854
- endforeach ()
1855
-
1856
- if (NOT aax_category_int STREQUAL "" )
1871
+ if (DEFINED aax_category_int)
1857
1872
set_target_properties (${target} PROPERTIES JUCE_AAX_CATEGORY ${aax_category_int} )
1858
1873
endif ()
1859
1874
0 commit comments