~mixxxdevelopers/mixxx/features_library_scanner

« back to all changes in this revision

Viewing changes to mixxx/mixxx/controlpushbutton.h

  • Committer: tuehaste
  • Date: 2002-02-26 11:12:07 UTC
  • Revision ID: vcs-imports@canonical.com-20020226111207-5rly26cj9gdd19ba
Initial revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          controlpushbutton.h  -  description
 
3
                             -------------------
 
4
    begin                : Wed Feb 20 2002
 
5
    copyright            : (C) 2002 by Tue and Ken Haste Andersen
 
6
    email                : 
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef CONTROLPUSHBUTTON_H
 
19
#define CONTROLPUSHBUTTON_H
 
20
 
 
21
#include <controlobject.h>
 
22
#include "defs.h"
 
23
#include "midiobject.h"
 
24
#include <sys/timeb.h>
 
25
class MidiObject;
 
26
/**
 
27
  *@author Tue and Ken Haste Andersen
 
28
  */
 
29
 
 
30
enum positionType {up,down};
 
31
enum valueType {off,on};
 
32
enum buttonType {latching, momentaneous, simulated_latching};
 
33
 
 
34
class ControlPushButton : public ControlObject  {
 
35
 Q_OBJECT
 
36
protected:
 
37
  valueType value;       // the value (on or off)
 
38
  char* name;        // The name of the button
 
39
  buttonType kind;  // Determine whether the button is latching or not.
 
40
  valueType invert(valueType value);
 
41
  MidiObject *midi;
 
42
public:
 
43
  positionType position;  // position of the button (up or down)
 
44
  short int midino;
 
45
  short int midimask;
 
46
  ControlPushButton(char*, buttonType, int, int, MidiObject *);
 
47
  ~ControlPushButton();
 
48
  char* print();
 
49
  short int getmidino();
 
50
  valueType getValue();
 
51
  positionType getPosition();
 
52
  char* printValue();
 
53
  void setValue(valueType);
 
54
public slots:
 
55
  void slotSetPosition(positionType);
 
56
  void pressed();
 
57
  void released();
 
58
signals:
 
59
  void valueChanged(valueType);
 
60
};
 
61
 
 
62
#endif