From 1bdf5157d0707e89b1bce0a939fbcfcf33047816 Mon Sep 17 00:00:00 2001 From: mescalinum Date: Wed, 19 Aug 2009 23:51:59 +0000 Subject: [song] is born svn path=/trunk/externals/ffext/; revision=11988 --- composer/pattern.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'composer/pattern.c') diff --git a/composer/pattern.c b/composer/pattern.c index 95afed2..819c585 100644 --- a/composer/pattern.c +++ b/composer/pattern.c @@ -28,7 +28,7 @@ static t_pattern* pattern_new(t_track* track, t_symbol* name, t_int rows) { ArrayListGetByName(track->x_patterns, name, t_pattern*, obj); - debugprint("pattern_new - object lookup {{%s}} => " PTR, name->s_name, obj); + debugprint("pattern_new - object lookup %s => " PTR, name->s_name, obj); if(obj) return obj; t_pattern* x = (t_pattern*)getbytes(sizeof(t_pattern)); @@ -86,6 +86,20 @@ static void pattern_resize(t_pattern *x, t_int newsize) { debugprint("final size: %d", x->x_rows_count); } +/* WARNING: do not call this for track with more than 1 pattern! + * Works only for the mastertrack (song_proxy) + */ +static void pattern_resize_cols(t_pattern* x, t_int newcols) { + int j; + for(j = 0; j < x->x_rows_count; j++) { + if(&x->x_rows[j]) + x->x_rows[j] = (t_atom*)resizebytes(x->x_rows[j], x->x_track->x_ncolumns, newcols); + else + x->x_rows[j] = (t_atom*)getbytes(sizeof(t_atom) * newcols); + } + x->x_track->x_ncolumns = newcols; +} + static void pattern_new_empty_row(t_pattern* x) { t_atom* rowdata = (t_atom*)getbytes(sizeof(t_atom) * x->x_track->x_ncolumns); int j; -- cgit v1.2.1