summaryrefslogtreecommitdiffstats
path: root/xbmc/cores/RetroPlayer/RetroPlayerUtils.cpp
blob: 42d6e47db7f42aaba53f781312634e83ca7339a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 *  Copyright (C) 2017-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#include "RetroPlayerUtils.h"

using namespace KODI;
using namespace RETRO;

const char* CRetroPlayerUtils::StretchModeToIdentifier(STRETCHMODE stretchMode)
{
  switch (stretchMode)
  {
    case STRETCHMODE::Normal:
      return STRETCHMODE_NORMAL_ID;
    case STRETCHMODE::Stretch4x3:
      return STRETCHMODE_STRETCH_4_3_ID;
    case STRETCHMODE::Fullscreen:
      return STRETCHMODE_FULLSCREEN_ID;
    case STRETCHMODE::Original:
      return STRETCHMODE_ORIGINAL_ID;
    default:
      break;
  }

  return "";
}

STRETCHMODE CRetroPlayerUtils::IdentifierToStretchMode(const std::string& stretchMode)
{
  if (stretchMode == STRETCHMODE_NORMAL_ID)
    return STRETCHMODE::Normal;
  else if (stretchMode == STRETCHMODE_STRETCH_4_3_ID)
    return STRETCHMODE::Stretch4x3;
  else if (stretchMode == STRETCHMODE_FULLSCREEN_ID)
    return STRETCHMODE::Fullscreen;
  else if (stretchMode == STRETCHMODE_ORIGINAL_ID)
    return STRETCHMODE::Original;

  return STRETCHMODE::Normal;
}