Browse Source

Get rid of fluid file for Track_Header widget, as fluid doesn't allow us multiple inheritance on widget classes.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
bcb8e5205c
5 changed files with 170 additions and 56 deletions
  1. +1
    -1
      Region.C
  2. +1
    -0
      Timeline.C
  3. +99
    -0
      Track_Header.C
  4. +69
    -0
      Track_Header.H
  5. +0
    -55
      Track_Header.fl

+ 1
- 1
Region.C View File

@@ -36,7 +36,7 @@ using namespace std;

extern Timeline *timeline;

Fl_Boxtype Region::_box = FL_PLASTIC_UP_BOX;
Fl_Boxtype Region::_box = FL_UP_BOX;

Fl_Color Region::_selection_color = FL_MAGENTA;



+ 1
- 0
Timeline.C View File

@@ -161,6 +161,7 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Group( X,
// o->end();

t->track( o );
t->color( FL_GREEN );
}

tracks = o;


+ 99
- 0
Track_Header.C View File

@@ -0,0 +1,99 @@

/*******************************************************************************/
/* Copyright (C) 2008 Jonathan Moore Liles */
/* */
/* This program is free software; you can redistribute it and/or modify it */
/* under the terms of the GNU General Public License as published by the */
/* Free Software Foundation; either version 2 of the License, or (at your */
/* option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, but WITHOUT */
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
/* more details. */
/* */
/* You should have received a copy of the GNU General Public License along */
/* with This program; see the file COPYING. If not,write to the Free Software */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/

#include "Track_Header.H"

Track_Header::Track_Header ( int X, int Y, int W, int H, const char *L ) :
Fl_Group ( X, Y, W, H, L )
{
Track_Header *o = this;
o->box( FL_THIN_UP_BOX );
{
Fl_Group *o = new Fl_Group( 2, 2, 149, 113 );
o->color( ( Fl_Color ) 53 );
{
Fl_Group *o = new Fl_Group( 4, 4, 144, 66 );
{
Fl_Input *o = name_field = new Fl_Input( 4, 9, 144, 25 );
o->color( ( Fl_Color ) 33 );
o->labeltype( FL_NO_LABEL );
o->labelcolor( FL_GRAY0 );
o->textcolor( 32 );
}
{
Fl_Button *o = record_button =
new Fl_Button( 6, 38, 26, 27, "@circle" );
o->type( 1 );
o->box( FL_ROUNDED_BOX );
o->color( FL_LIGHT1 );
o->labelsize( 8 );
}
{
Fl_Button *o = mute_button =
new Fl_Button( 35, 38, 26, 27, "m" );
o->type( 1 );
o->box( FL_ROUNDED_BOX );
o->color( FL_LIGHT1 );
o->labelsize( 11 );
}
{
Fl_Button *o = solo_button =
new Fl_Button( 66, 38, 26, 27, "s" );
o->type( 1 );
o->box( FL_ROUNDED_BOX );
o->color( FL_LIGHT1 );
o->labelsize( 11 );
}
{
Fl_Menu_Button *o = take_menu =
new Fl_Menu_Button( 97, 38, 47, 27, "T" );
o->box( FL_ROUNDED_BOX );
o->color( FL_LIGHT1 );
o->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
}
o->end();
}
o->size( Track_Header::width(), o->h() );
o->end();
}
{
Fl_Pack *o = takes = new Fl_Pack( 150, 0, 1006, 115 );
o->labeltype( FL_NO_LABEL );
o->align( FL_ALIGN_CLIP );
o->resize( x() + width(), y(), w() - width(), h() );
o->end();
Fl_Group::current()->resizable( o );
}
end();
}

int
Track_Header::width()
{
return 150;
}

void
Track_Header::track( Track * t )
{
_track = t;

t->size( 1, takes->h() );
takes->add( t );
}

+ 69
- 0
Track_Header.H View File

@@ -0,0 +1,69 @@

/*******************************************************************************/
/* Copyright (C) 2008 Jonathan Moore Liles */
/* */
/* This program is free software; you can redistribute it and/or modify it */
/* under the terms of the GNU General Public License as published by the */
/* Free Software Foundation; either version 2 of the License, or (at your */
/* option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, but WITHOUT */
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
/* more details. */
/* */
/* You should have received a copy of the GNU General Public License along */
/* with This program; see the file COPYING. If not,write to the Free Software */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/

#ifndef Track_Header_H
#define Track_Header_H
#include <FL/Fl.H>
#include "Track.H"
#include <FL/Fl_Group.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/Fl_Pack.H>

#include "Loggable.H"

class Track_Header : public Fl_Group, public Loggable
{

public:

Track_Header( int X, int Y, int W, int H, const char *L = 0 );

private:
Track * _track;

public:

Fl_Input * name_field;
Fl_Button *record_button;
Fl_Button *mute_button;
Fl_Button *solo_button;
Fl_Menu_Button *take_menu;

Fl_Pack *takes;

const char *class_name ( void ) { return "Track_Header"; }

void set ( char **sa )
{
return;
}

char ** get ( void )
{
return NULL;
}

static int width();

void track( Track * t );

};
#endif

+ 0
- 55
Track_Header.fl View File

@@ -1,55 +0,0 @@
# data file for the Fltk User Interface Designer (fluid)
version 1.0107
header_name {.H}
code_name {.C}
decl {\#include "Track.H"} {public
}

widget_class Track_Header {open
xywh {383 446 1156 116} type Double box THIN_UP_BOX resizable visible
} {
Function {width()} {open return_type {static int}
} {
code {return 150;} {}
}
decl {Track *_track;} {}
Fl_Group {} {open
xywh {2 2 149 113} color 53
code0 {o->size( Track_Header::width(), o->h() );}
} {
Fl_Group {} {open
xywh {4 4 144 66}
} {
Fl_Input name_field {
xywh {4 9 144 25} color 33 labeltype NO_LABEL labelcolor 32 textcolor 32
}
Fl_Button record_button {
label {@circle}
xywh {6 38 26 27} type Toggle box ROUNDED_BOX color 50 labelsize 8
}
Fl_Button mute_button {
label m
xywh {35 38 26 27} type Toggle box ROUNDED_BOX color 50 labelsize 11
}
Fl_Button solo_button {
label s
xywh {66 38 26 27} type Toggle box ROUNDED_BOX color 50 labelsize 11
}
Fl_Menu_Button take_menu {
label T open
xywh {97 38 47 27} box ROUNDED_BOX color 50 align 20
} {}
}
}
Fl_Pack takes {open selected
xywh {150 0 1006 115} labeltype NO_LABEL align 64 resizable
code0 {o->resize( x() + width(), y(), w() - width(), h() );}
} {}
Function {track( Track *t )} {open return_type void
} {
code {_track = t;

t->size( 1, takes->h() );
takes->add( t );} {}
}
}

Loading…
Cancel
Save