On Thursday 19 July 2007 02:23, Cesare Marilungo wrote: > D. Michael McIntyre wrote: > > On Wednesday 18 July 2007, Cesare Marilungo wrote: > >> Some weeks ago I've sent a mail to the list to discuss the ability to > >> load and save individual effects/synths presets in the plugin dialog. I > >> got no replies, and I hope I haven't said something stupid. > > > > Probably not stupid.
Not at all. I think it was just that bit too involved a question for anyone to have an instant answer for, and it probably arrived at a time when nobody had much time to think about it (which admittedly is pretty much any time). Like Michael, I read it and mentally shelved it for later. Sorry about that. Unlike our XML export code, which is located within the particular class being exported, we only have one single large XML import class (RoseXmlHandler, in src/document/) which reads a complete document in one go. In cases where we only need to import part of a document -- for example, when importing a .rgd device file, which consists of just the studio element from a .rg file -- we do it by importing the file as if it were a complete document, into a new RosegardenGUIDoc object, and then copying the devices we need from the imported document to the current one as appropriate. The plugin case would be quite similar to that, I expect. You can see an example of this logic in the interaction of BankEditorDialog (src/gui/studio) and ImportDeviceDialog (src/dialogs -- don't ask why these two related dialogs are in different parts of the source tree, it's probably a reorganisational mistake). The former calls doImport on the latter, which calls importFromRG if the source is a .rgd file, and this function (ImportDeviceDialog::importFromRG) does what I just described -- it loads a complete document from the .rgd file, and then copies the device and bank structures from it into local data members which are subsequently queried using the various get...() methods by BankEditorDialog. Note also that RosegardenGUIDoc::openDocument doesn't care whether the file it's loading is plain or gzipped XML. If you don't fancy looking into this yourself, you could send a patch for whatever you have now, and see if anyone picks it up. It's more likely to get looked at, by me or someone else here, if it's half-done already. > By the way, is it ok to ask about features requests here on this list? Yes. Chris ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
