kodi
DiscsUtils.h
1 /*
2  * Copyright (C) 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 namespace UTILS
14 {
15 namespace DISCS
16 {
17 
20 enum class DiscType
21 {
22  UNKNOWN,
23  DVD,
24  BLURAY
25 };
26 
29 struct DiscInfo
30 {
32  DiscType type{DiscType::UNKNOWN};
34  std::string serial;
36  std::string name;
37 
41  bool empty() { return (type == DiscType::UNKNOWN && name.empty() && serial.empty()); }
42 
45  void clear()
46  {
47  type = DiscType::UNKNOWN;
48  name.clear();
49  serial.clear();
50  }
51 };
52 
58 bool GetDiscInfo(DiscInfo& info, const std::string& mediaPath);
59 
64 DiscInfo ProbeDVDDiscInfo(const std::string& mediaPath);
65 
70 DiscInfo ProbeBlurayDiscInfo(const std::string& mediaPath);
71 
72 } // namespace DISCS
73 } // namespace UTILS
Abstracts the info the app knows about a disc (type, name, serial)
Definition: DiscsUtils.h:29
std::string name
The disc label (equivalent to the mount point label)
Definition: DiscsUtils.h:36
Definition: ColorUtils.h:18
void clear()
Clears all the DiscInfo members.
Definition: DiscsUtils.h:45
std::string serial
The disc serial number.
Definition: DiscsUtils.h:34
bool empty()
Check if the info is empty (e.g. after probing)
Definition: DiscsUtils.h:41