Commit b704f90f authored by Cyril Deguet's avatar Cyril Deguet

* winamp2.xml: all the equalizer sliders are working !!

* all: the slider background is now in a dedicaded tag 
"SliderBackground". The number of images can now be parametrized
 in both directions, and the offset between 2 images (padhoriz and
 padvert) is no more hardcoded
parent 85fad441
......@@ -332,16 +332,16 @@ void CtrlSliderCursor::getResizeFactors( float &rFactorX,
}
CtrlSliderBg::CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor,
const Bezier &rCurve, VarPercent &rVariable,
int thickness, GenericBitmap *pBackground,
int nbImages, VarBool *pVisible,
const UString &rHelp ):
int nbHoriz, int nbVert, int padHoriz, int padVert,
VarBool *pVisible, const UString &rHelp ):
CtrlGeneric( pIntf, rHelp, pVisible ), m_rCursor( rCursor ),
m_rVariable( rVariable ), m_thickness( thickness ), m_rCurve( rCurve ),
m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ),
m_pImgSeq( NULL ), m_nbImages( nbImages ), m_bgWidth( 0 ),
m_pImgSeq( NULL ), m_nbHoriz( nbHoriz ), m_nbVert( nbVert ),
m_padHoriz( padHoriz ), m_padVert( padVert ), m_bgWidth( 0 ),
m_bgHeight( 0 ), m_position( 0 )
{
if( pBackground )
......@@ -352,14 +352,14 @@ CtrlSliderBg::CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor,
pBackground->getHeight() );
m_pImgSeq->drawBitmap( *pBackground, 0, 0 );
m_bgWidth = pBackground->getWidth();
m_bgHeight = pBackground->getHeight() / nbImages;
m_bgWidth = pBackground->getWidth() / nbHoriz;
m_bgHeight = pBackground->getHeight() / nbVert;
// Observe the position variable
m_rVariable.addObserver( this );
// Initial position
m_position = (int)( m_rVariable.get() * (m_nbImages - 1) );
m_position = (int)( m_rVariable.get() * (m_nbHoriz * m_nbVert - 1) );
}
}
......@@ -386,10 +386,12 @@ void CtrlSliderBg::draw( OSGraphics &rImage, int xDest, int yDest )
{
if( m_pImgSeq )
{
// Locate the right image in the background bitmap
int x = m_bgWidth * ( m_position % m_nbHoriz );
int y = m_bgHeight * ( m_position / m_nbHoriz );
// Draw the background image
// XXX the "-2" is a hack for winamp skins...
rImage.drawGraphics( *m_pImgSeq, 0, m_position * m_bgHeight,
xDest, yDest, m_bgWidth, m_bgHeight - 2);
rImage.drawGraphics( *m_pImgSeq, x, y, xDest, yDest,
m_bgWidth - m_padHoriz, m_bgHeight - m_padVert );
}
}
......@@ -445,7 +447,7 @@ void CtrlSliderBg::handleEvent( EvtGeneric &rEvent )
void CtrlSliderBg::onUpdate( Subject<VarPercent> &rVariable )
{
m_position = (int)( m_rVariable.get() * (m_nbImages - 1) );
m_position = (int)( m_rVariable.get() * (m_nbHoriz * m_nbVert - 1) );
notifyLayout( m_bgWidth, m_bgHeight );
}
......
......@@ -111,8 +111,9 @@ class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent>
public:
CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor,
const Bezier &rCurve, VarPercent &rVariable,
int thickness, GenericBitmap *pBackground, int nbImages,
VarBool *pVisible, const UString &rHelp );
int thickness, GenericBitmap *pBackground, int nbHoriz,
int nbVert, int padHoriz, int padVert, VarBool *pVisible,
const UString &rHelp );
virtual ~CtrlSliderBg();
/// Tell whether the mouse is over the control
......@@ -141,7 +142,9 @@ class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent>
/// Background image sequence (optional)
OSGraphics *m_pImgSeq;
/// Number of images in the background bitmap
int m_nbImages;
int m_nbHoriz, m_nbVert;
/// Number of pixels between two images
int m_padHoriz, m_padVert;
/// Size of a background image
int m_bgWidth, m_bgHeight;
/// Index of the current background image
......
......@@ -591,9 +591,9 @@ void Builder::addSlider( const BuilderData::Slider &rData )
GET_BMP( pBmpOver, rData.m_overId );
GenericBitmap *pBgImage = NULL;
if( rData.m_background != "none" )
if( rData.m_imageId != "none" )
{
GET_BMP( pBgImage, rData.m_background );
GET_BMP( pBgImage, rData.m_imageId );
}
GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
......@@ -632,7 +632,8 @@ void Builder::addSlider( const BuilderData::Slider &rData )
UString( getIntf(), rData.m_help.c_str() ) );
CtrlSliderBg *pBackground = new CtrlSliderBg( getIntf(), *pCursor,
*pCurve, *pVar, rData.m_thickness, pBgImage, rData.m_nbImages,
*pCurve, *pVar, rData.m_thickness, pBgImage, rData.m_nbHoriz,
rData.m_nbVert, rData.m_padHoriz, rData.m_padVert,
pVisible, UString( getIntf(), rData.m_help.c_str() ) );
// Compute the position of the control
......
......@@ -11,7 +11,7 @@ Checkbox id:string xPos:int yPos:int leftTop:string rightBottom:string visible:s
Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:string bmpId:string actionId:string resize:string help:string layer:int windowId:string layoutId:string
Text id:string xPos:int yPos:int visible:string fontId:string text:string width:int leftTop:string rightBottom:string color:uint32_t help:string layer:int windowId:string layoutId:string
RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string
Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string background:string nbImages:int tooltip:string help:string layer:int windowId:string layoutId:string
Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string imageId:string nbHoriz:int nbVert:int padHoriz:int padVert:int tooltip:string help:string layer:int windowId:string layoutId:string
List id:string xPos:int yPos:int visible:string width:int height:int leftTop:string rightBottom:string fontId:string var:string bgImageId:string fgColor:uint32_t playColor:uint32_t bgColor1:uint32_t bgColor2:uint32_t selColor:uint32_t help:string layer:int windowId:string layoutId:string
Tree id:string xPos:int yPos:int visible:string width:int height:int leftTop:string rightBottom:string fontId:string var:string bgImageId:string itemImageId:string openImageId:string closedImageId:string fgColor:uint32_t playColor:uint32_t bgColor1:uint32_t bgColor2:uint32_t selColor:uint32_t help:string layer:int windowId:string layoutId:string
Video id:string xPos:int yPos:int width:int height:int leftTop:string rightBottom:string visible:string autoResize:bool help:string layer:int windowId:string layoutId:string
......@@ -45,7 +45,7 @@ struct BuilderData
Theme( const string & tooltipfont, int magnet, uint32_t alpha, uint32_t moveAlpha ):
m_tooltipfont( tooltipfont ), m_magnet( magnet ), m_alpha( alpha ), m_moveAlpha( moveAlpha ) {}
const string m_tooltipfont;
string m_tooltipfont;
int m_magnet;
uint32_t m_alpha;
uint32_t m_moveAlpha;
......@@ -59,8 +59,8 @@ m_tooltipfont( tooltipfont ), m_magnet( magnet ), m_alpha( alpha ), m_moveAlpha(
Bitmap( const string & id, const string & fileName, uint32_t alphaColor ):
m_id( id ), m_fileName( fileName ), m_alphaColor( alphaColor ) {}
const string m_id;
const string m_fileName;
string m_id;
string m_fileName;
uint32_t m_alphaColor;
};
/// List
......@@ -72,8 +72,8 @@ m_id( id ), m_fileName( fileName ), m_alphaColor( alphaColor ) {}
SubBitmap( const string & id, const string & parent, int x, int y, int width, int height ):
m_id( id ), m_parent( parent ), m_x( x ), m_y( y ), m_width( width ), m_height( height ) {}
const string m_id;
const string m_parent;
string m_id;
string m_parent;
int m_x;
int m_y;
int m_width;
......@@ -88,9 +88,9 @@ m_id( id ), m_parent( parent ), m_x( x ), m_y( y ), m_width( width ), m_height(
BitmapFont( const string & id, const string & file, const string & type ):
m_id( id ), m_file( file ), m_type( type ) {}
const string m_id;
const string m_file;
const string m_type;
string m_id;
string m_file;
string m_type;
};
/// List
list<BitmapFont> m_listBitmapFont;
......@@ -101,8 +101,8 @@ m_id( id ), m_file( file ), m_type( type ) {}
Font( const string & id, const string & fontFile, int size ):
m_id( id ), m_fontFile( fontFile ), m_size( size ) {}
const string m_id;
const string m_fontFile;
string m_id;
string m_fontFile;
int m_size;
};
/// List
......@@ -114,7 +114,7 @@ m_id( id ), m_fontFile( fontFile ), m_size( size ) {}
Window( const string & id, int xPos, int yPos, bool visible, bool dragDrop, bool playOnDrop ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_dragDrop( dragDrop ), m_playOnDrop( playOnDrop ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
bool m_visible;
......@@ -130,14 +130,14 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_dragDrop( dr
Layout( const string & id, int width, int height, int minWidth, int maxWidth, int minHeight, int maxHeight, const string & windowId ):
m_id( id ), m_width( width ), m_height( height ), m_minWidth( minWidth ), m_maxWidth( maxWidth ), m_minHeight( minHeight ), m_maxHeight( maxHeight ), m_windowId( windowId ) {}
const string m_id;
string m_id;
int m_width;
int m_height;
int m_minWidth;
int m_maxWidth;
int m_minHeight;
int m_maxHeight;
const string m_windowId;
string m_windowId;
};
/// List
list<Layout> m_listLayout;
......@@ -152,8 +152,8 @@ m_xPos( xPos ), m_yPos( yPos ), m_range( range ), m_priority( priority ), m_poin
int m_yPos;
int m_range;
int m_priority;
const string m_points;
const string m_layoutId;
string m_points;
string m_layoutId;
};
/// List
list<Anchor> m_listAnchor;
......@@ -164,21 +164,21 @@ m_xPos( xPos ), m_yPos( yPos ), m_range( range ), m_priority( priority ), m_poin
Button( const string & id, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & visible, const string & upId, const string & downId, const string & overId, const string & actionId, const string & tooltip, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_visible( visible ), m_upId( upId ), m_downId( downId ), m_overId( overId ), m_actionId( actionId ), m_tooltip( tooltip ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
const string m_leftTop;
const string m_rightBottom;
const string m_visible;
const string m_upId;
const string m_downId;
const string m_overId;
const string m_actionId;
const string m_tooltip;
const string m_help;
string m_leftTop;
string m_rightBottom;
string m_visible;
string m_upId;
string m_downId;
string m_overId;
string m_actionId;
string m_tooltip;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<Button> m_listButton;
......@@ -189,27 +189,27 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
Checkbox( const string & id, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & visible, const string & up1Id, const string & down1Id, const string & over1Id, const string & up2Id, const string & down2Id, const string & over2Id, const string & state, const string & action1, const string & action2, const string & tooltip1, const string & tooltip2, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_visible( visible ), m_up1Id( up1Id ), m_down1Id( down1Id ), m_over1Id( over1Id ), m_up2Id( up2Id ), m_down2Id( down2Id ), m_over2Id( over2Id ), m_state( state ), m_action1( action1 ), m_action2( action2 ), m_tooltip1( tooltip1 ), m_tooltip2( tooltip2 ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
const string m_leftTop;
const string m_rightBottom;
const string m_visible;
const string m_up1Id;
const string m_down1Id;
const string m_over1Id;
const string m_up2Id;
const string m_down2Id;
const string m_over2Id;
const string m_state;
const string m_action1;
const string m_action2;
const string m_tooltip1;
const string m_tooltip2;
const string m_help;
string m_leftTop;
string m_rightBottom;
string m_visible;
string m_up1Id;
string m_down1Id;
string m_over1Id;
string m_up2Id;
string m_down2Id;
string m_over2Id;
string m_state;
string m_action1;
string m_action2;
string m_tooltip1;
string m_tooltip2;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<Checkbox> m_listCheckbox;
......@@ -220,19 +220,19 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
Image( const string & id, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & visible, const string & bmpId, const string & actionId, const string & resize, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_visible( visible ), m_bmpId( bmpId ), m_actionId( actionId ), m_resize( resize ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
const string m_leftTop;
const string m_rightBottom;
const string m_visible;
const string m_bmpId;
const string m_actionId;
const string m_resize;
const string m_help;
string m_leftTop;
string m_rightBottom;
string m_visible;
string m_bmpId;
string m_actionId;
string m_resize;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<Image> m_listImage;
......@@ -243,20 +243,20 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
Text( const string & id, int xPos, int yPos, const string & visible, const string & fontId, const string & text, int width, const string & leftTop, const string & rightBottom, uint32_t color, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_fontId( fontId ), m_text( text ), m_width( width ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_color( color ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
const string m_visible;
const string m_fontId;
const string m_text;
string m_visible;
string m_fontId;
string m_text;
int m_width;
const string m_leftTop;
const string m_rightBottom;
string m_leftTop;
string m_rightBottom;
uint32_t m_color;
const string m_help;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<Text> m_listText;
......@@ -267,22 +267,22 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_fontId( font
RadialSlider( const string & id, const string & visible, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & sequence, int nbImages, float minAngle, float maxAngle, const string & value, const string & tooltip, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_visible( visible ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_sequence( sequence ), m_nbImages( nbImages ), m_minAngle( minAngle ), m_maxAngle( maxAngle ), m_value( value ), m_tooltip( tooltip ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
const string m_visible;
string m_id;
string m_visible;
int m_xPos;
int m_yPos;
const string m_leftTop;
const string m_rightBottom;
const string m_sequence;
string m_leftTop;
string m_rightBottom;
string m_sequence;
int m_nbImages;
float m_minAngle;
float m_maxAngle;
const string m_value;
const string m_tooltip;
const string m_help;
string m_value;
string m_tooltip;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<RadialSlider> m_listRadialSlider;
......@@ -290,28 +290,31 @@ m_id( id ), m_visible( visible ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( lef
/// Type definition
struct Slider
{
Slider( const string & id, const string & visible, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & upId, const string & downId, const string & overId, const string & points, int thickness, const string & value, const string & background, int nbImages, const string & tooltip, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_visible( visible ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_upId( upId ), m_downId( downId ), m_overId( overId ), m_points( points ), m_thickness( thickness ), m_value( value ), m_background( background ), m_nbImages( nbImages ), m_tooltip( tooltip ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
Slider( const string & id, const string & visible, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & upId, const string & downId, const string & overId, const string & points, int thickness, const string & value, const string & imageId, int nbHoriz, int nbVert, int padHoriz, int padVert, const string & tooltip, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_visible( visible ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_upId( upId ), m_downId( downId ), m_overId( overId ), m_points( points ), m_thickness( thickness ), m_value( value ), m_imageId( imageId ), m_nbHoriz( nbHoriz ), m_nbVert( nbVert ), m_padHoriz( padHoriz ), m_padVert( padVert ), m_tooltip( tooltip ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
const string m_visible;
string m_id;
string m_visible;
int m_xPos;
int m_yPos;
const string m_leftTop;
const string m_rightBottom;
const string m_upId;
const string m_downId;
const string m_overId;
const string m_points;
string m_leftTop;
string m_rightBottom;
string m_upId;
string m_downId;
string m_overId;
string m_points;
int m_thickness;
const string m_value;
const string m_background;
int m_nbImages;
const string m_tooltip;
const string m_help;
string m_value;
string m_imageId;
int m_nbHoriz;
int m_nbVert;
int m_padHoriz;
int m_padVert;
string m_tooltip;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<Slider> m_listSlider;
......@@ -322,26 +325,26 @@ m_id( id ), m_visible( visible ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( lef
List( const string & id, int xPos, int yPos, const string & visible, int width, int height, const string & leftTop, const string & rightBottom, const string & fontId, const string & var, const string & bgImageId, uint32_t fgColor, uint32_t playColor, uint32_t bgColor1, uint32_t bgColor2, uint32_t selColor, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_width( width ), m_height( height ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_fontId( fontId ), m_var( var ), m_bgImageId( bgImageId ), m_fgColor( fgColor ), m_playColor( playColor ), m_bgColor1( bgColor1 ), m_bgColor2( bgColor2 ), m_selColor( selColor ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
const string m_visible;
string m_visible;
int m_width;
int m_height;
const string m_leftTop;
const string m_rightBottom;
const string m_fontId;
const string m_var;
const string m_bgImageId;
string m_leftTop;
string m_rightBottom;
string m_fontId;
string m_var;
string m_bgImageId;
uint32_t m_fgColor;
uint32_t m_playColor;
uint32_t m_bgColor1;
uint32_t m_bgColor2;
uint32_t m_selColor;
const string m_help;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<List> m_listList;
......@@ -352,29 +355,29 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_width( width
Tree( const string & id, int xPos, int yPos, const string & visible, int width, int height, const string & leftTop, const string & rightBottom, const string & fontId, const string & var, const string & bgImageId, const string & itemImageId, const string & openImageId, const string & closedImageId, uint32_t fgColor, uint32_t playColor, uint32_t bgColor1, uint32_t bgColor2, uint32_t selColor, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_width( width ), m_height( height ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_fontId( fontId ), m_var( var ), m_bgImageId( bgImageId ), m_itemImageId( itemImageId ), m_openImageId( openImageId ), m_closedImageId( closedImageId ), m_fgColor( fgColor ), m_playColor( playColor ), m_bgColor1( bgColor1 ), m_bgColor2( bgColor2 ), m_selColor( selColor ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
const string m_visible;
string m_visible;
int m_width;
int m_height;
const string m_leftTop;
const string m_rightBottom;
const string m_fontId;
const string m_var;
const string m_bgImageId;
const string m_itemImageId;
const string m_openImageId;
const string m_closedImageId;
string m_leftTop;
string m_rightBottom;
string m_fontId;
string m_var;
string m_bgImageId;
string m_itemImageId;
string m_openImageId;
string m_closedImageId;
uint32_t m_fgColor;
uint32_t m_playColor;
uint32_t m_bgColor1;
uint32_t m_bgColor2;
uint32_t m_selColor;
const string m_help;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<Tree> m_listTree;
......@@ -385,19 +388,19 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_width( width
Video( const string & id, int xPos, int yPos, int width, int height, const string & leftTop, const string & rightBottom, const string & visible, bool autoResize, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_width( width ), m_height( height ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_visible( visible ), m_autoResize( autoResize ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
string m_id;
int m_xPos;
int m_yPos;
int m_width;
int m_height;
const string m_leftTop;
const string m_rightBottom;
const string m_visible;
string m_leftTop;
string m_rightBottom;
string m_visible;
bool m_autoResize;
const string m_help;
string m_help;
int m_layer;
const string m_windowId;
const string m_layoutId;
string m_windowId;
string m_layoutId;
};
/// List
list<Video> m_listVideo;
......
......@@ -79,8 +79,6 @@ while 1:
initlist += ", "
initlist += "m_" + varname + "( " + varname + " )"
vartype = vardef[1]
if vartype == "string":
vartype = "const string"
vars += " " + vartype + " m_" + varname + ";\n"
str += constructor + " ):\n" + initlist + " {}\n\n"
str += vars + " };\n"
......
......@@ -363,8 +363,6 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
CheckDefault( "over", "none" );
CheckDefault( "thickness", "10" );
CheckDefault( "value", "none" );
CheckDefault( "background", "none" );
CheckDefault( "nbimages", "1" );
CheckDefault( "tooltiptext", "" );
CheckDefault( "help", "" );
......@@ -380,17 +378,34 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
newValue = "playtree.slider";
}
const BuilderData::Slider slider( uniqueId( attr["id"] ),
attr["visible"],
atoi( attr["x"] ) + m_xOffset, atoi( attr["y"] ) + m_yOffset,
attr["lefttop"], attr["rightbottom"], attr["up"], attr["down"],
attr["visible"], atoi( attr["x"] ) + m_xOffset,
atoi( attr["y"] ) + m_yOffset, attr["lefttop"],
attr["rightbottom"], attr["up"], attr["down"],
attr["over"], attr["points"], atoi( attr["thickness"] ),
newValue, attr["background"], atoi( attr["nbimages"] ),
attr["tooltiptext"], attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId );
newValue, "none", 0, 0, 0, 0, attr["tooltiptext"],
attr["help"], m_curLayer, m_curWindowId, m_curLayoutId );
m_curLayer++;
m_pData->m_listSlider.push_back( slider );
}
else if( rName == "SliderBackground" )
{
RequireDefault( "image" );
CheckDefault( "nbhoriz", "1" );
CheckDefault( "nbvert", "1" );
CheckDefault( "padhoriz", "0" );
CheckDefault( "padvert", "0" );
// Retrieve the current slider data
BuilderData::Slider &slider = m_pData->m_listSlider.back();
slider.m_imageId = attr["image"];
slider.m_nbHoriz = atoi( attr["nbhoriz"] );
slider.m_nbVert = atoi( attr["nbvert"] );
slider.m_padHoriz = atoi( attr["padhoriz"] );
slider.m_padVert = atoi( attr["padvert"] );
}
else if( rName == "Text" )
{
RequireDefault( "font" );
......
......@@ -58,7 +58,6 @@
dragdrop CDATA "true"
playondrop CDATA "true"
>
<!ELEMENT Layout (Group)>
<!ATTLIST Layout
id CDATA "none"
......@@ -151,10 +150,18 @@
thickness CDATA "10"
value CDATA "none"
background CDATA "none"
nbimages CDATA "1"
tooltiptext CDATA ""
help CDATA ""
>
<!ELEMENT SliderBackground EMPTY>
<!ATTLIST SliderBackground
id CDATA "none"
image CDATA #REQUIRED
nbhoriz CDATA "1"
nbvert CDATA "1"
padhoriz CDATA "0"
padvert CDATA "0"
>
<!ELEMENT RadialSlider EMPTY>
<!ATTLIST RadialSlider
id CDATA "none"
......
......@@ -20,6 +20,14 @@
</Bitmap>
<Bitmap id="eqmain" file="eqmain.bmp" alphacolor="#FF0000">
<SubBitmap id="eq_bg" x="0" y="0" width="275" height="116" />
<SubBitmap id="eq_title_focus" x="0" y="134" width="275" height="14" />
<SubBitmap id="eq_notok_up" x="10" y="119" width="26" height="12" />
<SubBitmap id="eq_ok_up" x="69" y="119" width="26" height="12" />
<SubBitmap id="eq_notok_down" x="128" y="119" width="26" height="12" />
<SubBitmap id="eq_ok_down" x="187" y="119" width="26" height="12" />
<SubBitmap id="eq_slider_up" x="0" y="164" width="11" height="11" />
<SubBitmap id="eq_slider_down" x="0" y="176" width="11" height="11" />
<SubBitmap id="eq_slider_bg" x="13" y="164" width="210" height="130" />
</Bitmap>
<Bitmap id="pledit" file="pledit.bmp" alphacolor="#FF0000">
<SubBitmap id="pl_upleft_focus" x="0" y="0" width="25" height="20" />
......@@ -81,7 +89,9 @@
<Image x="0" y="0" image="title_focus" action="move" />
<Text font="digits_font" x="30" y="26" width="75" text="$T"/>
<Text font="text_font" x="111" y="27" width="155" text="$N"/>
<Slider value="volume" x="107" y="57" up="volume_up" down="volume_down" points="(7,6),(58,6)" background="volume_bg" nbimages="28" tooltiptext="Volume: $V%" />
<Slider value="volume" x="107" y="57" up="volume_up" down="volume_down" points="(7,6),(58,6)" tooltiptext="Volume: $V%">
<SliderBackground image="volume_bg" nbvert="28" padvert="1"/>
</Slider>
<Image x="16" y="72" image="time_bg"/>
<Slider value="time" x="29" y="77" up="time_up" down="time_down" points="(0,0),(220,0)" thickness="5" tooltiptext="Time: $T"/>
<Button x="263" y="3" up="quit_up" down="quit_down" over="quit_up" action="vlc.quit()" tooltiptext="Quit" />
......@@ -108,6 +118,38 @@
<Anchor x="275" y="116" priority="40" range="15" />
<Anchor x="20" y="116" points="(0,0),(235,0)" priority="30" range="15" />
<Image x="0" y="0" image="eq_bg" action="move" />
<Image x="0" y="0" image="eq_title_focus" action="move" />
<Checkbox x="15" y="20" up1="eq_notok_up" down1="eq_notok_down" up2="eq_ok_up" down2="eq_ok_down" state="equalizer.isEnabled" action1="equalizer.enable()" action2="equalizer.disable()" tooltiptext1="Enable equalizer" tooltiptext2="Disable equalizer"/>
<Slider value="equalizer.band(0)" x="78" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(1)" x="96" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(2)" x="114" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(3)" x="132" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(4)" x="150" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(5)" x="168" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(6)" x="186" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(7)" x="204" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(8)" x="222" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
<Slider value="equalizer.band(9)" x="240" y="37" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext="">
<SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1"/>
</Slider>
</Group>
</Layout>
</Window>
......
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