view presetManager.mm @ 1:23efe1f0cd8a

work on event logging
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Thu, 22 Nov 2012 17:59:13 +0000
parents 307e5fb699fb
children 43df75088d85
line wrap: on
line source
//
//  presetManager.mm
//  oscSenderExample
//
//  Created by Robert Tubb on 07/11/2012.
//
//

#include "presetManager.h"

//---------------------------------------------------------------------------

PresetManager presetManager;
//---------------------------------------------------------------------------


PresetManager::PresetManager(){
    nextID = 0;
    
}
//---------------------------------------------------------------------------

int PresetManager::addPreset(TwoVector coord, string name){
    // check for same name
    vector<Preset *>::iterator iter;
    for(iter = thePresets.begin(); iter < thePresets.end(); iter++){
        if ((*iter)->name == name){
            cout << " Preset by that name exists\n";
            
            // use exceptions!
            return -1;
        }
    }
    if(name == ""){
        cout << "Please name preset\n";
        return -2;
        
    }
    // check for same coords (!?!)
    thePresets.push_back(new Preset(coord, name,nextID));
    
    // if ok
    return nextID++;
}
//---------------------------------------------------------------------------
vector<TwoVector > getPresetsInRange(TwoVector min, TwoVector max){
    //return all the coordinates. oh and names (displayed at certain scales?).
}
//---------------------------------------------------------------------------
void startupLoadAll(){
  // get stuff from XML  
}
//---------------------------------------------------------------------------
void exitAndSaveAll(){
    
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------