annotate presetManager.h @ 0:307e5fb699fb

First commit.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Mon, 19 Nov 2012 12:56:47 +0000
parents
children 43df75088d85
rev   line source
rt300@0 1 //
rt300@0 2 // presetManager.h
rt300@0 3 // oscSenderExample
rt300@0 4 //
rt300@0 5 // Created by Robert Tubb on 07/11/2012.
rt300@0 6 //
rt300@0 7 //
rt300@0 8
rt300@0 9 #ifndef __oscSenderExample__presetManager__
rt300@0 10 #define __oscSenderExample__presetManager__
rt300@0 11
rt300@0 12 #include <iostream>
rt300@0 13 #include "ofMain.h"
rt300@0 14 #include "ofxiPhone.h"
rt300@0 15 #include "ofxiPhoneExtras.h"
rt300@0 16 #include "2dvector.h"
rt300@0 17
rt300@0 18 //---------------------------------------------------------------------------
rt300@0 19 class Preset{
rt300@0 20
rt300@0 21 public:
rt300@0 22 int presetID;
rt300@0 23 string name;
rt300@0 24 TwoVector coordinates;
rt300@0 25 Preset(TwoVector acoord, string aname,int aID){
rt300@0 26 coordinates = acoord;
rt300@0 27 name = aname;
rt300@0 28 presetID = aID;
rt300@0 29
rt300@0 30 };
rt300@0 31 };
rt300@0 32 //---------------------------------------------------------------------------
rt300@0 33 class PresetManager{
rt300@0 34 public:
rt300@0 35 int nextID;
rt300@0 36
rt300@0 37 // names values
rt300@0 38 // check if already there
rt300@0 39 // find and return all(?) presets within a certain coordinate range
rt300@0 40 vector<Preset *> thePresets; // we want vector ? or list? pointers using new?
rt300@0 41
rt300@0 42 int addPreset(TwoVector coord, string name); // returns id or negative error number
rt300@0 43 TwoVector recallPreset(int presetID); // by name ? id?
rt300@0 44 TwoVector recallPreset(string name); // by name ? id?
rt300@0 45 vector<TwoVector > getPresetsInRange(TwoVector min, TwoVector max);
rt300@0 46
rt300@0 47 void startupLoadAll(); // get stuff from XML
rt300@0 48 void exitAndSaveAll(); // save to XML, delete presets array (?)
rt300@0 49
rt300@0 50 PresetManager();
rt300@0 51 };
rt300@0 52
rt300@0 53 #endif /* defined(__oscSenderExample__presetManager__) */