#include "player.h" Player::Player() { mo = new Phonon::MediaObject(); ao = new Phonon::AudioOutput(Phonon::MusicCategory); Phonon::createPath(mo, ao); mo->setTickInterval(100); connect(mo, SIGNAL(tick(qint64)), SLOT(tick(qint64))); connect(mo, SIGNAL(totalTimeChanged(qint64)), SLOT(newlength(qint64))); } void Player::prev() { } void Player::pause() { mo->pause(); emit changed_state(false); } void Player::play() { static bool kake = false; if(!kake) { kake = true; mo->setCurrentSource(*(new Phonon::MediaSource("historie.tta"))); } mo->play(); emit changed_state(true); } void Player::next() { } void Player::seek(int pos) { mo->seek(pos * 1000); } void Player::tick(qint64 time) { emit changed_pos(time / 1000); } void Player::newlength(qint64 length) { emit changed_length(length / 1000); }