commit c5a2faa41ec5320f9e2eba3d7f942962c8499d84
parent 1776deb3da647f834c1c4deac50e5d8d596b6be4
Author: paulnasca <paulnasca>
Date: Sat, 21 Aug 2004 07:48:11 +0000
*** empty log message ***
Diffstat:
3 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/src/Misc/Bank.C b/src/Misc/Bank.C
@@ -429,15 +429,6 @@ void Bank::scanrootdir(char *rootdir){
};
closedir(dir);
-/*
-
- // printf("%s/\n",bankdirname);
- struct dirent *fn;
-
- while ((fn=readdir(dir))){
- if (fn->d_type!=DT_REG) continue;//this is not a regular file
- const char *filename= fn->d_name;
-*/
};
diff --git a/src/Params/PresetsStore.C b/src/Params/PresetsStore.C
@@ -28,13 +28,22 @@ PresetsStore presetsstore;
PresetsStore::PresetsStore(){
clipboard.data=NULL;
- clipboard.type[0]=0;;
+ clipboard.type[0]=0;
+
+ for (int i=0;i<MAX_PRESETS;i++){
+ presets[i].file=NULL;
+ presets[i].name=NULL;
+ };
+
};
PresetsStore::~PresetsStore(){
if (clipboard.data!=NULL) delete (clipboard.data);
+ clearpresets();
};
+//Clipboard management
+
void PresetsStore::copyclipboard(XMLwrapper *xml,char *type){
strcpy(clipboard.type,type);
if (clipboard.data!=NULL) delete (clipboard.data);
@@ -53,5 +62,27 @@ bool PresetsStore::checkclipboardtype(char *type){
return(strcmp(type,clipboard.type)==0);
};
+//Presets management
+void PresetsStore::clearpresets(){
+ for (int i=0;i<MAX_PRESETS;i++){
+ if (preset[i].file!=NULL) {
+ delete(presets[i].file);
+ presets[i].file=NULL;
+ };
+ if (preset[i].name!=NULL) {
+ delete(presets[i].name);
+ presets[i].name=NULL;
+ };
+ };
+
+};
+void PresetsStore::rescanforpresets(char *type){
+ clearpresets();
+ int presetk=0;
+ for (int i=0;i<MAX_PRESETS_DIR;i++){
+ if (config.cfg.presetsDirList[i]==NULL) continue;
+ //de continuat aici
+ };
+};
diff --git a/src/Params/PresetsStore.h b/src/Params/PresetsStore.h
@@ -22,6 +22,7 @@
#include "../Misc/XMLwrapper.h"
#define MAX_PRESETTYPE_SIZE 30
+#define MAX_PRESETS 1000
class PresetsStore{
public:
@@ -31,12 +32,21 @@ class PresetsStore{
bool pasteclipboard(XMLwrapper *xml);
bool checkclipboardtype(char *type);
+ struct presetstruct{
+ char *file;
+ char *name;
+ };
+ presetstruct presets[MAX_PRESETS];
+
private:
struct {
char *data;
char type[MAX_PRESETTYPE_SIZE];
} clipboard;
+ void clearpresets();
+ void rescanforpresets(char *type);
+
};
extern PresetsStore presetsstore;