save load table

Author:
License: GPL
Github: .axo

IO Variants: 2


Variant: 1

Inlets

charptr32 filename

bool32.rising save

bool32.rising load

Outlets

None

Attributes

objref table

objref SDapi

Declaration
int rem_sz;
bool trig;
Control Rate
if (inlet_load && !trig) {
	trig = 1;
	rem_sz = attr_SDapi.fsize(inlet_filename) % (attr_table.LENGTH * sizeof (attr_table.array));
	attr_SDapi.fload(inlet_filename,(char *) &attr_table.array[0],rem_sz);
		}
if (inlet_save && !trig) {
	trig = 1;
	rem_sz = attr_table.LENGTH * sizeof (attr_table.array);
	attr_SDapi.fsave(inlet_filename,(char *) &attr_table.array[0],rem_sz);
	}

if (!inlet_load && !inlet_save) trig = 0;

Variant: 2

Inlets

charptr32 filename

bool32.rising save

bool32.rising load

Outlets

None

Attributes

objref table

objref SDapi

Declaration
bool trig;
Control Rate
if (inlet_load && !trig) {
  trig = 1;
  int filesize = attr_SDapi.fsize(inlet_filename);
  int dstsize = attr_table.LENGTH * sizeof(*attr_table.array);
  int rem_sz = (filesize > dstsize) ? dstsize : filesize;
  attr_SDapi.fload(inlet_filename, (char *)&attr_table.array[0], rem_sz);
}
if (inlet_save && !trig) {
  trig = 1;
  int rem_sz = attr_table.LENGTH * sizeof(*attr_table.array);
  attr_SDapi.fsave(inlet_filename, (char *)&attr_table.array[0], rem_sz);
}

if (!inlet_load && !inlet_save)
  trig = 0;

Privacy

© 2024 Zrna Research