WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
RGBAEffectBase.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
6 using System.Xml.Serialization;
7 using DirectOutput.Cab.Toys;
9 
10 namespace DirectOutput.FX.RGBAFX
11 {
15  public abstract class RGBAEffectBase:EffectBase
16  {
17  protected Table.Table Table;
18 
19  private string _ToyName;
20 
21 
28  public string ToyName
29  {
30  get { return _ToyName; }
31  set
32  {
33  if (_ToyName != value)
34  {
35  _ToyName = value;
36  RGBAToy = null;
37  Layer = null;
38  }
39  }
40  }
41 
42 
43  [XmlIgnoreAttribute]
44  protected RGBAColor Layer { get; private set; }
45 
46 
47 
48  private int _LayerNr=0;
49 
56  public int LayerNr
57  {
58  get { return _LayerNr; }
59  set { _LayerNr = value; }
60  }
61 
62 
63 
64  private IRGBAToy _RGBAToy;
65 
70  [XmlIgnoreAttribute]
71  public IRGBAToy RGBAToy
72  {
73  get
74  {
75  return _RGBAToy;
76  }
77  private set
78  {
79  _RGBAToy = value;
80  }
81  }
82 
83 
89  public override void Init(Table.Table Table)
90  {
91  this.Table = Table;
92  if (!ToyName.IsNullOrWhiteSpace() && Table.Pinball.Cabinet.Toys.Contains(ToyName))
93  {
94  if (Table.Pinball.Cabinet.Toys[ToyName] is IRGBAToy)
95  {
96  RGBAToy = (IRGBAToy)Table.Pinball.Cabinet.Toys[ToyName];
97  Layer = RGBAToy.Layers[LayerNr];
98  }
99 
100  }
101  }
102 
106  public override void Finish()
107  {
108  this.Layer = null;
109  this.RGBAToy = null;
110  this.Table = null;
111 
112  base.Finish();
113  }
114 
115  }
116 }
This class stores information on colors used for toys and effects (e.g. RGBLed).
Definition: RGBAColor.cs:14
The namespace DirectOutput.Cab.Toys contains all toy related classes.
LayerDictionary< RGBAColor > Layers
Gets the dictionary of RGBALayers.
Definition: RGBAToy.cs:30
override void Init(Table.Table Table)
Initializes the RGBA effect. Resolves the name of the RGBA toy.
Base class for effects using RGBA toys
Common interface for RGB toys supporting several layers of color with alpha value.
Definition: IRGBAToy.cs:9
Abstract base class for IEffect objects. This class inherits NamedItemBase and implements IEffect...
Definition: EffectBase.cs:15
The namespace DirectOutput.Cab contains all cabinet related classes like the Cabinet class itself...
Definition: Cab.cs:16
override void Finish()
Finishes the RGBA effect.
override void Finish()
Finishes the RGBALed toy. Resets the the toy and releases all references.
Definition: RGBAToy.cs:191
Namespace for objects dealing with layers
Thie RGBAToy controls RGB leds and other gadgets displaying RGB colors. The RGBAToy has multilayer ...
Definition: RGBAToy.cs:19
The namespace DirectOutput.General contains classes for general use.