Skip to content

Commit

Permalink
Spell errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hww committed Feb 16, 2019
1 parent 8583701 commit 90c5757
Show file tree
Hide file tree
Showing 14 changed files with 4,261 additions and 4,028 deletions.
8,038 changes: 4,159 additions & 3,879 deletions Prefabs/Oscilloscope.prefab

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions Src/OscChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace VARP.OSC
{
[System.Serializable]
public class OscChannel : MonoBehaviour, IRenderableGUI, IRenderable, IPluggable
public class OscChannel : MonoBehaviour, IRenderGUI, IRender, IPlug
{
/// <summary>Channel names</summary>
public enum Name
Expand Down Expand Up @@ -368,7 +368,7 @@ public float Gain
}
}

/// <summary>Inrease gain</summary>
/// <summary>Increase gain</summary>
public void GainPlus()
{
var index = OscValue.Gain.GetValueIndex(gain);
Expand All @@ -385,35 +385,35 @@ public void GainMinus()
/// <summary>Set or get gain of the channel</summary>
public float Scale
{
get { return scale; }
get => scale;
set { Gain = 1f / value; }
}

/// <summary>Change position of the level</summary>
public float Position
{
get { return position; }
get => position;
set { position = value; isDirtyConfigText = true; }
}

/// <summary>Change AC/DC mode</summary>
public bool Decoupling
{
get { return decoupling; }
get => decoupling;
set { decoupling = value; isDirtyConfigText = true; }
}

/// <summary>Change AutoGain controll</summary>
/// <summary>Change AutoGain control</summary>
public bool AutoGain
{
get { return autoGain; }
get => autoGain;
set { autoGain = value; isDirtyConfigText = true; }
}

/// <summary>Rendering style</summary>
public OscProbe.Style Style
{
get { return style; }
get => style;
set { style = value; isDirtyConfigText = true; }
}

Expand All @@ -423,13 +423,13 @@ public OscProbe.Style Style
// channel's oscillogram
// =============================================================================================================

private List<OscChannelLabel> valueLabels = new List<OscChannelLabel>(10);
private readonly List<OscChannelLabel> valueLabels = new List<OscChannelLabel>(10);


/// <summary>Add vertical (value) label</summary>
public void AddValueLabel(string text, float y)
{
var label = oscilloscope.valueLables.SpawnLabel();
var label = oscilloscope.valueLabels.SpawnLabel();
label.text = text;
label.color = color;
label.position = y;
Expand All @@ -442,11 +442,11 @@ public void AddValueLabel(string text, float y)
private void ClearLabels()
{
for (var i=0; i<valueLabels.Count; i++)
oscilloscope.valueLables.Release(valueLabels[i]);
oscilloscope.valueLabels.Release(valueLabels[i]);
}
}

public interface IRenderable
public interface IRender
{
/// <summary>Render this channel</summary>
/// <param name="renderer"></param>
Expand All @@ -457,15 +457,15 @@ public interface IRenderable
void Render(OscRenderer renderer, int smpBeg, int smpEnd, float pixStart, float smpScaleToPixels);
}

public interface IRenderableGUI
public interface IRenderGUI
{
/// <summary>
/// Render gui widgets of this channel
/// </summary>
void RenderGUI();
}

public interface IPluggable
public interface IPlug
{
/// <summary>Update parameters of channel from the probe</summary>
void Plug(OscProbe probe);
Expand Down
30 changes: 6 additions & 24 deletions Src/OscChannelLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ public class OscChannelLabel : MonoBehaviour
private bool _visible;
public bool visible
{
get
{
return _visible;
}
get => _visible;
set
{
_visible = value;
Expand All @@ -53,10 +50,7 @@ public bool visible
private Color _color;
public Color color
{
get
{
return _color;
}
get => _color;
set
{
_color = value;
Expand All @@ -66,26 +60,14 @@ public Color color

public string text
{
get
{
return label.text;
}
set
{
label.text = value;
}
get => label.text;
set => label.text = value;
}

public Vector2 anchoredPosition
{
get
{
return rect.anchoredPosition;
}
set
{
rect.anchoredPosition = value;
}
get => rect.anchoredPosition;
set => rect.anchoredPosition = value;
}

}
Expand Down
31 changes: 6 additions & 25 deletions Src/OscCursorLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@ public class OscCursorLabel : MonoBehaviour
public Text label;
public Image image;
public RawImage line;
public Vector2 gridPosition;

public bool visible
{
get
{
return label.enabled;
}
get => label.enabled;
set
{
label.enabled = value;
Expand All @@ -51,10 +47,7 @@ public bool visible

public Color color
{
get
{
return label.color;
}
get => label.color;
set
{
label.color = value;
Expand All @@ -65,26 +58,14 @@ public Color color

public string text
{
get
{
return label.text;
}
set
{
label.text = value;
}
get => label.text;
set => label.text = value;
}

public Vector2 anchoredPosition
{
get
{
return rect.anchoredPosition;
}
set
{
rect.anchoredPosition = value;
}
get => rect.anchoredPosition;
set => rect.anchoredPosition = value;
}
}
}
4 changes: 2 additions & 2 deletions Src/OscFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class OscFont {

// Constant: font8x8_basic
// Contains an 8x8 font map for unicode points U+0000 - U+007F (basic latin)
public static readonly byte[] font8x8_basic = new byte[] {
private static readonly byte[] font8x8_basic = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // U+0000 (nul)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // U+0001
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // U+0002
Expand Down Expand Up @@ -169,7 +169,7 @@ public static void DrawChar(Texture2D texture, char c, int x, int y, Color color

y += 8;

var glyphIdx = (((int)c) & 0x7F) * 8;
var glyphIdx = (c & 0x7F) * 8;

for (var i = 0; i < 8; i++)
{
Expand Down
10 changes: 5 additions & 5 deletions Src/OscGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ void Update()
private bool drawGrid;
public bool DrawGrid
{
get { return drawGrid; }
get => drawGrid;
set { drawGrid = value; redraw = true; }
}

private bool drawRulerX;
public bool DrawRulerX
{
get { return drawRulerX; }
get => drawRulerX;
set { drawRulerX = value; redraw = true; }
}

private bool drawRulerY;
public bool DrawRulerY
{
get { return drawRulerY; }
get => drawRulerY;
set { drawRulerY = value; redraw = true; }
}

Expand All @@ -96,8 +96,8 @@ public bool DrawRulerY
/// <param name="color">Grid color</para>
public void Clear(Color color)
{
var w = (int) oscSettings.textureSize.x;
var h = (int) oscSettings.textureSize.y;
var w = oscSettings.textureSize.x;
var h = oscSettings.textureSize.y;
if (screenTexture == null)
{
CreateTexture(w, h, color);
Expand Down
15 changes: 5 additions & 10 deletions Src/OscLabelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void OnEnable()
freeLabels.Add(label);
for (var i = 1; i < labelsNumber; i++)
{
var instance = Instantiate(label.gameObject) as GameObject;
var instance = Instantiate(label.gameObject);
instance.transform.SetParent(transform, true);
instance.transform.localScale = new Vector3(1,1,1);
var instanceLabel = instance.GetComponent<OscChannelLabel>();
Expand All @@ -53,17 +53,12 @@ private void OnEnable()
public OscChannelLabel SpawnLabel()
{
if (freeLabels.Count == 0)
{
throw new SystemException("OscLabelManager.SpawnLabel reached limit if labels quantity.");
}
else
{
var last = freeLabels.Count - 1;
var label = freeLabels[last];
freeLabels.RemoveAt(freeLabels.Count - 1);

return label;
}
var last = freeLabels.Count - 1;
var label = freeLabels[last];
freeLabels.RemoveAt(freeLabels.Count - 1);
return label;
}

public void Release(OscChannelLabel label)
Expand Down
2 changes: 1 addition & 1 deletion Src/OscLed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void Start ()

public bool State
{
get { return state; }
get => state;
set {
state = value;
image.color = state ? colorOn : colorOff;
Expand Down
16 changes: 8 additions & 8 deletions Src/OscProbe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
namespace VARP.OSC
{
/// <summary>
/// The base class for all input. It is model of the oscilloscope's cable probe.
/// Also it has default settings for oscilloscope's channel. And when we will
/// plug input to the channel those settings will be applied to the channel.
/// The base class for all input. It is model of the oscilloscope's cable probe.
/// Also it has default settings for oscilloscope's channel. And when we will
/// plug input to the channel those settings will be applied to the channel.
/// </summary>
public class OscProbe
{
Expand Down Expand Up @@ -91,8 +91,8 @@ public enum Style { Default, Logic }
/// <summary>The gain (values per division)</summary>
public float Gain
{
get { return gain; }
set { gain = OscValue.Gain.GetValue(value); }
get => gain;
set => gain = OscValue.Gain.GetValue(value);
}

// =============================================================================================================
Expand Down Expand Up @@ -150,7 +150,7 @@ public void Log(Color value) {
public OscProbe(string name)
{
this.name = name;
// defalut method read all sample
// default method read all sample
this.readSample = null;
// default method read x value can be: this.readTriggerSample = (OscChannel channel) => channel.sample.x;
// but using X component is default function of readTriggerSample is null
Expand All @@ -165,7 +165,7 @@ public OscProbe(string name)
}

/// <summary>
/// Simple sine wave input
/// Simple sine wave input
/// </summary>
public class OscSineProbe : OscProbe
{
Expand All @@ -186,7 +186,7 @@ public OscSineProbe(string name, float frequence = 10f, float amplitude = 1f) :
}

/// <summary>
/// Simple square form wave input
/// Simple square form wave input
/// </summary>
public class OscSquareProbe : OscProbe
{
Expand Down
Loading

0 comments on commit 90c5757

Please sign in to comment.