Skip to content

Commit

Permalink
Added VCA and BUS data
Browse files Browse the repository at this point in the history
  • Loading branch information
QuestionableM committed May 27, 2023
1 parent ea030f7 commit b49d9ab
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 90 deletions.
60 changes: 60 additions & 0 deletions Code/AudioPlayer/AudioEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,64 @@ EventDirectory::EventDirectory(const std::string& name, const std::string& path)
EventDirectory::~EventDirectory()
{
this->Clear();
}




void BusData::RenderHeader()
{
ImGui::PushID(APP_PTR()->m_lineCounter++);

if (ImGui::CollapsingHeader(name.c_str()))
{
ImGui::Indent(20.0f);

float v_volume;
m_bus->getVolume(&v_volume);
if (ImGui::SliderFloat("Volume", &v_volume, 0.0f, 10.0f))
m_bus->setVolume(v_volume);

bool is_muted;
m_bus->getMute(&is_muted);
if (ImGui::Checkbox("Mute", &is_muted))
m_bus->setMute(is_muted);

bool v_paused;
m_bus->getPaused(&v_paused);
if (ImGui::Checkbox("Paused", &v_paused))
m_bus->setPaused(v_paused);

FMOD::ChannelGroup* v_group;
if (m_bus->getChannelGroup(&v_group) == FMOD_OK)
{
float v_pitch;
v_group->getPitch(&v_pitch);
if (ImGui::SliderFloat("Pitch", &v_pitch, 0.0f, 1.0f))
v_group->setPitch(v_pitch);
}

ImGui::Unindent(20.0f);
}

ImGui::PopID();
}

void VcaData::RenderHeader()
{
ImGui::PushID(APP_PTR()->m_lineCounter++);

if (ImGui::CollapsingHeader(name.c_str()))
{
ImGui::Indent();

float v_volume;
m_vca->getVolume(&v_volume);
if (ImGui::SliderFloat("Volume", &v_volume, 0.0f, 1.0f))
m_vca->setVolume(v_volume);

ImGui::Unindent();
}

ImGui::PopID();
}
26 changes: 26 additions & 0 deletions Code/AudioPlayer/AudioEvent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,30 @@ struct EventDirectory

EventDirectory(const std::string& name, const std::string& path);
~EventDirectory();
};

struct BusData
{
std::string name;
std::string m_lower_name;

FMOD::Studio::Bus* m_bus;

void RenderHeader();

BusData() = default;
~BusData() = default;
};

struct VcaData
{
std::string name;
std::string m_lower_name;

FMOD::Studio::VCA* m_vca;

void RenderHeader();

VcaData() = default;
~VcaData() = default;
};
Loading

0 comments on commit b49d9ab

Please sign in to comment.