├── .gitignore ├── LICENSE ├── OpenCVDeviceEnumerator.sln ├── OpenCVDeviceEnumerator ├── DeviceEnumerator.cpp ├── DeviceEnumerator.h ├── OpenCVDeviceEnumerator.cpp ├── OpenCVDeviceEnumerator.vcxproj └── OpenCVDeviceEnumerator.vcxproj.filters └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.pch 68 | *.pdb 69 | *.pgc 70 | *.pgd 71 | *.rsp 72 | *.sbr 73 | *.tlb 74 | *.tli 75 | *.tlh 76 | *.tmp 77 | *.tmp_proj 78 | *.log 79 | *.vspscc 80 | *.vssscc 81 | .builds 82 | *.pidb 83 | *.svclog 84 | *.scc 85 | 86 | # Chutzpah Test files 87 | _Chutzpah* 88 | 89 | # Visual C++ cache files 90 | ipch/ 91 | *.aps 92 | *.ncb 93 | *.opendb 94 | *.opensdf 95 | *.sdf 96 | *.cachefile 97 | *.VC.db 98 | *.VC.VC.opendb 99 | 100 | # Visual Studio profiler 101 | *.psess 102 | *.vsp 103 | *.vspx 104 | *.sap 105 | 106 | # Visual Studio Trace Files 107 | *.e2e 108 | 109 | # TFS 2012 Local Workspace 110 | $tf/ 111 | 112 | # Guidance Automation Toolkit 113 | *.gpState 114 | 115 | # ReSharper is a .NET coding add-in 116 | _ReSharper*/ 117 | *.[Rr]e[Ss]harper 118 | *.DotSettings.user 119 | 120 | # JustCode is a .NET coding add-in 121 | .JustCode 122 | 123 | # TeamCity is a build add-in 124 | _TeamCity* 125 | 126 | # DotCover is a Code Coverage Tool 127 | *.dotCover 128 | 129 | # AxoCover is a Code Coverage Tool 130 | .axoCover/* 131 | !.axoCover/settings.json 132 | 133 | # Visual Studio code coverage results 134 | *.coverage 135 | *.coveragexml 136 | 137 | # NCrunch 138 | _NCrunch_* 139 | .*crunch*.local.xml 140 | nCrunchTemp_* 141 | 142 | # MightyMoose 143 | *.mm.* 144 | AutoTest.Net/ 145 | 146 | # Web workbench (sass) 147 | .sass-cache/ 148 | 149 | # Installshield output folder 150 | [Ee]xpress/ 151 | 152 | # DocProject is a documentation generator add-in 153 | DocProject/buildhelp/ 154 | DocProject/Help/*.HxT 155 | DocProject/Help/*.HxC 156 | DocProject/Help/*.hhc 157 | DocProject/Help/*.hhk 158 | DocProject/Help/*.hhp 159 | DocProject/Help/Html2 160 | DocProject/Help/html 161 | 162 | # Click-Once directory 163 | publish/ 164 | 165 | # Publish Web Output 166 | *.[Pp]ublish.xml 167 | *.azurePubxml 168 | # Note: Comment the next line if you want to checkin your web deploy settings, 169 | # but database connection strings (with potential passwords) will be unencrypted 170 | *.pubxml 171 | *.publishproj 172 | 173 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 174 | # checkin your Azure Web App publish settings, but sensitive information contained 175 | # in these scripts will be unencrypted 176 | PublishScripts/ 177 | 178 | # NuGet Packages 179 | *.nupkg 180 | # The packages folder can be ignored because of Package Restore 181 | **/[Pp]ackages/* 182 | # except build/, which is used as an MSBuild target. 183 | !**/[Pp]ackages/build/ 184 | # Uncomment if necessary however generally it will be regenerated when needed 185 | #!**/[Pp]ackages/repositories.config 186 | # NuGet v3's project.json files produces more ignorable files 187 | *.nuget.props 188 | *.nuget.targets 189 | 190 | # Microsoft Azure Build Output 191 | csx/ 192 | *.build.csdef 193 | 194 | # Microsoft Azure Emulator 195 | ecf/ 196 | rcf/ 197 | 198 | # Windows Store app package directories and files 199 | AppPackages/ 200 | BundleArtifacts/ 201 | Package.StoreAssociation.xml 202 | _pkginfo.txt 203 | *.appx 204 | 205 | # Visual Studio cache files 206 | # files ending in .cache can be ignored 207 | *.[Cc]ache 208 | # but keep track of directories ending in .cache 209 | !*.[Cc]ache/ 210 | 211 | # Others 212 | ClientBin/ 213 | ~$* 214 | *~ 215 | *.dbmdl 216 | *.dbproj.schemaview 217 | *.jfm 218 | *.pfx 219 | *.publishsettings 220 | orleans.codegen.cs 221 | 222 | # Including strong name files can present a security risk 223 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 224 | #*.snk 225 | 226 | # Since there are multiple workflows, uncomment next line to ignore bower_components 227 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 228 | #bower_components/ 229 | 230 | # RIA/Silverlight projects 231 | Generated_Code/ 232 | 233 | # Backup & report files from converting an old project file 234 | # to a newer Visual Studio version. Backup files are not needed, 235 | # because we have git ;-) 236 | _UpgradeReport_Files/ 237 | Backup*/ 238 | UpgradeLog*.XML 239 | UpgradeLog*.htm 240 | 241 | # SQL Server files 242 | *.mdf 243 | *.ldf 244 | *.ndf 245 | 246 | # Business Intelligence projects 247 | *.rdl.data 248 | *.bim.layout 249 | *.bim_*.settings 250 | 251 | # Microsoft Fakes 252 | FakesAssemblies/ 253 | 254 | # GhostDoc plugin setting file 255 | *.GhostDoc.xml 256 | 257 | # Node.js Tools for Visual Studio 258 | .ntvs_analysis.dat 259 | node_modules/ 260 | 261 | # TypeScript v1 declaration files 262 | typings/ 263 | 264 | # Visual Studio 6 build log 265 | *.plg 266 | 267 | # Visual Studio 6 workspace options file 268 | *.opt 269 | 270 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 271 | *.vbw 272 | 273 | # Visual Studio LightSwitch build output 274 | **/*.HTMLClient/GeneratedArtifacts 275 | **/*.DesktopClient/GeneratedArtifacts 276 | **/*.DesktopClient/ModelManifest.xml 277 | **/*.Server/GeneratedArtifacts 278 | **/*.Server/ModelManifest.xml 279 | _Pvt_Extensions 280 | 281 | # Paket dependency manager 282 | .paket/paket.exe 283 | paket-files/ 284 | 285 | # FAKE - F# Make 286 | .fake/ 287 | 288 | # JetBrains Rider 289 | .idea/ 290 | *.sln.iml 291 | 292 | # CodeRush 293 | .cr/ 294 | 295 | # Python Tools for Visual Studio (PTVS) 296 | __pycache__/ 297 | *.pyc 298 | 299 | # Cake - Uncomment if you are using it 300 | # tools/** 301 | # !tools/packages.config 302 | 303 | # Tabs Studio 304 | *.tss 305 | 306 | # Telerik's JustMock configuration file 307 | *.jmconfig 308 | 309 | # BizTalk build output 310 | *.btp.cs 311 | *.btm.cs 312 | *.odx.cs 313 | *.xsd.cs 314 | 315 | # OpenCover UI analysis results 316 | OpenCover/ 317 | 318 | # Azure Stream Analytics local run output 319 | ASALocalRun/ 320 | 321 | # MSBuild Binary and Structured Log 322 | *.binlog -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 David Gil de Gómez Pérez (Studiosi) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OpenCVDeviceEnumerator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenCVDeviceEnumerator", "OpenCVDeviceEnumerator\OpenCVDeviceEnumerator.vcxproj", "{3AF6B86D-258D-406C-9BC3-0F243EE730F1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Debug|x64.ActiveCfg = Debug|x64 17 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Debug|x64.Build.0 = Debug|x64 18 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Debug|x86.ActiveCfg = Debug|Win32 19 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Debug|x86.Build.0 = Debug|Win32 20 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Release|x64.ActiveCfg = Release|x64 21 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Release|x64.Build.0 = Release|x64 22 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Release|x86.ActiveCfg = Release|Win32 23 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /OpenCVDeviceEnumerator/DeviceEnumerator.cpp: -------------------------------------------------------------------------------- 1 | #include "DeviceEnumerator.h" 2 | 3 | std::map DeviceEnumerator::getVideoDevicesMap() { 4 | return getDevicesMap(CLSID_VideoInputDeviceCategory); 5 | } 6 | 7 | std::map DeviceEnumerator::getAudioDevicesMap() { 8 | return getDevicesMap(CLSID_AudioInputDeviceCategory); 9 | } 10 | 11 | // Returns a map of id and devices that can be used 12 | std::map DeviceEnumerator::getDevicesMap(const GUID deviceClass) 13 | { 14 | std::map deviceMap; 15 | 16 | HRESULT hr = CoInitialize(nullptr); 17 | if (FAILED(hr)) { 18 | return deviceMap; // Empty deviceMap as an error 19 | } 20 | 21 | // Create the System Device Enumerator 22 | ICreateDevEnum *pDevEnum; 23 | hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pDevEnum)); 24 | 25 | // If succeeded, create an enumerator for the category 26 | IEnumMoniker *pEnum = NULL; 27 | if (SUCCEEDED(hr)) { 28 | hr = pDevEnum->CreateClassEnumerator(deviceClass, &pEnum, 0); 29 | if (hr == S_FALSE) { 30 | hr = VFW_E_NOT_FOUND; 31 | } 32 | pDevEnum->Release(); 33 | } 34 | 35 | // Now we check if the enumerator creation succeeded 36 | int deviceId = -1; 37 | if (SUCCEEDED(hr)) { 38 | // Fill the map with id and friendly device name 39 | IMoniker *pMoniker = NULL; 40 | while (pEnum->Next(1, &pMoniker, NULL) == S_OK) { 41 | 42 | IPropertyBag *pPropBag; 43 | HRESULT hr = pMoniker->BindToStorage(0, 0, IID_PPV_ARGS(&pPropBag)); 44 | if (FAILED(hr)) { 45 | pMoniker->Release(); 46 | continue; 47 | } 48 | 49 | // Create variant to hold data 50 | VARIANT var; 51 | VariantInit(&var); 52 | 53 | std::string deviceName; 54 | std::string devicePath; 55 | 56 | // Read FriendlyName or Description 57 | hr = pPropBag->Read(L"Description", &var, 0); // Read description 58 | if (FAILED(hr)) { 59 | // If description fails, try with the friendly name 60 | hr = pPropBag->Read(L"FriendlyName", &var, 0); 61 | } 62 | // If still fails, continue with next device 63 | if (FAILED(hr)) { 64 | VariantClear(&var); 65 | continue; 66 | } 67 | // Convert to string 68 | else { 69 | deviceName = ConvertBSTRToMBS(var.bstrVal); 70 | } 71 | 72 | VariantClear(&var); // We clean the variable in order to read the next value 73 | 74 | // We try to read the DevicePath 75 | hr = pPropBag->Read(L"DevicePath", &var, 0); 76 | if (FAILED(hr)) { 77 | VariantClear(&var); 78 | continue; // If it fails we continue with next device 79 | } 80 | else { 81 | devicePath = ConvertBSTRToMBS(var.bstrVal); 82 | } 83 | 84 | // We populate the map 85 | deviceId++; 86 | Device currentDevice; 87 | currentDevice.id = deviceId; 88 | currentDevice.deviceName = deviceName; 89 | currentDevice.devicePath = devicePath; 90 | deviceMap[deviceId] = currentDevice; 91 | 92 | } 93 | pEnum->Release(); 94 | } 95 | CoUninitialize(); 96 | return deviceMap; 97 | } 98 | 99 | /* 100 | This two methods were taken from 101 | https://stackoverflow.com/questions/6284524/bstr-to-stdstring-stdwstring-and-vice-versa 102 | */ 103 | 104 | std::string DeviceEnumerator::ConvertBSTRToMBS(BSTR bstr) 105 | { 106 | int wslen = ::SysStringLen(bstr); 107 | return ConvertWCSToMBS((wchar_t*)bstr, wslen); 108 | } 109 | 110 | std::string DeviceEnumerator::ConvertWCSToMBS(const wchar_t* pstr, long wslen) 111 | { 112 | int len = ::WideCharToMultiByte(CP_ACP, 0, pstr, wslen, NULL, 0, NULL, NULL); 113 | 114 | std::string dblstr(len, '\0'); 115 | len = ::WideCharToMultiByte(CP_ACP, 0 /* no flags */, 116 | pstr, wslen /* not necessary NULL-terminated */, 117 | &dblstr[0], len, 118 | NULL, NULL /* no default char */); 119 | 120 | return dblstr; 121 | } 122 | -------------------------------------------------------------------------------- /OpenCVDeviceEnumerator/DeviceEnumerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #pragma comment(lib, "strmiids") 7 | 8 | #include 9 | #include 10 | 11 | struct Device { 12 | int id; // This can be used to open the device in OpenCV 13 | std::string devicePath; 14 | std::string deviceName; // This can be used to show the devices to the user 15 | }; 16 | 17 | class DeviceEnumerator { 18 | 19 | public: 20 | 21 | DeviceEnumerator() = default; 22 | std::map getDevicesMap(const GUID deviceClass); 23 | std::map getVideoDevicesMap(); 24 | std::map getAudioDevicesMap(); 25 | 26 | private: 27 | 28 | std::string ConvertBSTRToMBS(BSTR bstr); 29 | std::string ConvertWCSToMBS(const wchar_t* pstr, long wslen); 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /OpenCVDeviceEnumerator/OpenCVDeviceEnumerator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "DeviceEnumerator.h" 5 | 6 | int main() 7 | { 8 | 9 | /* 10 | The id field of the Device struct can be used with an OpenCV VideoCapture object 11 | */ 12 | 13 | DeviceEnumerator de; 14 | 15 | // Audio Devices 16 | std::map devices = de.getAudioDevicesMap(); 17 | 18 | // Print information about the devices 19 | for (auto const &device : devices) { 20 | std::cout << "== AUDIO DEVICE (id:" << device.first << ") ==" << std::endl; 21 | std::cout << "Name: " << device.second.deviceName << std::endl; 22 | std::cout << "Path: " << device.second.devicePath << std::endl; 23 | } 24 | 25 | // Video Devices 26 | devices = de.getVideoDevicesMap(); 27 | 28 | // Print information about the devices 29 | for (auto const &device : devices) { 30 | std::cout << "== VIDEO DEVICE (id:" << device.first << ") ==" << std::endl; 31 | std::cout << "Name: " << device.second.deviceName << std::endl; 32 | std::cout << "Path: " << device.second.devicePath << std::endl; 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /OpenCVDeviceEnumerator/OpenCVDeviceEnumerator.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {3AF6B86D-258D-406C-9BC3-0F243EE730F1} 23 | Win32Proj 24 | OpenCVDeviceEnumerator 25 | 8.1 26 | 27 | 28 | 29 | Application 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | 75 | 76 | true 77 | 78 | 79 | false 80 | 81 | 82 | false 83 | 84 | 85 | 86 | NotUsing 87 | Level3 88 | Disabled 89 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 90 | true 91 | 92 | 93 | 94 | Console 95 | true 96 | 97 | 98 | 99 | 100 | NotUsing 101 | Level3 102 | Disabled 103 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 104 | true 105 | 106 | 107 | 108 | Console 109 | true 110 | 111 | 112 | 113 | 114 | Level3 115 | NotUsing 116 | MaxSpeed 117 | true 118 | true 119 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | true 121 | 122 | 123 | 124 | Console 125 | true 126 | true 127 | true 128 | 129 | 130 | 131 | 132 | Level3 133 | NotUsing 134 | MaxSpeed 135 | true 136 | true 137 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 138 | true 139 | 140 | 141 | 142 | Console 143 | true 144 | true 145 | true 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /OpenCVDeviceEnumerator/OpenCVDeviceEnumerator.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Header Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Device Enumerator for OpenCV 2 | 3 | This project contains a **C++** class that allows the enumeration of devices using DirectShow in Windows, in order to select and obtain the ID that needs to be used with OpenCV when creating, for example, a VideoCapture object to grab frames from a camera. I decided to put this up as "How to get the ID of a device to use inside OpenCV?" is a question that pops up continuously. The maintainers of OpenCV don't include this functionality in the library because it is **very** operating system dependant. 4 | 5 | ## Contents 6 | 7 | The project contains the class itself (DeviceEnumerator.h and DeviceEnumerator.cpp) and also an example of how to use the class (OpenCVDeviceEnumerator.cpp) 8 | 9 | ## License 10 | 11 | MIT License 12 | 13 | Copyright (c) 2018 David Gil de Gómez Pérez (Studiosi) 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | 33 | --------------------------------------------------------------------------------