#include "ToggleSounds.h"
#include "Utils/AudioUtils.h"
#include "Utils/FileUtils.h"
#include "Client.h"

auto ToggleSounds::onAnyEnabled() -> void {
    auto clientinstance = Client::clientinstance;
    if (!clientinstance) return;

    switch (mode) {
    case 0:
        Utils::Audio::playmc(_("random.pop"), volume, pitch);
        break;
    case 1:
        Utils::Audio::playmc(_("random.click"), volume, pitch);
        break;
    }
}

auto ToggleSounds::onAnyDisabled() -> void {
    switch (mode) {
    case 0:
        Utils::Audio::playmc(_("random.pop"), volume, disablepitch);
        break;
    case 1:
        Utils::Audio::playmc(_("random.click"), volume, disablepitch);
        break;
    }
}
