Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rivill
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MINT
Rivill
Commits
20299383
Commit
20299383
authored
2 years ago
by
Florent Berthaut
Browse files
Options
Downloads
Patches
Plain Diff
Removed audio output by default
parent
7a3d74eb
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/Reveal.cpp
+15
-0
15 additions, 0 deletions
src/Reveal.cpp
src/Reveal.hpp
+8
-3
8 additions, 3 deletions
src/Reveal.hpp
src/audio/AudioManager.cpp
+39
-32
39 additions, 32 deletions
src/audio/AudioManager.cpp
src/audio/AudioManager.hpp
+2
-0
2 additions, 0 deletions
src/audio/AudioManager.hpp
with
64 additions
and
35 deletions
src/Reveal.cpp
+
15
−
0
View file @
20299383
...
@@ -59,6 +59,7 @@
...
@@ -59,6 +59,7 @@
#include
"gui/GuiListener.hpp"
#include
"gui/GuiListener.hpp"
#include
"osc/OscManager.hpp"
#include
"osc/OscManager.hpp"
#include
"osc/OscListener.hpp"
#include
"osc/OscListener.hpp"
#include
"audio/AudioManager.hpp"
using
namespace
std
;
using
namespace
std
;
...
@@ -85,6 +86,13 @@ Reveal::Reveal() : GroupModule() {
...
@@ -85,6 +86,13 @@ Reveal::Reveal() : GroupModule() {
Attribute
::
ACTION_ATTRIBUTE
,
Attribute
::
ACTION_ATTRIBUTE
,
quitCallback
,
this
,
Attribute
::
LOCAL
,
quitCallback
,
this
,
Attribute
::
LOCAL
,
false
));
false
));
addAttribute
(
new
Attribute
(
"audio_output"
,
Attribute
::
BOOL_ATTRIBUTE
,
audioOutputCallback
,
this
,
1
,
Attribute
::
GLOBAL
));
m_audioOut
=
false
;
/*
addAttribute(new Attribute("ressources_folder",
addAttribute(new Attribute("ressources_folder",
Attribute::FOLDER_OPEN_ATTRIBUTE,
Attribute::FOLDER_OPEN_ATTRIBUTE,
ressourcesCallback, this, Attribute::LOCAL,
ressourcesCallback, this, Attribute::LOCAL,
...
@@ -92,6 +100,7 @@ Reveal::Reveal() : GroupModule() {
...
@@ -92,6 +100,7 @@ Reveal::Reveal() : GroupModule() {
addAttribute(new Attribute("ressource_upload",
addAttribute(new Attribute("ressource_upload",
Attribute::ACTION_STRING_ATTRIBUTE,
Attribute::ACTION_STRING_ATTRIBUTE,
uploadCallback,this,2,Attribute::GLOBAL,false));
uploadCallback,this,2,Attribute::GLOBAL,false));
*/
addAttribute
(
new
Attribute
(
"debug_osc_input"
,
addAttribute
(
new
Attribute
(
"debug_osc_input"
,
Attribute
::
BOOL_ATTRIBUTE
,
Attribute
::
BOOL_ATTRIBUTE
,
debugOscCallback
,
this
,
1
,
Attribute
::
GLOBAL
));
debugOscCallback
,
this
,
1
,
Attribute
::
GLOBAL
));
...
@@ -192,6 +201,12 @@ GLFWwindow* Reveal::getPreviewWindow() {
...
@@ -192,6 +201,12 @@ GLFWwindow* Reveal::getPreviewWindow() {
return
m_preview
->
getWindow
();
return
m_preview
->
getWindow
();
}
}
void
Reveal
::
setAudioOutput
(
const
bool
&
aud
)
{
if
(
aud
)
{
AudioManager
::
getInstance
()
->
init
();
}
}
void
Reveal
::
planOpen
(
std
::
string
opSt
)
{
void
Reveal
::
planOpen
(
std
::
string
opSt
)
{
//FIXME find better strategy for delaying text
//FIXME find better strategy for delaying text
m_openPlanned
=
10
;
m_openPlanned
=
10
;
...
...
This diff is collapsed.
Click to expand it.
src/Reveal.hpp
+
8
−
3
View file @
20299383
...
@@ -128,14 +128,18 @@ class Reveal : public GroupModule {
...
@@ -128,14 +128,18 @@ class Reveal : public GroupModule {
dynamic_cast
<
Reveal
*>
(
mod
)
->
uploadRessource
(
vf
);
dynamic_cast
<
Reveal
*>
(
mod
)
->
uploadRessource
(
vf
);
}
}
void
uploadRessource
(
const
std
::
vector
<
std
::
string
>&
vf
);
void
uploadRessource
(
const
std
::
vector
<
std
::
string
>&
vf
);
static
void
debugOscCallback
(
Module
*
mod
,
static
void
debugOscCallback
(
Module
*
mod
,
const
std
::
vector
<
bool
>&
vf
)
{
const
std
::
vector
<
bool
>&
vf
)
{
dynamic_cast
<
Reveal
*>
(
mod
)
->
debugOSC
(
vf
[
0
]);
dynamic_cast
<
Reveal
*>
(
mod
)
->
debugOSC
(
vf
[
0
]);
}
}
void
debugOSC
(
const
bool
&
deb
){
m_debugOSC
=
deb
;}
void
debugOSC
(
const
bool
&
deb
){
m_debugOSC
=
deb
;}
const
bool
&
getDebugOSC
()
{
return
m_debugOSC
;}
const
bool
&
getDebugOSC
()
{
return
m_debugOSC
;}
static
void
audioOutputCallback
(
Module
*
mod
,
const
std
::
vector
<
bool
>&
vf
)
{
dynamic_cast
<
Reveal
*>
(
mod
)
->
setAudioOutput
(
vf
[
0
]);
}
void
setAudioOutput
(
const
bool
&
aud
);
virtual
void
load
(
xmlNodePtr
);
virtual
void
load
(
xmlNodePtr
);
void
addUpdateObserver
(
Module
*
upObs
);
void
addUpdateObserver
(
Module
*
upObs
);
...
@@ -218,6 +222,7 @@ class Reveal : public GroupModule {
...
@@ -218,6 +222,7 @@ class Reveal : public GroupModule {
PreviewModule
*
m_preview
;
PreviewModule
*
m_preview
;
OutputManagerModule
*
m_output
;
OutputManagerModule
*
m_output
;
bool
m_debugOSC
;
bool
m_debugOSC
;
bool
m_audioOut
;
int
m_openPlanned
;
int
m_openPlanned
;
std
::
string
m_openPlannedName
;
std
::
string
m_openPlannedName
;
...
...
This diff is collapsed.
Click to expand it.
src/audio/AudioManager.cpp
+
39
−
32
View file @
20299383
...
@@ -78,7 +78,7 @@ int AudioManager::rtaudio_callback(void *outbuf, void *inbuf, unsigned int nFram
...
@@ -78,7 +78,7 @@ int AudioManager::rtaudio_callback(void *outbuf, void *inbuf, unsigned int nFram
}
}
else
{
else
{
memset
(
buf
,
0
,
nFrames
*
data
->
nChannel
*
sizeof
(
float
));
memset
(
buf
,
0
,
nFrames
*
data
->
nChannel
*
sizeof
(
float
));
cout
<<
"AudioManager : Could not read buffer"
<<
endl
;
//
cout<<"AudioManager : Could not read buffer"<<endl;
}
}
}
}
else
{
else
{
...
@@ -96,6 +96,10 @@ int AudioManager::rtaudio_callback(void *outbuf, void *inbuf, unsigned int nFram
...
@@ -96,6 +96,10 @@ int AudioManager::rtaudio_callback(void *outbuf, void *inbuf, unsigned int nFram
}
}
AudioManager
::
AudioManager
()
{
AudioManager
::
AudioManager
()
{
m_init
=
false
;
}
void
AudioManager
::
init
()
{
//audio = new RtAudio(RtAudio::LINUX_PULSE);
//audio = new RtAudio(RtAudio::LINUX_PULSE);
m_rtAudio
=
new
RtAudio
(
RtAudio
::
UNIX_JACK
);
m_rtAudio
=
new
RtAudio
(
RtAudio
::
UNIX_JACK
);
param
=
new
RtAudio
::
StreamParameters
();
param
=
new
RtAudio
::
StreamParameters
();
...
@@ -128,10 +132,12 @@ AudioManager::AudioManager() {
...
@@ -128,10 +132,12 @@ AudioManager::AudioManager() {
memset
(
&
data
.
mixBuffer
[
0
],
0
,
data
.
mixSize
*
sizeof
(
float
));
memset
(
&
data
.
mixBuffer
[
0
],
0
,
data
.
mixSize
*
sizeof
(
float
));
m_thread
=
new
std
::
thread
(
audioThreadFunction
,
this
);
m_thread
=
new
std
::
thread
(
audioThreadFunction
,
this
);
m_init
=
true
;
}
}
void
AudioManager
::
changeBuf
(
float
*
outputBuf
,
float
maxSinValue
)
{
void
AudioManager
::
changeBuf
(
float
*
outputBuf
,
float
maxSinValue
)
{
if
(
m_init
)
{
//check if there is space to write the new values
//check if there is space to write the new values
size_t
write_space
=
ringbuffer_write_space
(
data
.
ringBuffer
);
size_t
write_space
=
ringbuffer_write_space
(
data
.
ringBuffer
);
...
@@ -170,5 +176,6 @@ void AudioManager::changeBuf(float* outputBuf, float maxSinValue) {
...
@@ -170,5 +176,6 @@ void AudioManager::changeBuf(float* outputBuf, float maxSinValue) {
//cout<<"AudioManager : Could not write buffer"<<endl;
//cout<<"AudioManager : Could not write buffer"<<endl;
}
}
}
}
}
This diff is collapsed.
Click to expand it.
src/audio/AudioManager.hpp
+
2
−
0
View file @
20299383
...
@@ -66,6 +66,7 @@ class AudioManager {
...
@@ -66,6 +66,7 @@ class AudioManager {
static
AudioManager
*
getInstance
();
static
AudioManager
*
getInstance
();
~
AudioManager
();
~
AudioManager
();
void
init
();
void
changeBuf
(
float
*
outputBuf
,
float
maxSinValue
);
void
changeBuf
(
float
*
outputBuf
,
float
maxSinValue
);
int
getRate
();
int
getRate
();
int
getBufferSize
();
int
getBufferSize
();
...
@@ -87,6 +88,7 @@ class AudioManager {
...
@@ -87,6 +88,7 @@ class AudioManager {
CallbackData
data
;
CallbackData
data
;
std
::
mutex
mtx_audio
;
std
::
mutex
mtx_audio
;
bool
m_init
;
static
int
rtaudio_callback
(
void
*
outbuf
,
void
*
inbuf
,
static
int
rtaudio_callback
(
void
*
outbuf
,
void
*
inbuf
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment