2010-03-26, 02:32
EDIT --- duplicated post, please delete
jmarshall Wrote:Note that the export to XML brings other benefits which is why I bothered doing it: It's a text based format that can be altered more easily if one doesn't know SQL, and (more importantly) it's independent of the database layout, and can thus be used to transistion to a new, shinier schema.That's a very good point.
Quote:Is there any chance to include file settings(like zoom level, aspect ratio, etc.) in the exported XML? IMHO with that addition the export/import functionality would be almost perfect.
jmarshall Wrote:Sure - I just haven't been arsed doing it as yet. A patch would be most welcome if you're that way inclined.Thanks, but C++ is not my poison...
Cheers,
Jonathan
spiff Wrote:.NET
that evil poison we stay far far away from. xbmc runs on bare metal.
jmarshall Wrote:Sure - I just haven't been arsed doing it as yet. A patch would be most welcome if you're that way inclined.Well, I've drunk the beers, and I'm trying to make the modifications myself (using my very poor knowledge of C++):
TiXmlElement filesettings("filesettings");
XMLUtils::SetInt(&filesettings, "interleaved", m_settings.m_InterlaceMethod);
XMLUtils::SetInt(&filesettings, "viewmode", m_settings.m_ViewMode);
XMLUtils::SetFloat(&filesettings, "zoomamount", m_settings.m_CustomZoomAmount);
XMLUtils::SetFloat(&filesettings, "pixelratio", m_settings.m_CustomPixelRatio);
movie->InsertEndChild(filesettings);
jmarshall Wrote:You've got the right basic idea, but it's complicated somewhat by all the settings we have and how they're linked up - settings apply to files not just library files. I suspect it may be more useful just to dump out all the settings in a different block so that we ensure we dump them for files not in the main library.Thanks for the tip jmarshall, I understand that file settings are being stored for all video files and not just the ones in the library, but at least for me it's not important to save the setting for files not in the library, there maybe items in the settings table that are long gone from my disk so I'm not so sure if it is a good idea to just export all the settings.
Basically you'd just iterate through the settings table separately and dump out filename+path and the settings into an XML block. eg something like:
<settings>
<file path="full path here">
<interleaved></interleaved>
...
</file>
</settings>
or something.
ashlar Wrote:charrua, thanks a lot for contributing to this. It's really appreciated. At least by me.Thanks ashlar, no problem at all. I'm glad to help and learn a bit in the process
spiff Wrote:change the function to use m_pDS2 IF it is safe. if not, you have to use a new dataset.Thanks spiff, I already tried both: first used m_pDS, then m_pDS2 and then defined m_pDS3 and m_pDS4 to also change the dataset used in GetFileId that is called from GetVideoSettings, but I'm still having the same problem...
spiff Wrote:afaict from a *brief* look, you need to change GetPathId(), GetFileId() and GetVideoSettings(). it's highly sensitive code though, as those are possibly called elsewhere where we rely on them not touching m_pDS2.Thanks again spiff! The problem was in GetPathId(), I didn't see the call from GetFileID() to that function, I used new datasets for each one so there's not danger of touching m_pDS and m_pDS2 by mistake.