Browse Source

Add action to set range from region position and length.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
00aeaff29b
3 changed files with 14 additions and 1 deletions
  1. +3
    -0
      Timeline/Audio_Region.C
  2. +10
    -0
      Timeline/Timeline.C
  3. +1
    -1
      Timeline/Timeline.H

+ 3
- 0
Timeline/Audio_Region.C View File

@@ -265,6 +265,8 @@ Audio_Region::menu_cb ( const Fl_Menu_ *m )
_loop = 0;
else if ( ! strcmp( picked, "/Normalize" ) )
normalize();
else if ( ! strcmp( picked, "/Range from" ) )
timeline->range( start(), length() );
else if ( ! strcmp( picked, "/Remove" ) )
remove();
else
@@ -307,6 +309,7 @@ Audio_Region::menu ( void )
{ "Loop point to mouse", 'l', 0, 0 },
{ "Clear loop point", FL_SHIFT + 'l', 0, 0 },
{ "Normalize", 'n', 0, 0 },
{ "Range from", FL_CTRL + 'r', 0, 0 },
{ "Remove", 0, 0, 0 },
{ 0 },
};


+ 10
- 0
Timeline/Timeline.C View File

@@ -173,6 +173,16 @@ Timeline::fix_range ( void )
}
}

/** set the range to /start/ + /length/ */
void
Timeline::range ( nframes_t start, nframes_t length )
{
p1 = start;
p2 = start + length;

redraw();
}

void
Timeline::menu_cb ( Fl_Menu_ *m )
{


+ 1
- 1
Timeline/Timeline.H View File

@@ -144,7 +144,7 @@ public:
void update_tempomap ( void );

nframes_t fpp ( void ) const { return 1 << _fpp; }
void range ( nframes_t start, nframes_t length );
nframes_t length ( void ) const;
void sample_rate ( nframes_t r ) { _sample_rate = r; }
nframes_t sample_rate ( void ) const { return _sample_rate; }


Loading…
Cancel
Save