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.

110 lines
2.8KB

  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. #include "Sequence_Point.H"
  19. void
  20. Sequence_Point::get ( Log_Entry &e ) const
  21. {
  22. e.add( ":x", _r->offset );
  23. e.add( ":sequence", _sequence );
  24. }
  25. void
  26. Sequence_Point::set ( Log_Entry &e )
  27. {
  28. Sequence_Widget::set( e );
  29. for ( int i = 0; i < e.size(); ++i )
  30. {
  31. const char *s, *v;
  32. e.get( i, &s, &v );
  33. if ( ! strcmp( ":x", s ) )
  34. {
  35. sequence()->sort();
  36. }
  37. }
  38. }
  39. static void
  40. draw_marker ( Fl_Color c )
  41. {
  42. fl_color( c );
  43. fl_begin_polygon();
  44. #define vv(x,y) fl_vertex( x, y );
  45. vv( 0.0, 0.0 );
  46. vv( 0.0, 0.6 );
  47. vv( 0.5, 1.0 );
  48. vv( 1.0, 0.6 );
  49. vv( 1.0, 0.0 );
  50. vv( 0.0, 0.0 );
  51. fl_end_polygon();
  52. fl_color( fl_darker( c ) );
  53. fl_begin_line();
  54. vv( 0.0, 0.0 );
  55. vv( 0.0, 0.6 );
  56. vv( 0.5, 1.0 );
  57. vv( 1.0, 0.6 );
  58. vv( 1.0, 0.0 );
  59. vv( 0.0, 0.0 );
  60. fl_end_line();
  61. }
  62. void
  63. Sequence_Point::draw_box ( void )
  64. {
  65. // Sequence_Widget::draw_box();
  66. const int X = x() - (abs_w() >> 1);
  67. // const int Y = y() + Fl::box_dy( box() );
  68. const int Y = y();
  69. fl_color( color() );
  70. fl_push_matrix();
  71. fl_translate( X, Y + ( h() >> 3 ) );
  72. fl_scale( w(), h() - ( h() >> 3 ) );
  73. draw_marker( color() );
  74. fl_pop_matrix();
  75. // fl_line( X, Y, X, Y + h() - Fl::box_dh( box() ) );
  76. }
  77. void
  78. Sequence_Point::draw ( void )
  79. {
  80. // Sequence_Widget::draw();
  81. draw_label( _label, align() );
  82. }