Skip to content

Commit

Permalink
allow slider actions (volume/seek sliders) to have the precision of f…
Browse files Browse the repository at this point in the history
…loats, rather than being constrained to integral percentages
  • Loading branch information
Jonathan Marshall committed Feb 10, 2013
1 parent 9baaeda commit bc32307
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xbmc/guilib/GUISliderControl.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "GUIWindowManager.h" #include "GUIWindowManager.h"


static const SliderAction actions[] = { static const SliderAction actions[] = {
{"seek", "PlayerControl(SeekPercentage(%2d))", PLAYER_PROGRESS, false}, {"seek", "PlayerControl(SeekPercentage(%2f))", PLAYER_PROGRESS, false},
{"volume", "SetVolume(%2d)", PLAYER_VOLUME, true} {"volume", "SetVolume(%2f)", PLAYER_VOLUME, true}
}; };


CGUISliderControl::CGUISliderControl(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& backGroundTexture, const CTextureInfo& nibTexture, const CTextureInfo& nibTextureFocus, int iType) CGUISliderControl::CGUISliderControl(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& backGroundTexture, const CTextureInfo& nibTexture, const CTextureInfo& nibTextureFocus, int iType)
Expand Down Expand Up @@ -246,8 +246,8 @@ void CGUISliderControl::Move(int iNumSteps)


void CGUISliderControl::SendClick() void CGUISliderControl::SendClick()
{ {
int percent = MathUtils::round_int(100*GetProportion()); float percent = 100*GetProportion();
SEND_CLICK_MESSAGE(GetID(), GetParentID(), percent); SEND_CLICK_MESSAGE(GetID(), GetParentID(), MathUtils::round_int(percent));
if (m_action && (!m_dragging || m_action->fireOnDrag)) if (m_action && (!m_dragging || m_action->fireOnDrag))
{ {
CStdString action; CStdString action;
Expand Down

0 comments on commit bc32307

Please sign in to comment.