Skip to content

Commit

Permalink
initial public version
Browse files Browse the repository at this point in the history
  • Loading branch information
i-rinat committed Sep 14, 2014
1 parent ca9a34f commit 040b72b
Show file tree
Hide file tree
Showing 26 changed files with 4,677 additions and 1 deletion.
52 changes: 52 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
project(apulse)
cmake_minimum_required (VERSION 2.8.8)
add_definitions(-std=gnu99 -Wall -fPIC -fvisibility=hidden)
add_definitions(-Werror=implicit-function-declaration)

find_package(PkgConfig REQUIRED)

pkg_check_modules(PULSE libpulse REQUIRED)
pkg_check_modules(REQ glib-2.0 alsa REQUIRED)

include_directories(${PULSE_INCLUDE_DIRS})
include_directories(${REQ_INCLUDE_DIRS})

link_directories(${REQ_LIBRARY_DIRS})

add_library(pulse SHARED
src/apulse-channel-map.c
src/apulse-context.c
src/apulse-mainloop.c
src/apulse-misc.c
src/apulse-operation.c
src/apulse-proplist.c
src/apulse-signal.c
src/apulse-stream.c
src/apulse-threaded-mainloop.c
src/trace.c
src/util.c
src/ringbuffer.c
src/notimplemented.c
)

add_library(pulse-simple SHARED src/apulse-simple.c)
add_library(pulsecommon-5.0 SHARED src/apulse-common.c)

set_target_properties(pulse PROPERTIES VERSION 0)
set_target_properties(pulse-simple PROPERTIES VERSION 0)

set(SYMBOLMAP "-Wl,-version-script=${CMAKE_SOURCE_DIR}/src/symbolmap")

target_link_libraries(pulse ${SYMBOLMAP} ${REQ_LIBRARIES})
target_link_libraries(pulse-simple ${SYMBOLMAP} ${REQ_LIBRARIES})
target_link_libraries(pulsecommon-5.0 ${SYMBOLMAP} ${REQ_LIBRARIES})

add_subdirectory(tests)

set(APULSEPATH ${CMAKE_INSTALL_PREFIX}/lib/apulse)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/apulse.template
${CMAKE_CURRENT_BINARY_DIR}/apulse @ONLY)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/apulse DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(TARGETS pulse-simple pulsecommon-5.0 pulse DESTINATION ${APULSEPATH})
19 changes: 19 additions & 0 deletions LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
ALSA PulseAudio emulation
About
=====

PulseAudio emulation for ALSA.

License
=======

The MIT License. See LICENSE.MIT for full text.
81 changes: 81 additions & 0 deletions src/apulse-channel-map.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright © 2014 Rinat Ibragimov
*
* This file is part of "apulse" project.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#include "apulse.h"
#include "trace.h"


APULSE_EXPORT
pa_channel_map *
pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def)
{
trace_info("Z %s m=%p, channels=%u, def=%u\n", __func__, m, channels, def);

return NULL;
}

APULSE_EXPORT
pa_channel_map *
pa_channel_map_init_mono(pa_channel_map *m)
{
trace_info("F %s\n", __func__);

pa_channel_map *cm = calloc(1, sizeof(pa_channel_map));
cm->channels = 1;
cm->map[0] = PA_CHANNEL_POSITION_MONO;

return cm;
}

APULSE_EXPORT
pa_channel_map *
pa_channel_map_init_stereo(pa_channel_map *m)
{
trace_info("F %s\n", __func__);

pa_channel_map *cm = calloc(1, sizeof(pa_channel_map));
cm->channels = 2;
cm->map[0] = PA_CHANNEL_POSITION_FRONT_LEFT;
cm->map[1] = PA_CHANNEL_POSITION_FRONT_RIGHT;

return cm;
}

APULSE_EXPORT
pa_channel_map *
pa_channel_map_init_extend(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def)
{
trace_info("Z %s\n", __func__);

return NULL;
}

APULSE_EXPORT
int
pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *ss)
{
trace_info("Z %s\n", __func__);

return 1;
}
25 changes: 25 additions & 0 deletions src/apulse-common.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright © 2014 Rinat Ibragimov
*
* This file is part of "apulse" project.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#include "apulse.h"
Loading

0 comments on commit 040b72b

Please sign in to comment.