You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Tapio V. <aa...@us...> - 2010-07-22 15:36:28
|
Module: performous
Branch: portaudio
Commit: 3e6108e10242d57d3cce2df270dd1fb76188f0bf
Author: John Stumpo <st...@js...>
Date: Wed Jun 23 03:15:48 2010 -0400
Fix a case-sensitivity bug keeping OpenGL from being detected by cross-compilers to Windows.
---
cmake/Modules/FindOpenGL.cmake | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/Modules/FindOpenGL.cmake b/cmake/Modules/FindOpenGL.cmake
index 7ac1128..be991ab 100644
--- a/cmake/Modules/FindOpenGL.cmake
+++ b/cmake/Modules/FindOpenGL.cmake
@@ -20,12 +20,12 @@ find_path(OpenGL_INCLUDE_DIR
)
find_library(OpenGL_GL_LIBRARY
- NAMES GL libOpenGL32.a OpenGL32
+ NAMES GL libopengl32.a opengl32
PATHS ${OpenGL_PKGCONF_LIBRARY_DIRS}
)
find_library(OpenGL_GLU_LIBRARY
- NAMES GLU libGLU32.a GLU32
+ NAMES GLU libglu32.a glu32
PATHS ${OpenGL_PKGCONF_LIBRARY_DIRS}
)
|
|
From: Tapio V. <aa...@us...> - 2010-07-22 15:36:25
|
Module: performous Branch: portaudio Commit: 6399a773b019f449031ed0b30ee82feca0f5e354 Author: John Stumpo <st...@js...> Date: Fri Jun 18 02:17:53 2010 -0400 Add a script to cross-compile the dependency libraries for Windows. --- win32/cross-from-debian/Toolchain.cmake | 16 ++ win32/cross-from-debian/makedeps.sh | 371 +++++++++++++++++++++++++++++++ 2 files changed, 387 insertions(+), 0 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-07-22 15:36:23
|
Module: performous
Branch: portaudio
Commit: c72033b9e17ea640563625b818bf63d9d2a07b3d
Author: John Stumpo <st...@js...>
Date: Fri Jun 25 23:01:21 2010 -0400
Fix an include for Linux-to-Windows cross-compilation.
---
game/fs.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/fs.cc b/game/fs.cc
index 32163d0..5047c36 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -9,7 +9,7 @@
#ifdef _WIN32
#include <windows.h>
-#include <Shlobj.h>
+#include <shlobj.h>
#endif
fs::path getHomeDir() {
|
|
From: John S. <jst...@us...> - 2010-07-21 20:21:15
|
Module: performous Branch: master Commit: 454127977b4216f1f4874ab5c481f3f75e1154cb Author: John Stumpo <st...@js...> Date: Wed Jul 21 16:14:40 2010 -0400 Merge remote branch 'origin/master' --- |
|
From: John S. <jst...@us...> - 2010-07-21 20:21:13
|
Module: performous
Branch: master
Commit: 879d759f08cbede4fa3eb532cb52560af5b21230
Author: John Stumpo <st...@js...>
Date: Sat Jun 26 03:51:59 2010 -0400
Add Add/Remove Programs information to the installer.
---
win32/cross-from-debian/makepackage.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/win32/cross-from-debian/makepackage.py b/win32/cross-from-debian/makepackage.py
index f422145..4ff134a 100755
--- a/win32/cross-from-debian/makepackage.py
+++ b/win32/cross-from-debian/makepackage.py
@@ -89,6 +89,10 @@ makensis.stdin.write(r''' WriteRegStr HKLM "Software\Performous" "" "$INSTDIR"
CreateDirectory "$SMPROGRAMS\Performous"
CreateShortcut "$SMPROGRAMS\Performous\Performous.lnk" "$INSTDIR\bin\performous.exe"
CreateShortcut "$SMPROGRAMS\Performous\Uninstall.lnk" "$INSTDIR\uninst.exe"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Performous" "DisplayName" "Performous"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Performous" "UninstallString" "$\"$INSTDIR\uninst.exe$\""
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Performous" "DisplayIcon" "$INSTDIR\bin\performous.exe"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Performous" "DisplayVersion" "${VERSION}"
SectionEnd
Section Uninstall
@@ -107,6 +111,7 @@ makensis.stdin.write(r''' Delete "$INSTDIR\uninst.exe"
Delete "$SMPROGRAMS\Performous\Performous.lnk"
Delete "$SMPROGRAMS\Performous\Uninstall.lnk"
RmDir "$SMPROGRAMS\Performous"
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Performous"
DeleteRegKey /ifempty HKLM "Software\Performous"
SectionEnd
''')
|
|
From: John S. <jst...@us...> - 2010-07-21 20:21:10
|
Module: performous
Branch: master
Commit: cf6864f80dec1afb6897ef779bb609aed9c160d6
Author: John Stumpo <st...@js...>
Date: Sat Jun 26 03:31:05 2010 -0400
Add Start menu entries to the installer.
---
win32/cross-from-debian/makepackage.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/win32/cross-from-debian/makepackage.py b/win32/cross-from-debian/makepackage.py
index 2ad6342..f422145 100755
--- a/win32/cross-from-debian/makepackage.py
+++ b/win32/cross-from-debian/makepackage.py
@@ -85,6 +85,10 @@ for root, dirs, files in os.walk('.'):
makensis.stdin.write(r''' WriteRegStr HKLM "Software\Performous" "" "$INSTDIR"
WriteUninstaller "$INSTDIR\uninst.exe"
+ SetShellVarContext all
+ CreateDirectory "$SMPROGRAMS\Performous"
+ CreateShortcut "$SMPROGRAMS\Performous\Performous.lnk" "$INSTDIR\bin\performous.exe"
+ CreateShortcut "$SMPROGRAMS\Performous\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section Uninstall
@@ -99,6 +103,10 @@ for root, dirs, files in os.walk('.', topdown=False):
makensis.stdin.write(r''' Delete "$INSTDIR\uninst.exe"
RmDir "$INSTDIR"
+ SetShellVarContext all
+ Delete "$SMPROGRAMS\Performous\Performous.lnk"
+ Delete "$SMPROGRAMS\Performous\Uninstall.lnk"
+ RmDir "$SMPROGRAMS\Performous"
DeleteRegKey /ifempty HKLM "Software\Performous"
SectionEnd
''')
|
|
From: John S. <jst...@us...> - 2010-07-21 20:21:07
|
Module: performous Branch: master Commit: 25c741381324761dc21dccd299cad150934eacb0 Author: John Stumpo <st...@js...> Date: Sat Jun 26 03:10:36 2010 -0400 Add a script to generate a simple NSIS installer from the staged installation. As it is, it works (it installs and uninstalls just fine) but could use a bit of extra love. (Start menu entries and an Add/Remove Programs entry come to mind.) --- win32/cross-from-debian/makepackage.py | 111 ++++++++++++++++++++++++++++++++ 1 files changed, 111 insertions(+), 0 deletions(-) diff --git a/win32/cross-from-debian/makepackage.py b/win32/cross-from-debian/makepackage.py new file mode 100755 index 0000000..2ad6342 --- /dev/null +++ b/win32/cross-from-debian/makepackage.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python +# NSIS script generator for Performous. +# Copyright (C) 2010 John Stumpo +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import os +import subprocess +import sys + +try: + makensis = subprocess.Popen([os.environ['MAKENSIS'], '-'], stdin=subprocess.PIPE) +except KeyError: + makensis = subprocess.Popen(['makensis', '-'], stdin=subprocess.PIPE) + +if not os.path.isdir('dist'): + os.mkdir('dist') +os.chdir('stage') + +# Find the version number. +try: + resources = subprocess.Popen([os.environ['WINDRES'], 'bin/performous.exe'], stdout=subprocess.PIPE) +except: + try: + resources = subprocess.Popen(['windres', 'bin/performous.exe'], stdout=subprocess.PIPE) + except: + resources = subprocess.Popen(['i586-mingw32msvc-windres', 'bin/performous.exe'], stdout=subprocess.PIPE) +for line in resources.stdout.readlines(): + if not line.strip().startswith('VALUE'): + continue + if 'ProductVersion' in line: + version = line.strip().split('"')[-2] + break +else: + version = 'unknown' + + +makensis.stdin.write(r'''!include "MUI2.nsh" + +!define VERSION "%s" + +Name "Performous ${VERSION}" +OutFile "dist\Performous-${VERSION}-win32.exe" + +SetCompressor /SOLID lzma + +ShowInstDetails show +ShowUninstDetails show + +InstallDir "$PROGRAMFILES\Performous" +InstallDirRegKey HKLM "Software\Performous" "" + +RequestExecutionLevel admin + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +!insertmacro MUI_LANGUAGE "English" + +Section +''' % version) + +for root, dirs, files in os.walk('.'): + makensis.stdin.write(' SetOutPath "$INSTDIR\\%s"\n' % root.replace('/', '\\')) + for file in files: + makensis.stdin.write(' File "%s"\n' % os.path.join('stage', root, file).replace('/', '\\')) + +makensis.stdin.write(r''' WriteRegStr HKLM "Software\Performous" "" "$INSTDIR" + WriteUninstaller "$INSTDIR\uninst.exe" +SectionEnd + +Section Uninstall +''') + +for root, dirs, files in os.walk('.', topdown=False): + for dir in dirs: + makensis.stdin.write(' RmDir "$INSTDIR\\%s"\n' % os.path.join(root, dir).replace('/', '\\')) + for file in files: + makensis.stdin.write(' Delete "$INSTDIR\\%s"\n' % os.path.join(root, file).replace('/', '\\')) + makensis.stdin.write(' RmDir "$INSTDIR\\%s"\n' % root.replace('/', '\\')) + +makensis.stdin.write(r''' Delete "$INSTDIR\uninst.exe" + RmDir "$INSTDIR" + DeleteRegKey /ifempty HKLM "Software\Performous" +SectionEnd +''') + +makensis.stdin.close() +if makensis.wait() != 0: + print >>sys.stderr, 'Installer compilation failed.' + sys.exit(1) +else: + print '\ndist/Performous-%s-win32.exe is ready.' % version |
|
From: John S. <jst...@us...> - 2010-07-21 20:21:07
|
Module: performous Branch: master Commit: 6e3607a9d3914f47fe15a5fbdb7ebf7c8595ca2b Author: John Stumpo <st...@js...> Date: Sat Jun 26 03:12:23 2010 -0400 Add some notes about the cross-compilation setup. --- win32/cross-from-debian/README | 59 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 59 insertions(+), 0 deletions(-) diff --git a/win32/cross-from-debian/README b/win32/cross-from-debian/README new file mode 100644 index 0000000..cebc77c --- /dev/null +++ b/win32/cross-from-debian/README @@ -0,0 +1,59 @@ +These scripts were developed under Debian's mingw32 environment with the +wine package (and associated binfmt_misc rule, which is part of the package) +installed, so some programs do not detect that they are being cross-compiled +and attempt to run just-compiled programs because this works when the scripts +use the ".exe" suffix when they try to do so (as autoconf scripts do). So +we occasionally generate a shell script wrapper under the non-.exe name that +execs wine to satisfy scripts that fail to use ".exe" (some scripts do this +because it's perfectly OK to do this under Windows). + +For pkg-config handling, we simply wrap the *host* pkg-config in a shell +script that execs it with options causing it to look absolutely nowhere other +than deps/lib/pkgconfig for .pc files and we place that script earlier on the +PATH. This very neatly avoids the glib/pkg-config chicken-and-egg problem +that exists under Windows, though we don't bother building a Windows +pkg-config at all since we don't need it. + +The makedeps.sh script builds the dependencies under ./deps and places stamp +files in deps/build-stamps so it doesn't have to keep rebuilding the same +things if it is interrupted or experiences an error halfway through. You can +force a single package to be rebuilt by deleting the appropriate stamp file +and re-running makedeps.sh. (You might do this, for example, to get newer +ffmpeg code, as makedeps.sh builds the latest SVN of ffmpeg at the time the +script is run.) + +Once the dependencies are built, run makebuilddir.sh to invoke cmake with the +appropriate arguments for cross-compilation. (Arguments to makebuilddir.sh +are passed intact to cmake after the arguments the script itself passes but +before the final argument [the source directory], which the script provides +for you.) It is up to you to run "make" and "make install" in the ./build +directory (installation will occur to ./stage) after running makebuilddir.sh +to set up ./build appropriately. + +(Regarding installation, it is a good idea to delete or rename ./stage if it +exists before running "make install" so obsolete files aren't accidentally +included in the package you are building.) + +The copydlls.py script takes two directories as arguments and copies any DLLs +it can find in the first directory that are needed by PE executables in the +second directory into the second directory. + +The makepackage.py script creates an executable installer from the contents of +./stage using NSIS (NSIS can be built under non-Windows systems for use as a +cross-compiler, and many Linux distros package it in this form) and places it +into ./dist for your testing and distributing pleasure. + +In summary: + $ ./makedeps.sh + $ ./makebuilddir.sh + $ cd build + $ make + $ make install + $ cd .. + $ ./copydlls.py ./deps/bin ./stage/bin + [strip the binaries in ./stage/bin if you want] + $ ./makepackage.py + [test the file generated in ./dist] + [distribute said file if everything looks good] + +Happy cross-building! |
|
From: John S. <jst...@us...> - 2010-07-21 20:20:59
|
Module: performous
Branch: master
Commit: 63b6b919986640641e0da358b58e4ce6d0f619a7
Author: John Stumpo <st...@js...>
Date: Sat Jun 26 02:19:13 2010 -0400
Tell cmake where it can find windres so we get the icon in a cross-build.
---
win32/cross-from-debian/Toolchain.cmake | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/win32/cross-from-debian/Toolchain.cmake b/win32/cross-from-debian/Toolchain.cmake
index 0b79ba4..41cf6f8 100644
--- a/win32/cross-from-debian/Toolchain.cmake
+++ b/win32/cross-from-debian/Toolchain.cmake
@@ -14,3 +14,5 @@ set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc ${CMAKE_CURRENT_SOURCE_DIR}/win32
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+set(WINDRES i586-mingw32msvc-windres)
|
|
From: John S. <jst...@us...> - 2010-07-21 20:20:58
|
Module: performous Branch: master Commit: 1cdc9b4b77e0ac89a4acf3ee3f5d35ae4eddba65 Author: John Stumpo <st...@js...> Date: Fri Jun 25 22:45:37 2010 -0400 Add a script to copy the necessary dependency DLLs into what will become the released package. --- win32/cross-from-debian/copydlls.py | 116 +++++++++++++++++++++++++++++++++++ 1 files changed, 116 insertions(+), 0 deletions(-) diff --git a/win32/cross-from-debian/copydlls.py b/win32/cross-from-debian/copydlls.py new file mode 100755 index 0000000..ac2b8b3 --- /dev/null +++ b/win32/cross-from-debian/copydlls.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python +# DLL dependency resolution and copying script. +# Copyright (C) 2010 John Stumpo +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import os +import shutil +import struct +import sys + +if len(sys.argv) != 3: + sys.stderr.write('''Usage: %s [source] [destination] +Copies DLLs in source needed by PE executables in destination to destination. +Both source and destination should be directories. +''' % sys.argv[0]) + sys.exit(1) + +def is_pe_file(file): + f = open(file, 'rb') + if f.read(2) != 'MZ': + return False # DOS magic number not present + f.seek(60) + peoffset = struct.unpack('<L', f.read(4))[0] + f.seek(peoffset) + if f.read(4) != 'PE\0\0': + return False # PE magic number not present + return True + +def get_imports(file): + f = open(file, 'rb') + # We already know it's a PE, so don't bother checking again. + f.seek(60) + pe_header_offset = struct.unpack('<L', f.read(4))[0] + + # Get sizes of tables we need. + f.seek(pe_header_offset + 6) + number_of_sections = struct.unpack('<H', f.read(2))[0] + f.seek(pe_header_offset + 116) + number_of_data_directory_entries = struct.unpack('<L', f.read(4))[0] + data_directory_offset = f.tell() # it's right after the number of entries + + # Where is the import table? + f.seek(data_directory_offset + 8) + rva_of_import_table = struct.unpack('<L', f.read(4))[0] + + # Get the section ranges so we can convert RVAs to file offsets. + f.seek(data_directory_offset + 8 * number_of_data_directory_entries) + sections = [] + for i in range(number_of_sections): + section_descriptor_data = f.read(40) + name, size, va, rawsize, offset = struct.unpack('<8sLLLL', section_descriptor_data[:24]) + sections.append({'min': va, 'max': va+rawsize, 'offset': offset}) + + def seek_to_rva(rva): + for s in sections: + if s['min'] <= rva and rva < s['max']: + f.seek(rva - s['min'] + s['offset']) + return + raise ValueError, 'Could not find section for RVA.' + + # Walk the import table and get RVAs to the null-terminated names of DLLs this file uses. + # The table is terminated by an all-zero entry. + seek_to_rva(rva_of_import_table) + dll_rvas = [] + while True: + import_descriptor = f.read(20) + if import_descriptor == '\0' * 20: + break + dll_rvas.append(struct.unpack('<L', import_descriptor[12:16])[0]) + + # Read the DLL names from the RVAs we found in the import table. + dll_names = [] + for rva in dll_rvas: + seek_to_rva(rva) + name = '' + while True: + c = f.read(1) + if c == '\0': + break + name += c + dll_names.append(name) + + return dll_names + + +src_contents = os.listdir(sys.argv[1]) +dest_contents = os.listdir(sys.argv[2]) +for dest_name in dest_contents: + dest_fname = os.path.join(sys.argv[2], dest_name) + if os.path.isfile(dest_fname) and is_pe_file(dest_fname): + print dest_name + for dll in get_imports(dest_fname): + print '- %s' % dll, + if dll.lower() in [n.lower() for n in dest_contents]: + print '(already present)' + else: + for n in src_contents: + if n.lower() == dll.lower(): + shutil.copyfile(os.path.join(sys.argv[1], n), os.path.join(sys.argv[2], n)) + dest_contents.append(n) + print '(copied)' + break + else: + print '(assumed to be provided by operating system)' |
|
From: John S. <jst...@us...> - 2010-07-21 20:20:55
|
Module: performous Branch: master Commit: c58a0953eda8e8a207c283eafa0b5c4490a6c1a0 Author: John Stumpo <st...@js...> Date: Fri Jun 25 20:12:54 2010 -0400 Add a script that runs cmake with the right arguments. --- win32/cross-from-debian/makebuilddir.sh | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/win32/cross-from-debian/makebuilddir.sh b/win32/cross-from-debian/makebuilddir.sh new file mode 100755 index 0000000..3c469b9 --- /dev/null +++ b/win32/cross-from-debian/makebuilddir.sh @@ -0,0 +1,4 @@ +#!/bin/sh -e +mkdir -pv build +cd build +exec env PATH="`pwd`/../deps/bin:$PATH" cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain.cmake -DENABLE_TOOLS=OFF -DCMAKE_INSTALL_PREFIX="`pwd`/../stage" "$@" ../../.. |
|
From: John S. <jst...@us...> - 2010-07-21 20:20:53
|
Module: performous Branch: master Commit: a755874fcf1d1f1f816fffaa4a4865cef935ae11 Author: John Stumpo <st...@js...> Date: Fri Jun 25 19:23:57 2010 -0400 Split portmidi into portmidi and porttime so the cmake scripts detect it correctly. --- win32/cross-from-debian/makedeps.sh | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/win32/cross-from-debian/makedeps.sh b/win32/cross-from-debian/makedeps.sh index f92de94..355a4d2 100755 --- a/win32/cross-from-debian/makedeps.sh +++ b/win32/cross-from-debian/makedeps.sh @@ -269,9 +269,10 @@ if test ! -f "$PREFIX"/build-stamps/portmidi; then download http://download.sourceforge.net/portmedia/portmidi-src-200.zip unzip -o portmidi-src-200.zip cd portmidi - $CROSS_GCC -g -O2 -W -Wall -Ipm_common -Iporttime -DNDEBUG -D_WINDLL -mdll -o portmidi.dll -Wl,--out-implib,libportmidi.a pm_win/pmwin.c pm_win/pmwinmm.c porttime/ptwinmm.c pm_common/pmutil.c pm_common/portmidi.c -lwinmm - cp -v portmidi.dll "$PREFIX"/bin - cp -v libportmidi.a "$PREFIX"/lib + $CROSS_GCC -g -O2 -W -Wall -Iporttime -DNDEBUG -D_WINDLL -mdll -o porttime.dll -Wl,--out-implib,libporttime.a porttime/ptwinmm.c -lwinmm + $CROSS_GCC -g -O2 -W -Wall -Ipm_common -Iporttime -DNDEBUG -D_WINDLL -mdll -o portmidi.dll -Wl,--out-implib,libportmidi.a pm_win/pmwin.c pm_win/pmwinmm.c pm_common/pmutil.c pm_common/portmidi.c -L. -lporttime -lwinmm + cp -v portmidi.dll porttime.dll "$PREFIX"/bin + cp -v libportmidi.a libporttime.a "$PREFIX"/lib cp -v pm_common/portmidi.h porttime/porttime.h "$PREFIX"/include cd .. touch "$PREFIX"/build-stamps/portmidi |
|
From: John S. <jst...@us...> - 2010-07-21 20:20:50
|
Module: performous Branch: master Commit: a996445812c4443df84e9cdc56362d181a10e0ea Author: John Stumpo <st...@js...> Date: Fri Jun 25 01:39:55 2010 -0400 Use stamp files to skip building things already built. --- win32/cross-from-debian/makedeps.sh | 692 +++++++++++++++++++++-------------- 1 files changed, 412 insertions(+), 280 deletions(-) |
|
From: John S. <jst...@us...> - 2010-07-21 20:20:48
|
Module: performous Branch: master Commit: 2e78b09c8b10343b7bc524f5dfc6d237a6becc2a Author: John Stumpo <st...@js...> Date: Wed Jun 23 05:22:14 2010 -0400 Add commentary and genericity to the cross-makedeps script. --- win32/cross-from-debian/makedeps.sh | 180 ++++++++++++++++++++++++++-------- 1 files changed, 137 insertions(+), 43 deletions(-) |
|
From: John S. <jst...@us...> - 2010-07-21 20:20:45
|
Module: performous
Branch: master
Commit: 3e6108e10242d57d3cce2df270dd1fb76188f0bf
Author: John Stumpo <st...@js...>
Date: Wed Jun 23 03:15:48 2010 -0400
Fix a case-sensitivity bug keeping OpenGL from being detected by cross-compilers to Windows.
---
cmake/Modules/FindOpenGL.cmake | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/Modules/FindOpenGL.cmake b/cmake/Modules/FindOpenGL.cmake
index 7ac1128..be991ab 100644
--- a/cmake/Modules/FindOpenGL.cmake
+++ b/cmake/Modules/FindOpenGL.cmake
@@ -20,12 +20,12 @@ find_path(OpenGL_INCLUDE_DIR
)
find_library(OpenGL_GL_LIBRARY
- NAMES GL libOpenGL32.a OpenGL32
+ NAMES GL libopengl32.a opengl32
PATHS ${OpenGL_PKGCONF_LIBRARY_DIRS}
)
find_library(OpenGL_GLU_LIBRARY
- NAMES GLU libGLU32.a GLU32
+ NAMES GLU libglu32.a glu32
PATHS ${OpenGL_PKGCONF_LIBRARY_DIRS}
)
|
|
From: John S. <jst...@us...> - 2010-07-21 20:20:43
|
Module: performous Branch: master Commit: 6399a773b019f449031ed0b30ee82feca0f5e354 Author: John Stumpo <st...@js...> Date: Fri Jun 18 02:17:53 2010 -0400 Add a script to cross-compile the dependency libraries for Windows. --- win32/cross-from-debian/Toolchain.cmake | 16 ++ win32/cross-from-debian/makedeps.sh | 371 +++++++++++++++++++++++++++++++ 2 files changed, 387 insertions(+), 0 deletions(-) |
|
From: John S. <jst...@us...> - 2010-07-21 20:20:42
|
Module: performous
Branch: master
Commit: c72033b9e17ea640563625b818bf63d9d2a07b3d
Author: John Stumpo <st...@js...>
Date: Fri Jun 25 23:01:21 2010 -0400
Fix an include for Linux-to-Windows cross-compilation.
---
game/fs.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/fs.cc b/game/fs.cc
index 32163d0..5047c36 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -9,7 +9,7 @@
#ifdef _WIN32
#include <windows.h>
-#include <Shlobj.h>
+#include <shlobj.h>
#endif
fs::path getHomeDir() {
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-21 13:48:20
|
Module: performous
Branch: portaudio
Commit: b068521bce1700d3a5fdaedd142d64e89d344e4d
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Jul 18 22:50:44 2010 +0300
Audio config cleanup (removed in= setting) and simple support for mic assignments.
---
data/schema.xml | 6 +++---
game/audio.cc | 33 ++++++++++++++++++---------------
2 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index 26ebb9f..1c293f8 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -179,9 +179,9 @@ to save the current settings to XML.
</locale>
</entry>
<entry name="audio/devices" type="string_list">
- <stringvalue>in=2 dev="default" mics="blue,red"</stringvalue><!-- SingStar mics -->
- <stringvalue>in=1 dev="Microphone"</stringvalue><!-- Rock Band branded Logitech mic -->
- <stringvalue>in=1</stringvalue><!-- Any other microphone -->
+ <stringvalue>dev="USBMIC" mics="blue,red"</stringvalue><!-- SingStar mics -->
+ <stringvalue>dev="Microphone" mics="*"</stringvalue><!-- Rock Band branded Logitech mic -->
+ <stringvalue>mics="blue"</stringvalue><!-- Any other microphone (only if blue is still free) -->
<stringvalue>out=2</stringvalue><!-- Any stereo output device -->
<locale name="C">
<short>Audio devices</short>
diff --git a/game/audio.cc b/game/audio.cc
index d29cebd..27c499a 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -298,16 +298,15 @@ struct Audio::Impl {
boost::ptr_vector<Analyzer> analyzers;
bool playback;
Impl(): playback() {
- int mic_count = 0;
// Parse audio devices from config
ConfigItem::StringList devs = config["audio/devices"].sl();
for (ConfigItem::StringList::const_iterator it = devs.begin(), end = devs.end(); it != end; ++it) {
try {
struct Params {
- int in, out;
+ int out;
unsigned int rate;
std::string dev;
- std::vector<int> mics;
+ std::vector<std::string> mics;
} params = Params();
params.rate = 48000;
// Break into tokens:
@@ -318,14 +317,11 @@ struct Audio::Impl {
std::string key = it2->first;
std::istringstream iss(it2->second);
if (key == "out") iss >> params.out;
- else if (key == "in") iss >> params.in;
else if (key == "rate") iss >> params.rate;
else if (key == "dev") std::getline(iss, params.dev);
else if (key == "mics") {
// Parse a comma-separated list of mics
- for (std::string mic; std::getline(iss, mic, ','); ) {
- params.mics.push_back(0); // TODO/FIXME: implement
- }
+ for (std::string mic; std::getline(iss, mic, ','); params.mics.push_back(mic)) {}
}
else throw std::runtime_error("Unknown device parameter " + key);
if (!iss.eof()) throw std::runtime_error("Syntax error parsing device parameter " + key);
@@ -333,7 +329,7 @@ struct Audio::Impl {
int count = Pa_GetDeviceCount();
int dev = -1;
// Handle empty device
- if (params.dev.empty()) dev = params.in ? Pa_GetDefaultInputDevice() : Pa_GetDefaultOutputDevice();
+ if (params.dev.empty()) dev = (params.out == 0 ? Pa_GetDefaultInputDevice() : Pa_GetDefaultOutputDevice());
// Try numeric value
if (dev < 0) {
std::istringstream iss(params.dev);
@@ -344,31 +340,38 @@ struct Audio::Impl {
bool found = false;
// Try exact match first, then partial
for (int match_partial = 0; match_partial < 2 && !skip_partial; ++match_partial) {
- // Loop through the devices and try everyting that matches the name
+ // Loop through the devices and try everything that matches the name
for (int i = -1; i < count && (dev < 0 || i == -1); ++i) {
if (dev > 0 && i == -1) i = dev;
else if (i == -1) continue;
PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
if (!info) continue;
- if (params.in && info->maxInputChannels == 0) continue;
- if (params.out && info->maxOutputChannels == 0) continue;
+ if (info->maxInputChannels < int(params.mics.size())) continue;
+ if (info->maxOutputChannels < params.out) continue;
if (!match_partial && info->name != params.dev) continue;
if (match_partial && std::string(info->name).find(params.dev) == std::string::npos) continue;
// Match found if we got here
bool device_init_threw = true;
try {
- devices.push_back(new Device(params.in, params.out, params.rate, i));
+ devices.push_back(new Device(params.mics.size(), params.out, params.rate, i));
Device& d = devices.back();
device_init_threw = false;
// Start capture/playback on this device
d.start();
- // Assign mics for all channels of the device (TODO: proper assignments)
+ // Assign mics for all channels of the device
for (unsigned int j = 0; j < d.in; ++j) {
- if (mic_count + 1 > 4) break; // Too many mics
+ if (analyzers.size() >= 4) break; // Too many mics
+ std::string const& m = params.mics[j];
+ if (m.empty()) continue; // Input channel not used
+ // TODO: allow assignment in any order (not sequentially like the following code does)
+ if (m == "blue" && analyzers.size() != 0) continue;
+ if (m == "red" && analyzers.size() != 1) continue;
+ if (m == "green" && analyzers.size() != 2) continue;
+ if (m == "orange" && analyzers.size() != 3) continue;
+ // Add the new analyzer
Analyzer* a = new Analyzer(d.rate);
analyzers.push_back(a);
d.mics[j] = a;
- mic_count++;
}
// Assign playback output for the first available stereo output
if (!playback && d.out == 2) { d.outptr = &output; playback = true; }
|
|
From: Yoda-JM <yo...@us...> - 2010-07-21 10:45:49
|
Module: performous
Branch: master
Commit: 5ad067bd0953dbba3b3964bbd2e412c5e07aa1ce
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Jul 21 12:45:28 2010 +0200
Added explicit webcam/midi disabling
---
game/CMakeLists.txt | 36 ++++++++++++--------
.../games-arcade/performous/performous-9999.ebuild | 4 ++
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 17a11e7..5a4fa1f 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -96,24 +96,32 @@ else()
message(STATUS "Internationalization: Disabled (libintl not found)")
endif()
-find_package(PortMidi)
-if(PortMidi_FOUND)
- include_directories(${PortMidi_INCLUDE_DIRS})
- list(APPEND LIBS ${PortMidi_LIBRARIES})
- add_definitions("-DUSE_PORTMIDI")
- message(STATUS "MIDI I/O: Enabled")
+if(NOT NO_PORTMIDI)
+ find_package(PortMidi)
+ if(PortMidi_FOUND)
+ include_directories(${PortMidi_INCLUDE_DIRS})
+ list(APPEND LIBS ${PortMidi_LIBRARIES})
+ add_definitions("-DUSE_PORTMIDI")
+ message(STATUS "MIDI I/O: Enabled")
+ else()
+ message(STATUS "MIDI I/O: Disabled (libportmidi not found)")
+ endif()
else()
- message(STATUS "MIDI I/O: Disabled (libportmidi not found)")
+ message(STATUS "MIDI I/O: Disabled (explicitly disabled)")
endif()
-find_package(OpenCV)
-if(OpenCV_FOUND)
- include_directories(${OpenCV_INCLUDE_DIRS})
- list(APPEND LIBS ${OpenCV_LIBRARIES})
- add_definitions("-DUSE_OPENCV")
- message(STATUS "Webcam support: Enabled")
+if(NOT NO_WEBCAM)
+ find_package(OpenCV)
+ if(OpenCV_FOUND)
+ include_directories(${OpenCV_INCLUDE_DIRS})
+ list(APPEND LIBS ${OpenCV_LIBRARIES})
+ add_definitions("-DUSE_OPENCV")
+ message(STATUS "Webcam support: Enabled")
+ else()
+ message(STATUS "Webcam support: Disabled (libcv/libhighgui not found)")
+ endif()
else()
- message(STATUS "Webcam support: Disabled (libcv/libhighgui not found)")
+ message(STATUS "Webcam support: Disabled (explicitly disabled)")
endif()
diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild
index ba82507..d2a1ad5 100644
--- a/portage-overlay/games-arcade/performous/performous-9999.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild
@@ -91,12 +91,16 @@ src_configure() {
$(cmake-utils_use pulseaudio LibDA_PLUGIN_PULSEAUDIO)
$(cmake-utils_use_enable tools TOOLS)
$(cmake-utils_use_enable editor EDITOR)
+ $(cmake-utils_use_no webcam WEBCAM)
-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}
-DSHARE_INSTALL=share/performous
-DLOCALE_DIR=/usr/share
-DLIBDA_AUTODETECT_PLUGINS=false
-DLIBDA_PLUGIN_TESTING=false
-DCMAKE_BUILD_TYPE=Release"
+# local mycmakeargs="
+# $(cmake-utils_use_no midi MIDI)
+# ${mycmakeargs}"
cmake-utils_src_configure
}
|
|
From: Yoda-JM <yo...@us...> - 2010-07-21 00:23:15
|
Module: performous Branch: master Commit: 7bf290f86dbae6e0244d2c1d758f56368095b8b8 Author: Vincent Le Ligeour <yo...@us...> Date: Wed Jul 21 02:22:56 2010 +0200 Added master default to ebuild --- .../games-arcade/performous/performous-9999.ebuild | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild index d979e5f..ba82507 100644 --- a/portage-overlay/games-arcade/performous/performous-9999.ebuild +++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild @@ -25,6 +25,7 @@ if [ "$PV" != "9999" ]; then $SRC_URI" else EGIT_REPO_URI="git://performous.git.sourceforge.net/gitroot/performous/performous" + EGIT_BRANCH="master" fi LICENSE="GPL-2 |
|
From: Tapio V. <aa...@us...> - 2010-07-18 17:53:08
|
Module: performous
Branch: portaudio
Commit: f17a382e841b283ce7bad5bc09aef1141abe17d3
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jul 18 20:43:16 2010 +0300
Device string matching moved to audio.cc, also try until working one is found.
---
game/audio.cc | 78 ++++++++++++++++++++++++--------
libs/libda/include/libda/portaudio.hpp | 39 ----------------
2 files changed, 59 insertions(+), 58 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 4c9ccd5..d29cebd 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -5,6 +5,7 @@
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/thread/mutex.hpp>
+#include <boost/lexical_cast.hpp>
#include <libda/fft.hpp> // For M_PI
#include <libda/portaudio.hpp>
#include <cmath>
@@ -254,14 +255,14 @@ struct Device {
// Init
const unsigned int in, out;
const double rate;
- const std::string dev;
+ const unsigned int dev;
portaudio::Stream stream;
std::vector<Analyzer*> mics;
Output* outptr;
- Device(unsigned int in, unsigned int out, double rate, std::string dev):
+ Device(unsigned int in, unsigned int out, double rate, unsigned int dev):
in(in), out(out), rate(rate), dev(dev),
- stream(*this, in ? portaudio::Params().channelCount(in).device(dev, true) : (const PaStreamParameters*)NULL, (out ? portaudio::Params().channelCount(out).device(dev, false) : (const PaStreamParameters*)NULL), rate),
+ stream(*this, in ? portaudio::Params().channelCount(in).device(dev) : (const PaStreamParameters*)NULL, (out ? portaudio::Params().channelCount(out).device(dev) : (const PaStreamParameters*)NULL), rate),
outptr()
{
mics.resize(in);
@@ -269,7 +270,8 @@ struct Device {
void start() {
PaError err = Pa_StartStream(stream);
- if (err != paNoError) throw std::runtime_error("Cannot start PortAudio audio stream " + dev + ": " + Pa_GetErrorText(err));
+ if (err != paNoError) throw std::runtime_error("Cannot start PortAudio audio stream "
+ + boost::lexical_cast<std::string>(dev) + ": " + Pa_GetErrorText(err));
}
int operator()(void const* input, void* output, unsigned long frames, const PaStreamCallbackTimeInfo*, PaStreamCallbackFlags) try {
@@ -288,6 +290,7 @@ struct Device {
}
};
+
struct Audio::Impl {
Output output;
portaudio::Init init;
@@ -327,23 +330,60 @@ struct Audio::Impl {
else throw std::runtime_error("Unknown device parameter " + key);
if (!iss.eof()) throw std::runtime_error("Syntax error parsing device parameter " + key);
}
- devices.push_back(new Device(params.in, params.out, params.rate, params.dev));
- Device& d = devices.back();
- // Assign mics for all channels of the device (TODO: proper assignments)
- for (unsigned int i = 0; i < d.in; ++i) {
- if (mic_count + i + 1 > 4) break; // Too many mics
- Analyzer* a = new Analyzer(d.rate);
- analyzers.push_back(a);
- d.mics[i] = a;
+ int count = Pa_GetDeviceCount();
+ int dev = -1;
+ // Handle empty device
+ if (params.dev.empty()) dev = params.in ? Pa_GetDefaultInputDevice() : Pa_GetDefaultOutputDevice();
+ // Try numeric value
+ if (dev < 0) {
+ std::istringstream iss(params.dev);
+ int tmp;
+ if (iss >> tmp && iss.get() == EOF && tmp >= 0 && tmp < count) dev = tmp;
}
- // Assign playback output for the first available stereo output
- if (!playback && d.out == 2) {
- d.outptr = &output;
- playback = true;
+ bool skip_partial = false;
+ bool found = false;
+ // Try exact match first, then partial
+ for (int match_partial = 0; match_partial < 2 && !skip_partial; ++match_partial) {
+ // Loop through the devices and try everyting that matches the name
+ for (int i = -1; i < count && (dev < 0 || i == -1); ++i) {
+ if (dev > 0 && i == -1) i = dev;
+ else if (i == -1) continue;
+ PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
+ if (!info) continue;
+ if (params.in && info->maxInputChannels == 0) continue;
+ if (params.out && info->maxOutputChannels == 0) continue;
+ if (!match_partial && info->name != params.dev) continue;
+ if (match_partial && std::string(info->name).find(params.dev) == std::string::npos) continue;
+ // Match found if we got here
+ bool device_init_threw = true;
+ try {
+ devices.push_back(new Device(params.in, params.out, params.rate, i));
+ Device& d = devices.back();
+ device_init_threw = false;
+ // Start capture/playback on this device
+ d.start();
+ // Assign mics for all channels of the device (TODO: proper assignments)
+ for (unsigned int j = 0; j < d.in; ++j) {
+ if (mic_count + 1 > 4) break; // Too many mics
+ Analyzer* a = new Analyzer(d.rate);
+ analyzers.push_back(a);
+ d.mics[j] = a;
+ mic_count++;
+ }
+ // Assign playback output for the first available stereo output
+ if (!playback && d.out == 2) { d.outptr = &output; playback = true; }
+ } catch (...) {
+ if (!device_init_threw) devices.pop_back();
+ if (dev > 0) { skip_partial = true; break; } // Numeric, end search
+ continue;
+ }
+ skip_partial = true;
+ found = true;
+ break;
+ }
}
- // Start capture/playback on this device
- d.start();
- mic_count += d.in;
+ // Error handling
+ if (!found) throw std::runtime_error("Not found or already in use.");
} catch(std::runtime_error& e) {
std::cerr << "Audio device '" << *it << "': " << e.what() << std::endl;
}
diff --git a/libs/libda/include/libda/portaudio.hpp b/libs/libda/include/libda/portaudio.hpp
index cf0775f..fb2a575 100644
--- a/libs/libda/include/libda/portaudio.hpp
+++ b/libs/libda/include/libda/portaudio.hpp
@@ -48,45 +48,6 @@ namespace portaudio {
}
Params& channelCount(int val) { params.channelCount = val; return *this; }
Params& device(PaDeviceIndex val) { params.device = val; return *this; }
- Params& device(std::string const& name, bool inputDevice) {
- static std::vector<bool> used_devices(Pa_GetDeviceCount(), false);
- int count = Pa_GetDeviceCount();
- int val = -1;
- if (name.empty()) val = inputDevice ? Pa_GetDefaultInputDevice() : Pa_GetDefaultOutputDevice();
- if (val >= 0 && used_devices.at(val)) val = -1; // Don't use default device if it is already in use
- // Try numeric value
- if (val < 0) {
- std::istringstream iss(name);
- int tmp;
- if (iss >> tmp && iss.get() == EOF && tmp >= 0 && tmp < count && !used_devices.at(tmp)) val = tmp;
- }
- // Try matching exact name
- if (val < 0) for (int i = 0; i != count; ++i) {
- if (used_devices.at(i)) continue;
- PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
- if (!info) continue;
- if (inputDevice && info->maxInputChannels == 0) continue;
- if (!inputDevice && info->maxOutputChannels == 0) continue;
- if (info->name == name) { val = i; break; }
- }
- // Try matching partial name
- if (val < 0) for (int i = 0; i != count; ++i) {
- if (used_devices.at(i)) continue;
- PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
- if (!info) continue;
- if (inputDevice && info->maxInputChannels == 0) continue;
- if (!inputDevice && info->maxOutputChannels == 0) continue;
- if (std::string(info->name).find(name) != std::string::npos) { val = i; break; }
- }
- // Error handling
- std::string dir = inputDevice ? "input" : "output";
- if (val < 0) throw std::runtime_error(name.empty() ? "No PortAudio default " + dir + " device found" : "No matching PortAudio " + dir + " device (" + name + ") found");
- PaDeviceInfo const* info = Pa_GetDeviceInfo(val);
- if (!info) throw std::runtime_error("The specified " + dir + " device (" + name + ") does not exist."); // FIXME: When does this happen?
- if ((inputDevice ? info->maxInputChannels : info->maxOutputChannels) == 0) throw std::runtime_error("The PortAudio " + dir + " device specified (" + name + ") has no " + dir + " channels");
- // Set the device
- return device(val);
- }
Params& sampleFormat(PaSampleFormat val) { params.sampleFormat = val; return *this; }
Params& suggestedLatency(PaTime val) { params.suggestedLatency = val; return *this; }
Params& hostApiSpecificStreamInfo(void* val) { params.hostApiSpecificStreamInfo = val; return *this; }
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 16:08:27
|
Module: performous
Branch: portaudio
Commit: 07e9e2fa72fc060cf47a0bfc4476b26052689e17
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Jul 18 19:08:15 2010 +0300
Implement sample iterators and multichannel capture
---
game/audio.cc | 9 +++++----
libs/libda/include/libda/sample.hpp | 16 ++++++++++++++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index b92e325..458ee35 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -273,13 +273,14 @@ struct Device {
}
int operator()(void const* input, void* output, unsigned long frames, const PaStreamCallbackTimeInfo*, PaStreamCallbackFlags) try {
- float const* in = static_cast<float const*>(input);
- float* out = static_cast<float*>(output);
+ float const* inbuf = static_cast<float const*>(input);
+ float* outbuf = static_cast<float*>(output);
for (std::size_t i = 0; i < mics.size(); ++i) {
if (!mics[i]) continue; // No analyzer? -> Channel not used
- mics[i]->input(in, in + 1 * frames); // FIXME: needs libda iterators for multiple channel support
+ da::sample_const_iterator it = da::sample_const_iterator(inbuf + i, in);
+ mics[i]->input(it, it + frames);
}
- if (outptr) outptr->callback(out, out + 2 * frames);
+ if (outptr) outptr->callback(outbuf, outbuf + 2 * frames);
return paContinue;
} catch (std::exception& e) {
std::cerr << "Exception in audio callback: " << e.what() << std::endl;
diff --git a/libs/libda/include/libda/sample.hpp b/libs/libda/include/libda/sample.hpp
index 58502e0..29383e7 100644
--- a/libs/libda/include/libda/sample.hpp
+++ b/libs/libda/include/libda/sample.hpp
@@ -49,6 +49,22 @@ namespace da {
static inline int conv_to_s16_fast(sample_t s) { return static_cast<int>(s * max_s16); }
static inline int conv_to_s24_fast(sample_t s) { return static_cast<int>(s * max_s24); }
static inline int conv_to_s32_fast(sample_t s) { return static_cast<int>(s * max_s32); }
+
+ template <typename ValueType> class step_iterator: public std::iterator<std::random_access_iterator_tag, ValueType> {
+ ValueType* m_pos;
+ std::ptrdiff_t m_step;
+ public:
+ step_iterator(ValueType* pos, std::ptrdiff_t step): m_pos(pos), m_step(step) {}
+ ValueType& operator*() { return *m_pos; }
+ step_iterator operator+(std::ptrdiff_t rhs) { return step_iterator(m_pos + m_step * rhs, m_step); }
+ step_iterator& operator++() { m_pos += m_step; return *this; }
+ bool operator!=(step_iterator const& rhs) const { return m_pos != rhs.m_pos; }
+ std::ptrdiff_t operator-(step_iterator const& rhs) const { return (m_pos - rhs.m_pos) / m_step; }
+ // TODO: more operators
+ };
+
+ typedef step_iterator<sample_t> sample_iterator;
+ typedef step_iterator<sample_t const> sample_const_iterator;
}
#endif
|
|
From: Tapio V. <aa...@us...> - 2010-07-18 14:57:36
|
Module: performous
Branch: portaudio
Commit: 23c1b6546d236b08953cb504fa88233055c25c93
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jul 18 17:55:06 2010 +0300
Only match the same device once.
---
libs/libda/include/libda/portaudio.hpp | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libs/libda/include/libda/portaudio.hpp b/libs/libda/include/libda/portaudio.hpp
index c1ab993..cf0775f 100644
--- a/libs/libda/include/libda/portaudio.hpp
+++ b/libs/libda/include/libda/portaudio.hpp
@@ -49,17 +49,20 @@ namespace portaudio {
Params& channelCount(int val) { params.channelCount = val; return *this; }
Params& device(PaDeviceIndex val) { params.device = val; return *this; }
Params& device(std::string const& name, bool inputDevice) {
+ static std::vector<bool> used_devices(Pa_GetDeviceCount(), false);
int count = Pa_GetDeviceCount();
int val = -1;
if (name.empty()) val = inputDevice ? Pa_GetDefaultInputDevice() : Pa_GetDefaultOutputDevice();
+ if (val >= 0 && used_devices.at(val)) val = -1; // Don't use default device if it is already in use
// Try numeric value
if (val < 0) {
std::istringstream iss(name);
int tmp;
- if (iss >> tmp && iss.get() == EOF && tmp >= 0 && tmp < count) val = tmp;
+ if (iss >> tmp && iss.get() == EOF && tmp >= 0 && tmp < count && !used_devices.at(tmp)) val = tmp;
}
// Try matching exact name
if (val < 0) for (int i = 0; i != count; ++i) {
+ if (used_devices.at(i)) continue;
PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
if (!info) continue;
if (inputDevice && info->maxInputChannels == 0) continue;
@@ -68,6 +71,7 @@ namespace portaudio {
}
// Try matching partial name
if (val < 0) for (int i = 0; i != count; ++i) {
+ if (used_devices.at(i)) continue;
PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
if (!info) continue;
if (inputDevice && info->maxInputChannels == 0) continue;
|
|
From: Tapio V. <aa...@us...> - 2010-07-18 14:15:21
|
Module: performous
Branch: portaudio
Commit: 05aaf1dc2011ac1756fe72bb90d07cad14b360d3
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jul 18 17:14:53 2010 +0300
Limit the number of mics.
---
game/audio.cc | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index b92264f..b92e325 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -294,6 +294,7 @@ struct Audio::Impl {
boost::ptr_vector<Analyzer> analyzers;
bool playback;
Impl(): playback() {
+ int mic_count = 0;
// Parse audio devices from config
ConfigItem::StringList devs = config["audio/devices"].sl();
for (ConfigItem::StringList::const_iterator it = devs.begin(), end = devs.end(); it != end; ++it) {
@@ -327,8 +328,9 @@ struct Audio::Impl {
}
devices.push_back(new Device(params.in, params.out, params.rate, params.dev));
Device& d = devices.back();
- // Assign mics for all channels of the device (TODO: proper assignments and limit the number of mics)
+ // Assign mics for all channels of the device (TODO: proper assignments)
for (unsigned int i = 0; i < d.in; ++i) {
+ if (mic_count + i + 1 > 4) break; // Too many mics
Analyzer* a = new Analyzer(d.rate);
analyzers.push_back(a);
d.mics[i] = a;
@@ -340,6 +342,7 @@ struct Audio::Impl {
}
// Start capture/playback on this device
d.start();
+ mic_count += d.in;
} catch(std::runtime_error& e) {
std::cerr << "Audio device '" << *it << "': " << e.what() << std::endl;
}
|
|
From: Tapio V. <aa...@us...> - 2010-07-18 14:06:19
|
Module: performous
Branch: portaudio
Commit: 89d958378a472a339bf38db6c2ff6a81ec5c7451
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jul 18 17:05:09 2010 +0300
Audio device matching by name, first exact, then if not found, partial.
---
libs/libda/include/libda/portaudio.hpp | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/libs/libda/include/libda/portaudio.hpp b/libs/libda/include/libda/portaudio.hpp
index d6e33b1..c1ab993 100644
--- a/libs/libda/include/libda/portaudio.hpp
+++ b/libs/libda/include/libda/portaudio.hpp
@@ -58,14 +58,21 @@ namespace portaudio {
int tmp;
if (iss >> tmp && iss.get() == EOF && tmp >= 0 && tmp < count) val = tmp;
}
- // Try name matching
+ // Try matching exact name
if (val < 0) for (int i = 0; i != count; ++i) {
PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
if (!info) continue;
if (inputDevice && info->maxInputChannels == 0) continue;
if (!inputDevice && info->maxOutputChannels == 0) continue;
- val = i;
- break;
+ if (info->name == name) { val = i; break; }
+ }
+ // Try matching partial name
+ if (val < 0) for (int i = 0; i != count; ++i) {
+ PaDeviceInfo const* info = Pa_GetDeviceInfo(i);
+ if (!info) continue;
+ if (inputDevice && info->maxInputChannels == 0) continue;
+ if (!inputDevice && info->maxOutputChannels == 0) continue;
+ if (std::string(info->name).find(name) != std::string::npos) { val = i; break; }
}
// Error handling
std::string dir = inputDevice ? "input" : "output";
|