initial import
[dosrtxon] / libs / mikmod / drivers / drv_nos.c
1 /*      MikMod sound library
2         (c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS for
3         complete list.
4
5         This library is free software; you can redistribute it and/or modify
6         it under the terms of the GNU Library General Public License as
7         published by the Free Software Foundation; either version 2 of
8         the License, or (at your option) any later version.
9
10         This program is distributed in the hope that it will be useful,
11         but WITHOUT ANY WARRANTY; without even the implied warranty of
12         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13         GNU Library General Public License for more details.
14
15         You should have received a copy of the GNU Library General Public
16         License along with this library; if not, write to the Free Software
17         Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18         02111-1307, USA.
19 */
20
21 /*==============================================================================
22
23   $Id$
24
25   Driver for no output
26
27 ==============================================================================*/
28
29 /*
30
31         Written by Jean-Paul Mikkers <mikmak@via.nl>
32
33 */
34
35 #ifdef HAVE_CONFIG_H
36 #include "config.h"
37 #endif
38
39 #ifdef HAVE_UNISTD_H
40 #include <unistd.h>
41 #endif
42
43 #include "mikmod_internals.h"
44
45 #define ZEROLEN 32768
46
47 static  SBYTE *zerobuf=NULL;
48
49 static BOOL NS_IsThere(void)
50 {
51         return 1;
52 }
53
54 static int NS_Init(void)
55 {
56         zerobuf=(SBYTE*)MikMod_malloc(ZEROLEN);
57         return VC_Init();
58 }
59
60 static void NS_Exit(void)
61 {
62         VC_Exit();
63         MikMod_free(zerobuf);
64         zerobuf=NULL;
65 }
66
67 static void NS_Update(void)
68 {
69         if (zerobuf)
70                 VC_WriteBytes(zerobuf,ZEROLEN);
71 }
72
73 MIKMODAPI MDRIVER drv_nos={
74         NULL,
75         "No Sound",
76         "Nosound Driver v3.0",
77         255,255,
78         "nosound",
79         NULL,
80         NULL,
81         NS_IsThere,
82         VC_SampleLoad,
83         VC_SampleUnload,
84         VC_SampleSpace,
85         VC_SampleLength,
86         NS_Init,
87         NS_Exit,
88         NULL,
89         VC_SetNumVoices,
90         VC_PlayStart,
91         VC_PlayStop,
92         NS_Update,
93         NULL,
94         VC_VoiceSetVolume,
95         VC_VoiceGetVolume,
96         VC_VoiceSetFrequency,
97         VC_VoiceGetFrequency,
98         VC_VoiceSetPanning,
99         VC_VoiceGetPanning,
100         VC_VoicePlay,
101         VC_VoiceStop,
102         VC_VoiceStopped,
103         VC_VoiceGetPosition,
104         VC_VoiceRealVolume
105 };
106
107 /* ex:set ts=4: */