Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.6KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2008 Jonathan Moore Liles */
  3. /* */
  4. /* This program is free software; you can redistribute it and/or modify it */
  5. /* under the terms of the GNU General Public License as published by the */
  6. /* Free Software Foundation; either version 2 of the License, or (at your */
  7. /* option) any later version. */
  8. /* */
  9. /* This program is distributed in the hope that it will be useful, but WITHOUT */
  10. /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
  11. /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
  12. /* more details. */
  13. /* */
  14. /* You should have received a copy of the GNU General Public License along */
  15. /* with This program; see the file COPYING. If not,write to the Free Software */
  16. /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  17. /*******************************************************************************/
  18. #pragma once
  19. #include <FL/Fl_Widget.H>
  20. #include <FL/fl_draw.H>
  21. #include <FL/Fl.H>
  22. #include <vector>
  23. using namespace std;
  24. class Panner : public Fl_Widget
  25. {
  26. struct Point
  27. {
  28. /* axes */
  29. float x, y;
  30. Point ( ) : x( 0.0f ), y( 0.0f ) { }
  31. Point ( float X, float Y ) : x( X ), y( Y ) { }
  32. };
  33. /* channel configuration */
  34. int _ins,
  35. _outs;
  36. vector <Point> _points;
  37. static int pw ( void ) { return 6; }
  38. static int ph ( void ) { return 6; }
  39. static int _configs[][12];
  40. void bbox ( int &X, int &Y, int &W, int &H )
  41. {
  42. W = w() - Fl::box_dw( box() );
  43. H = h() - Fl::box_dh( box() );
  44. X = x() + Fl::box_dx( box() );
  45. Y = y() + Fl::box_dy( box() );
  46. }
  47. Point * event_point ( void );
  48. public:
  49. Panner ( int X, int Y, int W, int H, const char *L = 0 ) :
  50. Fl_Widget( X, Y, W, H, L )
  51. {
  52. _ins = _outs = 4;
  53. _points.push_back( Point( -1, -1 ) );
  54. _points.push_back( Point( 1, 1 ) );
  55. _points.push_back( Point( -1, 1 ) );
  56. _points.push_back( Point( 1, -1 ) );
  57. _outs = 5;
  58. }
  59. virtual ~Panner ( ) { }
  60. virtual void draw ( void );
  61. virtual int handle ( int );
  62. };