0001
0002
0003
0004
0005
0006 #ifndef __SND_SEQ_PORTS_H
0007 #define __SND_SEQ_PORTS_H
0008
0009 #include <sound/seq_kernel.h>
0010 #include "seq_lock.h"
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 struct snd_seq_subscribers {
0029 struct snd_seq_port_subscribe info;
0030 struct list_head src_list;
0031 struct list_head dest_list;
0032 atomic_t ref_count;
0033 };
0034
0035 struct snd_seq_port_subs_info {
0036 struct list_head list_head;
0037 unsigned int count;
0038 unsigned int exclusive: 1;
0039 struct rw_semaphore list_mutex;
0040 rwlock_t list_lock;
0041 int (*open)(void *private_data, struct snd_seq_port_subscribe *info);
0042 int (*close)(void *private_data, struct snd_seq_port_subscribe *info);
0043 };
0044
0045 struct snd_seq_client_port {
0046
0047 struct snd_seq_addr addr;
0048 struct module *owner;
0049 char name[64];
0050 struct list_head list;
0051 snd_use_lock_t use_lock;
0052
0053
0054 struct snd_seq_port_subs_info c_src;
0055 struct snd_seq_port_subs_info c_dest;
0056
0057 int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data,
0058 int atomic, int hop);
0059 void (*private_free)(void *private_data);
0060 void *private_data;
0061 unsigned int closing : 1;
0062 unsigned int timestamping: 1;
0063 unsigned int time_real: 1;
0064 int time_queue;
0065
0066
0067 unsigned int capability;
0068 unsigned int type;
0069
0070
0071 int midi_channels;
0072 int midi_voices;
0073 int synth_voices;
0074
0075 };
0076
0077 struct snd_seq_client;
0078
0079
0080 struct snd_seq_client_port *snd_seq_port_use_ptr(struct snd_seq_client *client, int num);
0081
0082
0083 struct snd_seq_client_port *snd_seq_port_query_nearest(struct snd_seq_client *client,
0084 struct snd_seq_port_info *pinfo);
0085
0086
0087 #define snd_seq_port_unlock(port) snd_use_lock_free(&(port)->use_lock)
0088
0089
0090 struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, int port_index);
0091
0092
0093 int snd_seq_delete_port(struct snd_seq_client *client, int port);
0094
0095
0096 int snd_seq_delete_all_ports(struct snd_seq_client *client);
0097
0098
0099 int snd_seq_set_port_info(struct snd_seq_client_port *port,
0100 struct snd_seq_port_info *info);
0101
0102
0103 int snd_seq_get_port_info(struct snd_seq_client_port *port,
0104 struct snd_seq_port_info *info);
0105
0106
0107 int snd_seq_port_connect(struct snd_seq_client *caller,
0108 struct snd_seq_client *s, struct snd_seq_client_port *sp,
0109 struct snd_seq_client *d, struct snd_seq_client_port *dp,
0110 struct snd_seq_port_subscribe *info);
0111
0112
0113 int snd_seq_port_disconnect(struct snd_seq_client *caller,
0114 struct snd_seq_client *s, struct snd_seq_client_port *sp,
0115 struct snd_seq_client *d, struct snd_seq_client_port *dp,
0116 struct snd_seq_port_subscribe *info);
0117
0118
0119 int snd_seq_port_subscribe(struct snd_seq_client_port *port,
0120 struct snd_seq_port_subscribe *info);
0121
0122
0123 int snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
0124 struct snd_seq_addr *dest_addr,
0125 struct snd_seq_port_subscribe *subs);
0126
0127 #endif