Skip to content

Commit 0865bed

Browse files
authored
Un-reverse message box string and caption on macOS (#427)
1 parent 0b9ebc5 commit 0865bed

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

NeuralAmpModeler/NeuralAmpModeler.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ const IVStyle style =
5353
const IVStyle titleStyle =
5454
DEFAULT_STYLE.WithValueText(IText(30, COLOR_WHITE, "Michroma-Regular")).WithDrawFrame(false).WithShadowOffset(2.f);
5555

56+
EMsgBoxResult _ShowMessageBox(iplug::igraphics::IGraphics* pGraphics, const char* str, const char* caption,
57+
EMsgBoxType type)
58+
{
59+
#ifdef OS_MAC
60+
// Apple is backwards?
61+
return pGraphics->ShowMessageBox(caption, str, type);
62+
#elif defined OS_WIN
63+
return pGraphics->ShowMessageBox(str, caption, type);
64+
#else
65+
#error NOT IMPLEMENTED
66+
#endif
67+
}
68+
5669

5770
NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
5871
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
@@ -165,7 +178,7 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
165178
{
166179
std::stringstream ss;
167180
ss << "Failed to load NAM model. Message:\n\n" << msg;
168-
GetUI()->ShowMessageBox(ss.str().c_str(), "Failed to load model!", kMB_OK);
181+
_ShowMessageBox(GetUI(), ss.str().c_str(), "Failed to load model!", kMB_OK);
169182
}
170183
std::cout << "Loaded: " << fileName.Get() << std::endl;
171184
}
@@ -183,7 +196,7 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
183196
message << "Failed to load IR file " << fileName.Get() << ":\n";
184197
message << dsp::wav::GetMsgForLoadReturnCode(retCode);
185198

186-
GetUI()->ShowMessageBox(message.str().c_str(), "Failed to load IR!", kMB_OK);
199+
_ShowMessageBox(GetUI(), message.str().c_str(), "Failed to load IR!", kMB_OK);
187200
}
188201
}
189202
};

0 commit comments

Comments
 (0)