Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
blaar
sndfile
Commits
17a4cf80
Commit
17a4cf80
authored
Jun 04, 2021
by
Votre Nom
Browse files
Modenise CMake C++
parent
442fbd30
Changes
4
Hide whitespace changes
Inline
Side-by-side
i_sndfile/CMakeLists.txt
View file @
17a4cf80
cmake_minimum_required
(
VERSION
2.6
)
cmake_minimum_required
(
VERSION
3.13
)
project
(
i_sndfile
)
find_path
(
SNDFILE_INCLUDE_DIR sndfile.h
)
find_library
(
SNDFILE_LIBRARIES NAMES sndfile
)
find_package
(
blc_channel REQUIRED
)
find_package
(
blc_program REQUIRED
)
find_package
(
blc REQUIRED
)
add_definitions
(
${
BL_DEFINITIONS
}
)
include_directories
(
${
BL_INCLUDE_DIRS
}
${
SNDFILE_INCLUDE_DIR
}
)
add_executable
(
i_sndfile i_sndfile.cpp
)
target_link_libraries
(
i_sndfile
${
BL_LIBRARIES
}
${
SNDFILE_LIBRARIES
}
)
target_link_libraries
(
i_sndfile
PRIVATE blc
${
SNDFILE_LIBRARIES
}
rt
)
i_sndfile/i_sndfile.cpp
View file @
17a4cf80
#include
<sndfile.h>
#include
"blc_text.h"
#include
"blc_channel.h"
#include
"blc_program.h"
#include
<unistd.h>
//getpid
...
...
@@ -7,7 +7,6 @@
#define DEFAULT_OUTPUT_NAME ":sound<pid>" //':'
int
main
(
int
argc
,
char
**
argv
){
blc_channel
output
;
char
const
*
filename
,
*
iterations_nb_str
,
*
length_str
,
*
output_name
,
*
period_str
,
*
samplerate_str
,
*
seek_pos_str
,
*
type_str
;
int
iterations_nb
,
period
,
samplerate
;
size_t
length
;
...
...
@@ -45,7 +44,7 @@ int main(int argc, char**argv){
if
(
strcmp
(
DEFAULT_OUTPUT_NAME
,
output_name
)
==
0
)
asprintf
((
char
**
)
&
output_name
,
":sound%d"
,
getpid
());
output
.
create_or_open
(
output_name
,
BLC_CHANNEL_WRITE
,
type
,
'
LPCM
'
,
1
,
length
);
blc_channel
output
(
output_name
,
BLC_CHANNEL_WRITE
,
type
,
'
LPCM
'
,
{
length
}
);
output
.
publish
();
CLEAR
(
sfinfo
);
...
...
o_sndfile/CMakeLists.txt
View file @
17a4cf80
cmake_minimum_required
(
VERSION
2.6
)
cmake_minimum_required
(
VERSION
3.13
)
project
(
o_sndfile
)
find_path
(
SNDFILE_INCLUDE_DIR sndfile.h
)
find_library
(
SNDFILE_LIBRARIES NAMES sndfile
)
find_package
(
blc_channel REQUIRED
)
find_package
(
blc_program REQUIRED
)
find_package
(
blc REQUIRED
)
add_definitions
(
${
BL_DEFINITIONS
}
)
include_directories
(
${
BL_INCLUDE_DIRS
}
${
SNDFILE_INCLUDE_DIR
}
)
add_executable
(
o_sndfile o_sndfile.cpp
)
target_link_libraries
(
o_sndfile
${
BL_LIBRARIES
}
${
SNDFILE_LIBRARIES
}
)
target_link_libraries
(
o_sndfile
PRIVATE blc
${
SNDFILE_LIBRARIES
}
rt
)
o_sndfile/o_sndfile.cpp
View file @
17a4cf80
#include
<sndfile.h>
#include
"blc_text.h"
#include
"blc_channel.h"
#include
"blc_program.h"
#include
<unistd.h>
//getpid
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment