From 2ae16fb30da53562f694129d75fb5443ab35ff05 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela
Date: Sun, 30 Aug 1998 21:08:44 +0000
Subject: [PATCH] Big renaming - from sound to asound...
---
CHANGELOG | 2 ++
Makefile | 18 +++++++++---------
configure.in | 4 ++--
doc/soundapi-1.html | 6 +++---
doc/soundapi-3.html | 4 ++--
doc/soundapi-4.html | 8 ++++----
doc/soundapi-5.html | 14 +++++++-------
doc/soundapi.sgml | 10 +++++-----
doc/soundapi.txt | 10 +++++-----
include/header.h | 2 +-
src/Makefile | 20 ++++++++++----------
src/control/cards.c | 2 +-
src/control/control.c | 2 +-
src/error.c | 2 +-
src/mixer/mixer.c | 2 +-
src/pcm/pcm.c | 2 +-
src/rawmidi/rawmidi.c | 2 +-
test/control.c | 2 +-
test/mixer.c | 2 +-
test/switches.c | 2 +-
20 files changed, 59 insertions(+), 57 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 1a1ddb8e..231f3311 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
0.0.9 -> 0.1.0
+* renamed soundlib.h to asoundlib.h
+* renamed libraries from libsound to libasound
* big API changes
- added switches interfaces
* added RawMIDI API
diff --git a/Makefile b/Makefile
index 7e467fe4..fa03fe6d 100644
--- a/Makefile
+++ b/Makefile
@@ -13,26 +13,26 @@ dummy:
endif
-all: include/soundlib.h
+all: include/asoundlib.h
$(MAKE) -C src
$(MAKE) -C doc
@echo
@echo "ALSA library were sucessfully compiled."
@echo
-include/soundlib.h: include/header.h include/version.h include/error.h include/footer.h \
+include/asoundlib.h: include/header.h include/version.h include/error.h include/footer.h \
include/control.h include/mixer.h include/pcm.h include/rawmidi.h
cat include/header.h include/version.h include/error.h \
include/control.h include/mixer.h \
include/pcm.h include/rawmidi.h \
- include/footer.h > include/soundlib.h
+ include/footer.h > include/asoundlib.h
install: all
- $(INSTALL) -m 644 -o root -g root include/soundlib.h ${includedir}/sys
- $(INSTALL) -m 644 -o root -g root lib/libsound.a ${libdir}
- $(LN_S) -f libsound.so.${SND_LIB_VERSION} ${libdir}/libsound.so
- $(LN_S) -f libsound.so.${SND_LIB_VERSION} ${libdir}/libsound.so.${SND_LIB_MAJOR}
- $(INSTALL) -m 644 -o root -g root lib/libsound.so.${SND_LIB_VERSION} ${libdir}
+ $(INSTALL) -m 644 -o root -g root include/asoundlib.h ${includedir}/sys
+ $(INSTALL) -m 644 -o root -g root lib/libasound.a ${libdir}
+ $(LN_S) -f libasound.so.${SND_LIB_VERSION} ${libdir}/libasound.so
+ $(LN_S) -f libasound.so.${SND_LIB_VERSION} ${libdir}/libasound.so.${SND_LIB_MAJOR}
+ $(INSTALL) -m 644 -o root -g root lib/libasound.so.${SND_LIB_VERSION} ${libdir}
/sbin/ldconfig
clean:
@@ -46,7 +46,7 @@ clean:
cvsclean: clean
rm -f configure config.cache config.log config.status Makefile.conf \
- utils/alsa-lib.spec include/config.h include/soundlib.h include/version.h
+ utils/alsa-lib.spec include/config.h include/asoundlib.h include/version.h
pack: cvsclean
chown -R root.root ../alsa-lib
diff --git a/configure.in b/configure.in
index 5fb3db4e..3ea6e2fa 100644
--- a/configure.in
+++ b/configure.in
@@ -12,7 +12,7 @@ AC_PROG_LN_S
dnl Checks for header files.
AC_HEADER_STDC
AC_CONFIG_HEADER(include/config.h)
-AC_CHECK_HEADERS(linux/sound.h)
+AC_CHECK_HEADERS(linux/asound.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -32,7 +32,7 @@ CFLAGS="-I$myprefix/include"
#echo "CFLAGS=$CFLAGS"
AC_MSG_CHECKING(for alsa-driver package)
AC_TRY_RUN([
-#include
+#include
void main(void)
{
#if !defined( SND_PROTOCOL_VERSION ) || !defined( SND_PROTOCOL_UNCOMPATIBLE )
diff --git a/doc/soundapi-1.html b/doc/soundapi-1.html
index f58691a2..71da2b89 100644
--- a/doc/soundapi-1.html
+++ b/doc/soundapi-1.html
@@ -20,9 +20,9 @@ may be placed in the library code instead of the kernel driver.
For a complete list of all variables and functions in the API you should look
at the following header files:
Time when record was started. This variable contains right value only if
@@ -503,19 +503,19 @@ char *buffer;
buffer = (char *)malloc( 512 * 1024 );
if ( !buffer ) return;
-if ( (err = snd_pcm_open( &handle, card, device, SND_PCM_OPEN_PLAYBACK )) < 0 ) {
+if ( (err = snd_pcm_open( &handle, card, device, SND_PCM_OPEN_PLAYBACK )) < 0 ) {
fprintf( stderr, "open failed: %s\n", snd_strerror( err ) );
return;
}
format.format = SND_PCM_SFMT_MU_LAW;
format.rate = 8000;
-format.voices = 1;
-if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
+format.channels = 1;
+if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
fprintf( stderr, "format setup failed: %s\n", snd_strerror( err ) );
snd_pcm_close( handle );
return;
}
-fd = open( "/tmp/test.au" );
+fd = open( "/tmp/test.au", O_RDONLY );
if ( fd < 0 ) {
perror( "open file" );
snd_pcm_close( handle );
@@ -534,7 +534,7 @@ if ( !memcmp( buffer, ".snd", 4 ) ) {
if ( idx > 128 ) idx = 128;
if ( idx > count ) idx = count;
}
-size = snd_pcm_write( handle, &buffer[ idx ], count - idx );
+size = snd_pcm_write( handle, &buffer[ idx ], count - idx );
printf( "Bytes written %i from %i...\n", size, count - idx );
snd_pcm_close( handle );
free( buffer );
diff --git a/doc/soundapi.sgml b/doc/soundapi.sgml
index bf32ebc3..3d0e482d 100644
--- a/doc/soundapi.sgml
+++ b/doc/soundapi.sgml
@@ -35,9 +35,9 @@ may be placed in the library code instead of the kernel driver.
For a complete list of all variables and functions in the API you should look
at the following header files:
- - /usr/include/sys/soundlib.h
-
- /usr/include/linux/sound.h
-
- /usr/include/linux/sounddetect.h
+
- /usr/include/sys/asoundlib.h
+
- /usr/include/linux/asound.h
+
- /usr/include/linux/asoundid.h
Error Codes
@@ -922,13 +922,13 @@ if ( (err = snd_pcm_open( &ero;handle, card, device, SND_PCM_OPEN_PLAYBACK )) <
}
format.format = SND_PCM_SFMT_MU_LAW;
format.rate = 8000;
-format.voices = 1;
+format.channels = 1;
if ( (err = snd_pcm_playback_format( handle, &ero;format )) < 0 ) {
fprintf( stderr, "format setup failed: %s\n", snd_strerror( err ) );
snd_pcm_close( handle );
return;
}
-fd = open( "/tmp/test.au" );
+fd = open( "/tmp/test.au", O_RDONLY );
if ( fd < 0 ) {
perror( "open file" );
snd_pcm_close( handle );
diff --git a/doc/soundapi.txt b/doc/soundapi.txt
index ebe5d45f..037de813 100644
--- a/doc/soundapi.txt
+++ b/doc/soundapi.txt
@@ -163,11 +163,11 @@
For a complete list of all variables and functions in the API you
should look at the following header files:
- 1. /usr/include/sys/soundlib.h
+ 1. /usr/include/sys/asoundlib.h
- 2. /usr/include/linux/sound.h
+ 2. /usr/include/linux/asound.h
- 3. /usr/include/linux/sounddetect.h
+ 3. /usr/include/linux/asoundid.h
22.. EErrrroorr CCooddeess
@@ -1197,13 +1197,13 @@
}
format.format = SND_PCM_SFMT_MU_LAW;
format.rate = 8000;
- format.voices = 1;
+ format.channels = 1;
if ( (err = snd_pcm_playback_format( handle, &format )) < 0 ) {
fprintf( stderr, "format setup failed: %s\n", snd_strerror( err ) );
snd_pcm_close( handle );
return;
}
- fd = open( "/tmp/test.au" );
+ fd = open( "/tmp/test.au", O_RDONLY );
if ( fd < 0 ) {
perror( "open file" );
snd_pcm_close( handle );
diff --git a/include/header.h b/include/header.h
index 3bf18124..7261c011 100644
--- a/include/header.h
+++ b/include/header.h
@@ -22,7 +22,7 @@
#ifndef __SOUNDLIB_H
#define __SOUNDLIB_H
-#include
+#include
#include
#include
diff --git a/src/Makefile b/src/Makefile
index 166426ca..42740fe1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -5,10 +5,10 @@
include ../Makefile.conf
-TARGET=../lib/libsound.a
-STARGET=../lib/libsound.so
-STARGETX=../lib/libsound.so.$(SND_LIB_VERSION)
-STARGETO=../lib/libsound.so.$(SND_LIB_MAJOR)
+TARGET=../lib/libasound.a
+STARGET=../lib/libasound.so
+STARGETX=../lib/libasound.so.$(SND_LIB_VERSION)
+STARGETO=../lib/libasound.so.$(SND_LIB_MAJOR)
TARGETS=$(TARGET) $(STARGET)
STATIC_LIBS= control/libcontrol.a \
@@ -34,14 +34,14 @@ SOBJECTS=error.So
all: $(TARGETS)
$(TARGET): .depend $(OBJECTS) $(STATIC_LIBS)
- rm -f ../lib/libsound.a
+ rm -f ../lib/libasound.a
$(LINKER) -r -o $(TARGET) $(STATIC_LIBS) $(OBJECTS)
$(STARGET): .depend $(SOBJECTS) $(DYNAMIC_LIBS)
- rm -f ../lib/libsound*.so*
- $(CC) -shared -Wl,-soname,libsound.so.$(SND_LIB_MAJOR) $(DYNAMIC_LIBS) $(SOBJECTS) -o $(STARGETX)
- ln -s libsound.so.$(SND_LIB_VERSION) $(STARGET)
- ln -s libsound.so.$(SND_LIB_VERSION) $(STARGETO)
+ rm -f ../lib/libasound*.so*
+ $(CC) -shared -Wl,-soname,libasound.so.$(SND_LIB_MAJOR) $(DYNAMIC_LIBS) $(SOBJECTS) -o $(STARGETX)
+ ln -s libasound.so.$(SND_LIB_VERSION) $(STARGET)
+ ln -s libasound.so.$(SND_LIB_VERSION) $(STARGETO)
control/libcontrol.a:
$(MAKE) -C control
@@ -69,7 +69,7 @@ clean:
$(MAKE) -C mixer clean
$(MAKE) -C rawmidi clean
rm -f core .depend *.o *.So *.orig *~
- rm -f ../lib/libsound.*
+ rm -f ../lib/libasound.*
.depend:
$(CPP) $(COPTS) $(INCLUDE) -M *.c > .depend
diff --git a/src/control/cards.c b/src/control/cards.c
index 413cb743..c7a8da27 100644
--- a/src/control/cards.c
+++ b/src/control/cards.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_CONTROL "/dev/sndcontrol%i"
diff --git a/src/control/control.c b/src/control/control.c
index 2e98b3df..b5912324 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_CONTROL "/dev/snd/control%i"
#define SND_CTL_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
diff --git a/src/error.c b/src/error.c
index 217a86d5..387d6da7 100644
--- a/src/error.c
+++ b/src/error.c
@@ -24,7 +24,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
static const char *snd_error_codes[] = {
"Sound protocol isn't compatible"
diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c
index 430a133c..f385bc99 100644
--- a/src/mixer/mixer.c
+++ b/src/mixer/mixer.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_MIXER "/dev/snd/mixer%i%i"
#define SND_MIXER_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 1 )
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 15c5d9ed..5557f13b 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_PCM "/dev/snd/pcm%i%i"
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c
index 016541e6..6a3b46ec 100644
--- a/src/rawmidi/rawmidi.c
+++ b/src/rawmidi/rawmidi.c
@@ -26,7 +26,7 @@
#include
#include
#include
-#include "soundlib.h"
+#include "asoundlib.h"
#define SND_FILE_RAWMIDI "/dev/snd/midi%i%i"
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
diff --git a/test/control.c b/test/control.c
index fa6e7502..e7f93119 100644
--- a/test/control.c
+++ b/test/control.c
@@ -1,6 +1,6 @@
#include
#include
-#include "../include/soundlib.h"
+#include "../include/asoundlib.h"
void main( void )
{
diff --git a/test/mixer.c b/test/mixer.c
index 6ef0f30b..1ab3e803 100644
--- a/test/mixer.c
+++ b/test/mixer.c
@@ -1,6 +1,6 @@
#include
#include
-#include "../include/soundlib.h"
+#include "../include/asoundlib.h"
static void mixer_test( int card, int device )
{
diff --git a/test/switches.c b/test/switches.c
index f8992c28..334e2baa 100644
--- a/test/switches.c
+++ b/test/switches.c
@@ -1,6 +1,6 @@
#include
#include
-#include "../include/soundlib.h"
+#include "../include/asoundlib.h"
const char *get_type( unsigned int type )
{
--
2.47.1