richarddobson 3 gadi atpakaļ
vecāks
revīzija
5e9fb752c2

+ 5 - 0
dev/externals/paprogs/CMakeLists.txt

@@ -0,0 +1,5 @@
+
+add_subdirectory(listaudevs)
+add_subdirectory(paplay)
+add_subdirectory(pvplay)
+add_subdirectory(recsf)

BIN
dev/externals/paprogs/dx9mgw.zip


+ 26 - 0
dev/externals/paprogs/listaudevs/CMakeLists.txt

@@ -0,0 +1,26 @@
+if(APPLE)
+  set(CMAKE_C_FLAGS "-O2 -Wall -mmacosx-version-min=10.5 -Dunix -fomit-frame-pointer -funroll-loops")
+  include_directories ( /Developer/Headers/FlatCarbon )
+  find_library(COREAUDIOLIB CoreAudio)
+  find_library(AUDIOTOOLBOX AudioToolbox)
+  find_library(AULIB AudioUnit)
+  find_library(CARBONLIB Carbon)
+  set(EXTRA_LIBRARIES1 ${COREAUDIOLIB} ${AUDIOTOOLBOX} ${AULIB} ${CARBONLIB} ${EXTRA_LIBRARIES})
+else()
+  if(MINGW)
+    set(CMAKE_C_FLAGS "-O3 -DWIN32 -D_WIN32 -fomit-frame-pointer  -funroll-loops")
+    set(EXTRA_LIBRARIES1 winmm dsound winspool ${EXTRA_LIBRARIES})
+  else()
+    set(CMAKE_C_FLAGS "-O3 -Wall -Dlinux -Dunix -fomit-frame-pointer -funroll-loops")
+    set(EXTRA_LIBRARIES1 jack asound portsf pthread ${EXTRA_LIBRARIES})
+  endif()
+endif()
+
+link_directories(../../include ../portaudio/lib/.libs)
+
+include_directories(../../../include ../include ../portaudio/include ../portaudio/src/common )
+
+add_executable(listaudevs devs.c)
+target_link_libraries(listaudevs portaudio.a  ${EXTRA_LIBRARIES1})
+
+my_install(listaudevs)

+ 69 - 0
dev/externals/paprogs/listaudevs/devs.c

@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1983-2020 Richard Dobson and Composers Desktop Project Ltd
+ * http://www.rwdobson.com
+ * http://www.composersdesktop.com
+ * This file is part of the CDP System.
+ * The CDP System is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public 
+ * License as published by the Free Software Foundation; either 
+ * version 2.1 of the License, or (at your option) any later version. 
+ *
+ * The CDP System is distributed in the hope that it will be useful, 
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the CDP System; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/* devs.c : display list of installed audio devices */  
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _WIN32
+# include <windows.h>
+#endif
+#include <portaudio.h>
+
+int show_devices(void);
+
+int main(void)
+{
+    return show_devices();
+}
+
+int show_devices(void)
+{
+        PaDeviceIndex numDevices,p;
+        const    PaDeviceInfo *pdi;
+        PaError  err;
+        int nOutputDevices = 0;
+
+        Pa_Initialize();
+        numDevices =  Pa_GetDeviceCount();
+        if( numDevices < 0 )
+        {
+            printf("ERROR: Pa_CountDevices returned 0x%x\n", numDevices );
+            err = numDevices;
+            return err;
+        }
+        //printf("Number of devices = %d\n", numDevices );
+        printf("Device\tInput\tOutput\tName\n");
+        
+        for( p=0; p<numDevices; p++ )
+        {
+            pdi = Pa_GetDeviceInfo( p );    
+            nOutputDevices++;
+            if( p == Pa_GetDefaultOutputDevice() ) 
+                printf("*");
+            else
+                printf(" ");
+            printf("%d\t%d\t%d\t%s\n",p,
+                pdi->maxInputChannels,
+                pdi->maxOutputChannels,
+                pdi->name);         
+        }
+        Pa_Terminate();
+        return 0;
+}