aboutsummaryrefslogtreecommitdiff
path: root/composer/pattern.c
diff options
context:
space:
mode:
Diffstat (limited to 'composer/pattern.c')
-rw-r--r--composer/pattern.c16
1 files changed, 15 insertions, 1 deletions
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;