Clementine-audio-player-Mac.../src/widgets/trackslider.h

69 lines
1.6 KiB
C
Raw Normal View History

/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
2010-01-15 18:12:47 +01:00
#ifndef TRACKSLIDER_H
#define TRACKSLIDER_H
#include <QWidget>
class QLabel;
class Ui_TrackSlider;
2010-01-15 18:12:47 +01:00
class TrackSlider : public QWidget {
Q_OBJECT
public:
TrackSlider(QWidget* parent = 0);
~TrackSlider();
2010-01-15 18:12:47 +01:00
// QWidget
QSize sizeHint() const;
// QObject
bool event(QEvent *);
2011-01-25 20:15:51 +01:00
static const char* kSettingsGroup;
2010-01-15 18:12:47 +01:00
public slots:
void SetValue(int elapsed, int total);
void SetStopped();
void SetCanSeek(bool can_seek);
2011-01-27 00:20:56 +01:00
void Seek(int gap);
2010-01-15 18:12:47 +01:00
signals:
void ValueChanged(int value);
private slots:
void ValueMaybeChanged(int value);
2011-01-25 20:15:51 +01:00
void ToggleTimeDisplay();
private:
void UpdateTimes(int elapsed);
void UpdateLabelWidth();
void UpdateLabelWidth(QLabel* label, const QString& text);
2010-01-15 18:12:47 +01:00
private:
Ui_TrackSlider* ui_;
bool setting_value_;
2011-01-25 20:15:51 +01:00
bool show_remaining_time_;
int slider_maximum_value_; //we cache it to avoid unnecessary updates
2010-01-15 18:12:47 +01:00
};
#endif // TRACKSLIDER_H