On Fri, Apr 23, 2010 at 05:31:36AM +0000, Jacob Meuser wrote:
> On Mon, Apr 19, 2010 at 09:51:01AM +0000, Jacob Meuser wrote:
> 
> > audio(4) users:
> 
> > x11/kde/multimedia3 mpeglib, not sure if it's actually used or not
> 
> the yaf-* players use mpeglib.
> 
> ok?

> ? patches/patch-mpeglib_lib_Makefile_in

oops

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/kde/multimedia3/Makefile,v
retrieving revision 1.64
diff -N -u -p Makefile
--- Makefile    21 Dec 2009 20:46:02 -0000      1.64
+++ Makefile    23 Apr 2010 05:45:02 -0000
@@ -4,7 +4,7 @@ COMMENT =               K Desktop Environment, multimedia 
applicat
 CATEGORIES =           x11 x11/kde
 VERSION =              3.5.10
 DISTNAME =             kdemultimedia-${VERSION}
-PKGNAME =              ${DISTNAME}p4
+PKGNAME =              ${DISTNAME}p5
 MODKDE_VERSION =       3.5.8
 SHARED_LIBS += artsbuilder          1.0      # .0.0
 SHARED_LIBS += artsmidi_idl         1.0      # .0.0
@@ -67,5 +67,8 @@ WANTLIB =     ICE SM X11 Xau Xdmcp Xext Xrender Xv Xxf86dg
                glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0 idn \
                jpeg m mad ossaudio pcre pcreposix png pthread rpcsvc sndio \
                stdc++ util xml2 z pthread-stubs xcb
+
+post-extract:
+       cp ${FILESDIR}/audioIO_sndio.cpp ${WRKSRC}/mpeglib/lib/util/audio
 
 .include <bsd.port.mk>
Index: files/audioIO_sndio.cpp
===================================================================
RCS file: files/audioIO_sndio.cpp
diff -N -u -p files/audioIO_sndio.cpp
--- /dev/null   22 Apr 2010 23:45:02 -0000
+++ files/audioIO_sndio.cpp     23 Apr 2010 05:45:02 -0000
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2010 Jacob Meuser <jake...@sdf.lonestar.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <sndio.h>
+
+#include "audioIO.h"
+
+static struct sio_hdl *hdl;
+static struct sio_par par;
+
+int
+audioConstruct()
+{
+       hdl = NULL;
+       return true;
+}
+
+void
+audioDestruct()
+{
+}
+
+int
+audioOpen()
+{
+       hdl = sio_open(NULL, SIO_PLAY, 0);
+       if (hdl == NULL) {
+               fprintf(stderr, "unable to open audio device\n");
+               return 0;
+       }
+
+       return true;
+}
+
+inline void
+audioFlush()
+{
+}
+
+void
+audioClose()
+{
+       if (hdl != NULL)
+               sio_close(hdl);
+}
+
+void
+audioInit(int sampleSize, int frequency, int stereo, int sign, int big)
+{
+       sio_initpar(&par);
+
+       par.bits = sampleSize;
+       par.sig = sign ? 1 : 0;
+       par.le = big ? 0 : 1;
+       par.rate = frequency;
+       par.pchan = stereo ? 2 : 1;
+
+       if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par))
+               fprintf(stderr, "error setting sndio parameters\n");
+  
+       if (par.bits != sampleSize ||
+           par.sig != sign ? 1 : 0 ||
+           par.le != big ? 0 : 1 ||
+           par.rate != frequency ||
+           par.pchan != stereo ? 2 : 1)
+               fprintf(stderr, "could not set requested audio parameters");
+
+       if (!sio_start(hdl))
+               fprintf(stderr, "could not start audio");
+}
+
+int
+getAudioBufferSize()
+{
+       return (par.appbufsz * par.bps * par.pchan);
+}
+
+
+void
+mixerSetVolume(int leftVolume, int rightVolume)
+{
+       /* values from 0..100 */
+}
+
+int
+mixerOpen()
+{
+       return false;
+}
+
+void
+mixerClose()
+{
+}
+
+int
+audioWrite(char *buffer, int count)
+{
+       return(sio_write(hdl, buffer, count));
+}
Index: patches/patch-mpeglib_lib_Makefile_in
===================================================================
RCS file: 
/cvs/ports/x11/kde/multimedia3/patches/Attic/patch-mpeglib_lib_Makefile_in,v
diff -N -u -p patches/patch-mpeglib_lib_Makefile_in
--- /dev/null   22 Apr 2010 23:45:02 -0000
+++ patches/patch-mpeglib_lib_Makefile_in       23 Apr 2010 05:45:02 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- mpeglib/lib/Makefile.in.orig       Thu Apr 22 19:09:59 2010
++++ mpeglib/lib/Makefile.in    Thu Apr 22 19:10:32 2010
+@@ -293,7 +293,7 @@ SET_MAKE = @SET_MAKE@
+ SHELL = @SHELL@
+ STRIP = @STRIP@
+ TAGLIB_CONFIG = @TAGLIB_CONFIG@
+-THIS_LIB_LIBS = @THIS_LIB_LIBS@
++THIS_LIB_LIBS = @THIS_LIB_LIBS@ -lsndio
+ THIS_LIB_MAJOR_VERSION = @THIS_LIB_MAJOR_VERSION@
+ THIS_LIB_MICRO_VERSION = @THIS_LIB_MICRO_VERSION@
+ THIS_LIB_MINOR_VERSION = @THIS_LIB_MINOR_VERSION@
Index: patches/patch-mpeglib_lib_util_audio_audioIO_SunOS_cpp
===================================================================
RCS file: 
/cvs/ports/x11/kde/multimedia3/patches/patch-mpeglib_lib_util_audio_audioIO_SunOS_cpp,v
retrieving revision 1.1
diff -N -u -p patches/patch-mpeglib_lib_util_audio_audioIO_SunOS_cpp
--- patches/patch-mpeglib_lib_util_audio_audioIO_SunOS_cpp      29 Jan 2009 
22:37:21 -0000      1.1
+++ /dev/null   23 Apr 2010 05:31:01 -0000
@@ -1,25 +0,0 @@
-$OpenBSD: patch-mpeglib_lib_util_audio_audioIO_SunOS_cpp,v 1.1 2009/01/29 
22:37:21 jakemsr Exp $
---- mpeglib/lib/util/audio/audioIO_SunOS.cpp.orig      Sun Dec 28 14:56:16 2008
-+++ mpeglib/lib/util/audio/audioIO_SunOS.cpp   Sun Dec 28 14:59:46 2008
-@@ -8,10 +8,11 @@
-  */
- 
- #include <sys/types.h>
--#include <sys/stropts.h>
-+#include <string.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <stdio.h>
-+#include <sys/ioctl.h>
- #include <sys/audioio.h>
- #include "audioIO.h"
- #include <iostream.h>
-@@ -128,7 +129,7 @@ void mixerSetVolume(int leftVolume,int rightVolume) {
-   //someone should fix the volume on solaris
-   balance=0;
-   
--  auinfo.play.balance=(uchar_t)balance;
-+  auinfo.play.balance=(unsigned char)balance;
-   if (ioctl(audio_fd,AUDIO_SETINFO,&auinfo)<0)
-     perror("Unable to set sound volume");
- }
Index: patches/patch-mpeglib_lib_util_audio_audioIO_cpp
===================================================================
RCS file: 
/cvs/ports/x11/kde/multimedia3/patches/patch-mpeglib_lib_util_audio_audioIO_cpp,v
retrieving revision 1.1
diff -N -u -p patches/patch-mpeglib_lib_util_audio_audioIO_cpp
--- patches/patch-mpeglib_lib_util_audio_audioIO_cpp    29 Jan 2009 22:37:21 
-0000      1.1
+++ patches/patch-mpeglib_lib_util_audio_audioIO_cpp    23 Apr 2010 05:45:02 
-0000
@@ -1,12 +1,12 @@
 $OpenBSD: patch-mpeglib_lib_util_audio_audioIO_cpp,v 1.1 2009/01/29 22:37:21 
jakemsr Exp $
---- mpeglib/lib/util/audio/audioIO.cpp.orig    Sun Dec 28 13:31:48 2008
-+++ mpeglib/lib/util/audio/audioIO.cpp Sun Dec 28 13:32:36 2008
+--- mpeglib/lib/util/audio/audioIO.cpp.orig    Sat Sep 10 01:19:53 2005
++++ mpeglib/lib/util/audio/audioIO.cpp Thu Apr 22 19:06:05 2010
 @@ -26,7 +26,11 @@
  #endif
  
  #ifdef OS_BSD
 +#ifdef __OpenBSD__
-+  #include "audioIO_SunOS.cpp"
++  #include "audioIO_sndio.cpp"
 +#else
    #include "audioIO_Linux.cpp"
 +#endif

Reply via email to