~ubuntu-branches/ubuntu/lucid/kmidimon/lucid

« back to all changes in this revision

Viewing changes to src/slideraction.h

  • Committer: Bazaar Package Importer
  • Author(s): Nick Ellery
  • Date: 2009-08-10 18:45:19 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090810184519-9q6ouf7i7708ni7s
Tags: 0.7.1-0ubuntu1
* New upstream release (LP: #411739).
  - Optionally translate notes, controllers and program numbers into names.
  - Support for GM, GS and XG standards, using .INS definition files.
  - New context menu option: adjust column sizes.
  - Fine grained event filters, in addition to the old coarse filters.
  - Fixed unregistered bug: don't change the current sequence PPQ/Tempo when 
    applying the preferences dialog.
  - New dialog showing information about the current loaded sequence.
  - Support for the SMF events: Sequence Number, Forced Channel, Forced Port 
    and SMPTE Offset.
  - Playback speed control: tempo "zoom" slider allowing continuous scaling 
    from 50% to 200%.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   KMidimon - ALSA sequencer based MIDI monitor                          *
 
3
 *   Copyright (C) 2005-2009 Pedro Lopez-Cabanillas                        *
 
4
 *   plcl@users.sourceforge.net                                            *
 
5
 *                                                                         *
 
6
 *   This program is free software; you can redistribute it and/or modify  *
 
7
 *   it under the terms of the GNU General Public License as published by  *
 
8
 *   the Free Software Foundation; either version 2 of the License, or     *
 
9
 *   (at your option) any later version.                                   *
 
10
 *                                                                         *
 
11
 *   This program is distributed in the hope that it will be useful,       *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU General Public License for more details.                          *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU General Public License     *
 
17
 *   along with this program; if not, write to the Free Software           *
 
18
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,            *
 
19
 *   MA 02110-1301, USA                                                    *
 
20
 ***************************************************************************/
 
21
/***************************************************************************
 
22
 *   Other copyright notices for this file include:                        *                                              *
 
23
 *   copyright (C) 2003      kiriuja  <kplayer-dev@en-directo.net>         *
 
24
 *   copyright (C) 2003-2009                                               *
 
25
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 
26
 ***************************************************************************/
 
27
 
 
28
#ifndef SLIDERACTION_H
 
29
#define SLIDERACTION_H
 
30
 
 
31
#include <kaction.h>
 
32
 
 
33
#include <QtGui/QSlider>
 
34
#include <QtGui/QFrame>
 
35
 
 
36
class QKeyEvent;
 
37
 
 
38
/**
 
39
 * KPlayer's slider widget.
 
40
 * Taken from umbrello (kdesdk SVN 992814, 2009-07-08) by Pedro Lopez-Cabanillas
 
41
 * (with small changes)
 
42
 *
 
43
 * Taken from kplayer CVS 2003-09-21 (kplayer > 0.3.1) by Jonathan Riddell
 
44
 * @author kiriuja
 
45
 */
 
46
class KPlayerSlider : public QSlider
 
47
{
 
48
    Q_OBJECT
 
49
 
 
50
public:
 
51
    explicit KPlayerSlider (Qt::Orientation, QWidget* parent = 0);
 
52
    virtual ~KPlayerSlider() {}
 
53
 
 
54
    virtual QSize sizeHint() const;
 
55
    virtual QSize minimumSizeHint() const;
 
56
    void setPageStep (int);
 
57
    void setup (int minimum, int maximum, int value, int pageStep, int lineStep = 1);
 
58
 
 
59
protected:
 
60
    friend class KPlayerSliderAction;
 
61
    friend class KPlayerPopupSliderAction;
 
62
};
 
63
 
 
64
/**
 
65
 * KPlayer popup frame.
 
66
 * @author kiriuja
 
67
 */
 
68
class KPlayerPopupFrame : public QFrame
 
69
{
 
70
    Q_OBJECT
 
71
 
 
72
public:
 
73
    KPlayerPopupFrame (QWidget* parent = 0);
 
74
    virtual ~KPlayerPopupFrame();
 
75
 
 
76
protected:
 
77
    virtual void keyPressEvent (QKeyEvent*);
 
78
};
 
79
 
 
80
/**
 
81
 * Action representing a popup slider activated by a toolbar button.
 
82
 * @author kiriuja
 
83
 */
 
84
class KPlayerPopupSliderAction : public KAction
 
85
{
 
86
    Q_OBJECT
 
87
 
 
88
public:
 
89
    KPlayerPopupSliderAction (const QObject* receiver, const char* slot, QObject *parent);
 
90
    virtual ~KPlayerPopupSliderAction();
 
91
 
 
92
    /** Returns a pointer to the KPlayerSlider object. */
 
93
    KPlayerSlider* slider() { return m_slider; }
 
94
 
 
95
protected slots:
 
96
    virtual void slotTriggered();
 
97
 
 
98
protected:
 
99
    KPlayerSlider*      m_slider;  ///< The slider.
 
100
    KPlayerPopupFrame*  m_frame;   ///< The popup frame.
 
101
};
 
102
 
 
103
#endif