1 /* 2 Cockos WDL License 3 4 Copyright (C) 2005 - 2015 Cockos Incorporated 5 Copyright (C) 2015 and later Auburn Sounds 6 7 Portions copyright other contributors, see each source file for more information 8 9 This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. 10 11 Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 14 1. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 15 1. This notice may not be removed or altered from any source distribution. 16 */ 17 module dplug.client.daw; 18 19 import core.stdc.string; 20 21 import std.string, 22 std.utf; 23 24 enum DAW 25 { 26 Unknown, 27 Reaper, 28 ProTools, 29 Cubase, 30 Nuendo, 31 Sonar, 32 Vegas, 33 FLStudio, 34 Samplitude, 35 AbletonLive, 36 Tracktion, 37 NTracks, 38 MelodyneStudio, 39 VSTScanner, 40 AULab, 41 Forte, 42 Chainer, 43 Audition, 44 Orion, 45 Bias, 46 SAWStudio, 47 Logic, 48 GarageBand, 49 DigitalPerformer, 50 Standalone, 51 AudioMulch, 52 StudioOne, 53 VST3TestHost, 54 Ardour 55 // These hosts don't report the host name: 56 // EnergyXT2 57 // MiniHost 58 } 59 60 private bool hasSubstring(const(char*) s, const(char*) sub) pure nothrow @nogc 61 { 62 return strstr(s, sub) != null; 63 } 64 65 DAW identifyDAW(const(char*) s) pure nothrow @nogc 66 { 67 // Warning: this relies on zero terminated string literals 68 if (hasSubstring(s, "reaper")) return DAW.Reaper; 69 if (hasSubstring(s, "cubase")) return DAW.Cubase; 70 if (hasSubstring(s, "reaper")) return DAW.Reaper; 71 if (hasSubstring(s, "nuendo")) return DAW.Nuendo; 72 if (hasSubstring(s, "cakewalk")) return DAW.Sonar; 73 if (hasSubstring(s, "samplitude")) return DAW.Samplitude; 74 if (hasSubstring(s, "fruity")) return DAW.FLStudio; 75 if (hasSubstring(s, "live")) return DAW.AbletonLive; 76 if (hasSubstring(s, "melodyne")) return DAW.MelodyneStudio; 77 if (hasSubstring(s, "vstmanlib")) return DAW.VSTScanner; 78 if (hasSubstring(s, "aulab")) return DAW.AULab; 79 if (hasSubstring(s, "garageband")) return DAW.GarageBand; 80 if (hasSubstring(s, "forte")) return DAW.Forte; 81 if (hasSubstring(s, "chainer")) return DAW.Chainer; 82 if (hasSubstring(s, "audition")) return DAW.Audition; 83 if (hasSubstring(s, "orion")) return DAW.Orion; 84 if (hasSubstring(s, "sawstudio")) return DAW.SAWStudio; 85 if (hasSubstring(s, "logic")) return DAW.Logic; 86 if (hasSubstring(s, "digital")) return DAW.DigitalPerformer; 87 if (hasSubstring(s, "audiomulch")) return DAW.AudioMulch; 88 if (hasSubstring(s, "presonus")) return DAW.StudioOne; 89 if (hasSubstring(s, "vst3plugintesthost")) return DAW.VST3TestHost; 90 if (hasSubstring(s, "protools")) return DAW.ProTools; 91 if (hasSubstring(s, "ardour")) return DAW.Ardour; 92 if (hasSubstring(s, "standalone")) return DAW.Standalone; 93 return DAW.Unknown; 94 }