~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_userInterfaces/ADM_GTK/ADM_toolkit_gtk/mediactrl.h

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2007-12-18 13:53:04 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071218135304-cdqec2lg2bglyz15
Tags: 1:2.4~preview3-0.0ubuntu1
* Upload to Ubuntu. (LP: #163287, LP: #126572)
* debian/changelog: re-added Ubuntu releases.
* debian/control:
  - Require debhelper >= 5.0.51 (for dh_icons) and imagemagick.
  - Build-depend on libsdl1.2-dev instead of libsdl-dev.
  - Build against newer libx264-dev. (LP: #138854)
  - Removed libamrnb-dev, not in Ubuntu yet.
* debian/rules:
  - Install all icon sizes, using convert (upstream installs none).
  - Added missing calls to dh_installmenu, dh_installman, dh_icons and
    dh_desktop.
* debian/menu, debian/avidemux-qt.menu:
  - Corrected package and executable names.
* debian/avidemux-common.install: Install icons.
* debian/avidemux.common.manpages: Install man/avidemux.1.
* debian/links, debian/avidemux-cli.links, debian/avidemux-gtk.links:
  - Link manpages to avidemux.1.gz.
* debian/install, debian/avidemux-qt.install, debian/avidemux-gtk.desktop,
  debian/avidemux-qt.desktop: Install desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* mediactrl.c -- Jog Shuttle device support
 
3
* Copyright (C) 2001-2007 Dan Dennedy <dan@dennedy.org>
 
4
* Taken from Kino 1.1.1, with permission.
 
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 Foundation,
 
18
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
19
*/
 
20
 
 
21
#ifndef _MEDIA_CTRL_H
 
22
#define _MEDIA_CTRL_H
 
23
 
 
24
// just to make the code more readable
 
25
#define KEY_RELEASE                     0x00
 
26
#define KEY_PRESS                       0x01
 
27
 
 
28
// not used yet
 
29
#define MEDIA_ST_ACTIVE                 0x02
 
30
#define MEDIA_ST_INACTIVE               0x01
 
31
 
 
32
// media ctrl event types
 
33
#define MEDIA_CTRL_EVENT_NONE           0x00
 
34
#define MEDIA_CTRL_EVENT_KEY            0x01
 
35
#define MEDIA_CTRL_EVENT_JOG            0x02
 
36
#define MEDIA_CTRL_EVENT_SHUTTLE        0x03
 
37
#define MEDIA_CTRL_EVENT_STICK          0x04
 
38
 
 
39
// the disconnect event - not used yet
 
40
#define MEDIA_CTRL_DISCONNECT           0x01
 
41
 
 
42
#define MEDIA_CTRL_SHIFT                0x01
 
43
 
 
44
#define MEDIA_CTRL_PLAY                 0x10
 
45
#define MEDIA_CTRL_PLAY_FWD             0x10
 
46
#define MEDIA_CTRL_REVERSE              0x11
 
47
#define MEDIA_CTRL_PLAY_REV             0x11
 
48
#define MEDIA_CTRL_STOP                 0x12
 
49
#define MEDIA_CTRL_PAUSE                0x13
 
50
#define MEDIA_CTRL_NEXT                 0x14
 
51
#define MEDIA_CTRL_PREV                 0x15
 
52
#define MEDIA_CTRL_RECORD               0x16
 
53
#define MEDIA_CTRL_FAST_FORWARD         0x17
 
54
#define MEDIA_CTRL_REWIND               0x18
 
55
 
 
56
#define MEDIA_CTRL_STICK_LEFT           0x20
 
57
#define MEDIA_CTRL_STICK_RIGHT          0x21
 
58
#define MEDIA_CTRL_STICK_UP             0x22
 
59
#define MEDIA_CTRL_STICK_DOWN           0x23
 
60
 
 
61
/* function keys, usually at top of device */
 
62
#define MEDIA_CTRL_F1                   0x100
 
63
#define MEDIA_CTRL_F2                   0x101
 
64
#define MEDIA_CTRL_F3                   0x102
 
65
#define MEDIA_CTRL_F4                   0x103
 
66
#define MEDIA_CTRL_F5                   0x104
 
67
#define MEDIA_CTRL_F6                   0x105
 
68
#define MEDIA_CTRL_F7                   0x106
 
69
#define MEDIA_CTRL_F8                   0x107
 
70
#define MEDIA_CTRL_F9                   0x108
 
71
#define MEDIA_CTRL_F10                  0x109
 
72
#define MEDIA_CTRL_F11                  0x10a
 
73
#define MEDIA_CTRL_F12                  0x10b
 
74
#define MEDIA_CTRL_F13                  0x10c
 
75
#define MEDIA_CTRL_F14                  0x10d
 
76
#define MEDIA_CTRL_F15                  0x10e
 
77
#define MEDIA_CTRL_F16                  0x10f
 
78
 
 
79
#define MEDIA_CTRL_B1                   0x110
 
80
#define MEDIA_CTRL_B2                   0x111
 
81
#define MEDIA_CTRL_B3                   0x112
 
82
#define MEDIA_CTRL_B4                   0x113
 
83
#define MEDIA_CTRL_B5                   0x114
 
84
#define MEDIA_CTRL_B6                   0x115
 
85
#define MEDIA_CTRL_B7                   0x116
 
86
#define MEDIA_CTRL_B8                   0x117
 
87
#define MEDIA_CTRL_B9                   0x118
 
88
#define MEDIA_CTRL_B10                  0x119
 
89
#define MEDIA_CTRL_B11                  0x11a
 
90
#define MEDIA_CTRL_B12                  0x11b
 
91
#define MEDIA_CTRL_B13                  0x11c
 
92
#define MEDIA_CTRL_B14                  0x11d
 
93
#define MEDIA_CTRL_B15                  0x11e
 
94
#define MEDIA_CTRL_B16                  0x11f
 
95
 
 
96
#ifdef __cplusplus
 
97
extern "C" {
 
98
#endif
 
99
 
 
100
struct media_ctrl_device;
 
101
 
 
102
struct media_ctrl_key
 
103
{
 
104
        int key;  // internal keycode - do not use
 
105
        const char *name;
 
106
        int code; // eventcode
 
107
        int action;
 
108
};
 
109
 
 
110
struct media_ctrl_event
 
111
{
 
112
        struct timeval time;
 
113
        unsigned short type;
 
114
        unsigned short code;
 
115
        char *name;
 
116
        int value;
 
117
        float fvalue;  // only defined for MEDIA_CTRL_EVENT_SHUTTLE
 
118
        unsigned short index;
 
119
};
 
120
 
 
121
struct media_ctrl
 
122
{
 
123
        int fd;
 
124
        int eventno;
 
125
        
 
126
        int status;
 
127
 
 
128
        struct media_ctrl_device *device;
 
129
 
 
130
        long jogpos;
 
131
        int  shuttlepos;
 
132
        
 
133
        int lastval;
 
134
        int lastshu;
 
135
        
 
136
        int jogrel; // accumulate relative values if events come too fast
 
137
        unsigned long last_jog_time; // last jog event
 
138
 
 
139
};
 
140
 
 
141
struct media_ctrl_device
 
142
{
 
143
        int vendor;
 
144
        int product;
 
145
        const char *name;
 
146
        struct media_ctrl_key *keys;
 
147
        void (*translate)(struct media_ctrl *ctrl, struct input_event *ev, struct media_ctrl_event *me);
 
148
};
 
149
 
 
150
void media_ctrl_open(struct media_ctrl *);
 
151
void media_ctrl_close(struct media_ctrl *);
 
152
void media_ctrl_read_event(struct media_ctrl *, struct media_ctrl_event *);
 
153
 
 
154
struct  media_ctrl_key *media_ctrl_get_keys(struct media_ctrl *);
 
155
 
 
156
#ifdef __cplusplus
 
157
}
 
158
#endif
 
159
 
 
160
#endif