Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/include/sound/asequencer.h

    r598 r679  
     1/* SPDX-License-Identifier: GPL-2.0-or-later */
    12/*
    23 *  Main header file for the ALSA sequencer
    34 *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
    45 *            (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
    5  *
    6  *
    7  *   This program is free software; you can redistribute it and/or modify
    8  *   it under the terms of the GNU General Public License as published by
    9  *   the Free Software Foundation; either version 2 of the License, or
    10  *   (at your option) any later version.
    11  *
    12  *   This program is distributed in the hope that it will be useful,
    13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15  *   GNU General Public License for more details.
    16  *
    17  *   You should have received a copy of the GNU General Public License
    18  *   along with this program; if not, write to the Free Software
    19  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    20  *
    216 */
    227#ifndef __SOUND_ASEQUENCER_H
    238#define __SOUND_ASEQUENCER_H
    249
    25 #ifdef __KERNEL__
    2610#include <linux/ioctl.h>
    2711#include <sound/asound.h>
    28 #endif
    29 
    30 /** version of the sequencer */
    31 #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
    32 
    33 /**
    34  * definition of sequencer event types
    35  */
    36 
    37 /** system messages
    38  * event data type = #snd_seq_result
    39  */
    40 #define SNDRV_SEQ_EVENT_SYSTEM          0
    41 #define SNDRV_SEQ_EVENT_RESULT          1
    42 
    43 /** note messages (channel specific)
    44  * event data type = #snd_seq_ev_note
    45  */
    46 #define SNDRV_SEQ_EVENT_NOTE            5
    47 #define SNDRV_SEQ_EVENT_NOTEON          6
    48 #define SNDRV_SEQ_EVENT_NOTEOFF         7
    49 #define SNDRV_SEQ_EVENT_KEYPRESS        8
    50        
    51 /** control messages (channel specific)
    52  * event data type = #snd_seq_ev_ctrl
    53  */
    54 #define SNDRV_SEQ_EVENT_CONTROLLER      10
    55 #define SNDRV_SEQ_EVENT_PGMCHANGE       11
    56 #define SNDRV_SEQ_EVENT_CHANPRESS       12
    57 #define SNDRV_SEQ_EVENT_PITCHBEND       13      /**< from -8192 to 8191 */
    58 #define SNDRV_SEQ_EVENT_CONTROL14       14      /**< 14 bit controller value */
    59 #define SNDRV_SEQ_EVENT_NONREGPARAM     15      /**< 14 bit NRPN address + 14 bit unsigned value */
    60 #define SNDRV_SEQ_EVENT_REGPARAM        16      /**< 14 bit RPN address + 14 bit unsigned value */
    61 
    62 /** synchronisation messages
    63  * event data type = #snd_seq_ev_ctrl
    64  */
    65 #define SNDRV_SEQ_EVENT_SONGPOS         20      /* Song Position Pointer with LSB and MSB values */
    66 #define SNDRV_SEQ_EVENT_SONGSEL         21      /* Song Select with song ID number */
    67 #define SNDRV_SEQ_EVENT_QFRAME          22      /* midi time code quarter frame */
    68 #define SNDRV_SEQ_EVENT_TIMESIGN        23      /* SMF Time Signature event */
    69 #define SNDRV_SEQ_EVENT_KEYSIGN         24      /* SMF Key Signature event */
    70                
    71 /** timer messages
    72  * event data type = snd_seq_ev_queue_control
    73  */
    74 #define SNDRV_SEQ_EVENT_START           30      /* midi Real Time Start message */
    75 #define SNDRV_SEQ_EVENT_CONTINUE        31      /* midi Real Time Continue message */
    76 #define SNDRV_SEQ_EVENT_STOP            32      /* midi Real Time Stop message */       
    77 #define SNDRV_SEQ_EVENT_SETPOS_TICK     33      /* set tick queue position */
    78 #define SNDRV_SEQ_EVENT_SETPOS_TIME     34      /* set realtime queue position */
    79 #define SNDRV_SEQ_EVENT_TEMPO           35      /* (SMF) Tempo event */
    80 #define SNDRV_SEQ_EVENT_CLOCK           36      /* midi Real Time Clock message */
    81 #define SNDRV_SEQ_EVENT_TICK            37      /* midi Real Time Tick message */
    82 #define SNDRV_SEQ_EVENT_QUEUE_SKEW      38      /* skew queue tempo */
    83 
    84 /** others
    85  * event data type = none
    86  */
    87 #define SNDRV_SEQ_EVENT_TUNE_REQUEST    40      /* tune request */
    88 #define SNDRV_SEQ_EVENT_RESET           41      /* reset to power-on state */
    89 #define SNDRV_SEQ_EVENT_SENSING         42      /* "active sensing" event */
    90 
    91 /** echo back, kernel private messages
    92  * event data type = any type
    93  */
    94 #define SNDRV_SEQ_EVENT_ECHO            50      /* echo event */
    95 #define SNDRV_SEQ_EVENT_OSS             51      /* OSS raw event */
    96 
    97 /** system status messages (broadcast for subscribers)
    98  * event data type = snd_seq_addr
    99  */
    100 #define SNDRV_SEQ_EVENT_CLIENT_START    60      /* new client has connected */
    101 #define SNDRV_SEQ_EVENT_CLIENT_EXIT     61      /* client has left the system */
    102 #define SNDRV_SEQ_EVENT_CLIENT_CHANGE   62      /* client status/info has changed */
    103 #define SNDRV_SEQ_EVENT_PORT_START      63      /* new port was created */
    104 #define SNDRV_SEQ_EVENT_PORT_EXIT       64      /* port was deleted from system */
    105 #define SNDRV_SEQ_EVENT_PORT_CHANGE     65      /* port status/info has changed */
    106 
    107 /** port connection changes
    108  * event data type = snd_seq_connect
    109  */
    110 #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66      /* ports connected */
    111 #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67    /* ports disconnected */
    112 
    113 /* 70-89:  synthesizer events - obsoleted */
    114 
    115 /** user-defined events with fixed length
    116  * event data type = any
    117  */
    118 #define SNDRV_SEQ_EVENT_USR0            90
    119 #define SNDRV_SEQ_EVENT_USR1            91
    120 #define SNDRV_SEQ_EVENT_USR2            92
    121 #define SNDRV_SEQ_EVENT_USR3            93
    122 #define SNDRV_SEQ_EVENT_USR4            94
    123 #define SNDRV_SEQ_EVENT_USR5            95
    124 #define SNDRV_SEQ_EVENT_USR6            96
    125 #define SNDRV_SEQ_EVENT_USR7            97
    126 #define SNDRV_SEQ_EVENT_USR8            98
    127 #define SNDRV_SEQ_EVENT_USR9            99
    128 
    129 /* 100-118: instrument layer - obsoleted */
    130 /* 119-129: reserved */
    131 
    132 /* 130-139: variable length events
    133  * event data type = snd_seq_ev_ext
    134  * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
    135  */
    136 #define SNDRV_SEQ_EVENT_SYSEX           130     /* system exclusive data (variable length) */
    137 #define SNDRV_SEQ_EVENT_BOUNCE          131     /* error event */
    138 /* 132-134: reserved */
    139 #define SNDRV_SEQ_EVENT_USR_VAR0        135
    140 #define SNDRV_SEQ_EVENT_USR_VAR1        136
    141 #define SNDRV_SEQ_EVENT_USR_VAR2        137
    142 #define SNDRV_SEQ_EVENT_USR_VAR3        138
    143 #define SNDRV_SEQ_EVENT_USR_VAR4        139
    144 
    145 /* 150-151: kernel events with quote - DO NOT use in user clients */
    146 #define SNDRV_SEQ_EVENT_KERNEL_ERROR    150
    147 #define SNDRV_SEQ_EVENT_KERNEL_QUOTE    151     /* obsolete */
    148 
    149 /* 152-191: reserved */
    150 
    151 /* 192-254: hardware specific events */
    152 
    153 /* 255: special event */
    154 #define SNDRV_SEQ_EVENT_NONE            255
    155 
    156 
    157 typedef unsigned char snd_seq_event_type_t;
    158 
    159 /** event address */
    160 struct snd_seq_addr {
    161         unsigned char client;   /**< Client number:         0..255, 255 = broadcast to all clients */
    162         unsigned char port;     /**< Port within client:    0..255, 255 = broadcast to all ports */
    163 };
    164 
    165 /** port connection */
    166 struct snd_seq_connect {
    167         struct snd_seq_addr sender;
    168         struct snd_seq_addr dest;
    169 };
    170 
    171 
    172 #define SNDRV_SEQ_ADDRESS_UNKNOWN       253     /* unknown source */
    173 #define SNDRV_SEQ_ADDRESS_SUBSCRIBERS   254     /* send event to all subscribed ports */
    174 #define SNDRV_SEQ_ADDRESS_BROADCAST     255     /* send event to all queues/clients/ports/channels */
    175 #define SNDRV_SEQ_QUEUE_DIRECT          253     /* direct dispatch */
    176 
    177         /* event mode flag - NOTE: only 8 bits available! */
    178 #define SNDRV_SEQ_TIME_STAMP_TICK       (0<<0) /* timestamp in clock ticks */
    179 #define SNDRV_SEQ_TIME_STAMP_REAL       (1<<0) /* timestamp in real time */
    180 #define SNDRV_SEQ_TIME_STAMP_MASK       (1<<0)
    181 
    182 #define SNDRV_SEQ_TIME_MODE_ABS         (0<<1)  /* absolute timestamp */
    183 #define SNDRV_SEQ_TIME_MODE_REL         (1<<1)  /* relative to current time */
    184 #define SNDRV_SEQ_TIME_MODE_MASK        (1<<1)
    185 
    186 #define SNDRV_SEQ_EVENT_LENGTH_FIXED    (0<<2)  /* fixed event size */
    187 #define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2)  /* variable event size */
    188 #define SNDRV_SEQ_EVENT_LENGTH_VARUSR   (2<<2)  /* variable event size - user memory space */
    189 #define SNDRV_SEQ_EVENT_LENGTH_MASK     (3<<2)
    190 
    191 #define SNDRV_SEQ_PRIORITY_NORMAL       (0<<4)  /* normal priority */
    192 #define SNDRV_SEQ_PRIORITY_HIGH         (1<<4)  /* event should be processed before others */
    193 #define SNDRV_SEQ_PRIORITY_MASK         (1<<4)
    194 
    195 
    196         /* note event */
    197 struct snd_seq_ev_note {
    198         unsigned char channel;
    199         unsigned char note;
    200         unsigned char velocity;
    201         unsigned char off_velocity;     /* only for SNDRV_SEQ_EVENT_NOTE */
    202         unsigned int duration;          /* only for SNDRV_SEQ_EVENT_NOTE */
    203 };
    204 
    205         /* controller event */
    206 struct snd_seq_ev_ctrl {
    207         unsigned char channel;
    208         unsigned char unused1, unused2, unused3;        /* pad */
    209         unsigned int param;
    210         signed int value;
    211 };
    212 
    213         /* generic set of bytes (12x8 bit) */
    214 struct snd_seq_ev_raw8 {
    215         unsigned char d[12];    /* 8 bit value */
    216 };
    217 
    218         /* generic set of integers (3x32 bit) */
    219 struct snd_seq_ev_raw32 {
    220         unsigned int d[3];      /* 32 bit value */
    221 };
    222 
    223         /* external stored data */
    224 #ifndef TARGET_OS2
    225 struct snd_seq_ev_ext {
    226         unsigned int len;       /* length of data */
    227         void *ptr;              /* pointer to data (note: maybe 64-bit) */
    228 } __attribute__((packed));
    229 #else
    230 #pragma pack(1)
    231 struct snd_seq_ev_ext {
    232         unsigned int len;       /* length of data */
    233         void *ptr;              /* pointer to data (note: maybe 64-bit) */
    234 };
    235 #pragma pack()
    236 #endif
    237 struct snd_seq_result {
    238         int event;              /* processed event type */
    239         int result;
    240 };
    241 
    242 
    243 struct snd_seq_real_time {
    244         unsigned int tv_sec;    /* seconds */
    245         unsigned int tv_nsec;   /* nanoseconds */
    246 };
    247 
    248 typedef unsigned int snd_seq_tick_time_t;       /* midi ticks */
    249 
    250 union snd_seq_timestamp {
    251         snd_seq_tick_time_t tick;
    252         struct snd_seq_real_time time;
    253 };
    254 
    255 struct snd_seq_queue_skew {
    256         unsigned int value;
    257         unsigned int base;
    258 };
    259 
    260         /* queue timer control */
    261 struct snd_seq_ev_queue_control {
    262         unsigned char queue;                    /* affected queue */
    263         unsigned char pad[3];                   /* reserved */
    264         union {
    265                 signed int value;               /* affected value (e.g. tempo) */
    266                 union snd_seq_timestamp time;   /* time */
    267                 unsigned int position;          /* sync position */
    268                 struct snd_seq_queue_skew skew;
    269                 unsigned int d32[2];
    270                 unsigned char d8[8];
    271         } param;
    272 };
    273 
    274         /* quoted event - inside the kernel only */
    275 #ifndef TARGET_OS2
    276 struct snd_seq_ev_quote {
    277         struct snd_seq_addr origin;             /* original sender */
    278         unsigned short value;           /* optional data */
    279         struct snd_seq_event *event;            /* quoted event */
    280 } __attribute__((packed));
    281 #else
    282 #pragma pack(1)
    283 struct snd_seq_ev_quote {
    284         struct snd_seq_addr origin;             /* original sender */
    285         unsigned short value;           /* optional data */
    286         struct snd_seq_event *event;            /* quoted event */
    287 };
    288 #pragma pack()
    289 #endif
    290 
    291         /* sequencer event */
    292 struct snd_seq_event {
    293         snd_seq_event_type_t type;      /* event type */
    294         unsigned char flags;            /* event flags */
    295         char tag;
    296        
    297         unsigned char queue;            /* schedule queue */
    298         union snd_seq_timestamp time;   /* schedule time */
    299 
    300 
    301         struct snd_seq_addr source;     /* source address */
    302         struct snd_seq_addr dest;       /* destination address */
    303 
    304         union {                         /* event data... */
    305                 struct snd_seq_ev_note note;
    306                 struct snd_seq_ev_ctrl control;
    307                 struct snd_seq_ev_raw8 raw8;
    308                 struct snd_seq_ev_raw32 raw32;
    309                 struct snd_seq_ev_ext ext;
    310                 struct snd_seq_ev_queue_control queue;
    311                 union snd_seq_timestamp time;
    312                 struct snd_seq_addr addr;
    313                 struct snd_seq_connect connect;
    314                 struct snd_seq_result result;
    315                 struct snd_seq_ev_quote quote;
    316         } data;
    317 };
    318 
    319 
    320 /*
    321  * bounce event - stored as variable size data
    322  */
    323 struct snd_seq_event_bounce {
    324         int err;
    325         struct snd_seq_event event;
    326         /* external data follows here. */
    327 };
    328 
    329 #ifdef __KERNEL__
     12#include <uapi/sound/asequencer.h>
    33013
    33114/* helper macro */
     
    38669#define snd_seq_queue_sync_port(q)      ((q) + 16)
    38770
    388 #endif /* __KERNEL__ */
    389 
    390         /* system information */
    391 struct snd_seq_system_info {
    392         int queues;                     /* maximum queues count */
    393         int clients;                    /* maximum clients count */
    394         int ports;                      /* maximum ports per client */
    395         int channels;                   /* maximum channels per port */
    396         int cur_clients;                /* current clients */
    397         int cur_queues;                 /* current queues */
    398         char reserved[24];
    399 };
    400 
    401 
    402         /* system running information */
    403 struct snd_seq_running_info {
    404         unsigned char client;           /* client id */
    405         unsigned char big_endian;       /* 1 = big-endian */
    406         unsigned char cpu_mode;         /* 4 = 32bit, 8 = 64bit */
    407         unsigned char pad;              /* reserved */
    408         unsigned char reserved[12];
    409 };
    410 
    411 
    412         /* known client numbers */
    413 #define SNDRV_SEQ_CLIENT_SYSTEM         0
    414         /* internal client numbers */
    415 #define SNDRV_SEQ_CLIENT_DUMMY          14      /* midi through */
    416 #define SNDRV_SEQ_CLIENT_OSS            15      /* oss sequencer emulator */
    417 
    418 
    419         /* client types */
    420 typedef int __bitwise snd_seq_client_type_t;
    421 #define NO_CLIENT       ((__force snd_seq_client_type_t) 0)
    422 #define USER_CLIENT     ((__force snd_seq_client_type_t) 1)
    423 #define KERNEL_CLIENT   ((__force snd_seq_client_type_t) 2)
    424                        
    425         /* event filter flags */
    426 #define SNDRV_SEQ_FILTER_BROADCAST      (1<<0)  /* accept broadcast messages */
    427 #define SNDRV_SEQ_FILTER_MULTICAST      (1<<1)  /* accept multicast messages */
    428 #define SNDRV_SEQ_FILTER_BOUNCE         (1<<2)  /* accept bounce event in error */
    429 #define SNDRV_SEQ_FILTER_USE_EVENT      (1<<31) /* use event filter */
    430 
    431 struct snd_seq_client_info {
    432         int client;                     /* client number to inquire */
    433         snd_seq_client_type_t type;     /* client type */
    434         char name[64];                  /* client name */
    435         unsigned int filter;            /* filter flags */
    436         unsigned char multicast_filter[8]; /* multicast filter bitmap */
    437         unsigned char event_filter[32]; /* event filter bitmap */
    438         int num_ports;                  /* RO: number of ports */
    439         int event_lost;                 /* number of lost events */
    440         char reserved[64];              /* for future use */
    441 };
    442 
    443 
    444 /* client pool size */
    445 struct snd_seq_client_pool {
    446         int client;                     /* client number to inquire */
    447         int output_pool;                /* outgoing (write) pool size */
    448         int input_pool;                 /* incoming (read) pool size */
    449         int output_room;                /* minimum free pool size for select/blocking mode */
    450         int output_free;                /* unused size */
    451         int input_free;                 /* unused size */
    452         char reserved[64];
    453 };
    454 
    455 
    456 /* Remove events by specified criteria */
    457 
    458 #define SNDRV_SEQ_REMOVE_INPUT          (1<<0)  /* Flush input queues */
    459 #define SNDRV_SEQ_REMOVE_OUTPUT         (1<<1)  /* Flush output queues */
    460 #define SNDRV_SEQ_REMOVE_DEST           (1<<2)  /* Restrict by destination q:client:port */
    461 #define SNDRV_SEQ_REMOVE_DEST_CHANNEL   (1<<3)  /* Restrict by channel */
    462 #define SNDRV_SEQ_REMOVE_TIME_BEFORE    (1<<4)  /* Restrict to before time */
    463 #define SNDRV_SEQ_REMOVE_TIME_AFTER     (1<<5)  /* Restrict to time or after */
    464 #define SNDRV_SEQ_REMOVE_TIME_TICK      (1<<6)  /* Time is in ticks */
    465 #define SNDRV_SEQ_REMOVE_EVENT_TYPE     (1<<7)  /* Restrict to event type */
    466 #define SNDRV_SEQ_REMOVE_IGNORE_OFF     (1<<8)  /* Do not flush off events */
    467 #define SNDRV_SEQ_REMOVE_TAG_MATCH      (1<<9)  /* Restrict to events with given tag */
    468 
    469 struct snd_seq_remove_events {
    470         unsigned int  remove_mode;      /* Flags that determine what gets removed */
    471 
    472         union snd_seq_timestamp time;
    473 
    474         unsigned char queue;    /* Queue for REMOVE_DEST */
    475         struct snd_seq_addr dest;       /* Address for REMOVE_DEST */
    476         unsigned char channel;  /* Channel for REMOVE_DEST */
    477 
    478         int  type;      /* For REMOVE_EVENT_TYPE */
    479         char  tag;      /* Tag for REMOVE_TAG */
    480 
    481         int  reserved[10];      /* To allow for future binary compatibility */
    482 
    483 };
    484 
    485 
    486         /* known port numbers */
    487 #define SNDRV_SEQ_PORT_SYSTEM_TIMER     0
    488 #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE  1
    489 
    490         /* port capabilities (32 bits) */
    491 #define SNDRV_SEQ_PORT_CAP_READ         (1<<0)  /* readable from this port */
    492 #define SNDRV_SEQ_PORT_CAP_WRITE        (1<<1)  /* writable to this port */
    493 
    494 #define SNDRV_SEQ_PORT_CAP_SYNC_READ    (1<<2)
    495 #define SNDRV_SEQ_PORT_CAP_SYNC_WRITE   (1<<3)
    496 
    497 #define SNDRV_SEQ_PORT_CAP_DUPLEX       (1<<4)
    498 
    499 #define SNDRV_SEQ_PORT_CAP_SUBS_READ    (1<<5)  /* allow read subscription */
    500 #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE   (1<<6)  /* allow write subscription */
    501 #define SNDRV_SEQ_PORT_CAP_NO_EXPORT    (1<<7)  /* routing not allowed */
    502 
    503         /* port type */
    504 #define SNDRV_SEQ_PORT_TYPE_SPECIFIC    (1<<0)  /* hardware specific */
    505 #define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
    506 #define SNDRV_SEQ_PORT_TYPE_MIDI_GM     (1<<2)  /* General MIDI compatible device */
    507 #define SNDRV_SEQ_PORT_TYPE_MIDI_GS     (1<<3)  /* GS compatible device */
    508 #define SNDRV_SEQ_PORT_TYPE_MIDI_XG     (1<<4)  /* XG compatible device */
    509 #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32   (1<<5)  /* MT-32 compatible device */
    510 #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2    (1<<6)  /* General MIDI 2 compatible device */
    511 
    512 /* other standards...*/
    513 #define SNDRV_SEQ_PORT_TYPE_SYNTH       (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
    514 #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11)       /* Sampling device (support sample download) */
    515 #define SNDRV_SEQ_PORT_TYPE_SAMPLE      (1<<12) /* Sampling device (sample can be downloaded at any time) */
    516 /*...*/
    517 #define SNDRV_SEQ_PORT_TYPE_HARDWARE    (1<<16) /* driver for a hardware device */
    518 #define SNDRV_SEQ_PORT_TYPE_SOFTWARE    (1<<17) /* implemented in software */
    519 #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
    520 #define SNDRV_SEQ_PORT_TYPE_PORT        (1<<19) /* connects to other device(s) */
    521 #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
    522 
    523 /* misc. conditioning flags */
    524 #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT   (1<<0)
    525 #define SNDRV_SEQ_PORT_FLG_TIMESTAMP    (1<<1)
    526 #define SNDRV_SEQ_PORT_FLG_TIME_REAL    (1<<2)
    527 
    528 struct snd_seq_port_info {
    529         struct snd_seq_addr addr;       /* client/port numbers */
    530         char name[64];                  /* port name */
    531 
    532         unsigned int capability;        /* port capability bits */
    533         unsigned int type;              /* port type bits */
    534         int midi_channels;              /* channels per MIDI port */
    535         int midi_voices;                /* voices per MIDI port */
    536         int synth_voices;               /* voices per SYNTH port */
    537 
    538         int read_use;                   /* R/O: subscribers for output (from this port) */
    539         int write_use;                  /* R/O: subscribers for input (to this port) */
    540 
    541         void *kernel;                   /* reserved for kernel use (must be NULL) */
    542         unsigned int flags;             /* misc. conditioning */
    543         unsigned char time_queue;       /* queue # for timestamping */
    544         char reserved[59];              /* for future use */
    545 };
    546 
    547 
    548 /* queue flags */
    549 #define SNDRV_SEQ_QUEUE_FLG_SYNC        (1<<0)  /* sync enabled */
    550 
    551 /* queue information */
    552 struct snd_seq_queue_info {
    553         int queue;              /* queue id */
    554 
    555         /*
    556          *  security settings, only owner of this queue can start/stop timer
    557          *  etc. if the queue is locked for other clients
    558          */
    559         int owner;              /* client id for owner of the queue */
    560         unsigned locked:1;      /* timing queue locked for other queues */
    561         char name[64];          /* name of this queue */
    562         unsigned int flags;     /* flags */
    563         char reserved[60];      /* for future use */
    564 
    565 };
    566 
    567 /* queue info/status */
    568 struct snd_seq_queue_status {
    569         int queue;                      /* queue id */
    570         int events;                     /* read-only - queue size */
    571         snd_seq_tick_time_t tick;       /* current tick */
    572         struct snd_seq_real_time time;  /* current time */
    573         int running;                    /* running state of queue */
    574         int flags;                      /* various flags */
    575         char reserved[64];              /* for the future */
    576 };
    577 
    578 
    579 /* queue tempo */
    580 struct snd_seq_queue_tempo {
    581         int queue;                      /* sequencer queue */
    582         unsigned int tempo;             /* current tempo, us/tick */
    583         int ppq;                        /* time resolution, ticks/quarter */
    584         unsigned int skew_value;        /* queue skew */
    585         unsigned int skew_base;         /* queue skew base */
    586         char reserved[24];              /* for the future */
    587 };
    588 
    589 
    590 /* sequencer timer sources */
    591 #define SNDRV_SEQ_TIMER_ALSA            0       /* ALSA timer */
    592 #define SNDRV_SEQ_TIMER_MIDI_CLOCK      1       /* Midi Clock (CLOCK event) */
    593 #define SNDRV_SEQ_TIMER_MIDI_TICK       2       /* Midi Timer Tick (TICK event) */
    594 
    595 /* queue timer info */
    596 struct snd_seq_queue_timer {
    597         int queue;                      /* sequencer queue */
    598         int type;                       /* source timer type */
    599         union {
    600                 struct {
    601                         struct snd_timer_id id; /* ALSA's timer ID */
    602                         unsigned int resolution;        /* resolution in Hz */
    603                 } alsa;
    604         } u;
    605         char reserved[64];              /* for the future use */
    606 };
    607 
    608 
    609 struct snd_seq_queue_client {
    610         int queue;              /* sequencer queue */
    611         int client;             /* sequencer client */
    612         int used;               /* queue is used with this client
    613                                    (must be set for accepting events) */
    614         /* per client watermarks */
    615         char reserved[64];      /* for future use */
    616 };
    617 
    618 
    619 #define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE   (1<<0)  /* exclusive connection */
    620 #define SNDRV_SEQ_PORT_SUBS_TIMESTAMP   (1<<1)
    621 #define SNDRV_SEQ_PORT_SUBS_TIME_REAL   (1<<2)
    622 
    623 struct snd_seq_port_subscribe {
    624         struct snd_seq_addr sender;     /* sender address */
    625         struct snd_seq_addr dest;       /* destination address */
    626         unsigned int voices;            /* number of voices to be allocated (0 = don't care) */
    627         unsigned int flags;             /* modes */
    628         unsigned char queue;            /* input time-stamp queue (optional) */
    629         unsigned char pad[3];           /* reserved */
    630         char reserved[64];
    631 };
    632 
    633 /* type of query subscription */
    634 #define SNDRV_SEQ_QUERY_SUBS_READ       0
    635 #define SNDRV_SEQ_QUERY_SUBS_WRITE      1
    636 
    637 struct snd_seq_query_subs {
    638         struct snd_seq_addr root;       /* client/port id to be searched */
    639         int type;               /* READ or WRITE */
    640         int index;              /* 0..N-1 */
    641         int num_subs;           /* R/O: number of subscriptions on this port */
    642         struct snd_seq_addr addr;       /* R/O: result */
    643         unsigned char queue;    /* R/O: result */
    644         unsigned int flags;     /* R/O: result */
    645         char reserved[64];      /* for future use */
    646 };
    647 
    648 
    649 /*
    650  *  IOCTL commands
    651  */
    652 
    653 #define SNDRV_SEQ_IOCTL_PVERSION        _IOR ('S', 0x00, int)
    654 #define SNDRV_SEQ_IOCTL_CLIENT_ID       _IOR ('S', 0x01, int)
    655 #define SNDRV_SEQ_IOCTL_SYSTEM_INFO     _IOWR('S', 0x02, struct snd_seq_system_info)
    656 #define SNDRV_SEQ_IOCTL_RUNNING_MODE    _IOWR('S', 0x03, struct snd_seq_running_info)
    657 
    658 #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
    659 #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
    660 
    661 #define SNDRV_SEQ_IOCTL_CREATE_PORT     _IOWR('S', 0x20, struct snd_seq_port_info)
    662 #define SNDRV_SEQ_IOCTL_DELETE_PORT     _IOW ('S', 0x21, struct snd_seq_port_info)
    663 #define SNDRV_SEQ_IOCTL_GET_PORT_INFO   _IOWR('S', 0x22, struct snd_seq_port_info)
    664 #define SNDRV_SEQ_IOCTL_SET_PORT_INFO   _IOW ('S', 0x23, struct snd_seq_port_info)
    665 
    666 #define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT  _IOW ('S', 0x30, struct snd_seq_port_subscribe)
    667 #define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
    668 
    669 #define SNDRV_SEQ_IOCTL_CREATE_QUEUE    _IOWR('S', 0x32, struct snd_seq_queue_info)
    670 #define SNDRV_SEQ_IOCTL_DELETE_QUEUE    _IOW ('S', 0x33, struct snd_seq_queue_info)
    671 #define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO  _IOWR('S', 0x34, struct snd_seq_queue_info)
    672 #define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO  _IOWR('S', 0x35, struct snd_seq_queue_info)
    673 #define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
    674 #define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
    675 #define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
    676 #define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
    677 #define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
    678 #define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
    679 #define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
    680 #define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
    681 /* XXX
    682 #define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC  _IOWR('S', 0x53, struct snd_seq_queue_sync)
    683 #define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC  _IOW ('S', 0x54, struct snd_seq_queue_sync)
    684 */
    685 #define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT        _IOWR('S', 0x49, struct snd_seq_queue_client)
    686 #define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT        _IOW ('S', 0x4a, struct snd_seq_queue_client)
    687 #define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
    688 #define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
    689 #define SNDRV_SEQ_IOCTL_REMOVE_EVENTS   _IOW ('S', 0x4e, struct snd_seq_remove_events)
    690 #define SNDRV_SEQ_IOCTL_QUERY_SUBS      _IOWR('S', 0x4f, struct snd_seq_query_subs)
    691 #define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION        _IOWR('S', 0x50, struct snd_seq_port_subscribe)
    692 #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT       _IOWR('S', 0x51, struct snd_seq_client_info)
    693 #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
    694 
    69571#endif /* __SOUND_ASEQUENCER_H */
Note: See TracChangeset for help on using the changeset viewer.