diff --git a/MainDisplay.cpp b/MainDisplay.cpp index 9001b2c..6e1ef0c 100644 --- a/MainDisplay.cpp +++ b/MainDisplay.cpp @@ -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 ("duration")); - m_slider->hideBar (false); + m_posbar->setMax (info.get ("duration")); + m_posbar->hideBar (false); } else { - m_slider->hideBar (true); + m_posbar->hideBar (true); } } diff --git a/MainDisplay.h b/MainDisplay.h index 03f77f8..5990704 100644 --- a/MainDisplay.h +++ b/MainDisplay.h @@ -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; diff --git a/Slider.cpp b/PosBar.cpp similarity index 79% rename from Slider.cpp rename to PosBar.cpp index b74584e..9c36165 100644 --- a/Slider.cpp +++ b/PosBar.cpp @@ -1,21 +1,21 @@ #include "MainWindow.h" -#include "Slider.h" +#include "PosBar.h" #include "Skin.h" #include #include -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(parent); + m_slider = dynamic_cast(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); } diff --git a/Slider.h b/PosBar.h similarity index 75% rename from Slider.h rename to PosBar.h index 005381e..fafa62a 100644 --- a/Slider.h +++ b/PosBar.h @@ -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; }; diff --git a/promoe.pro b/promoe.pro index 629eba7..c44f27b 100644 --- a/promoe.pro +++ b/promoe.pro @@ -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 \