traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso CMakeLists.txt src/engine/AudioDevice....


From: Remon Sijrier
Subject: [Traverso-commit] traverso CMakeLists.txt src/engine/AudioDevice....
Date: Tue, 11 Nov 2008 13:42:37 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       08/11/11 13:42:37

Modified files:
        .              : CMakeLists.txt 
        src/engine     : AudioDevice.cpp CMakeLists.txt 
Added files:
        src/engine     : CoreAudioDriver.cpp CoreAudioDriver.h 

Log message:
        * Added CoreAudioDriver file (basically empty still) added support for 
it to the build system and to AudioDevice (you can select it from the driver 
combo box, but it'll fail to load.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/CMakeLists.txt?cvsroot=traverso&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/traverso/src/engine/AudioDevice.cpp?cvsroot=traverso&r1=1.53&r2=1.54
http://cvs.savannah.gnu.org/viewcvs/traverso/src/engine/CMakeLists.txt?cvsroot=traverso&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/traverso/src/engine/CoreAudioDriver.cpp?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/engine/CoreAudioDriver.h?cvsroot=traverso&rev=1.1

Patches:
Index: CMakeLists.txt
===================================================================
RCS file: /sources/traverso/traverso/CMakeLists.txt,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- CMakeLists.txt      1 Jul 2008 20:32:28 -0000       1.28
+++ CMakeLists.txt      11 Nov 2008 13:42:37 -0000      1.29
@@ -23,6 +23,7 @@
 OPTION(WANT_ALSA       "Include ALSA (Advanced Linux Sound Architecture) 
support" ON)
 OPTION(WANT_PORTAUDIO  "Include PortAudio support (Driver support for Mac OS X 
and Windows" OFF)
 OPTION(WANT_PULSEAUDIO "Include PulseAudio support (Driver support for Linux 
and Windows" OFF)
+OPTION(WANT_COREAUDIO  "Include CoreAudio support (Driver support for Mac OS 
X" ON)
 OPTION(WANT_LV2                "Include LV2 Plugin support" ON)
 OPTION(USE_SYSTEM_SLV2_LIBRARY "Use system installed slv2 library. If not 
found, the internal one is compiled and used which needs the rdf development 
headers" OFF)
 OPTION(WANT_MP3_DECODE "Include mp3 decoding support, for playing mp3 files" 
ON)
@@ -167,6 +168,8 @@
        SET(HAVE_PULSEAUDIO FALSE)
 ENDIF(WANT_PULSEAUDIO)
 
+
+
 IF(WANT_LV2)
        IF(USE_SYSTEM_SLV2_LIBRARY)
                CHECK_INCLUDE_FILE("slv2/slv2.h" HAVE_SLV2_H)
@@ -340,10 +343,22 @@
 ENDIF(HAVE_MLOCK)
 
 
+# Detect if we want native Mac OS X support (CoreAudio)
+# and if we can build with it.
+IF(WANT_COREAUDIO)
+       SET(HAVE_COREAUDIO TRUE)
+       LIST(APPEND TRAVERSO_DEFINES -DCOREAUDIO_SUPPORT)
+ELSE(WANT_COREAUDIO)
+       SET(HAVE_COREAUDIO FALSE)
+ENDIF(WANT_COREAUDIO)
+
+
 IF(UNIX)
        
 #BEGIN Mac OS X section
        IF(APPLE)
+       
+
 # @ MAC OS X builders, I've NO IDEA what this should be, please have a look at 
it
 # It should be possible to create a working bundle with CPack using stuff
 # defined here ....???
@@ -588,6 +603,7 @@
 MESSAGE("ALSA support          :       ${HAVE_ALSA}")
 MESSAGE("Jack support          :       ${HAVE_JACK}")
 MESSAGE("PortAudio support     :       ${HAVE_PORTAUDIO}")
+MESSAGE("CoreAudio support     :       ${HAVE_COREAUDIO}")
 MESSAGE("SLV2 support          :       ${SLV2OPTIONS}")
 MESSAGE("MP3 read support      :       ${HAVE_MP3_DECODING}")
 MESSAGE("MP3 writing support   :       ${HAVE_MP3_ENCODING}")

Index: src/engine/AudioDevice.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/engine/AudioDevice.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- src/engine/AudioDevice.cpp  18 Feb 2008 08:17:30 -0000      1.53
+++ src/engine/AudioDevice.cpp  11 Nov 2008 13:42:37 -0000      1.54
@@ -17,7 +17,7 @@
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
-$Id: AudioDevice.cpp,v 1.53 2008/02/18 08:17:30 r_sijrier Exp $
+$Id: AudioDevice.cpp,v 1.54 2008/11/11 13:42:37 r_sijrier Exp $
 */
 
 #include "AudioDevice.h"
@@ -40,6 +40,10 @@
 #include "PulseAudioDriver.h"
 #endif
 
+#if defined (COREAUDIO_SUPPORT)
+#include "CoreAudioDriver.h"
+#endif
+
 
 #include "Driver.h"
 #include "Client.h"
@@ -170,6 +174,11 @@
        availableDrivers << "PulseAudio";
 #endif
        
+#if defined (COREAUDIO_SUPPORT)
+       availableDrivers << "CoreAudio";
+#endif
+
+       
        availableDrivers << "Null Driver";
        
        // tsar is a singleton, so initialization is done on first tsar() call
@@ -398,7 +407,7 @@
        }
 #endif
                
-       if (driverType == "PortAudio"|| (driverType == "PulseAudio") ) {
+       if (driverType == "PortAudio"|| (driverType == "PulseAudio") || 
(driverType == "CoreAudio")) {
                if (driver->start() == -1) {
                        // PortAudio driver failed to start, fallback to Null 
Driver:
                        set_parameters(rate, bufferSize, "Null Driver");
@@ -470,6 +479,22 @@
        }
 #endif
        
+
+#if defined (COREAUDIO_SUPPORT)
+       if (driverType == "CoreAudio") {
+               driver = new CoreAudioDriver(this, m_rate, m_bufferSize);
+               if (driver->setup(capture, playback, cardDevice) < 0) {
+                       message(tr("Audiodevice: Failed to create the CoreAudio 
Driver"), WARNING);
+                       delete driver;
+                       driver = 0;
+                       return -1;
+               }
+               m_driverType = driverType;
+               return 1;
+       }
+#endif
+
+       
        if (driverType == "Null Driver") {
                printf("Creating Null Driver...\n");
                driver = new Driver(this, m_rate, m_bufferSize);

Index: src/engine/CMakeLists.txt
===================================================================
RCS file: /sources/traverso/traverso/src/engine/CMakeLists.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- src/engine/CMakeLists.txt   18 Feb 2008 08:17:31 -0000      1.5
+++ src/engine/CMakeLists.txt   11 Nov 2008 13:42:37 -0000      1.6
@@ -50,6 +50,15 @@
        )
 ENDIF(HAVE_PULSEAUDIO)
 
+
+IF(HAVE_COREAUDIO)
+       SET(TRAVERSO_ENGINE_SOURCES
+       CoreAudioDriver.cpp
+       ${TRAVERSO_ENGINE_SOURCES}
+       )
+ENDIF(HAVE_COREAUDIO)
+
+
 SET(TRAVERSO_ENGINE_LIBRARY "traversoaudiobackend")
 
 QT4_WRAP_CPP(TRAVERSO_ENGINE_MOC_SOURCES ${TRAVERSO_ENGINE_MOC_CLASSES})

Index: src/engine/CoreAudioDriver.cpp
===================================================================
RCS file: src/engine/CoreAudioDriver.cpp
diff -N src/engine/CoreAudioDriver.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/engine/CoreAudioDriver.cpp      11 Nov 2008 13:42:37 -0000      1.1
@@ -0,0 +1,51 @@
+/*
+Copyright (C) 2008 Remon Sijrier 
+
+(November 2008) Ported to C++ for Traverso by Remon Sijrier
+Copyright (C) 2001 Paul Davis 
+
+This file is part of Traverso
+
+Traverso 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, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+
+*/
+
+/* CoreAudio driver based on jack-audio-connection-kit-0.xxx.x 
core_audio_driver.c */
+
+
+#include "CoreAudioDriver.h"
+#include "AudioChannel.h"
+#include <Utils.h>
+
+#include "Debugger.h"
+
+
+CoreAudioDriver::CoreAudioDriver(AudioDevice * dev, int rate, nframes_t 
bufferSize)
+       : Driver(dev, rate, bufferSize)
+{
+       PENTERCONS;
+}
+
+CoreAudioDriver::~ CoreAudioDriver()
+{
+       PENTERDES;
+} 
+
+int CoreAudioDriver::setup(bool capture, bool playback, const QString & 
cardDevice)
+{
+       return -1;
+}
+
+//eof

Index: src/engine/CoreAudioDriver.h
===================================================================
RCS file: src/engine/CoreAudioDriver.h
diff -N src/engine/CoreAudioDriver.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/engine/CoreAudioDriver.h        11 Nov 2008 13:42:37 -0000      1.1
@@ -0,0 +1,53 @@
+/*
+Copyright (C) 2008 Remon Sijrier 
+
+(November 2008) Ported to C++ for Traverso by Remon Sijrier
+Copyright (C) 2001 Paul Davis 
+
+This file is part of Traverso
+
+Traverso 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, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+
+*/
+
+#ifndef CORE_AUDIO_DRIVER_H
+#define CORE_AUDIO_DRIVER_H
+
+#include "Driver.h"
+
+
+class CoreAudioDriver : public Driver
+{
+public:
+       CoreAudioDriver(AudioDevice* dev, int rate, nframes_t bufferSize);
+       ~CoreAudioDriver();
+       
+//     int start();
+//     int stop();
+//     int _read(nframes_t nframes);
+//     int _write(nframes_t nframes);
+//     int _null_cycle(nframes_t nframes);
+//     int _run_cycle();
+//     int attach();
+//     int detach();
+//     int bufsize(nframes_t nframes);
+//     int restart();
+       int setup(bool capture=true, bool playback=true, const QString& 
cardDevice="none");
+
+};
+ 
+#endif
+
+//eof




reply via email to

[Prev in Thread] Current Thread [Next in Thread]