1 /* 2 * Copyright (C) 2005-2018 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 // CAutorun - Autorun for different Cd Media 12 // like DVD Movies or XBOX Games 13 // 14 // by Bobbin007 in 2003 15 // 16 // 17 // 18 19 #ifdef HAS_DVD_DRIVE 20 21 #include <memory> 22 #include <string> 23 #include <utility> 24 #include <vector> 25 26 struct IntegerSettingOption; 27 28 namespace XFILE 29 { 30 class IDirectory; 31 } 32 33 class CSetting; 34 35 enum AutoCDAction 36 { 37 AUTOCD_NONE = 0, 38 AUTOCD_PLAY, 39 AUTOCD_RIP 40 }; 41 42 namespace MEDIA_DETECT 43 { 44 class CAutorun 45 { 46 public: 47 CAutorun(); 48 virtual ~CAutorun(); 49 static bool CanResumePlayDVD(const std::string& path); 50 static bool PlayDisc(const std::string& path="", bool bypassSettings = false, bool startFromBeginning = false); 51 static bool PlayDiscAskResume(const std::string& path=""); 52 bool IsEnabled() const; 53 void Enable(); 54 void Disable(); 55 void HandleAutorun(); 56 static void ExecuteAutorun(const std::string& path = "", bool bypassSettings = false, bool ignoreplaying = true, bool startFromBeginning = false); 57 58 static void SettingOptionAudioCdActionsFiller(const std::shared_ptr<const CSetting>& setting, 59 std::vector<IntegerSettingOption>& list, 60 int& current, 61 void* data); 62 63 protected: 64 static bool RunDisc(XFILE::IDirectory* pDir, const std::string& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning); 65 bool m_bEnable; 66 }; 67 } 68 69 #endif 70