commit a0353c27f962f0332102bd6e9ae6b506a39a9f9a
parent b54c7f796999feb44d7b54300b4580b0c81f6e6a
Author: Steven Atkinson <[email protected]>
Date: Mon, 12 Dec 2022 19:46:27 -0800
Updates
Squashed commit of the following:
commit 62cc745c1a783f8f01e9dd9787771ed7855f37e6
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 21:17:58 2022 -0800
Version 0.5.6
commit 774b6c96567803529650968f1fcb287cd7640275
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 21:15:24 2022 -0800
Version 0.5.6
Squashed commit of the following:
commit aeac14442a6dce97af2ed6070fe9c6e5ed2b14f5
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 21:13:47 2022 -0800
Update README.md
commit a081fbdac32568608b6a2818fcd155498852136c
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 21:13:38 2022 -0800
Update license
commit f28a88835f19e59ecd69f25475eb7c4e40bcada7
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 21:08:55 2022 -0800
Create LICENSE
commit e28ffc314583fbf0f77e0679adc3bd5c434edf02
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 19:14:15 2022 -0800
Update config.h
Update name to be Mac-friendly
commit 84582db2366598ea086de0ea1e017794860c2344
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 12:33:31 2022 -0800
Version 0.5.6
commit b2447e4e2e4f55addca385777b4d324d3d0fbbcd
Author: Steven Atkinson <[email protected]>
Date: Sun Dec 11 03:19:19 2022 -0500
Update install files (#2)
* Black
* Fix pathing for Windows
* Changes for new version
Bump version
Changelog
* Update installer files
commit 1ee832ad44ee5ad6654dc39623d1fa2ae4ab0a7a
Author: Steven Atkinson <[email protected]>
Date: Sat Dec 10 21:29:49 2022 -0500
Cleanup (#1)
* Clean up unused knobs
* Make the color palette match the NAM group picture
* Messing with colors. High-contrast purple
* Less grating bright color
* Blue!
Diffstat:
14 files changed, 185 insertions(+), 104 deletions(-)
diff --git a/LICENSE b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Steven Atkinson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/NeuralAmpModeler/NeuralAmpModeler.cpp b/NeuralAmpModeler/NeuralAmpModeler.cpp
@@ -10,7 +10,60 @@
using namespace iplug;
using namespace igraphics;
-const IColor COLOR_MOUSEOVER = COLOR_GREEN.WithOpacity(0.3);
+// COLORS!
+const IColor COLOR_OFF_WHITE(255, 243, 246, 249); // Maeterial UI because Heidi said so
+
+// From group photo
+//const IColor COLOR_NAM_5(255, 206, 194, 224); // Languid Lavendar
+//const IColor COLOR_NAM_4(255, 30, 30, 39); // Raisin Black
+//const IColor COLOR_NAM_3(255, 48, 43, 96); // Space Cadet
+//const IColor COLOR_NAM_2(255, 3, 2, 1); // Black
+//const IColor COLOR_NAM_1(255, 18, 15, 18); // Smoky Black
+
+// Blue palette "Microsoft"
+//const IColor COLOR_NAM_1(255, 13, 27, 42); // Black Fogra 29
+//const IColor COLOR_NAM_2(255, 27, 38, 59); // Oxford Blue
+//const IColor COLOR_NAM_3(255, 65, 90, 119); // Bedazzled Blue
+//const IColor COLOR_NAM_4(255, 119, 141, 169); // Shadow Blue
+//const IColor COLOR_NAM_5(224, 225, 221, 224); // Platinum
+
+// Dark theme
+//const IColor COLOR_NAM_1(255, 26, 20, 35); // Xiketic
+//const IColor COLOR_NAM_2(255, 55, 37, 73); // Dark Purple
+//const IColor COLOR_NAM_3(255, 119, 76, 96); // Twilight Lavendar
+//const IColor COLOR_NAM_4(255, 183, 93, 105); // Popstar
+//const IColor COLOR_NAM_5(224, 234, 205, 194); // Unbleached Silk
+
+//const IColor COLOR_MOUSEOVER = COLOR_NAM_5.WithOpacity(0.3);
+
+// My 3 colors (purple)
+//const IColor COLOR_NAM_1(255, 18, 17, 19); // Smoky Black
+//const IColor COLOR_NAM_2(255, 115, 93, 120); // Old Lavendar
+//const IColor COLOR_NAM_3(255, 189, 185, 196); // Lavendar Gray
+//const IColor COLOR_NAM_2(255, 34, 39, 37); // Charleston Green
+//const IColor COLOR_NAM_2(255, 114, 161, 229); // Little Boy Blue
+//const IColor COLOR_NAM_3(255, 247, 247, 242); // Baby Powder
+//const IColor COLOR_NAM_3(255, 230, 220, 249); // Pale Purple Pantone
+//const IColor COLOR_NAM_3(255, 218, 203, 246); // Lavender Blue
+
+//Blue mode
+//const IColor COLOR_NAM_1(255, 18, 17, 19); // Smoky Black
+const IColor COLOR_NAM_1(255, 29, 26, 31); // Raisin Black
+//const IColor COLOR_NAM_2(255, 126, 188, 230); // Camel
+//const IColor COLOR_NAM_2(255, 152, 202, 235); // Pale Cerulean
+//const IColor COLOR_NAM_2(255, 46, 116, 163); // French Blue
+//const IColor COLOR_NAM_2(255, 80, 171, 232); // Blue Jeans
+const IColor COLOR_NAM_2(255, 80, 133, 232); // Azure
+//const IColor COLOR_NAM_3(255, 189, 185, 196); // Aero
+//const IColor COLOR_NAM_3(255, 221, 237, 248); // Alice Blue
+//const IColor COLOR_NAM_3(255, 207, 220, 229); // Beau Blue
+//const IColor COLOR_NAM_3(255, 187, 199, 208); // Silver Sand
+const IColor COLOR_NAM_3(255, 162, 178, 191); // Cadet Blue Crayola
+
+
+const IColor COLOR_MOUSEOVER = COLOR_NAM_3.WithOpacity(0.3);
+
+const IColor COLOR_HELP_TEXT = COLOR_WHITE;
class IRolloverSVGButtonControl : public ISVGButtonControl
{
@@ -65,9 +118,6 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
{
GetParam(kInputGain)->InitGain("Input", 0.0, -20.0, 20.0, 0.1);
GetParam(kOutputGain)->InitGain("Output", 0.0, -20.0, 20.0, 0.1);
- GetParam(kParametricDrive)->InitDouble("Drive", 0.5, 0.0, 1.0, 0.01);
- GetParam(kParametricLevel)->InitDouble("Level", 0.5, 0.0, 1.0, 0.01);
- GetParam(kParametricTone)->InitDouble("Tone", 0.5, 0.0, 1.0, 0.01);
try {
mDSP = get_hard_dsp();
@@ -100,18 +150,18 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
true, // Show label
true, // Show value
{
- DEFAULT_BGCOLOR, // Background
- COLOR_GREEN.WithOpacity(0.2), // Foreground
- COLOR_GREEN.WithOpacity(0.4), // Pressed
- COLOR_LIGHT_GRAY, // Frame
+ DEFAULT_BGCOLOR, //COLOR_NAM_1, //DEFAULT_BGCOLOR, // Background
+ COLOR_NAM_1, // .WithOpacity(0.5), // Foreground
+ COLOR_NAM_2.WithOpacity(0.4), // .WithOpacity(0.4), // Pressed
+ COLOR_NAM_3, // Frame
COLOR_MOUSEOVER, // Highlight
DEFAULT_SHCOLOR, // Shadow
- COLOR_GREEN, // Extra 1
+ COLOR_NAM_2 , // Extra 1
COLOR_RED, // Extra 2
DEFAULT_X3COLOR // Extra 3
}, // Colors
- {DEFAULT_TEXT_SIZE + 5.f, EVAlign::Middle, COLOR_WHITE},
- {DEFAULT_TEXT_SIZE + 5.f, EVAlign::Bottom, COLOR_WHITE},
+ {DEFAULT_TEXT_SIZE + 5.f, EVAlign::Middle, COLOR_NAM_3}, // Knob label text
+ {DEFAULT_TEXT_SIZE + 5.f, EVAlign::Bottom, COLOR_NAM_3}, // Knob value text
DEFAULT_HIDE_CURSOR,
DEFAULT_DRAW_FRAME,
false,
@@ -123,12 +173,13 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
DEFAULT_WIDGET_ANGLE
};
- auto tolexPNG = pGraphics->LoadBitmap(TOLEX_FN);
- pGraphics->AttachControl(new IBitmapControl(pGraphics->GetBounds(), tolexPNG, kNoParameter))->SetBlend(IBlend(EBlend::Default, 0.5));
- pGraphics->AttachControl(new IVPanelControl(mainArea, "", style.WithColor(kFG, COLOR_GREEN.WithContrast(-0.75))));
+ //auto tolexPNG = pGraphics->LoadBitmap(TOLEX_FN);
+ //pGraphics->AttachControl(new IBitmapControl(pGraphics->GetBounds(), tolexPNG, kNoParameter))->SetBlend(IBlend(EBlend::Default, 0.5));
+ // The background inside the outermost border
+ pGraphics->AttachControl(new IVPanelControl(mainArea, "", style.WithColor(kFG, COLOR_NAM_1))); // .WithContrast(-0.75)
pGraphics->AttachControl(new IVLabelControl(titleLabel, "Neural Amp Modeler", style
.WithDrawFrame(false)
- .WithValueText({30, EAlign::Center, COLOR_WHITE})));
+ .WithValueText({30, EAlign::Center, COLOR_NAM_3})));
// pGraphics->AttachControl(new IVBakedPresetManagerControl(modelArea, style.WithValueText({DEFAULT_TEXT_SIZE, EVAlign::Middle, COLOR_WHITE})));
@@ -141,46 +192,44 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
});
};
- pGraphics->AttachControl(new IVPanelControl(modelArea, "", style.WithColor(kFG, COLOR_YELLOW.WithContrast(-0.75))));
+ // Tells us what model is loaded
+ pGraphics->AttachControl(new IVPanelControl(modelArea, "", style.WithColor(kFG, COLOR_NAM_1))); // .WithContrast(-0.75)
pGraphics->AttachControl(new IRolloverSVGButtonControl(modelArea.GetFromLeft(30).GetPadded(-2.f), loadModel, folderSVG));
pGraphics->AttachControl(new IVUpdateableLabelControl(modelArea.GetReducedFromLeft(30), "Default model", style.WithDrawFrame(false).WithValueText(style.valueText.WithVAlign(EVAlign::Middle))), kCtrlTagModelName);
pGraphics->AttachControl(new IVKnobControl(knobs.GetGridCell(0, 0, 1, kNumParams).GetPadded(-10), kInputGain, "", style));
pGraphics->AttachControl(new IVKnobControl(knobs.GetGridCell(0, 1, 1, kNumParams).GetPadded(-10), kOutputGain, "", style));
- pGraphics->AttachControl(new IVKnobControl(knobs.GetGridCell(0, 2, 1, kNumParams).GetPadded(-10), kParametricTone, "", style))->SetDisabled(true);
- pGraphics->AttachControl(new IVKnobControl(knobs.GetGridCell(0, 3, 1, kNumParams).GetPadded(-10), kParametricDrive, "", style))->SetDisabled(true);
- pGraphics->AttachControl(new IVKnobControl(knobs.GetGridCell(0, 4, 1, kNumParams).GetPadded(-10), kParametricLevel, "", style))->SetDisabled(true);
pGraphics->AttachControl(new IVPeakAvgMeterControl(meterArea, "", style.WithWidgetFrac(0.5)
.WithShowValue(false)
- .WithColor(kFG, COLOR_GREEN), EDirection::Horizontal, {}, 0, -60.f, 12.f, {}), kCtrlTagMeter)
+ .WithColor(kFG, COLOR_NAM_2), EDirection::Horizontal, {}, 0, -60.f, 12.f, {}), kCtrlTagMeter)
->As<IVPeakAvgMeterControl<>>()->SetPeakSize(2.0f);
pGraphics->AttachControl(new IVAboutBoxControl(
new IRolloverCircleSVGButtonControl(mainArea.GetFromTRHC(50, 50).GetCentredInside(20, 20), DefaultClickActionFunc, helpSVG),
new IPanelControl(IRECT(),
// COLOR_LIGHT_GRAY,
- IPattern::CreateLinearGradient(b, EDirection::Vertical, { {COLOR_WHITE, 0.f}, {COLOR_BLACK, 1.f} }),
+ IPattern::CreateLinearGradient(b, EDirection::Vertical, { {COLOR_NAM_3, 0.f}, {COLOR_NAM_1, 1.f} }),
false, // draw frame
// AttachFunc
[style](IContainerBase* pParent, const IRECT& r) {
- pParent->AddChildControl(new IVPanelControl(IRECT(), "", style.WithColor(kFR, COLOR_BLACK).WithColor(kFG, COLOR_LIGHT_GRAY.WithOpacity(-0.75))));
+ pParent->AddChildControl(new IVPanelControl(IRECT(), "", style.WithColor(kFR, COLOR_NAM_3.WithOpacity(0.1)).WithColor(kFG, COLOR_NAM_1.WithOpacity(0.1))));
pParent->AddChildControl(new IVLabelControl(IRECT(), "Neural Amp Modeler", style
.WithDrawFrame(false)
- .WithValueText({30, EAlign::Center, COLOR_BLACK})));
+ .WithValueText({30, EAlign::Center, COLOR_HELP_TEXT})));
WDL_String versionStr {"Version "};
versionStr.Append(PLUG_VERSION_STR);
pParent->AddChildControl(new IVLabelControl(IRECT(), versionStr.Get(), style
.WithDrawFrame(false)
- .WithValueText({DEFAULT_TEXT_SIZE, EAlign::Center, COLOR_BLACK})));
+ .WithValueText({DEFAULT_TEXT_SIZE, EAlign::Center, COLOR_HELP_TEXT })));
pParent->AddChildControl(new IVLabelControl(IRECT(), "By Steven Atkinson", style
.WithDrawFrame(false)
- .WithValueText({DEFAULT_TEXT_SIZE, EAlign::Center, COLOR_BLACK})));
+ .WithValueText({DEFAULT_TEXT_SIZE, EAlign::Center, COLOR_HELP_TEXT})));
pParent->AddChildControl(new IURLControl(IRECT(),
"Train your own model",
- "https://github.com/sdatkinson/neural-amp-modeler", {DEFAULT_TEXT_SIZE, COLOR_BLACK}));
+ "https://github.com/sdatkinson/neural-amp-modeler", {DEFAULT_TEXT_SIZE, COLOR_HELP_TEXT }));
},
// ResizeFunc
[](IContainerBase* pParent, const IRECT& r) {
diff --git a/NeuralAmpModeler/NeuralAmpModeler.h b/NeuralAmpModeler/NeuralAmpModeler.h
@@ -14,9 +14,6 @@ enum EParams
{
kInputGain = 0,
kOutputGain,
- kParametricDrive,
- kParametricLevel,
- kParametricTone,
kNumParams
};
@@ -50,10 +47,7 @@ private:
std::unordered_map<std::string, double> mDSPParams = {
{ "Input", 0.0 },
- { "Output", 0.0 },
- { "Drive", 0.0 },
- { "Level", 0.0 },
- { "Tone" , 0.0 }
+ { "Output", 0.0 }
};
iplug::IPeakAvgSender<> mSender;
diff --git a/NeuralAmpModeler/config.h b/NeuralAmpModeler/config.h
@@ -1,10 +1,10 @@
#define PLUG_NAME "NeuralAmpModeler"
-#define PLUG_MFR "StevenAtkinson"
-#define PLUG_VERSION_HEX 0x00000505
-#define PLUG_VERSION_STR "0.5.5"
+#define PLUG_MFR "Steven Atkinson"
+#define PLUG_VERSION_HEX 0x00000506
+#define PLUG_VERSION_STR "0.5.6"
#define PLUG_UNIQUE_ID '1YEo'
#define PLUG_MFR_ID 'SDAa'
-#define PLUG_URL_STR "https://github.com/olilarkin/NeuralAmpModeler"
+#define PLUG_URL_STR "https://github.com/sdatkinson/NeuralAmpModelerPlugin"
#define PLUG_EMAIL_STR "[email protected]"
#define PLUG_COPYRIGHT_STR "Copyright 2022 Steven Atkinson"
#define PLUG_CLASS_NAME NeuralAmpModeler
diff --git a/NeuralAmpModeler/installer/NeuralAmpModeler.iss b/NeuralAmpModeler/installer/NeuralAmpModeler.iss
@@ -5,7 +5,7 @@ AppCopyright=Copyright (C) 2020 MANUFACTURER
AppPublisher=MANUFACTURER
AppPublisherURL=http://www.spam.com
AppSupportURL=http://www.spam.com
-AppVersion=0.5.5
+AppVersion=0.5.6
VersionInfoVersion=1.0.0
DefaultDirName={pf}\NeuralAmpModeler
DefaultGroupName=NeuralAmpModeler
diff --git a/NeuralAmpModeler/installer/changelog.txt b/NeuralAmpModeler/installer/changelog.txt
@@ -1,4 +1,5 @@
NeuralAmpModeler changelog
-www.acmeinc.com
+https://github.com/sdatkinson/NeuralAmpModelerPlugin
00/00/0000 - v0.5.5 Tweak UI
+12/10/2022 - v0.5.6 Tweak UI
diff --git a/NeuralAmpModeler/installer/intro.rtf b/NeuralAmpModeler/installer/intro.rtf
Binary files differ.
diff --git a/NeuralAmpModeler/installer/known-issues.txt b/NeuralAmpModeler/installer/known-issues.txt
@@ -1,4 +1 @@
-NeuralAmpModeler changelog
-www.acmeinc.com
-
-00/00/00 - v1.00 initial release
-\ No newline at end of file
+For known issues, see https://github.com/sdatkinson/NeuralAmpModelerPlugin/issues.
+\ No newline at end of file
diff --git a/NeuralAmpModeler/installer/license.rtf b/NeuralAmpModeler/installer/license.rtf
Binary files differ.
diff --git a/NeuralAmpModeler/installer/readme-mac.rtf b/NeuralAmpModeler/installer/readme-mac.rtf
Binary files differ.
diff --git a/NeuralAmpModeler/installer/readme-win-demo.rtf b/NeuralAmpModeler/installer/readme-win-demo.rtf
Binary files differ.
diff --git a/NeuralAmpModeler/installer/readme-win.rtf b/NeuralAmpModeler/installer/readme-win.rtf
Binary files differ.
diff --git a/README.md b/README.md
@@ -1,10 +1,11 @@
# Neural Amp Modeler Plug-in
-A VST3/AudioUnit plug-in* for [Neural Amp Modeler](https://github.com/sdatkinson/neural-amp-modeler), built with [iPlug2](https://iplug2.github.io).
+A VST3/AudioUnit plug-in\* for [Neural Amp Modeler](https://github.com/sdatkinson/neural-amp-modeler), built with [iPlug2](https://iplug2.github.io).
-* https://www.youtube.com/user/RunawayThumbtack
-* https://github.com/sdatkinson/neural-amp-modeler
+- https://www.youtube.com/user/RunawayThumbtack
+- https://github.com/sdatkinson/neural-amp-modeler
-This is a cleaned up version of [this repo](https://github.com/sdatkinson/iPlug2) to show the original authors a better way of doing their iPlug2 project :-)
+This is a cleaned up version of [the original iPlug2-based NAM plugin](https://github.com/sdatkinson/iPlug2) with some refactoring to adopt better practices recommended by the developers of iPlug2.
+(Thanks [Oli](https://github.com/olilarkin) for your generous suggestions!)
-* could also support VST2, AAX, CLAP, Linux, iOS soon
+\*could also support VST2, AAX, CLAP, Linux, iOS soon.
diff --git a/bump_version.py b/bump_version.py
@@ -8,67 +8,85 @@ import semver
IPLUG2_ROOT = "iPlug2"
PROJECT_ROOT = "NeuralAmpModeler"
-PROJECT_SCRIPTS = PROJECT_ROOT + "/scripts"
+PROJECT_SCRIPTS = os.path.join(PROJECT_ROOT, "scripts")
+
def replacestrs(filename, s, r):
- files = glob.glob(filename)
- print("replacing " + s + " with " + r + " in " + filename)
+ files = glob.glob(filename)
+ print("replacing " + s + " with " + r + " in " + filename)
+
+ for line in fileinput.input(files, inplace=1):
+ line = line.replace(s, r)
+ sys.stdout.write(line)
- for line in fileinput.input(files,inplace=1):
- line = line.replace(s, r)
- sys.stdout.write(line)
-sys.path.insert(0, os.path.join(os.getcwd(), IPLUG2_ROOT + "/Scripts"))
+sys.path.insert(0, os.path.join(os.getcwd(), IPLUG2_ROOT, "Scripts"))
from parse_config import parse_config
+
def main():
- config = parse_config(PROJECT_ROOT)
- versionStr = config['FULL_VER_STR']
- currentVersionInfo = semver.VersionInfo.parse(versionStr)
- print("current version in config.h: v" + versionStr)
-
- if len(sys.argv) == 2:
- if sys.argv[1] == 'major':
- newVersionInfo = currentVersionInfo.bump_major()
- elif sys.argv[1] == 'minor':
- newVersionInfo = currentVersionInfo.bump_minor()
- elif sys.argv[1] == 'patch':
- newVersionInfo = currentVersionInfo.bump_patch()
+ config = parse_config(PROJECT_ROOT)
+ versionStr = config["FULL_VER_STR"]
+ currentVersionInfo = semver.VersionInfo.parse(versionStr)
+ print("current version in config.h: v" + versionStr)
+
+ if len(sys.argv) == 2:
+ if sys.argv[1] == "major":
+ newVersionInfo = currentVersionInfo.bump_major()
+ elif sys.argv[1] == "minor":
+ newVersionInfo = currentVersionInfo.bump_minor()
+ elif sys.argv[1] == "patch":
+ newVersionInfo = currentVersionInfo.bump_patch()
+ else:
+ newVersionInfo = currentVersionInfo
else:
- newVersionInfo = currentVersionInfo
- else:
- print("Please supply an argument major, minor or patch")
- exit()
-
- newVersionInt = (newVersionInfo.major << 16 & 0xFFFF0000) + (newVersionInfo.minor << 8 & 0x0000FF00) + (newVersionInfo.patch & 0x000000FF)
-
- replacestrs(PROJECT_ROOT + "/config.h", '#define PLUG_VERSION_STR "' + versionStr + '"', '#define PLUG_VERSION_STR "' + str(newVersionInfo) + '"')
- replacestrs(PROJECT_ROOT + "/config.h", '#define PLUG_VERSION_HEX ' + config['PLUG_VERSION_HEX'], '#define PLUG_VERSION_HEX ' + '0x{:08x}'.format(newVersionInt))
-
- os.system("cd " + PROJECT_SCRIPTS + "; python3 update_version-mac.py")
- os.system("cd " + PROJECT_SCRIPTS + "; python3 update_version-ios.py")
- os.system("cd " + PROJECT_SCRIPTS + "; python3 update_installer-win.py 0")
-
- print("\nCurrent changelog: \n--------------------")
- os.system("cat " + PROJECT_ROOT + "/installer/changelog.txt")
- print("\n\n--------------------")
-
- edit = input("\nEdit changelog? Y/N: ")
-
- if edit == 'y' or edit == 'Y':
- os.system("vim " + PROJECT_ROOT + "/installer/changelog.txt")
-
- print("\nNew changelog: \n--------------------")
- os.system("cat " + PROJECT_ROOT + "/installer/changelog.txt")
- print("\n\n--------------------");
-
- edit = input("\nTag version and git push to origin (will prompt for commit message)? Y/N: ")
-
- if edit == 'y' or edit == 'Y':
- os.system("git commit -a --allow-empty")
- os.system("git tag v" + str(newVersionInfo))
- os.system("git push && git push --tags")
-
-if __name__ == '__main__':
- main()
+ print("Please supply an argument major, minor or patch")
+ exit()
+
+ newVersionInt = (
+ (newVersionInfo.major << 16 & 0xFFFF0000)
+ + (newVersionInfo.minor << 8 & 0x0000FF00)
+ + (newVersionInfo.patch & 0x000000FF)
+ )
+
+ replacestrs(
+ os.path.join(PROJECT_ROOT, "config.h"),
+ '#define PLUG_VERSION_STR "' + versionStr + '"',
+ '#define PLUG_VERSION_STR "' + str(newVersionInfo) + '"',
+ )
+ replacestrs(
+ os.path.join(PROJECT_ROOT, "config.h"),
+ "#define PLUG_VERSION_HEX " + config["PLUG_VERSION_HEX"],
+ "#define PLUG_VERSION_HEX " + "0x{:08x}".format(newVersionInt),
+ )
+
+ os.system("cd " + PROJECT_SCRIPTS + "; python3 update_version-mac.py")
+ os.system("cd " + PROJECT_SCRIPTS + "; python3 update_version-ios.py")
+ os.system("cd " + PROJECT_SCRIPTS + "; python3 update_installer-win.py 0")
+
+ print("\nCurrent changelog: \n--------------------")
+ os.system("cat " + os.path.join(PROJECT_ROOT, "installer", "changelog.txt"))
+ print("\n\n--------------------")
+
+ edit = input("\nEdit changelog? Y/N: ")
+
+ if edit == "y" or edit == "Y":
+ os.system("vim " + os.path.join(PROJECT_ROOT, "installer", "changelog.txt"))
+
+ print("\nNew changelog: \n--------------------")
+ os.system("cat " + os.path.join(PROJECT_ROOT, "installer", "changelog.txt"))
+ print("\n\n--------------------")
+
+ edit = input(
+ "\nTag version and git push to origin (will prompt for commit message)? Y/N: "
+ )
+
+ if edit == "y" or edit == "Y":
+ os.system("git commit -a --allow-empty")
+ os.system("git tag v" + str(newVersionInfo))
+ os.system("git push && git push --tags")
+
+
+if __name__ == "__main__":
+ main()