Enforce restriction on total number of patterns and phrases.
This commit is contained in:
parent
f8221f51e8
commit
d733de358e
|
@ -195,9 +195,14 @@ canvas_input_callback ( O_Canvas *widget, Canvas *c, int m )
|
|||
break;
|
||||
case 'c':
|
||||
{
|
||||
c->grid( c->grid()->create() );
|
||||
Grid *g = c->grid()->create();
|
||||
|
||||
ui->update_sequence_widgets();
|
||||
if ( g )
|
||||
{
|
||||
c->grid( g );
|
||||
|
||||
ui->update_sequence_widgets();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -261,7 +261,12 @@ pattern::recording ( void )
|
|||
pattern *
|
||||
pattern::create ( void )
|
||||
{
|
||||
return new pattern;
|
||||
if ( pattern::patterns() < 128 )
|
||||
{
|
||||
return new pattern;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pattern *
|
||||
|
|
|
@ -109,7 +109,12 @@ phrase::reset ( void )
|
|||
phrase *
|
||||
phrase::create ( void )
|
||||
{
|
||||
return new phrase;
|
||||
if ( phrase::phrases() < 128 )
|
||||
{
|
||||
return new phrase;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
phrase *
|
||||
|
|
Loading…
Reference in New Issue