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