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.

133 lines
4.1KB

  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 "Track_Header.H"
  19. void
  20. Track_Header::cb_input_field ( Fl_Widget *w, void *v )
  21. {
  22. ((Track_Header*)v)->cb_input_field();
  23. }
  24. void
  25. Track_Header::cb_input_field ( void )
  26. {
  27. log_start();
  28. if ( _name )
  29. free( _name );
  30. _name = strdup( name_field->value() );
  31. log_end();
  32. }
  33. Track_Header::Track_Header ( int X, int Y, int W, int H, const char *L ) :
  34. Fl_Group ( X, Y, W, H, L )
  35. {
  36. Track_Header *o = this;
  37. o->box( FL_THIN_UP_BOX );
  38. {
  39. Fl_Group *o = new Fl_Group( 2, 2, 149, 113 );
  40. o->color( ( Fl_Color ) 53 );
  41. {
  42. Fl_Group *o = new Fl_Group( 4, 4, 144, 66 );
  43. {
  44. Fl_Input *o = name_field = new Fl_Input( 4, 9, 144, 25 );
  45. o->color( ( Fl_Color ) 33 );
  46. o->labeltype( FL_NO_LABEL );
  47. o->labelcolor( FL_GRAY0 );
  48. o->textcolor( 32 );
  49. o->callback( cb_input_field, (void*)this );
  50. }
  51. {
  52. Fl_Button *o = record_button =
  53. new Fl_Button( 6, 38, 26, 27, "@circle" );
  54. o->type( 1 );
  55. o->box( FL_ROUNDED_BOX );
  56. o->color( FL_LIGHT1 );
  57. o->labelsize( 8 );
  58. }
  59. {
  60. Fl_Button *o = mute_button =
  61. new Fl_Button( 35, 38, 26, 27, "m" );
  62. o->type( 1 );
  63. o->box( FL_ROUNDED_BOX );
  64. o->color( FL_LIGHT1 );
  65. o->labelsize( 11 );
  66. }
  67. {
  68. Fl_Button *o = solo_button =
  69. new Fl_Button( 66, 38, 26, 27, "s" );
  70. o->type( 1 );
  71. o->box( FL_ROUNDED_BOX );
  72. o->color( FL_LIGHT1 );
  73. o->labelsize( 11 );
  74. }
  75. {
  76. Fl_Menu_Button *o = take_menu =
  77. new Fl_Menu_Button( 97, 38, 47, 27, "T" );
  78. o->box( FL_ROUNDED_BOX );
  79. o->color( FL_LIGHT1 );
  80. o->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
  81. }
  82. o->end();
  83. }
  84. o->size( Track_Header::width(), o->h() );
  85. o->end();
  86. }
  87. {
  88. Fl_Pack *o = takes = new Fl_Pack( 150, 0, 1006, 115 );
  89. o->labeltype( FL_NO_LABEL );
  90. o->align( FL_ALIGN_CLIP );
  91. o->resize( x() + width(), y(), w() - width(), h() );
  92. o->end();
  93. Fl_Group::current()->resizable( o );
  94. }
  95. end();
  96. _name = NULL;
  97. _track = NULL;
  98. _selected = false;
  99. log_create();
  100. }
  101. Track_Header::~Track_Header ( )
  102. {
  103. log_destroy();
  104. }
  105. int
  106. Track_Header::width()
  107. {
  108. return 150;
  109. }
  110. void
  111. Track_Header::track( Track * t )
  112. {
  113. _track = t;
  114. t->size( 1, takes->h() );
  115. takes->add( t );
  116. }