USB-Turntable: Implement Freeze()

This commit is contained in:
Stenzek 2023-07-23 13:12:12 +10:00 committed by Connor McLaughlin
parent 57d042ca4a
commit b56958abe4
2 changed files with 12 additions and 0 deletions

View File

@ -282,6 +282,17 @@ namespace usb_pad
return nullptr;
}
bool DJTurntableDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
TurntableState* s = USB_CONTAINER_OF(dev, TurntableState, dev);
if (!sw.DoMarker("DJTurntableDevice"))
return false;
sw.Do(&s->data.euphoria_led_state);
return !sw.HasError();
}
void DJTurntableDevice::UpdateSettings(USBDevice* dev, SettingsInterface& si) const
{
USB_CONTAINER_OF(dev, TurntableState, dev)->UpdateSettings(si, TypeName());

View File

@ -100,6 +100,7 @@ namespace usb_pad
const char* TypeName() const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;
void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;
std::span<const InputBindingInfo> Bindings(u32 subtype) const override;
std::span<const SettingInfo> Settings(u32 subtype) const override;