Hi,
I have the following problem: I have a text file, which contains some heterogenous data. Let me show you some example:
LRSObjectFile;
0;
1;
test.ogg;
3;
The first Line tells PD that the file is intended for the patch. The second line
tells PD what type of object to load (may be a constant later down the road) and the
rest contains data specific for that object (I have many dynamic objects which I compose
on the fly through dyn~ external).
Now what I am doing to parse such a file is highly stupid and I'd like to find some more elegant solution:
I am using three textfile objects (each for one line). What I'd like to have is one textfile object and figure, how to route the reading logic so that the output from the textfile is routed to the branch I need. Here is some pseudocode through tmp status variable:
int status = 0;
switch(status)
{
case 0:
read_and_verify_header();
status = 1;
break;
case 1:
read_object_typ();
status = 2;
break;
case 2:
read_and_fill_object_data_to the_end_of_the_file();
}
But I found this very hard to construct in PD. Any ideas or pointers in completely different direction?
Thanks a lot for giving this a thought.
Edit: for some spelling.