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();
|
||||
|
||||
if ( g )
|
||||
{
|
||||
c->grid( g );
|
||||
|
||||
ui->update_sequence_widgets();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -260,9 +260,14 @@ pattern::recording ( void )
|
|||
/* allows us to create a new pattern/phrase from a base class pointer */
|
||||
pattern *
|
||||
pattern::create ( void )
|
||||
{
|
||||
if ( pattern::patterns() < 128 )
|
||||
{
|
||||
return new pattern;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pattern *
|
||||
pattern::by_number ( int n ) const
|
||||
|
|
|
@ -108,9 +108,14 @@ phrase::reset ( void )
|
|||
|
||||
phrase *
|
||||
phrase::create ( void )
|
||||
{
|
||||
if ( phrase::phrases() < 128 )
|
||||
{
|
||||
return new phrase;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
phrase *
|
||||
phrase::by_number ( int n ) const
|
||||
|
|
Loading…
Reference in New Issue