bool CFanart::Unpack() { TiXmlDocument doc; doc.Parse(m_xml.c_str()); m_fanart.clear(); m_url.Empty(); TiXmlElement *fanart = doc.FirstChildElement("fanart"); if (fanart) { m_url = fanart->Attribute("url"); TiXmlElement *fanartThumb = fanart->FirstChildElement("thumb"); while (fanartThumb) { SFanartData data; data.strImage = fanartThumb->GetText(); data.strResolution = fanartThumb->Attribute("dim"); data.strPreview = fanartThumb->Attribute("preview"); if (data.strPreview.IsEmpty()) { // could be due to an old version in db - use old hardcoded method for now if (m_url.Equals("http://thetvdb.com/banners/")) data.strPreview = "_cache/" + data.strImage; } ParseColors(fanartThumb->Attribute("colors"), data.strColors); m_fanart.push_back(data); fanartThumb = fanartThumb->NextSiblingElement("thumb"); } } return true; }
void CMusikPrefs::LoadPrefs() { // main dialog m_Dlg_Size = StringToCSize( config->GetValue( "Dialog", "Dialog Size", "800x600" ) ); m_Dlg_Pos = StringToCPoint( config->GetValue( "Dialog", "Dialog Position", "50,50" ) ); m_Dlg_Maximized = StringToBool( config->GetValue( "Dialog", "Maximized", "0" ) ); m_Dlg_ResetUI = StringToBool( config->GetValue( "Dialog", "Reset UI", "1" ) ); // selection area m_SelectionBox_Count = StringToInt( config->GetValue( "Selection Area", "Count", "2" ) ); // playlist m_Playlist_Order = StringToCIntArray( config->GetValue( "Playlist", "Column Order", GetDefPlaylistOrder() ) ); m_Playlist_Sizes = StringToCIntArray( config->GetValue( "Playlist", "Column Sizes", GetDefPlaylistSizes() ) ); // now playing m_NowPlaying_CaptionFont = StringToInt( config->GetValue( "Now Playing", "Caption Font Size", "11" ) ); // player m_Player_Driver = StringToInt( config->GetValue( "Player", "Driver", "0" ) ); m_Player_Device = StringToInt( config->GetValue( "Player", "Device", "0" ) ); m_Player_Rate = StringToInt( config->GetValue( "Player", "Rate", "44100" ) ); m_Player_Max_Channels = StringToInt( config->GetValue( "Player", "Maximum Channels", "6" ) ); // crossfader m_Crossfader_Enabled = StringToBool( config->GetValue( "Crossfader", "Enabled", "1" ) ); m_Crossfader_Current = config->GetValue( "Crossfader", "Set Name", "Default" ); m_Crossfader_Default = StringToCrossfader( config->GetValue( "Crossfader", "Values", "2.0,0.5,1.0,3.0" ) ); // dialog colors MUSIK_COLOR_ACTIVECAPTION = StringToCOLORREF( config->GetValue( "Dialog Colors", "Active Caption", "255,0,255" ) ); MUSIK_COLOR_CAPTIONTEXT = StringToCOLORREF( config->GetValue( "Dialog Colors", "Active Caption Text", "255,0,255" ) ); MUSIK_COLOR_INACTIVECAPTION = StringToCOLORREF( config->GetValue( "Dialog Colors", "Inactive Caption", "255,0,255" ) ); MUSIK_COLOR_INACTIVECAPTIONTEXT = StringToCOLORREF( config->GetValue( "Dialog Colors", "Inactive Caption Text", "255,0,255" ) ); MUSIK_COLOR_BTNFACE = StringToCOLORREF( config->GetValue( "Dialog Colors", "Button Face", "255,0,255" ) ); MUSIK_COLOR_BTNTEXT = StringToCOLORREF( config->GetValue( "Dialog Colors", "Button Text", "255,0,255" ) ); MUSIK_COLOR_BTNHILIGHT = StringToCOLORREF( config->GetValue( "Dialog Colors", "Button Highlight", "255,0,255" ) ); MUSIK_COLOR_BTNSHADOW = StringToCOLORREF( config->GetValue( "Dialog Colors", "Button Shadow", "255,0,255" ) ); MUSIK_COLOR_LISTCTRL = StringToCOLORREF( config->GetValue( "Dialog Colors", "List Background", "255,0,255" ) ); MUSIK_COLOR_LISTCTRLTEXT = StringToCOLORREF( config->GetValue( "Dialog Colors", "List Text", "255,0,255" ) ); MUSIK_COLOR_HIGHLIGHT = StringToCOLORREF( config->GetValue( "Dialog Colors", "Color Highlight", "255,0,255" ) ); MUSIK_COLOR_HIGHLIGHTTEXT = StringToCOLORREF( config->GetValue( "Dialog Colors", "Color Highlight Text", "255,0,255" ) ); ParseColors(); }
bool CFanart::Unpack() { CXBMCTinyXML doc; doc.Parse(m_xml); m_fanart.clear(); TiXmlElement *fanart = doc.FirstChildElement("fanart"); while (fanart) { std::string url = XMLUtils::GetAttribute(fanart, "url"); TiXmlElement *fanartThumb = fanart->FirstChildElement("thumb"); while (fanartThumb) { if (!fanartThumb->NoChildren()) { SFanartData data; if (url.empty()) { data.strImage = fanartThumb->FirstChild()->ValueStr(); data.strPreview = XMLUtils::GetAttribute(fanartThumb, "preview"); } else { data.strImage = URIUtils::AddFileToFolder(url, fanartThumb->FirstChild()->ValueStr()); if (fanartThumb->Attribute("preview")) data.strPreview = URIUtils::AddFileToFolder(url, fanartThumb->Attribute("preview")); } data.strResolution = XMLUtils::GetAttribute(fanartThumb, "dim"); ParseColors(XMLUtils::GetAttribute(fanartThumb, "colors"), data.strColors); m_fanart.push_back(data); } fanartThumb = fanartThumb->NextSiblingElement("thumb"); } fanart = fanart->NextSiblingElement("fanart"); } return true; }