@@ -27,16 +27,16 @@ int FmodBank::get_loading_state() {
2727 return state;
2828}
2929
30- int FmodBank::get_bus_count () {
31- return buses .size ();
30+ int64_t FmodBank::get_bus_count () {
31+ return _buses .size ();
3232}
3333
34- int FmodBank::get_event_description_count () {
35- return eventDescriptions .size ();
34+ int64_t FmodBank::get_event_description_count () {
35+ return _event_descriptions .size ();
3636}
3737
38- int FmodBank::get_vca_count () const {
39- return VCAs .size ();
38+ int64_t FmodBank::get_vca_count () const {
39+ return _vcas .size ();
4040}
4141
4242int FmodBank::get_string_count () const {
@@ -47,23 +47,23 @@ int FmodBank::get_string_count() const {
4747
4848Array FmodBank::get_description_list () const {
4949 Array array;
50- for (const Ref<FmodEventDescription>& ref : eventDescriptions ) {
50+ for (const Ref<FmodEventDescription>& ref : _event_descriptions ) {
5151 array.append (ref);
5252 }
5353 return array;
5454}
5555
5656Array FmodBank::get_bus_list () const {
5757 Array array;
58- for (const Ref<FmodBus>& ref : buses ) {
58+ for (const Ref<FmodBus>& ref : _buses ) {
5959 array.append (ref);
6060 }
6161 return array;
6262}
6363
6464Array FmodBank::get_vca_list () const {
6565 Array array;
66- for (const Ref<FmodVCA>& ref : VCAs ) {
66+ for (const Ref<FmodVCA>& ref : _vcas ) {
6767 array.append (ref);
6868 }
6969 return array;
@@ -76,54 +76,78 @@ void FmodBank::update_bank_data() {
7676}
7777
7878void FmodBank::load_all_vca () {
79- FMOD::Studio::VCA* array[MAX_VCA_COUNT];
8079 int size = 0 ;
81- if (ERROR_CHECK_WITH_REASON (_wrapped->getVCAList (array, MAX_VCA_COUNT, &size), vformat (" Cannot get VCA list for bank %s" , get_path ()))) {
82- CHECK_SIZE (MAX_VCA_COUNT, size, VCAs)
83- VCAs.clear ();
84- for (int i = 0 ; i < size; ++i) {
85- Ref<FmodVCA> ref = FmodVCA::create_ref (array[i]);
86- VCAs.push_back (ref);
80+ if (ERROR_CHECK_WITH_REASON (_wrapped->getVCACount (&size), vformat (" Cannot get VCA count for bank %s" , get_path ()))) {
81+ if (size == 0 ) {
82+ return ;
83+ }
84+
85+ Vector<FMOD::Studio::VCA*> raw_vcas;
86+ raw_vcas.resize (size);
87+
88+ if (ERROR_CHECK_WITH_REASON (_wrapped->getVCAList (raw_vcas.ptrw (), size, &size), vformat (" Cannot get VCA list for bank %s" , get_path ()))) {
89+ _vcas.clear ();
90+
91+ for (int i = 0 ; i < size; ++i) {
92+ Ref<FmodVCA> ref = FmodVCA::create_ref (raw_vcas[i]);
93+ _vcas.push_back (ref);
94+ }
8795 }
8896 }
8997}
9098
9199void FmodBank::load_all_buses () {
92- FMOD::Studio::Bus* array[MAX_BUS_COUNT];
93100 int size = 0 ;
94- if (ERROR_CHECK_WITH_REASON (_wrapped->getBusList (array, MAX_BUS_COUNT, &size), vformat (" Cannot get bus list for bank %s" , get_path ()))) {
95- CHECK_SIZE (MAX_BUS_COUNT, size, buses)
96- buses.clear ();
97- for (int i = 0 ; i < size; ++i) {
98- Ref<FmodBus> ref = FmodBus::create_ref (array[i]);
99- buses.push_back (ref);
101+ if (ERROR_CHECK_WITH_REASON (_wrapped->getBusCount (&size), vformat (" Cannot get bus count for bank %s" , get_path ()))) {
102+ if (size == 0 ) {
103+ return ;
104+ }
105+
106+ Vector<FMOD::Studio::Bus*> raw_buses;
107+ raw_buses.resize (size);
108+
109+ if (ERROR_CHECK_WITH_REASON (_wrapped->getBusList (raw_buses.ptrw (), size, &size), vformat (" Cannot get bus list for bank %s" , get_path ()))) {
110+ _buses.clear ();
111+
112+ for (int i = 0 ; i < size; ++i) {
113+ Ref<FmodBus> ref = FmodBus::create_ref (raw_buses[i]);
114+ _buses.push_back (ref);
115+ }
100116 }
101117 }
102118}
103119
104120void FmodBank::load_all_event_descriptions () {
105- FMOD::Studio::EventDescription* array[MAX_EVENT_DESCRIPTION_COUNT];
106121 int size = 0 ;
107- if (ERROR_CHECK_WITH_REASON (_wrapped->getEventList (array, MAX_EVENT_DESCRIPTION_COUNT, &size), vformat (" Cannot get event list for bank %s" , get_path ()))) {
108- CHECK_SIZE (MAX_EVENT_DESCRIPTION_COUNT, size, Events)
109- eventDescriptions.clear ();
110- for (int i = 0 ; i < size; ++i) {
111- Ref<FmodEventDescription> ref = FmodEventDescription::create_ref (array[i]);
112- eventDescriptions.push_back (ref);
122+ if (ERROR_CHECK_WITH_REASON (_wrapped->getEventCount (&size), vformat (" Cannot get event count for bank %s" , get_path ()))) {
123+ if (size == 0 ) {
124+ return ;
125+ }
126+
127+ Vector<FMOD::Studio::EventDescription*> raw_events;
128+ raw_events.resize (size);
129+
130+ if (ERROR_CHECK_WITH_REASON (_wrapped->getEventList (raw_events.ptrw (), size, &size), vformat (" Cannot get event list for bank %s" , get_path ()))) {
131+ _event_descriptions.clear ();
132+
133+ for (int i = 0 ; i < size; ++i) {
134+ Ref<FmodEventDescription> ref = FmodEventDescription::create_ref (raw_events[i]);
135+ _event_descriptions.push_back (ref);
136+ }
113137 }
114138 }
115139}
116140
117- const List<Ref<FmodEventDescription>>& FmodBank::getEventDescriptions () const {
118- return eventDescriptions ;
141+ const List<Ref<FmodEventDescription>>& FmodBank::get_event_descriptions () const {
142+ return _event_descriptions ;
119143}
120144
121- const List<Ref<FmodBus>>& FmodBank::getBuses () const {
122- return buses ;
145+ const List<Ref<FmodBus>>& FmodBank::get_buses () const {
146+ return _buses ;
123147}
124148
125- const List<Ref<FmodVCA>>& FmodBank::getVcAs () const {
126- return VCAs ;
149+ const List<Ref<FmodVCA>>& FmodBank::get_vcas () const {
150+ return _vcas ;
127151}
128152
129153const String& FmodBank::get_godot_res_path () const {
0 commit comments