Commit b827c556 authored by Cyril Deguet's avatar Cyril Deguet

* winamp2.xml: support smaller volume bars (65 pixels instead of 68)

* builder.cpp: don't build a subbitmap or a fontbitmap if it already
  exists (so if the xml contains elements with the same id, the first
  valid one is kept)
parent 1bc1b831
...@@ -159,6 +159,12 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData ) ...@@ -159,6 +159,12 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData )
void Builder::addSubBitmap( const BuilderData::SubBitmap &rData ) void Builder::addSubBitmap( const BuilderData::SubBitmap &rData )
{ {
if( m_pTheme->m_bitmaps.find( rData.m_id ) != m_pTheme->m_bitmaps.end() )
{
msg_Dbg( getIntf(), "Bitmap %s already exists", rData.m_id.c_str() );
return;
}
// Get the parent bitmap // Get the parent bitmap
GenericBitmap *pParentBmp = NULL; GenericBitmap *pParentBmp = NULL;
GET_BMP( pParentBmp, rData.m_parent ); GET_BMP( pParentBmp, rData.m_parent );
...@@ -181,6 +187,12 @@ void Builder::addSubBitmap( const BuilderData::SubBitmap &rData ) ...@@ -181,6 +187,12 @@ void Builder::addSubBitmap( const BuilderData::SubBitmap &rData )
void Builder::addBitmapFont( const BuilderData::BitmapFont &rData ) void Builder::addBitmapFont( const BuilderData::BitmapFont &rData )
{ {
if( m_pTheme->m_fonts.find( rData.m_id ) != m_pTheme->m_fonts.end() )
{
msg_Dbg( getIntf(), "Font %s already exists", rData.m_id.c_str() );
return;
}
GenericBitmap *pBmp = GenericBitmap *pBmp =
new FileBitmap( getIntf(), m_pImageHandler, new FileBitmap( getIntf(), m_pImageHandler,
getFilePath( rData.m_file ), 0 ); getFilePath( rData.m_file ), 0 );
......
...@@ -106,7 +106,7 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr ) ...@@ -106,7 +106,7 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
RequireDefault( "width" ); RequireDefault( "width" );
RequireDefault( "height" ); RequireDefault( "height" );
const BuilderData::SubBitmap bitmap( uniqueId( attr["id"] ), const BuilderData::SubBitmap bitmap( attr["id"],
m_curBitmapId, atoi( attr["x"] ), atoi( attr["y"] ), m_curBitmapId, atoi( attr["x"] ), atoi( attr["y"] ),
atoi( attr["width"] ), atoi( attr["height"] ) ); atoi( attr["width"] ), atoi( attr["height"] ) );
m_pData->m_listSubBitmap.push_back( bitmap ); m_pData->m_listSubBitmap.push_back( bitmap );
......
...@@ -117,12 +117,13 @@ ...@@ -117,12 +117,13 @@
</Bitmap> </Bitmap>
<Bitmap id="volume" file="volume.bmp" alphacolor="#FF0001"> <Bitmap id="volume" file="volume.bmp" alphacolor="#FF0001">
<SubBitmap id="volume_bg" x="0" y="0" width="68" height="418" /> <SubBitmap id="volume_bg" x="0" y="0" width="68" height="418" />
<SubBitmap id="volume_bg" x="0" y="0" width="65" height="418" />
<SubBitmap id="volume_up" x="15" y="422" width="14" height="11" /> <SubBitmap id="volume_up" x="15" y="422" width="14" height="11" />
<SubBitmap id="volume_down" x="0" y="422" width="14" height="11" /> <SubBitmap id="volume_down" x="0" y="422" width="14" height="11" />
</Bitmap> </Bitmap>
<Font id="playlist_font" file="FreeSansBold.ttf" size="11" /> <Font id="playlist_font" file="FreeSansBold.ttf" size="11" />
<BitmapFont id="digits_font" file="numbers.bmp" type="digits" />
<BitmapFont id="digits_font" file="nums_ex.bmp" type="digits" /> <BitmapFont id="digits_font" file="nums_ex.bmp" type="digits" />
<BitmapFont id="digits_font" file="numbers.bmp" type="digits" />
<BitmapFont id="text_font" file="text.bmp" type="text" /> <BitmapFont id="text_font" file="text.bmp" type="text" />
<Window id="main_window" x="100" y="100"> <Window id="main_window" x="100" y="100">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment