Clean up zoom bar a bit.

This commit is contained in:
Jonathan Moore Liles 2008-02-17 15:25:02 -06:00
parent 0328ebfa2d
commit 05854badd9
2 changed files with 35 additions and 1 deletions

27
const.h Normal file
View File

@ -0,0 +1,27 @@
/*******************************************************************************/
/* 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. */
/*******************************************************************************/
/* default peak file resolution, therefore normally any zoom level less than this will
require reading from the audio files directly */
const int FRAMES_PER_PEAK = 256;

9
main.C
View File

@ -40,6 +40,8 @@ Fl_Color velocity_colors[128];
#include "Track.H"
#include "Timeline.H"
#include "const.h"
void
init_colors ( void )
{
@ -64,6 +66,11 @@ cb_zoom ( Fl_Widget *w, void *v )
timeline.scroll->redraw();
if ( timeline.fpp < FRAMES_PER_PEAK )
w->selection_color( FL_RED );
else
w->selection_color( FL_GRAY );
printf( "%f\n", timeline.fpp );
}
@ -136,7 +143,7 @@ main ( int argc, char **argv )
Fl_Slider *zoom_slider = new Fl_Slider( 0, 0, 800, 24 );
zoom_slider->type( 1 );
zoom_slider->callback( cb_zoom, 0 );
zoom_slider->range( 1, 1024 );
zoom_slider->range( 2, 4096 );
zoom_slider->step( 1 );
zoom_slider->value( 256 );