#include "mainwindow.h" MainWindow::MainWindow() { //setAttribute(Qt::WA_MacBrushedMetal, true); setupUi(this); connect(button_prev, SIGNAL(clicked()), SIGNAL(prev())); connect(button_pause, SIGNAL(clicked()), SIGNAL(pause())); connect(button_play, SIGNAL(clicked()), SIGNAL(play())); connect(button_next, SIGNAL(clicked()), SIGNAL(next())); connect(slider_seek, SIGNAL(sliderReleased()), SLOT(slider_released())); button_pause->hide(); } void MainWindow::update_track(const QUrl& track) { } void MainWindow::update_state(bool playing) { if(playing) { button_play->hide(); button_pause->show(); } else { button_pause->hide(); button_play->show(); } } void MainWindow::update_pos(int pos) { label_pos->setText(QString("%1:%2").arg(pos / 60).arg(pos % 60, 2, 10, QChar('0'))); if(!slider_seek->isSliderDown()) { slider_seek->setValue(pos); } } void MainWindow::update_length(int length) { label_length->setText(QString("%1:%2").arg(length / 60).arg(length % 60, 2, 10, QChar('0'))); slider_seek->setMaximum(length); } void MainWindow::slider_released() { emit seek(slider_seek->value()); }