2017-11-25 21:03:18 +00:00
|
|
|
|
|
|
|
class ReverbEdit : OptionMenu
|
|
|
|
{
|
|
|
|
static native double GetValue(int index);
|
2017-11-26 09:16:21 +00:00
|
|
|
static native double SetValue(int index, double value);
|
2017-11-25 21:03:18 +00:00
|
|
|
static native bool GrayCheck();
|
|
|
|
static native string, int GetSelectedEnvironment();
|
2017-11-26 13:13:56 +00:00
|
|
|
static native void FillSelectMenu(String ccmd, OptionMenuDescriptor desc);
|
2017-11-25 21:03:18 +00:00
|
|
|
|
|
|
|
override void Init(Menu parent, OptionMenuDescriptor desc)
|
|
|
|
{
|
|
|
|
super.Init(parent, desc);
|
|
|
|
OnReturn();
|
|
|
|
}
|
|
|
|
|
|
|
|
override void OnReturn()
|
|
|
|
{
|
|
|
|
string env;
|
|
|
|
int id;
|
|
|
|
|
|
|
|
[env, id] = GetSelectedEnvironment();
|
|
|
|
|
|
|
|
let li = GetItem('EvironmentName');
|
|
|
|
if (li != NULL)
|
|
|
|
{
|
|
|
|
if (id != -1)
|
|
|
|
{
|
|
|
|
li.SetValue(0, 1);
|
|
|
|
li.SetString(0, env);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
li.SetValue(0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
li = GetItem('EvironmentID');
|
|
|
|
if (li != NULL)
|
|
|
|
{
|
|
|
|
if (id != -1)
|
|
|
|
{
|
|
|
|
li.SetValue(0, 1);
|
|
|
|
li.SetString(0, String.Format("%d, %d", (id >> 8) & 255, id & 255));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
li.SetValue(0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ReverbSelect : OptionMenu
|
|
|
|
{
|
|
|
|
//=============================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
override void Init(Menu parent, OptionMenuDescriptor desc)
|
|
|
|
{
|
2017-11-26 13:13:56 +00:00
|
|
|
ReverbEdit.FillSelectMenu("selectenvironment", desc);
|
2017-11-25 21:03:18 +00:00
|
|
|
super.Init(parent, desc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
//
|
|
|
|
// opens a submenu, command is a submenu name
|
|
|
|
//
|
|
|
|
//=============================================================================
|
|
|
|
|
2017-11-26 13:13:56 +00:00
|
|
|
class OptionMenuItemReverbSelect : OptionMenuItemSubMenu
|
2017-11-25 21:03:18 +00:00
|
|
|
{
|
2017-11-26 13:13:56 +00:00
|
|
|
OptionMenuItemReverbSelect Init(String label, Name command)
|
2017-11-25 21:03:18 +00:00
|
|
|
{
|
|
|
|
Super.init(label, command, 0, false);
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected)
|
|
|
|
{
|
|
|
|
int x = drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor);
|
|
|
|
|
2017-11-26 13:13:56 +00:00
|
|
|
String text = ReverbEdit.GetSelectedEnvironment();
|
|
|
|
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true);
|
2017-11-25 21:03:18 +00:00
|
|
|
|
|
|
|
return indent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//=============================================================================
|
|
|
|
|
2017-11-26 09:16:21 +00:00
|
|
|
class OptionMenuItemReverbOption : OptionMenuItemOptionBase
|
|
|
|
{
|
|
|
|
int mValIndex;
|
|
|
|
|
|
|
|
OptionMenuItemReverbOption Init(String label, int valindex, Name values)
|
|
|
|
{
|
|
|
|
Super.Init(label, "", values, null, false);
|
|
|
|
mValIndex = valindex;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
override bool isGrayed()
|
|
|
|
{
|
|
|
|
return ReverbEdit.GrayCheck();
|
|
|
|
}
|
|
|
|
|
|
|
|
override int GetSelection()
|
|
|
|
{
|
|
|
|
return int(ReverbEdit.GetValue(mValIndex));
|
|
|
|
}
|
|
|
|
|
|
|
|
override void SetSelection(int Selection)
|
|
|
|
{
|
|
|
|
ReverbEdit.SetValue(mValIndex, Selection);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
class OptionMenuItemSliderReverbEditOption : OptionMenuSliderBase
|
2017-11-25 21:03:18 +00:00
|
|
|
{
|
|
|
|
int mValIndex;
|
|
|
|
String mEditValue;
|
|
|
|
TextEnterMenu mEnter;
|
|
|
|
|
2017-11-26 09:16:21 +00:00
|
|
|
OptionMenuItemSliderReverbEditOption Init(String label, double min, double max, double step, int showval, int valindex)
|
2017-11-25 21:03:18 +00:00
|
|
|
{
|
|
|
|
Super.Init(label, min, max, step, showval);
|
|
|
|
mValIndex = valindex;
|
|
|
|
mEnter = null;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override double GetSliderValue()
|
|
|
|
{
|
|
|
|
return ReverbEdit.GetValue(mValIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
override void SetSliderValue(double val)
|
|
|
|
{
|
|
|
|
ReverbEdit.SetValue(mValIndex, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
override bool Selectable()
|
|
|
|
{
|
2017-11-26 09:16:21 +00:00
|
|
|
return !ReverbEdit.GrayCheck();
|
2017-11-25 21:03:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual String Represent()
|
|
|
|
{
|
|
|
|
return mEnter.GetText() .. SmallFont.GetCursor();
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected)
|
|
|
|
{
|
2017-11-26 19:11:14 +00:00
|
|
|
drawLabel(indent, y, selected ? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, ReverbEdit.GrayCheck());
|
2017-11-25 21:03:18 +00:00
|
|
|
|
2017-12-03 12:06:23 +00:00
|
|
|
mDrawX = indent + CursorSpace();
|
2017-11-25 21:03:18 +00:00
|
|
|
if (mEnter)
|
|
|
|
{
|
2017-12-03 12:06:23 +00:00
|
|
|
screen.DrawText(SmallFont, OptionMenuSettings.mFontColorValue, mDrawX, y, Represent(), DTA_CleanNoMove_1, true);
|
2017-11-25 21:03:18 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-12-03 12:06:23 +00:00
|
|
|
DrawSlider (mDrawX, y, mMin, mMax, GetSliderValue(), mShowValue, indent);
|
2017-11-25 21:03:18 +00:00
|
|
|
}
|
|
|
|
return indent;
|
|
|
|
}
|
|
|
|
|
|
|
|
override bool MenuEvent (int mkey, bool fromcontroller)
|
|
|
|
{
|
|
|
|
if (mkey == Menu.MKEY_Enter)
|
|
|
|
{
|
|
|
|
Menu.MenuSound("menu/choose");
|
|
|
|
mEnter = TextEnterMenu.Open(Menu.GetCurrentMenu(), String.Format("%.3f", GetSliderValue()), -1, 2, fromcontroller);
|
|
|
|
mEnter.ActivateMenu();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if (mkey == Menu.MKEY_Input)
|
|
|
|
{
|
|
|
|
String val = mEnter.GetText();
|
|
|
|
SetSliderValue(val.toDouble());
|
|
|
|
mEnter = null;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if (mkey == Menu.MKEY_Abort)
|
|
|
|
{
|
|
|
|
mEnter = null;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Super.MenuEvent(mkey, fromcontroller);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|