summaryrefslogtreecommitdiffstats
path: root/mp_fifo.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 15:44:03 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 15:52:29 +0300
commit06405a5ba56a0c38b76859a8e1e4665061028a79 (patch)
tree2ed28c357697664f1d736455441314df2c71a261 /mp_fifo.c
parent77ec83e351ca7218464f8f77a711520d68fa2e5d (diff)
downloadmpv-06405a5ba56a0c38b76859a8e1e4665061028a79.tar.bz2
mpv-06405a5ba56a0c38b76859a8e1e4665061028a79.tar.xz
Move key_fifo_size & doubleclick_time to options struct
Diffstat (limited to 'mp_fifo.c')
-rw-r--r--mp_fifo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mp_fifo.c b/mp_fifo.c
index 0699a55e4d..62228e8558 100644
--- a/mp_fifo.c
+++ b/mp_fifo.c
@@ -4,10 +4,11 @@
#include "input/mouse.h"
#include "mp_fifo.h"
#include "talloc.h"
+#include "options.h"
-int key_fifo_size = 7;
struct mp_fifo {
+ struct MPOpts *opts;
int *data;
int readpos;
int writepos;
@@ -16,10 +17,11 @@ struct mp_fifo {
int last_key[2];
};
-struct mp_fifo *mp_fifo_create(void)
+struct mp_fifo *mp_fifo_create(struct MPOpts *opts)
{
struct mp_fifo *fifo = talloc_zero(NULL, struct mp_fifo);
- fifo->size = key_fifo_size;
+ fifo->opts = opts;
+ fifo->size = opts->key_fifo_size;
fifo->data = talloc_array_ptrtype(fifo, fifo->data, fifo->size);
return fifo;
}
@@ -48,9 +50,6 @@ int mplayer_get_key(void *ctx, int fd)
return key;
}
-
-unsigned doubleclick_time = 300;
-
static void put_double(struct mp_fifo *fifo, int code)
{
if (code >= MOUSE_BTN0 && code <= MOUSE_BTN9)
@@ -60,6 +59,7 @@ static void put_double(struct mp_fifo *fifo, int code)
void mplayer_put_key(struct mp_fifo *fifo, int code)
{
unsigned now = GetTimerMS();
+ int doubleclick_time = fifo->opts->doubleclick_time;
// ignore system-doubleclick if we generate these events ourselves
if (doubleclick_time
&& (code & ~MP_KEY_DOWN) >= MOUSE_BTN0_DBL