// SPDX-FileCopyrightText: © 2024 Allegro DVT <github-ip@allegrodvt.com>
// SPDX-License-Identifier: MIT

#pragma once

#include <string>

static std::string const SETTINGS_INDEX_MIMES {
  "SETTINGS_INDEX_MIMES"
};
static std::string const SETTINGS_INDEX_CLOCK {
  "SETTINGS_INDEX_CLOCK"
};
static std::string const SETTINGS_INDEX_STRIDE_ALIGNMENTS {
  "SETTINGS_INDEX_STRIDE_ALIGNMENTS"
};
static std::string const SETTINGS_INDEX_GROUP_OF_PICTURES {
  "SETTINGS_INDEX_GROUP_OF_PICTURES"
};
static std::string const SETTINGS_INDEX_INTERNAL_ENTROPY_BUFFER {
  "SETTINGS_INDEX_INTERNAL_ENTROPY_BUFFER"
};
static std::string const SETTINGS_INDEX_LATENCY {
  "SETTINGS_INDEX_LATENCY"
};
static std::string const SETTINGS_INDEX_LOW_BANDWIDTH {
  "SETTINGS_INDEX_LOW_BANDWIDTH"
};
static std::string const SETTINGS_INDEX_CONSTRAINED_INTRA_PREDICTION {
  "SETTINGS_INDEX_CONSTRAINED_INTRA_PREDICTION"
};
static std::string const SETTINGS_INDEX_ENTROPY_CODING {
  "SETTINGS_INDEX_ENTROPY_CODING"
};
static std::string const SETTINGS_INDEX_VIDEO_MODE {
  "SETTINGS_INDEX_VIDEO_MODE"
};
static std::string const SETTINGS_INDEX_VIDEO_MODES_SUPPORTED {
  "SETTINGS_INDEX_VIDEO_MODES_SUPPORTED"
};
static std::string const SETTINGS_INDEX_SEQUENCE_PICTURE_MODE {
  "SETTINGS_INDEX_SEQUENCE_PICTURE_MODE"
};
static std::string const SETTINGS_INDEX_SEQUENCE_PICTURE_MODES_SUPPORTED {
  "SETTINGS_INDEX_SEQUENCE_PICTURE_MODES_SUPPORTED"
};
static std::string const SETTINGS_INDEX_BITRATE {
  "SETTINGS_INDEX_BITRATE"
};
static std::string const SETTINGS_INDEX_CACHE_LEVEL2 {
  "SETTINGS_INDEX_CACHE_LEVEL2"
};
static std::string const SETTINGS_INDEX_CACHE_LEVEL2_REDUCED_RANGE {
  "SETTINGS_INDEX_CACHE_LEVEL2_REDUCED_RANGE"
};
static std::string const SETTINGS_INDEX_BUFFER_HANDLES {
  "SETTINGS_INDEX_BUFFER_HANDLES"
};
static std::string const SETTINGS_INDEX_BUFFER_COUNTS {
  "SETTINGS_INDEX_BUFFER_COUNTS"
};
static std::string const SETTINGS_INDEX_BUFFER_SIZES {
  "SETTINGS_INDEX_BUFFER_SIZES"
};
static std::string const SETTINGS_INDEX_BUFFER_BYTES_ALIGNMENTS {
  "SETTINGS_INDEX_BUFFER_BYTES_ALIGNMENTS"
};
static std::string const SETTINGS_INDEX_BUFFER_CONTIGUITIES {
  "SETTINGS_INDEX_BUFFER_CONTIGUITIES"
};
static std::string const SETTINGS_INDEX_FILLER_DATA {
  "SETTINGS_INDEX_FILLER_DATA"
};
static std::string const SETTINGS_INDEX_ASPECT_RATIO {
  "SETTINGS_INDEX_ASPECT_RATIO"
};
static std::string const SETTINGS_INDEX_SCALING_LIST {
  "SETTINGS_INDEX_SCALING_LIST"
};
static std::string const SETTINGS_INDEX_QUANTIZATION_PARAMETER {
  "SETTINGS_INDEX_QUANTIZATION_PARAMETER"
};
static std::string const SETTINGS_INDEX_LOOP_FILTER {
  "SETTINGS_INDEX_LOOP_FILTER"
};
static std::string const SETTINGS_INDEX_PROFILE_LEVEL {
  "SETTINGS_INDEX_PROFILE_LEVEL"
};
static std::string const SETTINGS_INDEX_PROFILES_LEVELS_SUPPORTED {
  "SETTINGS_INDEX_PROFILES_LEVELS_SUPPORTED"
};
static std::string const SETTINGS_INDEX_FORMAT {
  "SETTINGS_INDEX_FORMAT"
};
static std::string const SETTINGS_INDEX_FORMATS_SUPPORTED {
  "SETTINGS_INDEX_FORMATS_SUPPORTED"
};
static std::string const SETTINGS_INDEX_SLICE_PARAMETER {
  "SETTINGS_INDEX_SLICE_PARAMETER"
};
static std::string const SETTINGS_INDEX_SUBFRAME {
  "SETTINGS_INDEX_SUBFRAME"
};
static std::string const SETTINGS_INDEX_RESOLUTION {
  "SETTINGS_INDEX_RESOLUTION"
};
static std::string const SETTINGS_INDEX_DECODED_PICTURE_BUFFER {
  "SETTINGS_INDEX_DECODED_PICTURE_BUFFER"
};
static std::string const SETTINGS_INDEX_COLOR_PRIMARIES {
  "SETTINGS_INDEX_COLOR_PRIMARIES"
};
static std::string const SETTINGS_INDEX_TRANSFER_CHARACTERISTICS {
  "SETTINGS_INDEX_TRANSFER_CHARACTERISTICS"
};
static std::string const SETTINGS_INDEX_COLOUR_MATRIX {
  "SETTINGS_INDEX_COLOUR_MATRIX"
};
static std::string const SETTINGS_INDEX_INPUT_PARSED {
  "SETTINGS_INDEX_INPUT_PARSED"
};
static std::string const SETTINGS_INDEX_LOOKAHEAD {
  "SETTINGS_INDEX_LOOKAHEAD"
};
static std::string const SETTINGS_INDEX_TWOPASS {
  "SETTINGS_INDEX_TWOPASS"
};
static std::string const SETTINGS_INDEX_LLP2_EARLY_CB {
  "SETTINGS_INDEX_LLP2_EARLY_CB"
};
static std::string const SETTINGS_INDEX_INPUT_SYNCHRONIZATION {
  "SETTINGS_INDEX_INPUT_SYNCHRONIZATION"
};
static std::string const SETTINGS_INDEX_SEPARATE_CONFIGURATION_FROM_DATA {
  "SETTINGS_INDEX_SEPARATE_CONFIGURATION_FROM_DATA"
};
static std::string const SETTINGS_INDEX_MAX_PICTURE_SIZES {
  "SETTINGS_INDEX_MAX_PICTURE_SIZES"
};
static std::string const SETTINGS_INDEX_LOOP_FILTER_BETA {
  "SETTINGS_INDEX_LOOP_FILTER_BETA"
};
static std::string const SETTINGS_INDEX_LOOP_FILTER_TC {
  "SETTINGS_INDEX_LOOP_FILTER_TC"
};
static std::string const SETTINGS_INDEX_ACCESS_UNIT_DELIMITER {
  "SETTINGS_INDEX_ACCESS_UNIT_DELIMITER"
};
static std::string const SETTINGS_INDEX_BUFFERING_PERIOD_SEI {
  "SETTINGS_INDEX_BUFFERING_PERIOD_SEI"
};
static std::string const SETTINGS_INDEX_PICTURE_TIMING_SEI {
  "SETTINGS_INDEX_PICTURE_TIMING_SEI"
};
static std::string const SETTINGS_INDEX_RECOVERY_POINT_SEI {
  "SETTINGS_INDEX_RECOVERY_POINT_SEI"
};
static std::string const SETTINGS_INDEX_MASTERING_DISPLAY_COLOUR_VOLUME_SEI {
  "SETTINGS_INDEX_MASTERING_DISPLAY_COLOUR_VOLUME_SEI"
};
static std::string const SETTINGS_INDEX_CONTENT_LIGHT_LEVEL_SEI {
  "SETTINGS_INDEX_CONTENT_LIGHT_LEVEL_SEI"
};
static std::string const SETTINGS_INDEX_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI {
  "SETTINGS_INDEX_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI"
};
static std::string const SETTINGS_INDEX_ST2094_10_SEI {
  "SETTINGS_INDEX_ST2094_10_SEI"
};
static std::string const SETTINGS_INDEX_ST2094_40_SEI {
  "SETTINGS_INDEX_ST2094_40_SEI"
};
static std::string const SETTINGS_INDEX_RATE_CONTROL_PLUGIN {
  "SETTINGS_INDEX_RATE_CONTROL_PLUGIN"
};
static std::string const SETTINGS_INDEX_INPUT_CROP {
  "SETTINGS_INDEX_INPUT_CROP"
};
static std::string const SETTINGS_INDEX_OUTPUT_CROP {
  "SETTINGS_INDEX_OUTPUT_CROP"
};
static std::string const SETTINGS_INDEX_MAX_PICTURE_SIZES_IN_BITS {
  "SETTINGS_INDEX_MAX_PICTURE_SIZES_IN_BITS"
};
static std::string const SETTINGS_INDEX_UNIFORM_SLICE_TYPE {
  "SETTINGS_INDEX_UNIFORM_SLICE_TYPE"
};
static std::string const SETTINGS_INDEX_LOG2_CODING_UNIT {
  "SETTINGS_INDEX_LOG2_CODING_UNIT"
};
static std::string const SETTINGS_INDEX_OUTPUT_POSITION {
  "SETTINGS_INDEX_OUTPUT_POSITION"
};
static std::string const SETTINGS_INDEX_START_CODE_BYTES_ALIGNMENT {
  "SETTINGS_INDEX_START_CODE_BYTES_ALIGNMENT"
};
static std::string const SETTINGS_INDEX_VIDEO_FULL_RANGE {
  "SETTINGS_INDEX_VIDEO_FULL_RANGE"
};
static std::string const SETTINGS_INDEX_REALTIME {
  "SETTINGS_INDEX_REALTIME"
};

struct SettingsInterface
{
  enum ErrorType
  {
    SUCCESS,
    BAD_INDEX,
    BAD_PARAMETER,
    NOT_IMPLEMENTED,
    UNDEFINED,
    MAX,
  };

  virtual ~SettingsInterface() = 0;
  virtual ErrorType Get(std::string index, void* settings) const = 0;
  virtual ErrorType Set(std::string index, void const* settings) = 0;
  virtual void Reset() = 0;
  virtual bool Check() = 0;
};

#include <map>
static std::map<SettingsInterface::ErrorType, std::string> ToStringErrorSettings
{
  {
    SettingsInterface::SUCCESS, "SUCCESS"
  },
  {
    SettingsInterface::BAD_INDEX, "BAD_INDEX"
  },
  {
    SettingsInterface::BAD_PARAMETER, "BAD_PARAMETER"
  },
  {
    SettingsInterface::NOT_IMPLEMENTED, "NOT_IMPLEMENTED"
  },
  {
    SettingsInterface::UNDEFINED, "UNDEFINED"
  },
  {
    SettingsInterface::MAX, "MAX"
  },
};
