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.

109 lines
2.7KB

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