promoe/PlayStatus.cpp
Daniel Svensson 787a5c7b5b Singletonify XMMSHandler and kick out everything not XMMSisch from the class.
A class that needs to talk to xmms2 now calls XMMSHandler::getInstance()
and all communication is handled by signals'n'slots.
2006-02-26 19:16:43 +01:00

40 lines
858 B
C++

#include "PlayStatus.h"
PlayStatus::PlayStatus (QWidget *parent) : PixWidget (parent)
{
XMMSHandler *xmmsh = XMMSHandler::getInstance();
setMinimumSize(11, 9);
setMaximumSize(11, 9);
m_status = XMMS_PLAYBACK_STATUS_STOP;
connect (xmmsh, SIGNAL(playbackStatusChanged(uint)),
this, SLOT(setStatus(uint)));
}
void
PlayStatus::setPixmaps (Skin *skin)
{
m_pixmap_play = skin->getItem (Skin::PIC_PLAY);
m_pixmap_pause = skin->getItem (Skin::PIC_PAUSE);
m_pixmap_stop = skin->getItem (Skin::PIC_STOP);
setStatus (m_status);
}
void
PlayStatus::setStatus (uint status)
{
qDebug("funkar");
if (status == XMMS_PLAYBACK_STATUS_STOP) {
m_pixmap = m_pixmap_stop;
} else if (status == XMMS_PLAYBACK_STATUS_PLAY) {
m_pixmap = m_pixmap_play;
} else if (status == XMMS_PLAYBACK_STATUS_PAUSE) {
m_pixmap = m_pixmap_pause;
}
update ();
}