LMMS
Loading...
Searching...
No Matches
QtXmlWrapper.h
Go to the documentation of this file.
1/*
2 * QtXmlWrapper.h - a QtXml based XML backend for ZynAddSubxFX
3 *
4 * Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25/* File derived from XMLwrapper.h: */
26/*
27 ZynAddSubFX - a software synthesizer
28
29 XMLwrapper.h - XML wrapper
30 Copyright (C) 2003-2005 Nasca Octavian Paul
31 Copyright (C) 2009-2009 Mark McCurry
32 Author: Nasca Octavian Paul
33 Mark McCurry
34
35 This program is free software; you can redistribute it and/or modify
36 it under the terms of version 2 of the GNU General Public License
37 as published by the Free Software Foundation.
38
39 This program is distributed in the hope that it will be useful,
40 but WITHOUT ANY WARRANTY; without even the implied warranty of
41 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 GNU General Public License (version 2 or later) for more details.
43
44 You should have received a copy of the GNU General Public License (version 2)
45 along with this program; if not, write to the Free Software Foundation,
46 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
47
48*/
49
50#ifndef QT_XML_WRAPPER_H
51#define QT_XML_WRAPPER_H
52
53#include "../globals.h"
54
55#include <string>
56#include <cstdlib>
57#include <cstdio>
58#include <cstring>
59
60#define QtXmlWrapper XMLwrapper
61
62struct XmlData;
63
65{
66public:
69
70 int saveXMLfile( const std::string & filename ) const;
71 int loadXMLfile( const std::string & filename );
72
73 char *getXMLdata() const;
74 bool putXMLdata( const char *xmldata );
75
76 void addpar( const std::string & name, int val );
77 void addparreal( const std::string & name, float val);
78 void addparbool( const std::string & name, int val );
79 void addparstr( const std::string & name, const std::string & val );
80
81 void beginbranch( const std::string & name );
82 void beginbranch( const std::string & name, int id );
83 void endbranch();
84
85
86 int enterbranch( const std::string & name );
87 int enterbranch( const std::string & name, int id );
88 void exitbranch();
89 int getbranchid( int min, int max ) const;
90
91 int getpar( const std::string & name, int defaultpar, int min, int max ) const;
92 int getpar127( const std::string & name, int defaultpar ) const;
93 int getparbool( const std::string & name, int defaultpar ) const;
94
95 void getparstr( const std::string & name, char * par, int maxstrlen ) const;
96 std::string getparstr( const std::string & name, const std::string & defaultpar ) const;
97 float getparreal( const char * name, float defaultpar ) const;
98
99 float getparreal(const char *name, float defaultpar, float min, float max) const;
100
101 bool minimal;
102
103 void setPadSynth( bool enabled );
104 bool hasPadSynth() const;
105
106
107private:
108 int dosavefile(const char *filename, int compression, const char *xmldata) const;
109
110 char *doloadfile(const std::string &filename) const;
111
112 struct
113 {
114 int Major;
115 int Minor;
118
120
121
122};
123
124#endif
125
#define QtXmlWrapper
Definition QtXmlWrapper.h:60
int getparbool(const std::string &name, int defaultpar) const
Definition QtXmlWrapper.cpp:444
bool hasPadSynth() const
Definition QtXmlWrapper.cpp:156
char * doloadfile(const std::string &filename) const
Definition QtXmlWrapper.cpp:316
void addparbool(const std::string &name, int val)
Definition QtXmlWrapper.cpp:240
void getparstr(const std::string &name, char *par, int maxstrlen) const
Definition QtXmlWrapper.cpp:460
int saveXMLfile(const std::string &filename) const
Definition QtXmlWrapper.cpp:173
bool putXMLdata(const char *xmldata)
Definition QtXmlWrapper.cpp:347
void addparreal(const std::string &name, float val)
Definition QtXmlWrapper.cpp:234
int Revision
Definition QtXmlWrapper.h:116
int Major
Definition QtXmlWrapper.h:114
int dosavefile(const char *filename, int compression, const char *xmldata) const
Definition QtXmlWrapper.cpp:194
void addparstr(const std::string &name, const std::string &val)
Definition QtXmlWrapper.cpp:248
XmlData * d
Definition QtXmlWrapper.h:119
void addpar(const std::string &name, int val)
Definition QtXmlWrapper.cpp:228
int getpar127(const std::string &name, int defaultpar) const
Definition QtXmlWrapper.cpp:439
int loadXMLfile(const std::string &filename)
Definition QtXmlWrapper.cpp:276
float getparreal(const char *name, float defaultpar) const
Definition QtXmlWrapper.cpp:504
char * getXMLdata() const
Definition QtXmlWrapper.cpp:187
void setPadSynth(bool enabled)
Definition QtXmlWrapper.cpp:123
QtXmlWrapper()
Definition QtXmlWrapper.cpp:80
int enterbranch(const std::string &name)
Definition QtXmlWrapper.cpp:362
int getbranchid(int min, int max) const
Definition QtXmlWrapper.cpp:396
void endbranch()
Definition QtXmlWrapper.cpp:267
void exitbranch()
Definition QtXmlWrapper.cpp:390
int getpar(const std::string &name, int defaultpar, int min, int max) const
Definition QtXmlWrapper.cpp:420
void beginbranch(const std::string &name)
Definition QtXmlWrapper.cpp:257
bool minimal
Definition QtXmlWrapper.h:101
int Minor
Definition QtXmlWrapper.h:115
static char filename[]
Definition features.c:5
static const char * name
Definition pugl.h:1582
int val
Definition jpeglib.h:956
int version
Definition jpeglib.h:901
#define min(x, y)
Definition os.h:74
#define max(x, y)
Definition os.h:78
Definition QtXmlWrapper.cpp:66