Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to load secondary audio files and use them with VU meter #4577

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions xLights/AudioManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1621,9 +1621,9 @@ void ProgressFunction(wxProgressDialog* pd, int p) {
}

// Get the pre-prepared data for this frame
const FrameData* AudioManager::GetFrameData(int frame, const std::string& timing, bool needNotes) {
log4cpp::Category& logger_base = log4cpp::Category::getInstance(std::string("log_base"));

const FrameData* AudioManager::GetFrameData(int frame, bool needNotes)
{
log4cpp::Category &logger_base = log4cpp::Category::getInstance(std::string("log_base"));
// Grab the lock so we can safely access the frame data
std::shared_lock<std::shared_timed_mutex> lock(_mutex);

Expand Down Expand Up @@ -1657,9 +1657,10 @@ const FrameData* AudioManager::GetFrameData(int frame, const std::string& timing
return nullptr;
}

const FrameData* AudioManager::GetFrameData(const std::string& timing, long ms, bool needNotes) {
const FrameData* AudioManager::GetFrameData(long ms, bool needNotes)
{
int frame = ms / _intervalMS;
return GetFrameData(frame, timing, needNotes);
return GetFrameData(frame, needNotes);
}

// Constant Bitrate Detection Functions
Expand Down
19 changes: 8 additions & 11 deletions xLights/AudioManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,14 @@ class AudioManager {
float* GetRawRightDataPtr(long offset);
float* GetRawLeftDataPtr(long offset);
void SetStepBlock(int step, int block);
void SetFrameInterval(int intervalMS);
int GetFrameInterval() const {
return _intervalMS;
}
const FrameData* GetFrameData(int frame, const std::string& timing, bool needNotes = false);
const FrameData* GetFrameData(const std::string& timing, long ms, bool needNotes = false);
void DoPrepareFrameData();
void DoPolyphonicTranscription(wxProgressDialog* dlg, AudioManagerProgressCallback progresscallback);
bool IsPolyphonicTranscriptionDone() const {
return _polyphonicTranscriptionDone;
};

void SetFrameInterval(int intervalMS);
int GetFrameInterval() const { return _intervalMS; }
const FrameData* GetFrameData(int frame, bool needNotes = false);
const FrameData* GetFrameData(long ms, bool needNotes = false);
void DoPrepareFrameData();
void DoPolyphonicTranscription(wxProgressDialog* dlg, AudioManagerProgressCallback progresscallback);
bool IsPolyphonicTranscriptionDone() const { return _polyphonicTranscriptionDone; };

void LoadAudioData(bool separateThread, AVFormatContext* formatContext, AVCodecContext* codecContext, AVStream* audioStream, AVFrame* frame);
void DoLoadAudioData(AVFormatContext* formatContext, AVCodecContext* codecContext, AVStream* audioStream, AVFrame* frame);
Expand Down
2 changes: 1 addition & 1 deletion xLights/PixelBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2972,7 +2972,7 @@ void PixelBufferClass::HandleLayerTransitions(int EffectPeriod, int ii) {
if (layers[ii]->use_music_sparkle_count &&
layers[ii]->buffer.GetMedia() != nullptr) {
float f = 0.0;
auto pf = layers[ii]->buffer.GetMedia()->GetFrameData(layers[ii]->buffer.curPeriod, "");
auto pf = layers[ii]->buffer.GetMedia()->GetFrameData(layers[ii]->buffer.curPeriod);
if (pf != nullptr) {
f = pf->max;
}
Expand Down
7 changes: 7 additions & 0 deletions xLights/RenderBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ AudioManager* RenderBuffer::GetMedia() const
return xLightsFrame::CurrentSeqXmlFile->GetMedia();
}

AudioManager* RenderBuffer::GetSubMedia(const std::string& audioFile) const {
if (xLightsFrame::CurrentSeqXmlFile == nullptr) {
return nullptr;
}
return xLightsFrame::CurrentSeqXmlFile->GetSubMedia(audioFile);
}

const Model* RenderBuffer::GetModel() const
{
return model;
Expand Down
1 change: 1 addition & 0 deletions xLights/RenderBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ class /*NCCDLLEXPORT*/ RenderBuffer {
RenderBuffer(RenderBuffer& buffer);
void InitBuffer(int newBufferHt, int newBufferWi, const std::string& bufferTransform, bool nodeBuffer = false);
AudioManager* GetMedia() const;
AudioManager* GetSubMedia(const std::string& audioFile) const;
const Model* GetModel() const;
const std::string &GetModelName() const;
const wxString &GetXmlHeaderInfo(HEADER_INFO_TYPES node_type) const;
Expand Down
75 changes: 67 additions & 8 deletions xLights/SeqSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const wxWindowID SeqSettingsDialog::ID_TEXTCTRL1 = wxNewId();
const wxWindowID SeqSettingsDialog::ID_TEXTCTRL2 = wxNewId();
const wxWindowID SeqSettingsDialog::ID_TEXTCTRL3 = wxNewId();
const wxWindowID SeqSettingsDialog::ID_BUTTON1 = wxNewId();
const wxWindowID SeqSettingsDialog::ID_BUTTON_AddMiliseconds = wxNewId();
const wxWindowID SeqSettingsDialog::ID_BUTTON_AddMilliseconds = wxNewId();
const wxWindowID SeqSettingsDialog::ID_STATICTEXT4 = wxNewId();
const wxWindowID SeqSettingsDialog::ID_LISTBOX_SUB_AUDIO = wxNewId();
const wxWindowID SeqSettingsDialog::ID_BUTTON_ADD_SUB_AUDIO = wxNewId();
const wxWindowID SeqSettingsDialog::ID_BUTTON_REMOVE_SUB_AUDIO = wxNewId();
const wxWindowID SeqSettingsDialog::ID_STATICTEXT_Xml_Total_Length = wxNewId();
const wxWindowID SeqSettingsDialog::ID_TEXTCTRL_Xml_Seq_Duration = wxNewId();
const wxWindowID SeqSettingsDialog::ID_CHECKBOX_Overwrite_Tags = wxNewId();
Expand Down Expand Up @@ -185,13 +189,14 @@ SeqSettingsDialog::SeqSettingsDialog(wxWindow* parent, xLightsXmlFile* file_to_h
quick_start_pressed = wxArtProvider::GetBitmapBundle("xlART_quick_start_pressed", wxART_BUTTON);

//(*Initialize(SeqSettingsDialog)
wxBoxSizer* BoxSizer1;
wxBoxSizer* BoxSizer2;
wxFlexGridSizer* FlexGridSizer10;
wxFlexGridSizer* FlexGridSizer11;
wxFlexGridSizer* FlexGridSizer12;
wxFlexGridSizer* FlexGridSizer13;
wxFlexGridSizer* FlexGridSizer14;
wxFlexGridSizer* FlexGridSizer15;
wxFlexGridSizer* FlexGridSizer16;
wxFlexGridSizer* FlexGridSizer1;
wxFlexGridSizer* FlexGridSizer2;
wxFlexGridSizer* FlexGridSizer3;
Expand Down Expand Up @@ -268,10 +273,21 @@ SeqSettingsDialog::SeqSettingsDialog(wxWindow* parent, xLightsXmlFile* file_to_h
Button_Download = new wxButton(PanelInfo, ID_BUTTON1, _("Download Sequence and Lyrics"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
FlexGridSizer10->Add(Button_Download, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer10->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer16 = new wxFlexGridSizer(0, 3, 0, 0);
Button_AddMiliseconds = new wxButton(PanelInfo, ID_BUTTON_AddMiliseconds, _("Add Miliseconds"), wxDefaultPosition, wxSize(143,23), 0, wxDefaultValidator, _T("ID_BUTTON_AddMiliseconds"));
FlexGridSizer16->Add(Button_AddMiliseconds, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer10->Add(FlexGridSizer16, 1, wxLEFT, 5);
Button_AddMilliseconds = new wxButton(PanelInfo, ID_BUTTON_AddMilliseconds, _("Add Milliseconds"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON_AddMilliseconds"));
FlexGridSizer10->Add(Button_AddMilliseconds, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer10->Add(0,0,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText5 = new wxStaticText(PanelInfo, ID_STATICTEXT4, _("Sub Audio:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
FlexGridSizer10->Add(StaticText5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer1 = new wxBoxSizer(wxVERTICAL);
ListBoxSubAudio = new wxListBox(PanelInfo, ID_LISTBOX_SUB_AUDIO, wxDefaultPosition, wxSize(860,79), 0, 0, 0, wxDefaultValidator, _T("ID_LISTBOX_SUB_AUDIO"));
BoxSizer1->Add(ListBoxSubAudio, 1, wxALL|wxEXPAND, 5);
BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
ButtonAddSubAudio = new wxButton(PanelInfo, ID_BUTTON_ADD_SUB_AUDIO, _("Add"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON_ADD_SUB_AUDIO"));
BoxSizer2->Add(ButtonAddSubAudio, 0, wxALL, 5);
ButtonRemoveSubAudio = new wxButton(PanelInfo, ID_BUTTON_REMOVE_SUB_AUDIO, _("Remove"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON_REMOVE_SUB_AUDIO"));
BoxSizer2->Add(ButtonRemoveSubAudio, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer1->Add(BoxSizer2, 0, wxALL|wxEXPAND, 5);
FlexGridSizer10->Add(BoxSizer1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer4->Add(FlexGridSizer10, 1, wxALL|wxEXPAND, 5);
FlexGridSizer6 = new wxFlexGridSizer(0, 4, 0, 0);
StaticText_Xml_Total_Length = new wxStaticText(PanelInfo, ID_STATICTEXT_Xml_Total_Length, _("Sequence Duration:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT_Xml_Total_Length"));
Expand Down Expand Up @@ -434,7 +450,9 @@ SeqSettingsDialog::SeqSettingsDialog(wxWindow* parent, xLightsXmlFile* file_to_h
Connect(ID_CHOICE_Xml_Seq_Type, wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction)&SeqSettingsDialog::OnChoice_Xml_Seq_TypeSelect);
Connect(ID_BITMAPBUTTON_Xml_Media_File, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnBitmapButton_Xml_Media_FileClick);
Connect(ID_BUTTON1, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnButton_DownloadClick);
Connect(ID_BUTTON_AddMiliseconds, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnButton_AddMilisecondsClick);
Connect(ID_BUTTON_AddMilliseconds, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnButton_AddMillisecondsClick);
Connect(ID_BUTTON_ADD_SUB_AUDIO, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnButtonAddSubAudioClick);
Connect(ID_BUTTON_REMOVE_SUB_AUDIO, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnButtonRemoveSubAudioClick);
Connect(ID_TEXTCTRL_Xml_Seq_Duration, wxEVT_COMMAND_TEXT_UPDATED, (wxObjectEventFunction)&SeqSettingsDialog::OnTextCtrl_Xml_Seq_DurationText);
Connect(ID_BITMAPBUTTON__ModifyTiming, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnBitmapButton_ModifyTimingClick);
Connect(ID_CHECKBOX1, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&SeqSettingsDialog::OnCheckBox1Click);
Expand Down Expand Up @@ -524,6 +542,11 @@ SeqSettingsDialog::SeqSettingsDialog(wxWindow* parent, xLightsXmlFile* file_to_h
TextCtrl_Xml_Media_File->SetValue(xml_file->GetMedia()->FileName());
}
SetHash();

for (auto const& su : xml_file->GetSubMediaFiles()) {
ListBoxSubAudio->Append(su);
}

TextCtrl_Xml_Seq_Duration->ChangeValue(xml_file->GetSequenceDurationString());
BlendingCheckBox->SetValue(xml_file->supportsModelBlending());

Expand Down Expand Up @@ -1855,7 +1878,43 @@ void SeqSettingsDialog::OnButton_MusicOpenClick(wxCommandEvent& event)
::wxLaunchDefaultBrowser(link);
}

void SeqSettingsDialog::OnButton_AddMilisecondsClick(wxCommandEvent& event) {
void SeqSettingsDialog::OnButtonAddSubAudioClick(wxCommandEvent& event)
{
wxFileDialog OpenDialog(this, "Choose Audio file", wxEmptyString, wxEmptyString, "FPP Audio Files|*.mp3;*.ogg;*.m4p;*.mp4;*.m4a;*.aac;*.wav;*.flac;*.wma;*.au;*.mkv;*.mov|xLights Audio Files|*.mp3;*.ogg;*.m4p;*.mp4;*.avi;*.wma;*.au;*.wav;*.m4a;*.mid;*.mkv;*.mov;*.mpg;*.asf;*.flv;*.mpeg;*.wmv;*.flac", wxFD_OPEN | wxFD_FILE_MUST_EXIST, wxDefaultPosition);

std::string media_directory = media_directories.empty() ? "" : media_directories.front();

if (wxDir::Exists(media_directory)) {
OpenDialog.SetDirectory(media_directory);
}

if (OpenDialog.ShowModal() == wxID_OK) {
wxString filename = OpenDialog.GetFilename();
ObtainAccessToURL(filename.ToStdString());

SetCursor(wxCURSOR_WAIT);
xml_file->AddSubMediaFile(xLightsParent->GetShowDirectory(), filename);
ListBoxSubAudio->Clear();

for (auto const& su : xml_file->GetSubMediaFiles()) {
ListBoxSubAudio->Append(su);
}

SetCursor(wxCURSOR_DEFAULT);
}
}

void SeqSettingsDialog::OnButtonRemoveSubAudioClick(wxCommandEvent& event) {
auto su = ListBoxSubAudio->GetStringSelection();
xml_file->RemoveSubMediaFile(su);
ListBoxSubAudio->Clear();

for (auto const& su : xml_file->GetSubMediaFiles()) {
ListBoxSubAudio->Append(su);
}
}

void SeqSettingsDialog::OnButton_AddMillisecondsClick(wxCommandEvent & event) {
const std::string inputFile = TextCtrl_Xml_Media_File->GetValue();
wxFileName inFile(inputFile);
const std::string mp3dur = TextCtrl_Xml_Seq_Duration->GetValue();
Expand Down
18 changes: 15 additions & 3 deletions xLights/SeqSettingsDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <wx/choice.h>
#include <wx/dialog.h>
#include <wx/gbsizer.h>
#include <wx/listbox.h>
#include <wx/notebook.h>
#include <wx/panel.h>
#include <wx/sizer.h>
Expand All @@ -46,7 +47,9 @@ class SeqSettingsDialog: public wxDialog
//(*Declarations(SeqSettingsDialog)
wxBitmapButton* BitmapButton_ModifyTiming;
wxBitmapButton* BitmapButton_Xml_Media_File;
wxButton* Button_AddMiliseconds;
wxButton* ButtonAddSubAudio;
wxButton* ButtonRemoveSubAudio;
wxButton* Button_AddMilliseconds;
wxButton* Button_Cancel;
wxButton* Button_Close;
wxButton* Button_Download;
Expand All @@ -64,6 +67,7 @@ class SeqSettingsDialog: public wxDialog
wxCheckBox* CheckBox_Overwrite_Tags;
wxChoice* Choice_Xml_Seq_Type;
wxChoice* RenderModeChoice;
wxListBox* ListBoxSubAudio;
wxNotebook* Notebook_Seq_Settings;
wxPanel* PanelInfo;
wxPanel* PanelMetaData;
Expand All @@ -72,6 +76,7 @@ class SeqSettingsDialog: public wxDialog
wxStaticText* StaticText1;
wxStaticText* StaticText3;
wxStaticText* StaticText4;
wxStaticText* StaticText5;
wxStaticText* StaticText_File;
wxStaticText* StaticText_Filename;
wxStaticText* StaticText_Info;
Expand Down Expand Up @@ -153,7 +158,11 @@ class SeqSettingsDialog: public wxDialog
static const wxWindowID ID_TEXTCTRL2;
static const wxWindowID ID_TEXTCTRL3;
static const wxWindowID ID_BUTTON1;
static const wxWindowID ID_BUTTON_AddMiliseconds;
static const wxWindowID ID_BUTTON_AddMilliseconds;
static const wxWindowID ID_STATICTEXT4;
static const wxWindowID ID_LISTBOX_SUB_AUDIO;
static const wxWindowID ID_BUTTON_ADD_SUB_AUDIO;
static const wxWindowID ID_BUTTON_REMOVE_SUB_AUDIO;
static const wxWindowID ID_STATICTEXT_Xml_Total_Length;
static const wxWindowID ID_TEXTCTRL_Xml_Seq_Duration;
static const wxWindowID ID_CHECKBOX_Overwrite_Tags;
Expand Down Expand Up @@ -263,7 +272,10 @@ class SeqSettingsDialog: public wxDialog
void OnButton_EmailSendClick(wxCommandEvent& event);
void OnButton_WebsiteOpenClick(wxCommandEvent& event);
void OnButton_MusicOpenClick(wxCommandEvent& event);
void OnButton_AddMilisecondsClick(wxCommandEvent& event);
void OnButtonAddSubAudioClick(wxCommandEvent& event);
void OnButtonRemoveSubAudioClick(wxCommandEvent& event);
void OnButton_AddMillisecondsClick(wxCommandEvent& event);

//*)

void OnButton_Xml_Rename_TimingClick(wxCommandEvent& event);
Expand Down
4 changes: 2 additions & 2 deletions xLights/ValueCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ float ValueCurve::GetValueAt(float offset, long startMS, long endMS)
// find the maximum of any intervening frames
float f = 0.0;
for (long ms = time; ms < time + msperPoint; ms += frameMS) {
auto pf = __audioManager->GetFrameData("", ms + frameMS);
auto pf = __audioManager->GetFrameData( ms + frameMS);
if (pf != nullptr) {
if (pf->max > f) {
f = pf->max;
Expand Down Expand Up @@ -1914,7 +1914,7 @@ float ValueCurve::GetValueAt(float offset, long startMS, long endMS)
if (__audioManager != nullptr) {
long time = (float)startMS + offset * (endMS - startMS);
float f = 0.0;
auto pf = __audioManager->GetFrameData("", time);
auto pf = __audioManager->GetFrameData(time);
if (pf != nullptr) {
f = ApplyGain(pf->max, GetParameter3());
if (_type == "Inverted Music") {
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/FireEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void FireEffect::Render(Effect* effect, const SettingsMap& SettingsMap, RenderBu
HeightPct = 10;
if (buffer.GetMedia() != nullptr) {
float f = 0.0;
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (pf != nullptr) {
f = pf->max;
}
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/FireworksEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void FireworksEffect::Render(Effect *effect, const SettingsMap &SettingsMap, Ren
if (useMusic)
{
if (buffer.GetMedia() != nullptr) {
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (pf != nullptr) {
f = pf->max;
}
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/LiquidEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ void LiquidEffect::Step(b2World* world, RenderBuffer &buffer, bool enabled[], in
float audioLevel = 0.0001f;
if (buffer.GetMedia() != nullptr)
{
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (pf != nullptr) {
audioLevel = pf->max;
}
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/MeteorsEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void MeteorsEffect::Render(Effect *effect, const SettingsMap &SettingsMap, Rende
if (SettingsMap.GetBool("CHECKBOX_Meteors_UseMusic", false)) {
float f = 0.0;
if (buffer.GetMedia() != nullptr) {
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (pf != nullptr) {
f = pf->max;
}
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/MusicEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void MusicEffect::CreateEvents(RenderBuffer& buffer, std::vector<std::list<Music
// go through each frame and extract the data i need
for (int f = buffer.curEffStartPer; f <= buffer.curEffEndPer; ++f)
{
auto pdata = buffer.GetMedia()->GetFrameData(f, "");
auto pdata = buffer.GetMedia()->GetFrameData(f);

if (pdata != nullptr) {
auto pn = pdata->vu.cbegin();
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/ShaderEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ void ShaderEffect::Render(Effect* eff, const SettingsMap& SettingsMap, RenderBuf

AudioManager* audioManager = buffer.GetMedia();
if (audioManager != nullptr) {
auto fftData = audioManager->GetFrameData(buffer.curPeriod, "");
auto fftData = audioManager->GetFrameData(buffer.curPeriod);
if (fftData) {
std::vector<float> fft128;
if ( _shaderConfig->IsAudioFFTShader() )
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/ShapeEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ void ShapeEffect::Render(Effect *effect, const SettingsMap &SettingsMap, RenderB
if (timing == "") useTiming = false;
if (useMusic) {
if (buffer.GetMedia() != nullptr) {
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (pf != nullptr) {
f = pf->max;
}
Expand Down
2 changes: 1 addition & 1 deletion xLights/effects/StrobeEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void StrobeEffect::Render(Effect *effect, const SettingsMap &SettingsMap, Render
if (reactToMusic) {
float f = 0.0;
if (buffer.GetMedia() != nullptr) {
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto pf = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (pf != nullptr) {
f = pf->max;
}
Expand Down
4 changes: 2 additions & 2 deletions xLights/effects/TendrilEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ void TendrilEffect::Render(RenderBuffer& buffer, const std::string& movement,
// line movement based on music
float f = 0.1f;
if (buffer.GetMedia() != nullptr) {
auto p = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto p = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (p != nullptr) {
f = p->max;
}
Expand All @@ -767,7 +767,7 @@ void TendrilEffect::Render(RenderBuffer& buffer, const std::string& movement,
}
float f = 0.1f;
if (buffer.GetMedia() != nullptr) {
auto p = buffer.GetMedia()->GetFrameData(buffer.curPeriod, "");
auto p = buffer.GetMedia()->GetFrameData(buffer.curPeriod);
if (p != nullptr) {
f = p->max;
}
Expand Down
Loading
Loading