Skip to content

Commit

Permalink
pulseaudio via single enable
Browse files Browse the repository at this point in the history
  • Loading branch information
beaumanvienna committed Feb 27, 2024
1 parent d7609ec commit aaff720
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion application/lucre/UI/settingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ namespace LucreApp

void SettingsScreen::SetSoundCallback()
{
#ifdef LINUX
#ifdef PULSEAUDIO
Sound::SetCallback([=](const LibPAmanager::Event& event)
{
UI::m_ScreenManager->RecreateAllViews();
Expand Down
13 changes: 7 additions & 6 deletions engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ project "engine"
"MultiProcessorCompile"
}

if USE_PULSEAUDIO then
defines
{
"PULSEAUDIO"
}
end

filter "system:linux"

linkoptions { "-fno-pie -no-pie" }
Expand Down Expand Up @@ -176,12 +183,6 @@ project "engine"
include "vendor/box2d"
include "vendor/assetImporter"

if os.host() == "linux" then

include "vendor/pamanager/libpamanager/libpamanager.lua"

end

if ( (os.host() == "linux") or (os.host() == "windows" and _ACTION == "gmake2") or (os.host() == "macosx" and _ACTION == "gmake2")) then

project "resource-system-gnu"
Expand Down
2 changes: 1 addition & 1 deletion engine/audio/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "audio/sound.h"

#ifdef LINUX
#ifdef PULSEAUDIO

using namespace LibPAmanager;

Expand Down
2 changes: 1 addition & 1 deletion engine/audio/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "engine.h"

#ifdef LINUX
#ifdef PULSEAUDIO

#include "SoundDeviceManager.h"

Expand Down
6 changes: 3 additions & 3 deletions engine/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ namespace GfxRenderEngine
// init audio
m_Audio = Audio::Create();
m_Audio->Start();
#ifdef LINUX
Sound::SetCallback([=](const LibPAmanager::Event& event)
#ifdef PULSEAUDIO
Sound::SetCallback([this](const LibPAmanager::Event& event)
{
AudioCallback((int)event.GetType());
});
Expand Down Expand Up @@ -283,7 +283,7 @@ namespace GfxRenderEngine

void Engine::AudioCallback(int eventType)
{
#ifdef LINUX
#ifdef PULSEAUDIO
switch (eventType)
{

Expand Down
20 changes: 18 additions & 2 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ project "lucre"
{
}

if os.host() == "linux" then
USE_PULSEAUDIO = true
end
if USE_PULSEAUDIO then
links
{
"libpamanager"
}
defines
{
"PULSEAUDIO"
}
end

filter "system:linux"

linkoptions { "-fno-pie -no-pie" }
Expand All @@ -104,7 +118,6 @@ project "lucre"
"X11",
"Xrandr",
"Xi",
"libpamanager",
"pulse",
"glib-2.0",
"gio-2.0",
Expand Down Expand Up @@ -261,5 +274,8 @@ project "lucre"
print("done.")
end

include "engine.lua"
if USE_PULSEAUDIO then
include "vendor/pamanager/libpamanager/libpamanager.lua"
end

include "engine.lua"

0 comments on commit aaff720

Please sign in to comment.