It worked!
well, i had to add +"\n" to the print statement, and ill probably change the whole line to
print("Now Playing: " +originalFile+ "\n");
maybe in the future ill add more song data, but if i do i can easily build off of this.
I just realized that upon first starting the winamp, it clears the text file, so the sketch crashes, but i think theres a setting in the plugin to change that. EDIT: There is, now it no longer initializes the file.
Also, when the first song plays, "current" was equal to "original" so i added another condition and int in order to make sure it prints the first song the first time.
Here's my current build, sans serial
String originalFile;
String currentFile;
PFont font;
int i=0;
void setup() {
size(400,400);
font = loadFont("CourierNew36.vlw");
String[] original = loadStrings("nowplaying.txt");
originalFile = original[0];
}
void draw() {
String[] current = loadStrings("nowplaying.txt");
currentFile = current[0];
if((currentFile.equals(originalFile))&& (i==0)){
print(originalFile+"\n");
textFont(font);
text(originalFile,20,200);
i++;
}
else if(!currentFile.equals(originalFile))
{
originalFile = currentFile;
print(originalFile+"\n");
textFont(font);
text(originalFile,20,200);
saveStrings("data\\original.txt",current);
}
}