summaryrefslogtreecommitdiffstats
path: root/xbmc/Autorun.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /xbmc/Autorun.h
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/Autorun.h')
-rw-r--r--xbmc/Autorun.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/xbmc/Autorun.h b/xbmc/Autorun.h
new file mode 100644
index 0000000..1bd342b
--- /dev/null
+++ b/xbmc/Autorun.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2005-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.
+ */
+
+#pragma once
+
+// CAutorun - Autorun for different Cd Media
+// like DVD Movies or XBOX Games
+//
+// by Bobbin007 in 2003
+//
+//
+//
+
+#ifdef HAS_DVD_DRIVE
+
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+struct IntegerSettingOption;
+
+namespace XFILE
+{
+ class IDirectory;
+}
+
+class CSetting;
+
+enum AutoCDAction
+{
+ AUTOCD_NONE = 0,
+ AUTOCD_PLAY,
+ AUTOCD_RIP
+};
+
+namespace MEDIA_DETECT
+{
+class CAutorun
+{
+public:
+ CAutorun();
+ virtual ~CAutorun();
+ static bool CanResumePlayDVD(const std::string& path);
+ static bool PlayDisc(const std::string& path="", bool bypassSettings = false, bool startFromBeginning = false);
+ static bool PlayDiscAskResume(const std::string& path="");
+ bool IsEnabled() const;
+ void Enable();
+ void Disable();
+ void HandleAutorun();
+
+ /*! \brief Execute the autorun. Used for example to automatically rip cds or play optical discs
+ * @param path the path for the item (e.g. the disc path)
+ * @return true if some action was executed, false otherwise
+ */
+ static bool ExecuteAutorun(const std::string& path);
+
+ static void SettingOptionAudioCdActionsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+
+protected:
+ static bool RunDisc(XFILE::IDirectory* pDir, const std::string& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning);
+ bool m_bEnable;
+};
+}
+
+#endif