diff --git a/Notebook.pde b/Notebook.pde index 891236e..2ddba27 100644 --- a/Notebook.pde +++ b/Notebook.pde @@ -6,7 +6,7 @@ class Notebook { int id; Notebook(int id_, String notebookpath_, String[] imagepaths_) { id = id_; - notebookpath = dataPath("") + "/" + notebookpath_; + notebookpath = dataPath("") + "/Notizhefte/" + notebookpath_; imagepaths = Arrays.copyOfRange(imagepaths_, 1, imagepaths_.length-1); String[] separated = notebookpath_.split("-"); dateText = (getMonth(int(separated[1])) + " " + separated[0]); @@ -49,12 +49,12 @@ String getMonth(int id) { ArrayList notebooks = new ArrayList(); void createNotebooks() { - File datafolder = new File(dataPath("")); + File datafolder = new File(dataPath("") + "/Notizhefte"); String[] notebooknames = datafolder.list(); notebooknames = sort(notebooknames); int notebookID = 0; for (int i = 0; i < notebooknames.length; i++) { - File notebookfolder = new File(dataPath("") + "/" + notebooknames[i]); + File notebookfolder = new File(dataPath("") + "/Notizhefte/" + notebooknames[i]); if (notebookfolder.list() != null) { String[] imagenames = notebookfolder.list(); List strings = Arrays.asList(imagenames); diff --git a/README.md b/README.md index 3ca5cc2..989a9b9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ ## Notizheftanzeiger Mit Processing 3 oder 4 zu öffnen und auszuführen -Benötigt ordner "data" mit Notizheftdaten +Benötigt ordner "Notizhefte" im Ordner "data" diff --git a/data/save.sav b/data/save.sav new file mode 100644 index 0000000..f8f9fdf --- /dev/null +++ b/data/save.sav @@ -0,0 +1,2 @@ +0 +8 diff --git a/notizheftanzeiger.pde b/notizheftanzeiger.pde index e80c952..9360ac0 100644 --- a/notizheftanzeiger.pde +++ b/notizheftanzeiger.pde @@ -16,12 +16,16 @@ int startTransitionTime; float transitionProgress; final static int NORMAL = 0; final static int RANDOM = 1; - +String[] save; void setup() { //fullScreen(); //if using fullScreen, comment the next line size(960, 540); fill(255); + save = loadStrings(dataPath("") + "/save.sav"); + currentNotebookNo = int(save[0]); + currentSlideNo = int(save[1]); + if (displayTimeline) { textSize(20); textAlign(CENTER); @@ -44,6 +48,11 @@ void draw() { tint(255, transitionProgress); image(nextSlide, 0, 0, width, height); if (millis() - startTransitionTime > transitionTime) { + + save[0] = str(currentNotebookNo); + save[1] = str(currentSlideNo); + saveStrings(dataPath("") + "/save.sav", save); + currentSlide = nextSlide; transitionProgress = 0; transition = false;