summaryrefslogtreecommitdiff
path: root/lib/libsalsa/seqmid.c
blob: e3ad1d0de1dbce4b6f87ea38567179d96c62f937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/*
 *  Copyright (c) 2004 by Hannu Savolainen < hannu@opensound.com>
 *
 *   This library is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License version 2.1 as
 *   published by the Free Software Foundation.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public
 *   License along with this library; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */
#include <stdio.h>
#include "local.h"

/**
 * \brief create a port - simple version
 * \param seq sequencer handle
 * \param name the name of the port
 * \param caps capability bits
 * \param type type bits
 * \return the created port number or negative error code
 *
 * Creates a port with the given capability and type bits.
 *
 * \sa snd_seq_create_port(), snd_seq_delete_simple_port()
 */
int
snd_seq_create_simple_port (snd_seq_t * seq, const char *name,
			    unsigned int caps, unsigned int type)
{
  snd_seq_port_info_t pinfo;
  int result;

  dbg_printf
    ("snd_seq_create_simple_port(seq=%x, name='%s', caps=%x, type=%x)\n", seq,
     name, caps, type);

  memset (&pinfo, 0, sizeof (pinfo));
  if (name)
    strncpy (pinfo.name, name, sizeof (pinfo.name) - 1);
  pinfo.capability = caps;
  pinfo.type = type;
  pinfo.midi_channels = 16;
  pinfo.midi_voices = 64;	/* XXX */
  pinfo.synth_voices = 0;	/* XXX */

  result = snd_seq_create_port (seq, &pinfo);
  if (result < 0)
    return result;
  else
    return pinfo.port;
}

/**
 * \brief delete the port
 * \param seq sequencer handle
 * \param port port id
 * \return 0 on success or negative error code
 *
 * \sa snd_seq_delete_port(), snd_seq_create_simple_port()
 */
int
snd_seq_delete_simple_port (snd_seq_t * seq, int port)
{
  dbg_printf ("snd_seq_delete_simple_port()\n");

  return 0;
}

/**
 * \brief set client name
 * \param seq sequencer handle
 * \param name name string
 * \return 0 on success or negative error code
 *
 * \sa snd_seq_set_client_info()
 */
int
snd_seq_set_client_name (snd_seq_t * seq, const char *name)
{
  snd_seq_client_info_t info;
  int err;

  dbg_printf ("snd_seq_set_client_name(seq=%x, name='%s')\n", seq, name);

  if ((err = snd_seq_get_client_info (seq, &info)) < 0)
    return err;
  strncpy (info.name, name, sizeof (info.name) - 1);
  return snd_seq_set_client_info (seq, &info);
}

/**
 * \brief change the output pool size of the given client
 * \param seq sequencer handle
 * \param size output pool size
 * \return 0 on success or negative error code
 *
 * \sa snd_seq_set_client_pool()
 */
int
snd_seq_set_client_pool_output (snd_seq_t * seq, size_t size)
{
  dbg_printf ("snd_seq_set_client_pool_output(seq=%x, size=%d)\n", seq, size);
  return 0;
}

/**
 * \brief parse the given string and get the sequencer address
 * \param seq sequencer handle
 * \param addr the address pointer to be returned
 * \param arg the string to be parsed
 * \return 0 on success or negative error code
 *
 * This function parses the sequencer client and port numbers from the given string.
 * The client and port tokes are separated by either colon or period, e.g. 128:1.
 * When \a seq is not NULL, the function accepts also a client name not only
 * digit numbers.
 */
int
snd_seq_parse_address (snd_seq_t * seq, snd_seq_addr_t * addr,
		       const char *arg)
{
  dbg_printf ("snd_seq_parse_address()\n");

  return 0;
}

/**
 * \brief wait until all events are processed
 * \param seq sequencer handle
 * \return 0 on success or negative error code
 *
 * This function waits until all events of this client are processed.
 *
 * \sa snd_seq_drain_output()
 */
int
snd_seq_sync_output_queue (snd_seq_t * seq)
{
  dbg_printf ("snd_seq_sync_output_queue()\n");

  return 0;
}

/**
 * \brief simple disconnection
 * \param myport the port id as sender
 * \param dest_client destination client id
 * \param dest_port destination port id
 * \return 0 on success or negative error code
 *
 * Remove connection from the given sender client:port
 * to the given destination port in the current client.
 *
 * \sa snd_seq_unsubscribe_port(), snd_seq_connect_to()
 */
int
snd_seq_disconnect_to (snd_seq_t * seq, int myport, int dest_client,
		       int dest_port)
{
  dbg_printf
    ("snd_seq_disconnect_to(seq=%x, myport=%d, dest_client=%d, dest_port=%d)\n",
     seq, myport, dest_client, dest_port);

  return 0;
}

/**
 * \brief change the input pool size of the given client
 * \param seq sequencer handle
 * \param size input pool size
 * \return 0 on success or negative error code
 *
 * \sa snd_seq_set_client_pool()
 */
int
snd_seq_set_client_pool_input (snd_seq_t * seq, size_t size)
{
  dbg_printf ("snd_seq_set_client_pool_input(seq=%x, size=%d)\n", seq, size);

  return 0;
}

/**
 * \brief change the output room size of the given client
 * \param seq sequencer handle
 * \param size output room size
 * \return 0 on success or negative error code
 *
 * \sa snd_seq_set_client_pool()
 */
int
snd_seq_set_client_pool_output_room (snd_seq_t * seq, size_t size)
{
  dbg_printf ("snd_seq_set_client_pool_output_room(seq=%x, size=%d)\n", seq,
	      size);

  return 0;
}