void WgSimpleVolumeMeter::SetSections( float bottomFraction, float topFraction ) { if( bottomFraction < 0.f ) bottomFraction = 0.f; if( bottomFraction > 1.f ) bottomFraction = 1.f; if( topFraction < 0.f ) topFraction = 0.f; float middleFraction = 1.f - bottomFraction - topFraction; if( middleFraction < 0.f ) middleFraction = 0.f; topFraction = 1.f - bottomFraction - middleFraction; if( bottomFraction != m_sectionHeight[0] || topFraction != m_sectionHeight[2] ) { m_sectionHeight[0] = bottomFraction; m_sectionHeight[1] = middleFraction; m_sectionHeight[2] = topFraction; _updateSectionPixelHeight(); _requestRender(); } }
void WgSimpleVolumeMeter::_onCloneContent( const WgWidget * _pOrg ) { const WgSimpleVolumeMeter * pOrg = static_cast<const WgSimpleVolumeMeter*>(_pOrg); for( int i = 0 ; i < 3 ; i++ ) { m_sectionColors[i] = pOrg->m_sectionColors[i]; m_sectionHeight[i] = pOrg->m_sectionHeight[i]; } m_holdHeight = pOrg->m_holdHeight; m_bStereo = pOrg->m_bStereo; m_peak[0] = pOrg->m_peak[0]; m_peak[1] = pOrg->m_peak[1]; m_hold[0] = pOrg->m_hold[0]; m_hold[1] = pOrg->m_hold[1]; _updateSectionPixelHeight(); }
void WgSimpleVolumeMeter::_onSkinChanged( const WgSkinPtr& pOldSkin, const WgSkinPtr& pNewSkin ) { WgWidget::_onSkinChanged(pOldSkin,pNewSkin); _updateSectionPixelHeight(); }
void WgSimpleVolumeMeter::_onNewSize( const WgSize& size ) { _updateSectionPixelHeight(); _requestRender(); }
void SimpleVolumeMeter::_onSkinChanged( const Skin_p& pOldSkin, const Skin_p& pNewSkin ) { Widget::_onSkinChanged(pOldSkin,pNewSkin); _updateSectionPixelHeight(); }