xbmc
DVDStateSerializer.h
1 /*
2  * Copyright (C) 2005-2022 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <string>
12 
13 class TiXmlElement;
14 
16 struct DVDState
17 {
19  int32_t title = -1;
21  int32_t pgn = -1;
23  int32_t pgcn = -1;
25  int32_t current_angle = -1;
27  int8_t subp_num = -1;
29  int8_t audio_num = -1;
31  bool sub_enabled = false;
32 };
33 
37 {
38 public:
40  CDVDStateSerializer() = default;
41 
43  ~CDVDStateSerializer() = default;
44 
51  bool XMLToDVDState(DVDState& state, const std::string& xmlstate);
52 
58  bool DVDStateToXML(std::string& xmlstate, const DVDState& state);
59 
60 private:
66  void AddXMLElement(TiXmlElement& root, const std::string& name, const std::string& value);
67 };
Pod structure which represents the current dvd state with respect to dvdnav properties.
Definition: DVDStateSerializer.h:16
int32_t title
Definition: DVDStateSerializer.h:19
int8_t subp_num
Definition: DVDStateSerializer.h:27
int32_t current_angle
Definition: DVDStateSerializer.h:25
int32_t pgcn
Definition: DVDStateSerializer.h:23
int8_t audio_num
Definition: DVDStateSerializer.h:29
bool sub_enabled
Definition: DVDStateSerializer.h:31
int32_t pgn
Definition: DVDStateSerializer.h:21
Auxiliar class to serialize/deserialize the dvd state (into/from XML)
Definition: DVDStateSerializer.h:36