-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/feature/audio_enhancemen…
…ts' into development
- Loading branch information
Showing
19 changed files
with
486 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# | ||
# This file is part of openauto project. | ||
# Copyright (C) 2018 f1x.studio (Michal Szwaj) | ||
# | ||
# openauto 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 3 of the License, or | ||
# (at your option) any later version. | ||
|
||
# openauto 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 openauto. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
if (RTAUDIO_LIBRARIES AND RTAUDIO_INCLUDE_DIRS) | ||
# in cache already | ||
set(RTAUDIO_FOUND TRUE) | ||
else (RTAUDIO_LIBRARIES AND RTAUDIO_INCLUDE_DIRS) | ||
find_path(RTAUDIO_INCLUDE_DIR | ||
NAMES | ||
RtAudio.h | ||
PATHS | ||
/usr/include | ||
/usr/local/include | ||
/opt/local/include | ||
/sw/include | ||
PATH_SUFFIXES | ||
rtaudio | ||
) | ||
|
||
find_library(RTAUDIO_LIBRARY | ||
NAMES | ||
rtaudio | ||
PATHS | ||
/usr/lib | ||
/usr/local/lib | ||
/opt/local/lib | ||
/sw/lib | ||
) | ||
|
||
set(RTAUDIO_INCLUDE_DIRS | ||
${RTAUDIO_INCLUDE_DIR} | ||
) | ||
set(RTAUDIO_LIBRARIES | ||
${RTAUDIO_LIBRARY} | ||
) | ||
|
||
if (RTAUDIO_INCLUDE_DIRS AND RTAUDIO_LIBRARIES) | ||
set(RTAUDIO_FOUND TRUE) | ||
endif (RTAUDIO_INCLUDE_DIRS AND RTAUDIO_LIBRARIES) | ||
|
||
if (RTAUDIO_FOUND) | ||
if (NOT rtaudio_FIND_QUIETLY) | ||
message(STATUS "Found rtaudio:") | ||
message(STATUS " - Includes: ${RTAUDIO_INCLUDE_DIRS}") | ||
message(STATUS " - Libraries: ${RTAUDIO_LIBRARIES}") | ||
endif (NOT rtaudio_FIND_QUIETLY) | ||
else (RTAUDIO_FOUND) | ||
if (rtaudio_FIND_REQUIRED) | ||
message(FATAL_ERROR "Could not find rtaudio") | ||
endif (rtaudio_FIND_REQUIRED) | ||
endif (RTAUDIO_FOUND) | ||
|
||
mark_as_advanced(RTAUDIO_INCLUDE_DIRS RTAUDIO_LIBRARIES) | ||
|
||
endif (RTAUDIO_LIBRARIES AND RTAUDIO_INCLUDE_DIRS) |
39 changes: 39 additions & 0 deletions
39
include/f1x/openauto/autoapp/Configuration/AudioOutputBackendType.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* This file is part of openauto project. | ||
* Copyright (C) 2018 f1x.studio (Michal Szwaj) | ||
* | ||
* openauto 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 3 of the License, or | ||
* (at your option) any later version. | ||
* openauto 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 openauto. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace f1x | ||
{ | ||
namespace openauto | ||
{ | ||
namespace autoapp | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
enum class AudioOutputBackendType | ||
{ | ||
RTAUDIO, | ||
QT | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* This file is part of openauto project. | ||
* Copyright (C) 2018 f1x.studio (Michal Szwaj) | ||
* | ||
* openauto 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 3 of the License, or | ||
* (at your option) any later version. | ||
* openauto 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 openauto. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <RtAudio.h> | ||
#include <f1x/openauto/autoapp/Projection/IAudioOutput.hpp> | ||
#include <f1x/openauto/autoapp/Projection/SequentialBuffer.hpp> | ||
|
||
namespace f1x | ||
{ | ||
namespace openauto | ||
{ | ||
namespace autoapp | ||
{ | ||
namespace projection | ||
{ | ||
|
||
class RtAudioOutput: public IAudioOutput | ||
{ | ||
public: | ||
RtAudioOutput(uint32_t channelCount, uint32_t sampleSize, uint32_t sampleRate); | ||
bool open() override; | ||
void write(aasdk::messenger::Timestamp::ValueType timestamp, const aasdk::common::DataConstBuffer& buffer) override; | ||
void start() override; | ||
void stop() override; | ||
void suspend() override; | ||
uint32_t getSampleSize() const override; | ||
uint32_t getChannelCount() const override; | ||
uint32_t getSampleRate() const override; | ||
|
||
private: | ||
void doSuspend(); | ||
static int audioBufferReadHandler(void* outputBuffer, void* inputBuffer, unsigned int nBufferFrames, | ||
double streamTime, RtAudioStreamStatus status, void* userData); | ||
|
||
uint32_t channelCount_; | ||
uint32_t sampleSize_; | ||
uint32_t sampleRate_; | ||
SequentialBuffer audioBuffer_; | ||
std::unique_ptr<RtAudio> dac_; | ||
std::mutex mutex_; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.