diff --git a/zynaddsubfx-096a2a2db9bc7d7f9bb2bf8ee12136134708ef23.patch b/zynaddsubfx-096a2a2db9bc7d7f9bb2bf8ee12136134708ef23.patch new file mode 100644 index 0000000..9ece47d --- /dev/null +++ b/zynaddsubfx-096a2a2db9bc7d7f9bb2bf8ee12136134708ef23.patch @@ -0,0 +1,361 @@ +From: fundamental +Date: Fri, 4 Sep 2009 22:46:21 +0000 (-0400) +Subject: Gave XMLwrapper doxygen comments +X-Git-Url: http://zynaddsubfx.git.sourceforge.net/git/gitweb.cgi?p=zynaddsubfx%2Fzynaddsubfx;a=commitdiff_plain;h=096a2a2db9bc7d7f9bb2bf8ee12136134708ef23 + +Gave XMLwrapper doxygen comments +--- + +diff --git a/src/Misc/XMLwrapper.h b/src/Misc/XMLwrapper.h +index 6b6849f..9519021 100644 +--- a/src/Misc/XMLwrapper.h ++++ b/src/Misc/XMLwrapper.h +@@ -1,9 +1,11 @@ + /* + ZynAddSubFX - a software synthesizer + +- XML.h - XML wrapper ++ XMLwrapper.h - XML wrapper + Copyright (C) 2003-2005 Nasca Octavian Paul ++ Copyright (C) 2009-2009 Mark McCurry + Author: Nasca Octavian Paul ++ Mark McCurry + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License +@@ -34,143 +36,278 @@ + //the maxim tree depth + #define STACKSIZE 100 + ++/**Mxml wrapper*/ + class XMLwrapper + { + public: ++ /** ++ * Constructor. ++ * Will Construct the object and fill in top level branch ++ * */ + XMLwrapper(); +- ~XMLwrapper(); + +- /********************************/ +- /* SAVE to XML */ +- /********************************/ ++ /**Destructor*/ ++ ~XMLwrapper(); + +- //returns 0 if ok or -1 if the file cannot be saved ++ /** ++ * Saves the XML to a file. ++ * @param filename the name of the destination file. ++ * @returns 0 if ok or -1 if the file cannot be saved. ++ */ + int saveXMLfile(const std::string &filename); + +- //returns the new allocated string that contains the XML data (used for clipboard) +- //the string is NULL terminated ++ /** ++ * Return XML tree as a string. ++ * Note: The string must be freed with free() to deallocate ++ * @returns a newly allocated NULL terminated string of the XML data. ++ */ + char *getXMLdata(); + +- //add simple parameter (name and value) ++ /** ++ * Add simple parameter. ++ * @param name The name of the mXML node. ++ * @param val The string value of the mXml node ++ */ + void addpar(const std::string &name,int val); ++ ++ /** ++ * Adds a realtype parameter. ++ * @param name The name of the mXML node. ++ * @param val The REALTYPE value of the node. ++ */ + void addparreal(const std::string &name,REALTYPE val); + +- //add boolean parameter (name and boolean value) +- //if the value is 0 => "yes", else "no" ++ /** ++ * Add boolean parameter. ++ * \todo Fix this reverse boolean logic. ++ * @param name The name of the mXML node. ++ * @param val The boolean value of the node (0->"yes";else->"no"). ++ */ + void addparbool(const std::string &name,int val); + +- //add string parameter (name and string) ++ /** ++ * Add string parameter. ++ * @param name The name of the mXML node. ++ * @param val The string value of the node. ++ */ + void addparstr(const std::string &name,const std::string &val); + +- //add a branch ++ /** ++ * Create a new branch. ++ * @param name Name of new branch ++ * @see void endbranch() ++ */ + void beginbranch(const std::string &name); ++ /** ++ * Create a new branch. ++ * @param name Name of new branch ++ * @param id "id" value of branch ++ * @see void endbranch() ++ */ + void beginbranch(const std::string &name, int id); + +- //this must be called after each branch (nodes that contains child nodes) ++ /**Closes new branches. ++ * This must be called to exit each branch created by beginbranch( ). ++ * @see void beginbranch(const std::string &name) ++ * @see void beginbranch(const std::string &name, int id) ++ */ + void endbranch(); + +- /********************************/ +- /* LOAD from XML */ +- /********************************/ +- +- //returns 0 if ok or -1 if the file cannot be loaded ++ /** ++ * Loads file into XMLwrapper. ++ * @param filename file to be loaded ++ * @returns 0 if ok or -1 if the file cannot be loaded ++ */ + int loadXMLfile(const std::string &filename); + +- //used by the clipboard ++ /** ++ * Loads string into XMLwrapper. ++ * @param xmldata NULL terminated string of XML data. ++ * @returns true if successful. ++ */ + bool putXMLdata(const char *xmldata); + +- //enter into the branch +- //returns 1 if is ok, or 0 otherwise ++ /** ++ * Enters the branch. ++ * @param name Name of branch. ++ * @returns 1 if is ok, or 0 otherwise. ++ */ + int enterbranch(const std::string &name); + +- +- //enter into the branch with id +- //returns 1 if is ok, or 0 otherwise ++ /** ++ * Enter into the branch \c name with id \c id. ++ * @param name Name of branch. ++ * @param id Value of branch's "id". ++ * @returns 1 if is ok, or 0 otherwise. ++ */ + int enterbranch(const std::string &name, int id); + +- //exits from a branch ++ /**Exits from a branch*/ + void exitbranch(); + +- //get the the branch_id and limits it between the min and max +- //if min==max==0, it will not limit it +- //if there isn't any id, will return min +- //this must be called only imediately after enterbranch() ++ /**Get the the branch_id and limits it between the min and max. ++ * if min==max==0, it will not limit it ++ * if there isn't any id, will return min ++ * this must be called only imediately after enterbranch() ++ */ + int getbranchid(int min, int max); + +- //it returns the parameter and limits it between min and max +- //if min==max==0, it will not limit it +- //if no parameter will be here, the defaultpar will be returned ++ /** ++ * Returns the integer value stored in node name. ++ * It returns the integer value between the limits min and max. ++ * If min==max==0, then the value will not be limited. ++ * If there is no location named name, then defaultpar will be returned. ++ * @param name The parameter name. ++ * @param defaultpar The default value if the real value is not found. ++ * @param min The minimum return value. ++ * @param max The maximum return value. ++ */ + int getpar(const std::string &name,int defaultpar,int min,int max); + +- //the same as getpar, but the limits are 0 and 127 ++ /** ++ * Returns the integer value stored in the node with range [0,127]. ++ * @param name The parameter name. ++ * @param defaultpar The default value if the real value is not found. ++ */ + int getpar127(const std::string &name,int defaultpar); + ++ /** ++ * Returns the boolean value stored in the node. ++ * @param name The parameter name. ++ * @param defaultpar The default value if the real value is not found. ++ */ + int getparbool(const std::string &name,int defaultpar); + ++ /** ++ * Get the string value stored in the node. ++ * @param name The parameter name. ++ * @param par Pointer to destination string ++ * @param maxstrlen Max string length for destination ++ */ + void getparstr(const std::string &name,char *par,int maxstrlen); ++ ++ /** ++ * Returns the real value stored in the node. ++ * @param name The parameter name. ++ * @param defaultpar The default value if the real value is not found. ++ */ + REALTYPE getparreal(const char *name,REALTYPE defaultpar); ++ ++ /** ++ * Returns the real value stored in the node. ++ * @param name The parameter name. ++ * @param defaultpar The default value if the real value is not found. ++ * @param min The minimum value ++ * @param max The maximum value ++ */ + REALTYPE getparreal(const char *name,REALTYPE defaultpar,REALTYPE min,REALTYPE max); + +- bool minimal;//false if all parameters will be stored (used only for clipboard) ++ bool minimal;/** +- //returns the node ++ /** ++ * Adds params like this: ++ * . ++ * @returns The node ++ */ + mxml_node_t *addparams0(const char *name); + +- //adds params like this: +- // +- //returns the node ++ /** ++ * Adds params like this: ++ * . ++ * @returns The node ++ */ + mxml_node_t *addparams1(const char *name,const char *par1,const char *val1); + +- //adds params like this: +- // +- //returns the node ++ /** ++ * Adds params like this: ++ * . ++ * @returns the node ++ */ + mxml_node_t *addparams2(const char *name,const char *par1,const char *val1,const char *par2, const char *val2); + ++ /** ++ * Convert integer to string ++ * @param x integer input ++ * @returns string output ++ */ + char *int2str(int x); ++ ++ /** ++ * Convert integer to string ++ * @param x integer input ++ * @returns string output ++ */ + char *real2str(REALTYPE x); + ++ /** ++ * Convert string to int ++ * @param str string input ++ * @returns integer output ++ */ + int str2int(const char *str); ++ ++ /** ++ * Convert string to realtype ++ * @param x integer input ++ * @returns string output ++ */ + REALTYPE str2real(const char *str); + ++ /**Temporary string for various uses*/ + char tmpstr[TMPSTR_SIZE]; + + +- //this is used to store the parents ++ /**this is used to store the parents. ++ * @todo Use the stack class provided by C++*/ + mxml_node_t *parentstack[STACKSIZE]; +- int stackpos; ++ int stackpos;/** +Date: Tue, 8 Sep 2009 02:59:33 +0000 (-0400) +Subject: Fixed error in XMLwrapper::doloadfile( ) +X-Git-Url: http://zynaddsubfx.git.sourceforge.net/git/gitweb.cgi?p=zynaddsubfx%2Fzynaddsubfx;a=commitdiff_plain;h=5bf008e390b86944b8175c21f2a021a4d6863de2 + +Fixed error in XMLwrapper::doloadfile( ) + +Fixed error that prevented XMLwrapper from loading files on Fedora +--- + +diff --git a/src/Misc/XMLwrapper.cpp b/src/Misc/XMLwrapper.cpp +index 2731d41..078cbb8 100644 +--- a/src/Misc/XMLwrapper.cpp ++++ b/src/Misc/XMLwrapper.cpp +@@ -21,9 +21,13 @@ + */ + + #include "XMLwrapper.h" ++#include + #include + #include ++#include + #include ++#include ++#include + + #include "../globals.h" + #include "Util.h" +@@ -303,48 +307,34 @@ int XMLwrapper::loadXMLfile(const string &filename) + + char *XMLwrapper::doloadfile(const string &filename) + { +- char *xmldata=NULL; +- int filesize=-1; +- +- //try get filesize as gzip data (first) +- gzFile gzfile=gzopen(filename.c_str(),"rb"); +- if (gzfile!=NULL) {//this is a gzip file +- // first check it's size +- while (!gzeof(gzfile)) { +- gzseek (gzfile,1024*1024,SEEK_CUR); +- if (gztell(gzfile)>10000000) { +- gzclose(gzfile); +- goto notgzip;//the file is too big +- }; +- }; +- filesize=gztell(gzfile); +- +- //rewind the file and load the data +- xmldata=new char[filesize+1]; +- ZERO(xmldata,filesize+1); +- +- gzrewind(gzfile); +- gzread(gzfile,xmldata,filesize); ++ char * xmldata = NULL; ++ gzFile gzfile = gzopen(filename.c_str(),"rb"); + +- gzclose(gzfile); +- return (xmldata); +- } else {//this is not a gzip file +-notgzip: +- FILE *file=fopen(filename.c_str(),"rb"); +- if (file==NULL) return(NULL); +- fseek(file,0,SEEK_END); +- filesize=ftell(file); ++ if (gzfile != NULL) {//The possibly compressed file opened + +- xmldata=new char [filesize+1]; +- ZERO(xmldata,filesize+1); ++ stringstream strBuf; //reading stream ++ const int bufSize = 500; //fetch size ++ char fetchBuf[bufSize+1];//fetch buffer ++ int read = 0; //chars read in last fetch + +- rewind(file); +- fread(xmldata,filesize,1,file); ++ fetchBuf[bufSize] = 0;//force null termination + +- fclose(file); +- return(xmldata); +- }; +-}; ++ while(bufSize == (read = gzread(gzfile, fetchBuf, bufSize))) ++ strBuf << fetchBuf; ++ ++ fetchBuf[read] = 0;//Truncate last partial read ++ strBuf << fetchBuf; ++ ++ gzclose(gzfile); ++ ++ //Place data in output format ++ string tmp = strBuf.str(); ++ xmldata = new char[tmp.size()+1]; ++ strncpy(xmldata, tmp.c_str(), tmp.size()+1); ++ } ++ ++ return xmldata; ++} + + bool XMLwrapper::putXMLdata(const char *xmldata) + { +@@ -393,6 +383,7 @@ int XMLwrapper::enterbranch(const string &name,int id) + + void XMLwrapper::exitbranch() + { ++ /**@bug Does not set the current node correctly*/ + pop(); + }; + +@@ -524,13 +515,10 @@ mxml_node_t *XMLwrapper::addparams2(const char *name,const char *par1,const char + return(element); + }; + +- +- +- + void XMLwrapper::push(mxml_node_t *node) + { + if (stackpos>=STACKSIZE-1) { +- printf("BUG!: XMLwrapper::push() - full parentstack\n"); ++ cerr << "BUG!: XMLwrapper::push() - full parentstack" << endl; + return; + }; + stackpos++; +@@ -542,7 +530,7 @@ void XMLwrapper::push(mxml_node_t *node) + mxml_node_t *XMLwrapper::pop() + { + if (stackpos<=0) { +- printf("BUG!: XMLwrapper::pop() - empty parentstack\n"); ++ cerr << "BUG!: XMLwrapper::pop() - empty parentstack" << endl; + return (root); + }; + mxml_node_t *node=parentstack[stackpos]; +@@ -557,7 +545,7 @@ mxml_node_t *XMLwrapper::pop() + mxml_node_t *XMLwrapper::peek() + { + if (stackpos<=0) { +- printf("BUG!: XMLwrapper::peek() - empty parentstack\n"); ++ cerr << "BUG!: XMLwrapper::peek() - empty parentstack" << endl; + return (root); + }; + return(parentstack[stackpos]); +diff --git a/src/Misc/XMLwrapper.h b/src/Misc/XMLwrapper.h +index 9519021..ccf875d 100644 +--- a/src/Misc/XMLwrapper.h ++++ b/src/Misc/XMLwrapper.h +@@ -224,9 +224,12 @@ private: + */ + int dosavefile(const char *filename,int compression,const char *xmldata); + +- /**Loads the file. +- * @param filename the name of the file +- * @returns gunziped contents of file ++ /** ++ * Loads specified file and returns data. ++ * ++ * Will load a gziped file or an uncompressed file. ++ * @param filename the file ++ * @return The decompressed data + */ + char *doloadfile(const std::string &filename); + diff --git a/zynaddsubfx.spec b/zynaddsubfx.spec index 09b5e23..0bfa818 100644 --- a/zynaddsubfx.spec +++ b/zynaddsubfx.spec @@ -1,7 +1,7 @@ Summary: Real-time software synthesizer Name: zynaddsubfx Version: 2.4.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: Applications/Multimedia URL: http://zynaddsubfx.sourceforge.net @@ -11,6 +11,11 @@ Patch0: zynaddsubfx-jack-support.patch Patch1: zynaddsubfx-fltk-config-broken.patch Patch2: zynaddsubfx-fltk-config-broken-2.patch Patch3: zynaddsubfx-build-flags.patch +# Fixed error that prevented XMLwrapper from loading files on Fedora +# http://sourceforge.net/support/tracker.php?aid=2852148 +# Also RHBZ #518755 +Patch4: zynaddsubfx-096a2a2db9bc7d7f9bb2bf8ee12136134708ef23.patch +Patch5: zynaddsubfx-5bf008e390b86944b8175c21f2a021a4d6863de2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: fltk >= 1.1.3 @@ -35,10 +40,12 @@ effects like Reverb, Echo, Chorus, Phaser... %prep %setup -q -n ZynAddSubFX-%{version} -%patch0 -p1 -%patch1 -p0 -%patch2 -p1 -%patch3 -p1 +%patch0 -p1 -b .jack +%patch1 -p0 -b .fltk1 +%patch2 -p1 -b .fltk2 +%patch3 -p1 -b .flags +%patch4 -p1 -b .doxy +%patch5 -p1 -b .loadfiles %build %ifarch %{ix86} x86_64 @@ -125,6 +132,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/icons/hicolor/64x64/apps/zynaddsubfx.png %changelog +* Tue Sep 08 2009 Orcan Ogetbil - 2.4.0-2 +- Bugfix: presets and parameters don't load on ix86 (RHBZ #518755) + * Thu Aug 06 2009 Orcan Ogetbil - 2.4.0-1 - Update to 2.4.0 - Update scriptlets according to new guidelines