head	1.6;
access;
symbols
	rel-0-2-1:1.4
	before_adj_struct:1.3.2.1
	jack:1.3.0.2
	rel-0-1-0:1.2
	rel-0-0-0:1.1;
locks; strict;
comment	@ * @;


1.6
date	2007.03.22.20.55.43;	author robertatwood;	state Exp;
branches;
next	1.5;

1.5
date	2006.04.23.22.03.14;	author robertatwood;	state Exp;
branches;
next	1.4;

1.4
date	2006.04.05.21.53.36;	author robertatwood;	state Exp;
branches;
next	1.3;

1.3
date	2005.08.20.18.26.42;	author robertatwood;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2005.04.03.20.05.38;	author robertatwood;	state Exp;
branches;
next	1.1;

1.1
date	2004.04.16.11.36.56;	author robertatwood;	state Exp;
branches;
next	;

1.3.2.1
date	2006.01.04.00.06.03;	author robertatwood;	state Exp;
branches;
next	1.3.2.2;

1.3.2.2
date	2006.01.04.00.41.58;	author robertatwood;	state Exp;
branches;
next	1.3.2.3;

1.3.2.3
date	2006.01.04.02.31.33;	author robertatwood;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Updated GPL text to reflect new address of Free Software foundation
Prepare to move repository to savannah.nongnu.org
@
text
@/**************************************************************
This file is part of the Variseq program.
Variseq -- a variable pitch and step sample sequencer
Copyright (C) 2004  Robert Atwood r.atwood (at) imperial (dot) ac (dot) uk

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; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 
See the file COPYING for more information
**************************************************************/


#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "constants.h"
#include "myFl.h"
extern void press(Fl_Widget  *w, void *data);
extern void stype_cb(Fl_Widget  *w, void *data);
extern void ap_cb(Fl_Widget  *w, void *data);
/* this is the definintion of an individual control group. */
ctrl::ctrl(int x , int y , int w, int h,const char * label):
   Fl_Group(x,y,w,h,label),
   sampbut(x,y, SWIDTH,SWIDTH,""),                           /* button to select which sample */
   pan(x,y+SWIDTH,SWIDTH,SWIDTH,""),                         /* dial for panning */
   clip(x,y+SWIDTH+SWIDTH,(SWIDTH/2),2*SWIDTH,""),           /* blue slider for clipping */
   vol(x+(SWIDTH/2),y+SWIDTH+SWIDTH,(SWIDTH/2),2*SWIDTH,""), /* green/red slider for volume */
   note(x,y+4*SWIDTH,SWIDTH,SHEIGHT,""),                     /* numbered slider for note pitch */
   oct(x,y+4*SWIDTH+SHEIGHT,SWIDTH,SWIDTH,""),               /* color coded slider for octave pitch */
   nlen(x,y+5*SWIDTH+SHEIGHT,SWIDTH,SWIDTH/2,"")             /* little horiz. slider for note length */
{

   sampbut.callback(press,NULL);

   pan.type(FL_LINE_DIAL);
   pan.minimum(1);
   pan.maximum(0);
   pan.angles(90,270);
   pan.value(0.5);
   pan.selection_color(FL_RED);
   pan.color(FL_WHITE);
   pan.redraw();

   clip.type(FL_VERT_FILL_SLIDER);
   clip.minimum(1);
   clip.maximum(0);
   clip.value(1);
   clip.selection_color(FL_BLUE);
   clip.redraw();

   vol.type(FL_VERT_FILL_SLIDER);
   vol.minimum(2);
   vol.maximum(-4);
   vol.value(0);
   vol.selection_color(FL_GREEN);
   vol.redraw();

   #ifdef COMPACT
   note.maximum(1);
   note.minimum(1);
   #else
   note.slider(FL_UP_BOX);
   note.type(FL_VERT_NICE_SLIDER);
   #endif
   note.value(1);
   note.step(1,1);
   note.selection_color(2);
   note.when(FL_WHEN_RELEASE);

   oct.type(FL_VERTICAL);
   oct.slider_size(.001);
   oct.minimum( N_OCT - 1 );
   oct.maximum(0);
   oct.step(1,1);
   oct.value(D_OCT);
   oct.selection_color(D_OCT);

   nlen.type(FL_HORIZONTAL);
   nlen.slider_size(.001);
   nlen.minimum(1);
   nlen.maximum(16);
   nlen.step(1,1);
   nlen.value(8);
   nlen.color(8);


   end();
}

mybt::mybt(int x, int y, int w, int h, const char * label)
 : Fl_Light_Button(x,y,w,h,label){
}


stype::stype(int x, int y, int w, int h, const char * label)
 : Fl_Slider(x,y,w,h,label){
}
soct::soct(int x, int y, int w, int h, const char * label)
 : Fl_Slider(x,y,w,h,label){
}
slenval::slenval(int x, int y, int w, int h, const char * label)
 : Fl_Slider(x,y,w,h,label){
}
/* object for controlling the sample replacement */
sampctrl::sampctrl(int x , int y, int w, int h, const char * label):
	Fl_Group(x,y,w,h,""), /* prefer unlabelled box with the name inside! */
	nlbt (x,y,SWIDTH,SWIDTH,""),
	nibt (x+SWIDTH,y,SWIDTH,SWIDTH,""),
	nbbt (x+ 2*SWIDTH ,y,SWIDTH,SWIDTH,""),
	sampname (x + 3 * SWIDTH,y,NAMEWIDTH,SWIDTH,""),
	bars (x + 3 * SWIDTH + NAMEWIDTH,y,SWIDTH,SWIDTH,""),
	type (x + 4 * SWIDTH + NAMEWIDTH,y,SWIDTH,SWIDTH,""),
	apbt (x + 5 * SWIDTH + NAMEWIDTH, y, SWIDTH,SWIDTH,"")
{
   bars.minimum(1);
   bars.maximum(99);
   bars.step(1);
   bars.value(1);
   type.minimum(0);
   type.maximum(3);
   type.step(1);

   type.type(FL_HORIZONTAL);

   nlbt.value(1);
   nibt.value(1);
   nbbt.value(1);

   nlbt.sethandle(&sampname);
   nibt.sethandle(&sampname);
   nbbt.sethandle(&sampname);

   nlbt.myfunc(1);
   nibt.myfunc(2);
   nbbt.myfunc(3);

   nlbt.color(1);
   nibt.color(2);
   nbbt.color(3);
   sampname.value(label);
   end();
}


int sampctrl::mynum(int newnum){
   my_num=newnum;
   nlbt.mynum(my_num);

   nibt.mynum(my_num);

   nbbt.mynum(my_num);
   type.callback(stype_cb,NULL);
   apbt.mynum(my_num);
   apbt.callback(ap_cb,NULL);
}
   void sampctrl::scallback(void (&func)(Fl_Widget*, void*), int* &data)
{
     nlbt.callback(func,data);
     nibt.callback(func,data);
     nbbt.callback(func,data);
}
/* $Id: myFl.C,v 1.5 2006/04/23 22:03:14 robertatwood Exp $ */
@


1.5
log
@Fixed popup window location and sample name label
@
text
@d18 1
a18 1
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
d22 1
d173 1
a173 1
/* $Id: myFl.C,v 1.4 2006/04/05 21:53:36 robertatwood Exp $ */
@


1.4
log
@Jack version is the main branch now
@
text
@d68 4
d74 1
a74 2
   note.minimum(1);
   note.maximum(1);
d116 1
a116 1
	Fl_Group(x,y,w,h,label),
d150 1
a150 3

   
   
d154 1
d172 1
a172 1
/* $Id: myFl.C,v 1.3.2.3 2006/01/04 02:31:33 robertatwood Exp $ */
@


1.3
log
@Added a save/restore workspace function
Added window to display names of samples
@
text
@d29 2
d102 3
d111 60
a170 1
/* $Id: myFl.C,v 1.2 2005/04/03 19:05:10 robert Exp $ */
@


1.3.2.1
log
@Jack input as well, and scrambling in compile-time option
@
text
@d106 1
a106 56
/* object for controlling the sample replacement */
sampctrl::sampctrl(int x , int y, int w, int h, const char * label):
	Fl_Group(x,y,w,h,label),
	nlbt (x,y,SWIDTH,SWIDTH,""),
	nibt (x+SWIDTH,y,SWIDTH,SWIDTH,""),
	nbbt (x+ 2*SWIDTH ,y,SWIDTH,SWIDTH,""),
	sampname (x + 3 * SWIDTH,y,NAMEWIDTH,SWIDTH,""),
	bars (x + 3 * SWIDTH + NAMEWIDTH,y,SWIDTH,SWIDTH,""),
	type (x + 4 * SWIDTH + NAMEWIDTH,y,SWIDTH,SWIDTH,""),
	apbt (x + 5 * SWIDTH + NAMEWIDTH, y, SWIDTH,SWIDTH,"")
{
   bars.minimum(0);
   bars.maximum(100);
   bars.step(1);
   type.minimum(0);
   type.maximum(3);
   type.step(1);

   type.type(FL_HORIZONTAL);

   nlbt.value(1);
   nibt.value(1);
   nbbt.value(1);

   nlbt.sethandle(&sampname);
   nibt.sethandle(&sampname);
   nbbt.sethandle(&sampname);

   nlbt.myfunc(1);
   nibt.myfunc(2);
   nbbt.myfunc(3);

   nlbt.color(1);
   nibt.color(2);
   nbbt.color(3);

   
   
   end();
}

int sampctrl::mynum(int newnum){
   my_num=newnum;
   nlbt.mynum(my_num);

   nibt.mynum(my_num);

   nbbt.mynum(my_num);
}
   void sampctrl::scallback(void (&func)(Fl_Widget*, void*), int* &data)
{
     nlbt.callback(func,data);
     nibt.callback(func,data);
     nbbt.callback(func,data);
}
/* $Id: myFl.C,v 1.3 2005/08/20 18:26:42 robertatwood Exp $ */
@


1.3.2.2
log
@Before adding the adjustment structure into the sampel table
@
text
@a28 1
extern void stype_cb(Fl_Widget  *w, void *data);
a99 3
stype::stype(int x, int y, int w, int h, const char * label)
 : Fl_Slider(x,y,w,h,label){
}
a153 1
   type.callback(stype_cb,NULL);
d161 1
a161 1
/* $Id: myFl.C,v 1.3.2.1 2006/01/04 00:06:03 robertatwood Exp $ */
@


1.3.2.3
log
@Sample scramblizer adjusters added
@
text
@a29 1
extern void ap_cb(Fl_Widget  *w, void *data);
d121 2
a122 2
   bars.minimum(1);
   bars.maximum(99);
a123 1
   bars.value(1);
a158 2
   apbt.mynum(my_num);
   apbt.callback(ap_cb,NULL);
@


1.2
log
@Changed the buffer writing so that samples extend into unused notes.
Altered file choose usage to correctly use the FLTK chooser
@
text
@@


1.1
log
@Initial version uploaded to Sourceforge
@
text
@d29 1
d32 7
a38 7
   sampbut(x,y, SWIDTH,SWIDTH,""),
   pan(x,y+SWIDTH,SWIDTH,SWIDTH,""),
   clip(x,y+SWIDTH+SWIDTH,(SWIDTH/2),2*SWIDTH,""),
   vol(x+(SWIDTH/2),y+SWIDTH+SWIDTH,(SWIDTH/2),2*SWIDTH,""),
   note(x,y+4*SWIDTH,SWIDTH,SHEIGHT,""),
   oct(x,y+4*SWIDTH+SHEIGHT,SWIDTH,SWIDTH,""),
   nlen(x,y+5*SWIDTH+SHEIGHT,SWIDTH,SWIDTH/2,"")
d106 1
a106 1
/* $Id: myFl.C,v 1.9 2004/04/12 13:22:33 robert Exp $ */
@

