| 1 | /* |
| 2 | * File: seqlib.h |
| 3 | * |
| 4 | * Copyright (C) 1999-2003 Steve Ratcliffe |
| 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 version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * |
| 16 | * --------- |
| 17 | * This file is a set of interfaces to provide a little |
| 18 | * higher level view of the sequencer. It is mainly experimental |
| 19 | * to investigate new approaches. If successful they will be proposed |
| 20 | * as additions/replacements to the existing seq lib. |
| 21 | * |
| 22 | * |
| 23 | * |
| 24 | */ |
| 25 | #if HAVE_ALSA_ASOUNDLIB_H |
| 26 | #include <alsa/asoundlib.h> |
| 27 | #else |
| 28 | #include <sys/asoundlib.h> |
| 29 | #endif |
| 30 | |
| 31 | typedef struct seq_context seq_context_t; |
| 32 | |
| 33 | seq_context_t *seq_create_context(); |
| 34 | seq_context_t *seq_new_client(seq_context_t *ctxp); |
| 35 | void seq_free_context(seq_context_t *cxtp); |
| 36 | int seq_new_port(seq_context_t *ctxp); |
| 37 | void seq_destroy_port(seq_context_t *cxtp, int port); |
| 38 | int seq_connect_add(seq_context_t *ctxp, int client, int port); |
| 39 | int seq_init_tempo(seq_context_t *ctxp, int resolution, int tempo, |
| 40 | int realtime); |
| 41 | void seq_set_queue(seq_context_t *ctxp, int q); |
| 42 | int seq_sendto(seq_context_t *ctxp, snd_seq_event_t *ev, int client, int port); |
| 43 | int seq_send_to_all(seq_context_t *ctxp, snd_seq_event_t *ep); |
| 44 | snd_seq_addr_t * seq_dev_addr(seq_context_t *ctxp, int dev); |
| 45 | void seq_start_timer(seq_context_t *ctxp); |
| 46 | void seq_stop_timer(seq_context_t *ctxp); |
| 47 | void seq_control_timer(seq_context_t *ctxp, int onoff); |
| 48 | int seq_write(seq_context_t *ctxp, snd_seq_event_t *ep); |
| 49 | void *seq_handle(seq_context_t *ctxp); |
| 50 | |
| 51 | void seq_midi_event_init(seq_context_t *ctxp, snd_seq_event_t *ep, |
| 52 | unsigned long time, int devchan); |
| 53 | void seq_midi_note(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, int note, |
| 54 | int vel, int length); |
| 55 | void seq_midi_note_on(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, int note, |
| 56 | int vel, int length); |
| 57 | void seq_midi_note_off(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, int note, |
| 58 | int vel, int length); |
| 59 | void seq_midi_keypress(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, int note, |
| 60 | int value); |
| 61 | void seq_midi_control(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, int control, |
| 62 | int value); |
| 63 | void seq_midi_program(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, int program); |
| 64 | void seq_midi_chanpress(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, |
| 65 | int pressure); |
| 66 | void seq_midi_pitchbend(seq_context_t *ctxp, snd_seq_event_t *ep, int devchan, int bend); |
| 67 | void seq_midi_tempo(seq_context_t *ctxp, snd_seq_event_t *ep, int tempo); |
| 68 | void seq_midi_sysex(seq_context_t *ctxp, snd_seq_event_t *ep, int status, |
| 69 | unsigned char *data, int length); |
| 70 | void seq_midi_echo(seq_context_t *ctxp, unsigned long time); |