1 /*
2     TiMidity++ -- MIDI to WAVE converter and player
3     Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
4     Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
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 as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10 
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
foo()13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20 
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif /* HAVE_CONFIG_H */
24 #include "timidity.h"
25 #include "output.h"
26 
27 static int open_output(void);
28 static void close_output(void);
29 static int output_data(char *buf, int32 bytes);
30 static int acntl(int request, void *arg);
31 
32 PlayMode modmidi_play_mode = {
33     DEFAULT_RATE,
34     PE_16BIT|PE_SIGNED,
35     PF_PCM_STREAM|PF_FILE_OUTPUT,
36     -1,
37     {0,0,0,0,0},
38     "MOD -> MIDI file conversion", 'M',
39     NULL,
40     open_output,
41     close_output,
42     output_data,
43     acntl
44 };
45 
46 static int open_output(void)
47 {
48     modmidi_play_mode.fd = 0;
49     return 0;
50 }
51 
52 static void close_output(void)
53 {
54     modmidi_play_mode.fd = -1;
55 }
56 
57 static int output_data(char *buf, int32 bytes)
58 {
59     return bytes;
60 }
61 
62 static int acntl(int request, void *arg)
63 {
64     switch(request)
65     {
66       case PM_REQ_DISCARD:
67       case PM_REQ_PLAY_START: /* Called just before playing */
68       case PM_REQ_PLAY_END: /* Called just after playing */
69 	return 0;
70     }
71     return -1;
72 }
73