3 #include "eax_fx_slots.h"
7 #include "eax_exception.h"
16 class EaxFxSlotsException
:
20 explicit EaxFxSlotsException(
23 EaxException
{"EAX_FX_SLOTS", message
}
26 }; // EaxFxSlotsException
32 void EaxFxSlots::initialize(
33 ALCcontext
& al_context
)
35 initialize_fx_slots(al_context
);
38 void EaxFxSlots::uninitialize() noexcept
40 for (auto& fx_slot
: fx_slots_
)
46 const ALeffectslot
& EaxFxSlots::get(EaxFxSlotIndex index
) const
48 if(!index
.has_value())
50 return *fx_slots_
[index
.value()];
53 ALeffectslot
& EaxFxSlots::get(EaxFxSlotIndex index
)
55 if(!index
.has_value())
57 return *fx_slots_
[index
.value()];
60 void EaxFxSlots::unlock_legacy() noexcept
62 fx_slots_
[0]->eax_unlock_legacy();
63 fx_slots_
[1]->eax_unlock_legacy();
67 void EaxFxSlots::fail(
70 throw EaxFxSlotsException
{message
};
73 void EaxFxSlots::initialize_fx_slots(
74 ALCcontext
& al_context
)
76 auto fx_slot_index
= EaxFxSlotIndexValue
{};
78 for (auto& fx_slot
: fx_slots_
)
80 fx_slot
= eax_create_al_effect_slot(al_context
);
81 fx_slot
->eax_initialize(al_context
, fx_slot_index
);