~ubuntu-branches/ubuntu/quantal/kscd/quantal-proposed

« back to all changes in this revision

Viewing changes to gui/seekslider.h

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-06-14 17:35:46 UTC
  • Revision ID: package-import@ubuntu.com-20120614173546-0t4dq1zkvl62ebpd
Tags: upstream-4.8.90+repack
Import upstream version 4.8.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Kscd - A simple cd player for the KDE Project
 
3
 *
 
4
 * Copyright (c) 1997 Bernd Johannes wuebben@math.cornell.edu
 
5
 * Copyright (c) 2002-2003 Aaron J. Seigo <aseigo@kde.org>
 
6
 * Copyright (c) 2004 Alexander Kern <alex.kern@gmx.de>
 
7
 * Copyright (c) 2003-2006 Richard Lärkäng <nouseforaname@home.se>
 
8
 *
 
9
 * --------------
 
10
 * ISI KsCD Team :
 
11
 * --------------
 
12
 * Stanislas KRZYWDA <stanislas.krzywda@gmail.com>
 
13
 * Sovanramy Var <mastasushi@gmail.com>
 
14
 * Bouchikhi Mohamed-Amine <bouchikhi.amine@gmail.com>
 
15
 * Gastellu Sylvain<sylvain.gastellu@gmail.com>
 
16
 * -----------------------------------------------------------------------------
 
17
 *
 
18
 * This program is free software; you can redistribute it and/or modify
 
19
 * it under the terms of the GNU General Public License as published by
 
20
 * the Free Software Foundation; either version 2, or (at your option)
 
21
 * any later version.
 
22
 *
 
23
 * This program is distributed in the hope that it will be useful,
 
24
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
26
 * GNU General Public License for more details.
 
27
 *
 
28
 * You should have received a copy of the GNU General Public License
 
29
 * along with this program; if not, write to the Free Software
 
30
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
31
 *
 
32
 */
 
33
#ifndef SEEKSLIDER_H
 
34
#define SEEKSLIDER_H
 
35
 
 
36
#include <QWidget>
 
37
#include <QTimeLine>
 
38
#include <kdebug.h>
 
39
// #include "kscdwidget.h"
 
40
#include "seekbar.h"
 
41
#include "seekcursor.h"
 
42
 
 
43
class SeekSlider:public QWidget
 
44
{
 
45
        Q_OBJECT
 
46
 
 
47
public:
 
48
        SeekSlider(QWidget * parent=0);
 
49
        virtual ~SeekSlider();
 
50
 
 
51
        SeekCursor* cursor() const;
 
52
        SeekBar* bar() const;
 
53
 
 
54
        void setTime(qint64);
 
55
        qint64 getTime() const;
 
56
        void setTotalTime(qint64);
 
57
        void moveC();
 
58
        /**
 
59
         * Calculation of move to do in 1 second
 
60
         */
 
61
        void  setStep();
 
62
        int  getStep() const;
 
63
 
 
64
        /**
 
65
         * Initialize all attibutes
 
66
         */
 
67
        void init(qint64);
 
68
 
 
69
        /**
 
70
         * Start the qtimeline
 
71
         */
 
72
        void start(qint64 time);
 
73
 
 
74
        /**
 
75
         * Stop the qtimeline
 
76
         */
 
77
        void stop();
 
78
 
 
79
        /**
 
80
         * Paused the qtimeline
 
81
         */
 
82
        void pause();
 
83
 
 
84
private:
 
85
 
 
86
        /**
 
87
         * The bar of the slider
 
88
         */
 
89
        SeekBar* m_bar;
 
90
 
 
91
        /**
 
92
         * The cursor of the slider
 
93
         */
 
94
        SeekCursor* m_cursor;
 
95
 
 
96
        /**
 
97
         * A QTimeLine
 
98
         */
 
99
        QTimeLine* m_timeL;
 
100
 
 
101
        /**
 
102
         * Current state of the slider
 
103
         */
 
104
        QTimeLine::State m_state;
 
105
 
 
106
        /**
 
107
         * Current time of the current track
 
108
         */
 
109
        qint64 m_time;
 
110
 
 
111
        /**
 
112
         * Total time of the current track
 
113
         */
 
114
        qint64 m_totalTime;
 
115
 
 
116
        /**
 
117
         * Move to do in 1 second
 
118
         */
 
119
        int m_step;
 
120
public slots:
 
121
        /**
 
122
         * Restart the qtimeline after the pause mode
 
123
         */
 
124
        void resume(QTimeLine::State state);
 
125
};
 
126
 
 
127
#endif /*SEEKSLIDER_H_*/