# HG changeset patch # User Eris Caffee # Date 1427842713 18000 # Node ID 9f0ed655b46c7de636634500d2e58935d319ea6a # Parent d51a735106c2daf4f95ffe92fe7f8c3885ee74c1 Simple player added. Doesn't work right, though. There's lots of static. Is it because I'm in a VM? diff -r d51a735106c2 -r 9f0ed655b46c CMakeLists.txt --- a/CMakeLists.txt Thu Mar 26 16:17:33 2015 -0500 +++ b/CMakeLists.txt Tue Mar 31 17:58:33 2015 -0500 @@ -1,10 +1,10 @@ cmake_minimum_required (VERSION 2.6 FATAL_ERROR) #set (CMAKE_VERBOSE_MAKEFILE ON) -set (App_Name "libaocpp") -project (${App_Name}) +set (Proj_Name "libaocpp") +project (${Proj_Name}) -set (App_Description "Object Oriented wrapper around libao.") +set (Proj_Description "Object Oriented wrapper around libao.") ################################################################################ @@ -60,6 +60,50 @@ ################################################################################ + +find_path(AO_INCLUDE_DIR ao/ao.h) +find_library(AO_LIBRARY NAMES ao) + +if (AO_INCLUDE_DIR AND AO_LIBRARY) + include_directories( + ${AO_INCLUDE_DIR} + ${INCLUDE_DIRECTORIES} + ) +else () + message (FATAL_ERROR "AO not found") +endif() + + +find_path(VORBISFILE_INCLUDE_DIR vorbis/vorbisfile.h) +find_library(VORBISFILE_LIBRARY NAMES vorbisfile) + +if (VORBISFILE_INCLUDE_DIR AND VORBISFILE_LIBRARY) + include_directories( + ${VORBISFILE_INCLUDE_DIR} + ${INCLUDE_DIRECTORIES} + ) +else () + message (FATAL_ERROR "VorbisFile not found") +endif() + +find_library(VORBIS_LIBRARY NAMES vorbis) +find_path(VORBISFILE_INCLUDE_DIR vorbis/vorbisfile.h) +find_library(VORBISFILE_LIBRARY NAMES vorbisfile) + +if (VORBISFILE_INCLUDE_DIR AND VORBISFILE_LIBRARY AND VORBIS_LIBRARY) + include_directories( + ${VORBISFILE_INCLUDE_DIR} + ${INCLUDE_DIRECTORIES} + ) +else () + message (FATAL_ERROR "VorbisFile not found") +endif() + +message (STATUS "VORBISFILE_INCLUDE_DIR ${VORBISFILE_INCLUDE_DIR}") +message (STATUS "VORBISFILE_LIBRARY ${VORBISFILE_LIBRARY}") +message (STATUS "VORBIS_LIBRARY ${VORBIS_LIBRARY}") + +################################################################################ # The core project files set (LIB_SRCS @@ -70,6 +114,10 @@ src/aopp.hpp ) +######################################## + +set (TEST_APP_NAME "aopp_system_info") + set ( AOPP_SYSTEM_INFO_SRCS src/aopp_system_info.cpp ) @@ -79,7 +127,6 @@ link_directories ( ) -set (TEST_APP_NAME "aopp_system_info") # Define the executable program file we are creating. We must list all of # the source files. @@ -90,9 +137,55 @@ # Although we listed the library directories above, we also need to list the # individual libraries we will be linking against. -target_link_libraries (${TEST_APP_NAME} +target_link_libraries(${TEST_APP_NAME} + ${AO_LIBRARY} + ${TARGET_LINK_LIBRARIES} + ) + + +######################################## + +set (PLAYOGG_APP_NAME "playogg") + +set ( PLAYOGG_SRCS +src/playogg.cpp ) +# The directories that contain the libraries we will be linking against. +# This must come before the ADD_EXECUTABLE directive. +link_directories ( + ) + + +# Define the executable program file we are creating. We must list all of +# the source files. +add_executable ( ${PLAYOGG_APP_NAME} + ${PLAYOGG_SRCS} + ${LIB_SRCS} + ) + +# Although we listed the library directories above, we also need to list the +# individual libraries we will be linking against. +target_link_libraries(${PLAYOGG_APP_NAME} + ${AO_LIBRARY} + ${VORBIS_LIBRARY} + ${VORBISFILE_LIBRARY} + ${TARGET_LINK_LIBRARIES} + ) + + + + + + + + + + + + + + # Example to build a linux library with a test driver. @@ -186,28 +279,3 @@ endif () ################################################################################ - -option(Option_AO_Dev "Build a libao Application." ON) - -if (Option_AO_Dev) - - find_path(AO_INCLUDE_DIR ao/ao.h) - find_library(AO_LIBRARY NAMES ao) - - if (AO_INCLUDE_DIR AND AO_LIBRARY) - include_directories( - ${AO_INCLUDE_DIR} - ${INCLUDE_DIRECTORIES} - ) - - target_link_libraries(${TEST_APP_NAME} - ${AO_LIBRARY} - ${TARGET_LINK_LIBRARIES} - ) - else () - message (FATAL_ERROR "AO not found") - endif() - -endif () - -################################################################################ diff -r d51a735106c2 -r 9f0ed655b46c src/AODriver.cpp --- a/src/AODriver.cpp Thu Mar 26 16:17:33 2015 -0500 +++ b/src/AODriver.cpp Tue Mar 31 17:58:33 2015 -0500 @@ -41,7 +41,7 @@ ); if ( dev ) { AODevice *d; - *d = AODevice( dev ); + d = new AODevice( dev ); return d; } return NULL;