File: Yclientnet.h

package info (click to toggle)
yiff 2.06-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,464 kB
  • ctags: 3,028
  • sloc: ansic: 47,463; makefile: 218; sh: 77
file content (132 lines) | stat: -rw-r--r-- 3,266 bytes parent folder | download | duplicates (3)
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
/*
                          Y Sound Systems

                 Client to Server Network Functions

	This header file is only needed to build the libY2 library,
	Y client programs need not #include this file.

        For contact and programming information, see:

        http://fox.mit.edu/xsw/yiff

 */

#ifndef YCLIENTNET_H
#define YCLIENTNET_H


#include <stdio.h>
#include <db.h>
#include <sys/types.h>

#include "Y.h"     /* Yiff protocol. */
#include "Ylib.h"

/*
 *	Standard inputs and protocol for inputs of all YNetParse*()
 *	functions:
 */
#define YCNP_STD_INPUTS_PROTO \
        YConnection *con, \
        YEvent *event, \
        u_int8_t *buf, \
        u_int32_t chunk_length, \
        u_int16_t major_op_code, \
        u_int16_t minor_op_code

#define YCNP_STD_INPUTS \
        con, \
        event, \
        buf, \
        chunk_length, \
        major_op_code, \
        minor_op_code


extern int YNetSendAudioChangePreset(
	YConnection *con,
	char *audio_mode_name
);
extern int YNetSendAudioChangeValues(
	YConnection *con,
        int sample_size,
        int channels,
        YDataLength sample_rate,
        int direction,
        int allow_fragmenting,
        int num_fragments,
        int fragment_size
);
extern int YNetParseAudioChange(YCNP_STD_INPUTS_PROTO);

extern int YNetSendCycleChange(YConnection *con, long cycle_us);
extern int YNetParseCycleChange(YCNP_STD_INPUTS_PROTO);

extern int YNetSendDisconnect(YConnection *con, int reason);
extern int YNetParseDisconnect(YCNP_STD_INPUTS_PROTO);

extern int YNetSendSetHost(
	YConnection *con,
	u_int16_t minor_op_code,
	YIPUnion *ip
);
extern int YNetParseSetHost(YCNP_STD_INPUTS_PROTO);

extern int YNetSendSetMixerChannel(
        YConnection *con,
        int mixer_code,
        Coefficient value1,
        Coefficient value2
);
extern int YNetSendGetMixerChannel(YConnection *con, int mixer_code);
extern int YNetParseMixerChannel(YCNP_STD_INPUTS_PROTO);

extern int YNetSendSoundPlay(
        YConnection *con,
	YID yid,
        char *path,
        YDataPosition pos,
        YVolumeStruct *volume,
        int repeats
);
extern int YNetParseSoundPlay(YCNP_STD_INPUTS_PROTO);

extern int YNetSendSoundKill(YConnection *con, YID yid);
extern int YNetParseSoundKill(YCNP_STD_INPUTS_PROTO);

extern int YNetSendGetSoundObjectAttributes(
        YConnection *con,
        char *path
);
extern int YNetParseSoundObjectAttributes(YCNP_STD_INPUTS_PROTO);

extern int YNetSendShutdown(YConnection *con, int reason);
extern int YNetParseShutdown(YCNP_STD_INPUTS_PROTO);

extern int YNetSendSync(YConnection *con, long cycle_ahead_us);
extern int YNetParseSync(YCNP_STD_INPUTS_PROTO);

extern int YNetSendGetAudioStats(YConnection *con);
extern int YNetParseAudioStats(YCNP_STD_INPUTS_PROTO);

extern int YNetSendGetServerStats(YConnection *con);
extern int YNetParseServerStats(YCNP_STD_INPUTS_PROTO);

extern int YNetSendListAudioModes(YConnection *con);
extern int YNetParseListAudioModes(YCNP_STD_INPUTS_PROTO);


extern int YNetParse(
        YConnection *con,
        YEvent *event,
        u_int8_t *buf,
        u_int32_t chunk_length,
        u_int16_t major_op_code,
        u_int16_t minor_op_code
);

extern int YNetRecv(YConnection *con);


#endif	/* YCLIENTNET_H */