Renamed Slider class to PosBar.

This commit is contained in:
Daniel Svensson 2006-08-18 14:39:15 +02:00
parent d114edf75f
commit 0c233da62a
5 changed files with 38 additions and 38 deletions

View file

@ -10,7 +10,7 @@
#include "TimeDisplay.h"
#include "SmallNumberDisplay.h"
#include "StereoMono.h"
#include "Slider.h"
#include "PosBar.h"
#include "PlayStatus.h"
#include "VolumeSlider.h"
#include "Playlist.h"
@ -51,10 +51,10 @@ MainDisplay::MainDisplay (QWidget *parent) : SkinDisplay(parent)
m_clutterbar = new ClutterBar (this);
m_clutterbar->move (10, 22);
m_slider = new Slider (this, Skin::POSBAR,
m_posbar = new PosBar (this, Skin::POSBAR,
Skin::POSBAR_BTN_0,
Skin::POSBAR_BTN_1);
m_slider->move (16, 72);
m_posbar->move (16, 72);
m_playstatus = new PlayStatus (this);
m_playstatus->move (24, 28);
@ -105,8 +105,8 @@ MainDisplay::setStatus (Xmms::Playback::Status status)
{
if (status == Xmms::Playback::STOPPED) {
m_time->setTime(0);
m_slider->setPos (0);
m_slider->hideBar (true);
m_posbar->setPos (0);
m_posbar->hideBar (true);
}
}
@ -115,7 +115,7 @@ MainDisplay::setPlaytime (uint time)
{
uint showtime;
if (m_mw->isTimemodeReverse()) {
uint maxtime = m_slider->getMax();
uint maxtime = m_posbar->getMax();
showtime = -(maxtime - time);
} else {
showtime = time;
@ -123,7 +123,7 @@ MainDisplay::setPlaytime (uint time)
m_time->setTime (showtime);
// update slider
m_slider->setPos (time);
m_posbar->setPos (time);
}
void
@ -166,10 +166,10 @@ MainDisplay::setMediainfo (const Xmms::PropDict &info)
}
if (info.contains ("duration")) {
m_slider->setMax (info.get<int32_t> ("duration"));
m_slider->hideBar (false);
m_posbar->setMax (info.get<int32_t> ("duration"));
m_posbar->hideBar (false);
} else {
m_slider->hideBar (true);
m_posbar->hideBar (true);
}
}

View file

@ -36,7 +36,7 @@ class TextScroller;
class TimeDisplay;
class SmallNumberDisplay;
class StereoMono;
class Slider;
class PosBar;
class VolumeSlider;
class PlayStatus;
class MainWindow;
@ -58,7 +58,7 @@ class MainDisplay : public SkinDisplay
SmallNumberDisplay *m_khz;
StereoMono *m_stereo;
Slider *m_slider;
PosBar *m_posbar;
VolumeSlider *m_vslider;
PlayStatus *m_playstatus;

View file

@ -1,21 +1,21 @@
#include "MainWindow.h"
#include "Slider.h"
#include "PosBar.h"
#include "Skin.h"
#include <QWidget>
#include <QMouseEvent>
BarButton::BarButton (QWidget *parent, uint normal, uint pressed) : Button (parent, normal, pressed)
PosButton::PosButton (QWidget *parent, uint normal, uint pressed) : Button (parent, normal, pressed)
{
m_slider = dynamic_cast<Slider *>(parent);
m_slider = dynamic_cast<PosBar *>(parent);
setMinimumSize (29, 10);
setMaximumSize (29, 10);
m_moving = false;
}
void
BarButton::setPos (uint pos)
PosButton::setPos (uint pos)
{
m_pos = pos;
if (!m_moving) {
@ -24,13 +24,13 @@ BarButton::setPos (uint pos)
}
uint
BarButton::getPos (void)
PosButton::getPos (void)
{
return m_pos;
}
void
BarButton::mousePressEvent (QMouseEvent *event)
PosButton::mousePressEvent (QMouseEvent *event)
{
QPoint p (event->pos ());
@ -39,7 +39,7 @@ BarButton::mousePressEvent (QMouseEvent *event)
}
void
BarButton::mouseReleaseEvent (QMouseEvent *event)
PosButton::mouseReleaseEvent (QMouseEvent *event)
{
m_moving = false;
@ -49,7 +49,7 @@ BarButton::mouseReleaseEvent (QMouseEvent *event)
}
void
BarButton::mouseMoveEvent (QMouseEvent *event)
PosButton::mouseMoveEvent (QMouseEvent *event)
{
QPoint p (event->pos ());
@ -77,7 +77,7 @@ BarButton::mouseMoveEvent (QMouseEvent *event)
}
Slider::Slider (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vertical) : PixWidget (parent)
PosBar::PosBar (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vertical) : PixWidget (parent)
{
m_bg = bg;
m_vertical = vertical;
@ -87,7 +87,7 @@ Slider::Slider (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vert
m_max = 0;
m_button = new BarButton (this, bnormal, bpressed);
m_button = new PosButton (this, bnormal, bpressed);
m_button->move (0, 0);
if (m_vertical) {
@ -101,7 +101,7 @@ Slider::Slider (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vert
}
void
Slider::setSize (uint x, uint y)
PosBar::setSize (uint x, uint y)
{
setMinimumSize (x, y);
setMaximumSize (x, y);
@ -115,7 +115,7 @@ Slider::setSize (uint x, uint y)
}
uint
Slider::getPos (void)
PosBar::getPos (void)
{
if (m_vertical) {
@ -126,7 +126,7 @@ Slider::getPos (void)
}
void
Slider::hideBar (bool b)
PosBar::hideBar (bool b)
{
if (b) {
@ -139,7 +139,7 @@ Slider::hideBar (bool b)
}
void
Slider::setPos (uint p)
PosBar::setPos (uint p)
{
if (!m_max) {
return;
@ -153,13 +153,13 @@ Slider::setPos (uint p)
}
void
Slider::requestPos (float value)
PosBar::requestPos (float value)
{
XMMSHandler::getInstance ().setPlaytime (m_max * value);
}
void
Slider::setPixmaps (Skin *skin)
PosBar::setPixmaps (Skin *skin)
{
m_pixmap = skin->getItem (m_bg);
}

View file

@ -4,12 +4,12 @@
#include "PixWidget.h"
#include "Button.h"
class Slider;
class PosBar;
class BarButton : public Button
class PosButton : public Button
{
public:
BarButton (QWidget *, uint, uint);
PosButton (QWidget *, uint, uint);
void mouseMoveEvent (QMouseEvent *);
void mousePressEvent (QMouseEvent *);
@ -19,18 +19,18 @@ class BarButton : public Button
uint getPos (void);
private:
Slider *m_slider;
PosBar *m_slider;
bool m_moving;
uint m_pos;
};
class Slider : public PixWidget
class PosBar : public PixWidget
{
Q_OBJECT
public:
Slider (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vertical=true);
~Slider () { }
PosBar (QWidget *parent, uint bg, uint bnormal, uint bpressed, bool vertical=true);
~PosBar () { }
void setSize (uint, uint);
uint getPos (void);
@ -50,7 +50,7 @@ class Slider : public PixWidget
int m_bg;
uint m_max;
uint m_pix;
BarButton *m_button;
PosButton *m_button;
};

View file

@ -13,7 +13,7 @@ SOURCES += XmmsQT4.cpp \
XMMSSocket.cpp \
SmallNumberDisplay.cpp \
StereoMono.cpp \
Slider.cpp \
PosBar.cpp \
PlayStatus.cpp \
ShadedDisplay.cpp \
Playlist.cpp \
@ -47,7 +47,7 @@ HEADERS += XmmsQT4.h \
XMMSSocket.h \
SmallNumberDisplay.h \
StereoMono.h \
Slider.h \
PosBar.h \
PlayStatus.h \
ShadedDisplay.h \
Playlist.h \