string 8 caps

constant string
Author: Johannes Taelman
License: BSD
Github: rbrt/string/string 8 caps.axo

Inlets

bool32 caps

Outlets

charptr32 string

charptr32 text1

charptr32 text2

charptr32 text3

charptr32 text4

charptr32 text5

charptr32 text6

charptr32 text7

Attributes

spinner maxLength

table str0

table str1

table str2

table str3

table str4

table str5

table str6

table str7

Declaration
char c[8][attr_maxLength];

bool caps;
bool prev;
uint8_t start;
int8_t offset;
Init
strcpy(&c[0][0], "attr_str0");
strcpy(&c[1][0], "attr_str1");
strcpy(&c[2][0], "attr_str2");
strcpy(&c[3][0], "attr_str3");
strcpy(&c[4][0], "attr_str4");
strcpy(&c[5][0], "attr_str5");
strcpy(&c[6][0], "attr_str6");
strcpy(&c[7][0], "attr_str7");
Control Rate
outlet_text0 = &c[0][0];
outlet_text1 = &c[1][0];
outlet_text2 = &c[2][0];
outlet_text3 = &c[3][0];
outlet_text4 = &c[4][0];
outlet_text5 = &c[5][0];
outlet_text6 = &c[6][0];
outlet_text7 = &c[7][0];

if (inlet_caps != caps) {
  caps = inlet_caps;
  if (inlet_caps) {
    start = 97;
    offset = -32;
  } else {
    start = 65;
    offset = 32;
  }
  int ii;
  for (ii = 0; ii < 8; ii++) {
    int i;
    for (i = 0; i < attr_maxLength; i++)
      if ((c[ii][i] >= start) && (c[ii][i] <= (start + 25)))
        c[ii][i] = c[ii][i] + offset;
  }
}

Privacy

© 2024 Zrna Research