/*------------------------------------------------------------------------------
 src/lib/djWidget/djShuttleWidget.h

 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJ_SHUTTLE_WIDGET_H
#define DJ_SHUTTLE_WIDGET_H
#include <djWidget.h>

namespace dj {

// Shuttle widget.
//
class ShuttleWidget : public Widget {
public:

  ShuttleWidget();
  
  // Signals.
  //
  Signal<bool> & startSig() { return _startSig; }
  Signal<bool> & stopSig() { return _stopSig; }
  Signal<int> & valueSig() { return _valueSig; }
  
  // Layout.
  //
  const Vec2i sizeHint() const;

  // Widget.
  //
  void draw();
  int handle(int);
  
private:

  double _value;

  Signal<bool> _startSig, _stopSig;
  Signal<int> _valueSig;
  
  Fl_Image * _icon [8];
  bool _pressed;
  Vec2i _mouseTd;
};

}

#endif
