-Strip::Strip (const std::string& name, int index)
- : Group (name)
- , _solo (0)
- , _recenable (0)
- , _mute (0)
- , _select (0)
- , _vselect (0)
- , _fader_touch (0)
- , _vpot (0)
- , _gain (0)
- , _index (index)
-{
- /* master strip only */
-}
-
-Strip::Strip (Surface& surface, const std::string& name, int index, int unit_index, StripControlDefinition* ctls)
- : Group (name)
- , _solo (0)
- , _recenable (0)
- , _mute (0)
- , _select (0)
- , _vselect (0)
- , _fader_touch (0)
- , _vpot (0)
- , _gain (0)
- , _index (index)
-{
- /* build the controls for this track, which will automatically add them
- to the Group
- */
-
- for (uint32_t i = 0; ctls[i].name[0]; ++i) {
- ctls[i].factory (surface, ctls[i].base_id + unit_index, unit_index+1, ctls[i].name, *this);
- }
-}
-
-/**
- TODO could optimise this to use enum, but it's only
- called during the protocol class instantiation.
-*/
-void Strip::add (Control & control)
-{
- Group::add (control);
-
- if (control.name() == "gain") {
- _gain = reinterpret_cast<Fader*>(&control);
- } else if (control.name() == "vpot") {
- _vpot = reinterpret_cast<Pot*>(&control);
- } else if (control.name() == "recenable") {
- _recenable = reinterpret_cast<Button*>(&control);
- } else if (control.name() == "solo") {
- _solo = reinterpret_cast<Button*>(&control);
- } else if (control.name() == "mute") {
- _mute = reinterpret_cast<Button*>(&control);
- } else if (control.name() == "select") {
- _select = reinterpret_cast<Button*>(&control);
- } else if (control.name() == "vselect") {
- _vselect = reinterpret_cast<Button*>(&control);
- } else if (control.name() == "fader_touch") {
- _fader_touch = reinterpret_cast<Button*>(&control);
- } else if (control.name() == "meter") {
- _meter = reinterpret_cast<Meter*>(&control);
- } else if (control.type() == Control::type_led || control.type() == Control::type_led_ring) {
- // relax
- } else {
- ostringstream os;
- os << "Strip::add: unknown control type " << control;
- throw MackieControlException (os.str());
- }
-}
-
-Control::Control (int id, int ordinal, std::string name, Group & group)