Re: RFC: one or many positioners?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.04.2013 20:56, Lars Hanisch wrote:
Am 22.04.2013 14:28, schrieb Klaus Schmidinger:
...
or even

   virtual void Drive(bool Left) {}    // true = left, false = right
   virtual void Step(int Steps) {}     // <0 = left, >0 = right
   virtual void SetLimit(bool Left) {} // true = left, false = right

?

  If you would go this way, I would prefer an enum as parameter, because it's easier to use and the code is easier to
understand. You don't have to remember if true is left or right. :)
  "Step" would than have two parameters, the enum and an uint.

Well, I guess especially with the Step() function it could have been nice
to have the sign indicate the direction. But then again VDR itself probably
isn't going to use Step() with anything else but '1', so

  enum ePositionerDirection { pdLeft, pdRight };
  virtual void Step(ePositionerDirection Direction, uint NumSteps = 1);

should do just fine...

Klaus

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr




[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux