mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
MusicMod: Fixed the build
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3507 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
108
Externals/MusicMod/Main/Src/Frame.cpp
vendored
108
Externals/MusicMod/Main/Src/Frame.cpp
vendored
@ -25,6 +25,7 @@
|
||||
|
||||
#include "IniFile.h" // Common
|
||||
#include "Log.h"
|
||||
#include "Setup.h"
|
||||
|
||||
#include "../../../../Source/Core/DolphinWX/Src/Globals.h" // DolphinWX
|
||||
#include "../../../../Source/Core/DolphinWX/Src/Frame.h"
|
||||
@ -39,10 +40,9 @@
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Declarations and definitions
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
namespace MusicMod
|
||||
{
|
||||
bool GlobalMute = false;
|
||||
@ -51,16 +51,15 @@ namespace MusicMod
|
||||
int GlobalVolume = 125;
|
||||
extern bool dllloaded;
|
||||
|
||||
void ShowConsole();
|
||||
void ShowConsole(bool);
|
||||
void Init();
|
||||
}
|
||||
//////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Change the brightness of a wxBitmap
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
wxBitmap SetBrightness(wxBitmap _Bitmap, int _Brightness, bool Gray)
|
||||
{
|
||||
wxImage _Image = _Bitmap.ConvertToImage();
|
||||
@ -126,9 +125,12 @@ wxBitmap SetBrightness(wxBitmap _Bitmap, int _Brightness, bool Gray)
|
||||
|
||||
//wxMessageBox(Tmp);
|
||||
}
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Create bitmaps
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#ifdef MUSICMOD
|
||||
void
|
||||
CFrame::MM_InitBitmaps(int Theme)
|
||||
@ -158,20 +160,22 @@ CFrame::MM_InitBitmaps(int Theme)
|
||||
// Update in case the bitmap has been updated
|
||||
//if (GetToolBar() != NULL) TheToolBar->FindById(Toolbar_Log)->SetNormalBitmap(m_Bitmaps[Toolbar_Log]);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void
|
||||
CFrame::MM_PopulateGUI()
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Create GUI controls
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void CFrame::MM_PopulateGUI()
|
||||
{
|
||||
wxToolBar* toolBar = TheToolBar; // Shortcut
|
||||
|
||||
toolBar->AddSeparator();
|
||||
|
||||
MusicMod::Init();
|
||||
|
||||
// ---------------------------------------
|
||||
// ------------------------------------------------------------
|
||||
// Draw a rotated music label
|
||||
// ---------------------
|
||||
/*
|
||||
wxBitmap m_RotatedText(30, 15);
|
||||
wxMemoryDC dc;
|
||||
dc.SelectObject(m_RotatedText);
|
||||
@ -180,7 +184,7 @@ CFrame::MM_PopulateGUI()
|
||||
// Set outline and fill colors
|
||||
dc.SetBackground(BackgroundGrayBrush);
|
||||
dc.Clear();
|
||||
|
||||
// Set font style and color
|
||||
wxFont m_font(8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
|
||||
dc.SetFont(m_font);
|
||||
dc.SetTextForeground(wxColour(*wxLIGHT_GREY));
|
||||
@ -191,8 +195,8 @@ CFrame::MM_PopulateGUI()
|
||||
wxStaticBitmap * m_StaticBitmap = new wxStaticBitmap(toolBar, wxID_ANY, m_RotatedText);
|
||||
|
||||
toolBar->AddControl(m_StaticBitmap);
|
||||
// ---------------------------
|
||||
|
||||
*/
|
||||
// ------------------------------------------------------------
|
||||
|
||||
|
||||
mm_ToolMute = toolBar->AddTool(IDM_MUTE, _T("Mute"), m_Bitmaps[Toolbar_PluginDSP], _T("Mute music"));
|
||||
@ -210,16 +214,17 @@ CFrame::MM_PopulateGUI()
|
||||
*/
|
||||
|
||||
|
||||
// ---------------------
|
||||
// ---------------------------------------------------------
|
||||
/* Lots of code to get a label for the slider, in 2.9.0 AddControl accepts a label so then
|
||||
this code can be simplified a lot */
|
||||
// ---------
|
||||
wxPanel * mm_SliderPanel = new wxPanel(toolBar, IDS_VOLUME_PANEL, wxDefaultPosition, wxDefaultSize);
|
||||
mm_Slider = new wxSlider(mm_SliderPanel, IDS_VOLUME, 125, 0, 255, wxDefaultPosition, wxDefaultSize);
|
||||
wxPanel * mm_SliderPanel = new wxPanel(toolBar, IDM_VOLUME_PANEL, wxDefaultPosition, wxDefaultSize);
|
||||
mm_Slider = new wxSlider(mm_SliderPanel, IDM_VOLUME, 125, 0, 255, wxDefaultPosition, wxDefaultSize);
|
||||
//mm_Slider->SetToolTip("Change the music volume");
|
||||
mm_Slider->SetValue(MusicMod::GlobalVolume);
|
||||
// ---------------------------------------------------------
|
||||
|
||||
wxStaticText * mm_SliderText = new wxStaticText(mm_SliderPanel, IDS_VOLUME_LABEL, _T("Volume"), wxDefaultPosition, wxDefaultSize);
|
||||
wxStaticText * mm_SliderText = new wxStaticText(mm_SliderPanel, IDM_VOLUME_LABEL, _T("Volume"), wxDefaultPosition, wxDefaultSize);
|
||||
wxBoxSizer * mm_VolSizer = new wxBoxSizer(wxVERTICAL);
|
||||
mm_VolSizer->Add(mm_Slider, 0, wxEXPAND | wxALL, 0);
|
||||
mm_VolSizer->Add(mm_SliderText, 0, wxCENTER | wxALL, 0);
|
||||
@ -230,14 +235,16 @@ CFrame::MM_PopulateGUI()
|
||||
toolBar->AddControl((wxControl*)mm_SliderPanel);
|
||||
// ---------
|
||||
|
||||
mm_ToolLog = toolBar->AddTool(IDT_LOG, _T("Log"), m_Bitmaps[Toolbar_Log],
|
||||
wxT("Show or hide log. Enable the log window and restart Dolphin to show the DLL status."));
|
||||
// Console button disabled
|
||||
//mm_ToolLog = toolBar->AddTool(IDM_LOG, _T("Log"), m_Bitmaps[Toolbar_Log],
|
||||
// wxT("Show or hide log. Enable the log window and restart Dolphin to show the DLL status."));
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Update GUI
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void
|
||||
CFrame::MM_UpdateGUI()
|
||||
{
|
||||
@ -263,6 +270,7 @@ CFrame::MM_UpdateGUI()
|
||||
mm_ToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
|
||||
}
|
||||
|
||||
/*
|
||||
if(MusicMod::bShowConsole)
|
||||
{
|
||||
mm_ToolLog->SetNormalBitmap(m_Bitmaps[Toolbar_Log]);
|
||||
@ -271,18 +279,19 @@ CFrame::MM_UpdateGUI()
|
||||
{
|
||||
mm_ToolLog->SetNormalBitmap(m_Bitmaps[Toolbar_Log_Dis]);
|
||||
}
|
||||
*/
|
||||
}
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Play and stop music
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void
|
||||
CFrame::MM_OnPlay()
|
||||
{
|
||||
//INFO_LOG(AUDIO,"\nCFrame::OnPlayMusicMod > Begin\n");
|
||||
//NOTICE_LOG(AUDIO,"\nCFrame::OnPlayMusicMod > Begin\n");
|
||||
|
||||
// Save the volume
|
||||
MusicMod::GlobalVolume = mm_Slider->GetValue();
|
||||
@ -296,7 +305,7 @@ CFrame::MM_OnPlay()
|
||||
{
|
||||
if (Core::GetState() == Core::CORE_RUN)
|
||||
{
|
||||
//INFO_LOG(AUDIO,"CFrame::OnPlayMusicMod > Pause\n");
|
||||
//NOTICE_LOG(AUDIO,"CFrame::OnPlayMusicMod > Pause\n");
|
||||
if(!MusicMod::GlobalPause) // we may has set this elsewhere
|
||||
{
|
||||
MusicMod::GlobalPause = true;
|
||||
@ -308,7 +317,7 @@ CFrame::MM_OnPlay()
|
||||
}
|
||||
else
|
||||
{
|
||||
//INFO_LOG(AUDIO,"CFrame::OnPlayMusicMod > Play\n");
|
||||
//NOTICE_LOG(AUDIO,"CFrame::OnPlayMusicMod > Play\n");
|
||||
if(MusicMod::GlobalPause) // we may has set this elsewhere
|
||||
{
|
||||
MusicMod::GlobalPause = false;
|
||||
@ -332,11 +341,11 @@ CFrame::MM_OnStop()
|
||||
|
||||
// =======================================================================================
|
||||
// Mute music
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void
|
||||
CFrame::MM_OnMute(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
//INFO_LOG(AUDIO,"CFrame::OnMute > Begin\n");
|
||||
//NOTICE_LOG(AUDIO,"CFrame::OnMute > Begin\n");
|
||||
//MessageBox(0, "", "", 0);
|
||||
|
||||
if(!MusicMod::GlobalMute)
|
||||
@ -364,11 +373,11 @@ CFrame::MM_OnMute(wxCommandEvent& WXUNUSED (event))
|
||||
|
||||
// =======================================================================================
|
||||
// Pause music
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void
|
||||
CFrame::MM_OnPause(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
INFO_LOG(AUDIO,"CFrame::OnPause > Begin\n");
|
||||
NOTICE_LOG(AUDIO,"CFrame::OnPause > Begin\n");
|
||||
//MessageBox(0, "", "", 0);
|
||||
|
||||
if(!MusicMod::GlobalPause)
|
||||
@ -392,14 +401,12 @@ CFrame::MM_OnPause(wxCommandEvent& WXUNUSED (event))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Change volume
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void CFrame::MM_OnVolume(wxScrollEvent& event)
|
||||
{
|
||||
//INFO_LOG(AUDIO,"CFrame::OnVolume > Begin <%i>\n", event.GetPosition());
|
||||
//NOTICE_LOG(AUDIO,"CFrame::OnVolume > Begin <%i>\n", event.GetPosition());
|
||||
//MessageBox(0, "", "", 0);
|
||||
|
||||
//if(event.GetEventType() == wxEVT_SCROLL_PAGEUP || event.GetEventType() == wxEVT_SCROLL_PAGEDOWN)
|
||||
@ -428,38 +435,29 @@ void CFrame::MM_OnVolume(wxScrollEvent& event)
|
||||
//=======================================================================================
|
||||
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Show log
|
||||
// ---------------------------------------------------------------------------------------
|
||||
void CFrame::MM_OnLog(wxCommandEvent& event)
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void CFrame::MM_OnLog(bool Show)
|
||||
{
|
||||
//INFO_LOG(AUDIO,"CFrame::OnLog > Begin\n");
|
||||
//NOTICE_LOG(AUDIO, "CFrame::OnLog > Begin\n");
|
||||
//MessageBox(0, "", "", 0);
|
||||
//NOTICE_LOG(AUDIO, "MM_OnLog: %i", MusicMod::dllloaded);
|
||||
|
||||
if(!MusicMod::dllloaded) return; // Avoid crash
|
||||
// Check that Init() was run
|
||||
if(!MusicMod::dllloaded) MusicMod::Init();
|
||||
// Check that it succeeded
|
||||
if(!MusicMod::dllloaded) return;
|
||||
|
||||
MusicMod::bShowConsole = !MusicMod::bShowConsole;
|
||||
|
||||
if(MusicMod::bShowConsole)
|
||||
/* What we do here is run StartConsoleWin() in Common directly after each
|
||||
other first in the exe then in the DLL, sometimes this would give me a rampant memory
|
||||
usage increase until the exe crashed at 700 MB memory usage or something like that.
|
||||
For that reason I'm trying to sleep for a moment between them here. */
|
||||
{ MusicMod::ShowConsole(); Sleep(100); Player_Console(true); }
|
||||
else
|
||||
{
|
||||
#if defined (_WIN32)
|
||||
Console::Close(); Player_Console(false);
|
||||
#endif
|
||||
}
|
||||
MusicMod::bShowConsole = Show;
|
||||
MusicMod::ShowConsole(MusicMod::bShowConsole);
|
||||
|
||||
IniFile file;
|
||||
file.Load("Plainamp.ini");
|
||||
file.Set("Interface", "ShowConsole", MusicMod::bShowConsole);
|
||||
file.Save("Plainamp.ini");
|
||||
|
||||
UpdateGUI();
|
||||
//UpdateGUI();
|
||||
}
|
||||
//=======================================================================================
|
||||
|
||||
|
72
Externals/MusicMod/Main/Src/Main.cpp
vendored
72
Externals/MusicMod/Main/Src/Main.cpp
vendored
@ -98,7 +98,7 @@ void StructSort (std::vector <MyFilesStructure> &MyFiles)
|
||||
{
|
||||
MyFilesStructure temp;
|
||||
|
||||
//INFO_LOG(AUDIO,"StructSort > Begin\n");
|
||||
//NOTICE_LOG(AUDIO,"StructSort > Begin\n");
|
||||
|
||||
for(int i = 0; i < MyFiles.size() - 1; i++)
|
||||
{
|
||||
@ -119,16 +119,29 @@ void StructSort (std::vector <MyFilesStructure> &MyFiles)
|
||||
std::cout << i << " " << MyFiles[i].path.c_str() << "#" << MyFiles[i].offset << "\n";
|
||||
}
|
||||
|
||||
//INFO_LOG(AUDIO,"StructSort > Done\n");
|
||||
//NOTICE_LOG(AUDIO,"StructSort > Done\n");
|
||||
}
|
||||
// ============================
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
/* Run these things once */
|
||||
/* Run these things once when Dolphin starts */
|
||||
// ------------------------
|
||||
void ShowConsole()
|
||||
void ShowConsole(bool Show)
|
||||
{
|
||||
if (Show)
|
||||
{
|
||||
/* What we do here is run StartConsoleWin() in Common directly after each
|
||||
other first in the exe then in the DLL, sometimes this would give me a rampant memory
|
||||
usage increase until the exe crashed at 700 MB memory usage or something like that.
|
||||
For that reason I'm trying to sleep for a moment between them here. */
|
||||
Sleep(100);
|
||||
Player_Console(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Player_Console(false);
|
||||
}
|
||||
// Console::Open(100, 2000, "MusicMod", true); // Give room for 2000 rows
|
||||
}
|
||||
|
||||
@ -149,13 +162,13 @@ void Init()
|
||||
// ---------------------------------------
|
||||
// Make a debugging window
|
||||
// ---------------------
|
||||
if(MusicMod::bShowConsole) ShowConsole();
|
||||
//if(MusicMod::bShowConsole) ShowConsole();
|
||||
|
||||
// Write version
|
||||
#ifdef _M_X64
|
||||
INFO_LOG(AUDIO,"64 bit version\n");
|
||||
NOTICE_LOG(AUDIO,"64 bit version\n");
|
||||
#else
|
||||
INFO_LOG(AUDIO,"32 bit version\n");
|
||||
NOTICE_LOG(AUDIO,"32 bit version\n");
|
||||
#endif
|
||||
// -----------
|
||||
|
||||
@ -165,7 +178,7 @@ void Init()
|
||||
// Show DLL status
|
||||
Player_Main(MusicMod::bShowConsole);
|
||||
//play_file("c:\\demo36_02.ast");
|
||||
//INFO_LOG(AUDIO,"DLL loaded\n");
|
||||
//NOTICE_LOG(AUDIO,"DLL loaded\n");
|
||||
|
||||
dllloaded = true; // Do this once
|
||||
}
|
||||
@ -173,15 +186,17 @@ void Init()
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
/* This will read the GC file system. */
|
||||
/* Function: Read the GC file system when a game is booted
|
||||
Called from: BootManager.cpp */
|
||||
// ------------------------
|
||||
void Main(std::string FileName)
|
||||
{
|
||||
//
|
||||
DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(FileName.c_str());
|
||||
|
||||
DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(FileName);
|
||||
//
|
||||
my_pFileSystem = new DiscIO::CFileSystemGCWii(pVolume);
|
||||
// Check that it worked
|
||||
if (my_pFileSystem->m_FileInfoVector.size() == 0) NOTICE_LOG(AUDIO, "Volume creation failed")
|
||||
|
||||
/* We have to sort the files according to offset so that out scan in Blob.cpp works.
|
||||
Because StructSort() only works for MyFilesStructure I copy the offset and filenames
|
||||
@ -202,7 +217,7 @@ void Main(std::string FileName)
|
||||
LPSECURITY_ATTRIBUTES attr;
|
||||
attr = NULL;
|
||||
MusicPath = "Music\\";
|
||||
INFO_LOG(AUDIO,"Created a Music directory\n");
|
||||
NOTICE_LOG(AUDIO,"Created a Music directory\n");
|
||||
CreateDirectory(MusicPath.c_str(), attr);
|
||||
// ----------------------------------------------------------------------------------------
|
||||
}
|
||||
@ -216,8 +231,6 @@ void CheckFile(std::string File, int FileNumber)
|
||||
// Do nothing if we found the same file again
|
||||
if (CurrentFile == File) return;
|
||||
|
||||
//INFO_LOG(AUDIO,">>>> (%i)Current read %s <%u = %ux%i> <block %u>\n", i, CurrentFiles[i].path.c_str(), offset, CurrentFiles[i].offset, size);
|
||||
|
||||
// Check if it's a music file
|
||||
if (CheckFileEnding(File.c_str()))
|
||||
{
|
||||
@ -227,7 +240,7 @@ void CheckFile(std::string File, int FileNumber)
|
||||
if (CurrentPlayFile == File) return;
|
||||
|
||||
// Notify the user
|
||||
INFO_LOG(AUDIO,"\n >>> (%i/%i) Match %s\n\n", FileNumber, MyFiles.size(), File.c_str());
|
||||
NOTICE_LOG(AUDIO,"\n >>> (%i/%i) Match %s\n", FileNumber, MyFiles.size(), File.c_str());
|
||||
|
||||
// Save the matched file
|
||||
CurrentPlayFile = File;
|
||||
@ -236,7 +249,7 @@ void CheckFile(std::string File, int FileNumber)
|
||||
// We will now save the file to the PC hard drive
|
||||
// ------------------
|
||||
// Get the filename
|
||||
std::size_t pointer = File.find_last_of("\\");
|
||||
std::size_t pointer = File.find_last_of("/");
|
||||
std::string fragment = File.substr (0, (pointer-0));
|
||||
int compare = File.length() - fragment.length(); // Get the length of the filename
|
||||
fragment = File.substr ((pointer+1), compare); // Now we have the filename
|
||||
@ -245,9 +258,11 @@ void CheckFile(std::string File, int FileNumber)
|
||||
std::string FilePath = (MusicPath + fragment);
|
||||
|
||||
WritingFile = true; // Avoid detecting the file we are writing
|
||||
INFO_LOG(AUDIO,"Writing <%s> to <%s>\n", File.c_str(), FilePath.c_str());
|
||||
my_pFileSystem->ExportFile(File.c_str(), FilePath.c_str());
|
||||
NOTICE_LOG(AUDIO, "Writing '%s' to '%s'", File.c_str(), FilePath.c_str());
|
||||
if (!my_pFileSystem->ExportFile(File.c_str(), FilePath.c_str()))
|
||||
NOTICE_LOG(AUDIO, "ERROR: ExportFile failed");
|
||||
WritingFile = false;
|
||||
// ------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Play the file we found
|
||||
@ -256,8 +271,9 @@ void CheckFile(std::string File, int FileNumber)
|
||||
{
|
||||
Player_Play((char*)FilePath.c_str()); // retype it from const char* to char*
|
||||
} else {
|
||||
INFO_LOG(AUDIO,"Warning > Music DLL is not loaded");
|
||||
NOTICE_LOG(AUDIO, "Warning > Music DLL is not loaded");
|
||||
}
|
||||
// ------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Remove the last file, if any
|
||||
@ -266,11 +282,12 @@ void CheckFile(std::string File, int FileNumber)
|
||||
{
|
||||
if(!remove(CurrentPlayFilePath.c_str()))
|
||||
{
|
||||
INFO_LOG(AUDIO,"The program failed to remove <%s>\n", CurrentPlayFilePath.c_str());
|
||||
NOTICE_LOG(AUDIO,"The program failed to remove '%s'", CurrentPlayFilePath.c_str());
|
||||
} else {
|
||||
INFO_LOG(AUDIO,"The program removed <%s>\n", CurrentPlayFilePath.c_str());
|
||||
NOTICE_LOG(AUDIO,"The program removed '%s'", CurrentPlayFilePath.c_str());
|
||||
}
|
||||
}
|
||||
// ------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Save the current playing file
|
||||
@ -279,7 +296,7 @@ void CheckFile(std::string File, int FileNumber)
|
||||
}
|
||||
|
||||
// Tell the user about the files we ignored
|
||||
INFO_LOG(AUDIO,"(%i/%i) Ignored %s\n", FileNumber, MyFiles.size(), File.c_str());
|
||||
NOTICE_LOG(AUDIO,"(%i/%i) Ignored '%s'\n", FileNumber, MyFiles.size(), File.c_str());
|
||||
|
||||
// Update the current file
|
||||
CurrentFile = File;
|
||||
@ -299,8 +316,6 @@ void FindFilename(u64 offset, u64 size)
|
||||
upp the scanning */
|
||||
if(PowerPC::GetState() == PowerPC::CPUState::CPU_RUNNING && offset != 0 && !WritingFile)
|
||||
{
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* Get the filename. Here we go through all files until we come to the file that has
|
||||
the matching offset. Before MyFiles has data this loop will go nowhere. We have to
|
||||
@ -310,6 +325,9 @@ void FindFilename(u64 offset, u64 size)
|
||||
// ---------------------------------------------------------------------------------------
|
||||
for (int i = 0; i < (int)(MyFiles.size() - 1); ++i)
|
||||
{
|
||||
// Log
|
||||
//NOTICE_LOG(AUDIO, ">>> Comparing %s [#%i, Size: %i, Location: %u] with %u", MyFiles[i].path.c_str(), i, size, MyFiles[i].offset, offset);
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
/* If we assume that myoffset is the begginning of every file this works.
|
||||
Suppose there are three files
|
||||
@ -332,6 +350,12 @@ void FindFilename(u64 offset, u64 size)
|
||||
// Stop checking
|
||||
break;
|
||||
}
|
||||
|
||||
// If the file check failed
|
||||
if (i == (int)(MyFiles.size() - 1) - 1)
|
||||
{
|
||||
NOTICE_LOG(AUDIO, "ERROR: GC filename search failed");
|
||||
}
|
||||
}
|
||||
} // This ends the entire filescan
|
||||
// =======================================================================================
|
||||
|
22
Externals/MusicMod/Player/Src/Config.cpp
vendored
22
Externals/MusicMod/Player/Src/Config.cpp
vendored
@ -34,7 +34,7 @@ const TCHAR * SECTION = TEXT( "Plainamp" );
|
||||
ConfVar::ConfVar( TCHAR * szKey, ConfMode mode )
|
||||
{
|
||||
// MessageBox( 0, TEXT( "no const @ ConfVar" ), TEXT( "" ), 0 );
|
||||
//INFO_LOG(AUDIO,"ConfVar::ConfVar(TCHAR) > Got <%s>\n", szKey);
|
||||
//NOTICE_LOG(AUDIO,"ConfVar::ConfVar(TCHAR) > Got <%s>\n", szKey);
|
||||
|
||||
// Init
|
||||
const int iLen = ( int )_tcslen( szKey );
|
||||
@ -59,7 +59,7 @@ ConfVar::ConfVar( TCHAR * szKey, ConfMode mode )
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ConfVar::ConfVar( const TCHAR * szKey, ConfMode mode )
|
||||
{
|
||||
//INFO_LOG(AUDIO,"ConfVar::ConfVar(const TCHAR) > Got <%s>\n", szKey);
|
||||
//NOTICE_LOG(AUDIO,"ConfVar::ConfVar(const TCHAR) > Got <%s>\n", szKey);
|
||||
|
||||
// Init
|
||||
m_szKey = ( TCHAR * )szKey;
|
||||
@ -73,7 +73,7 @@ ConfVar::ConfVar( const TCHAR * szKey, ConfMode mode )
|
||||
if( !conf_map ) conf_map = new map<TCHAR *, ConfVar *>;
|
||||
conf_map->insert( pair<TCHAR *, ConfVar *>( m_szKey, this ) );
|
||||
|
||||
//INFO_LOG(AUDIO,"ConfVar::ConfVar(const TCHAR) > Insert <%s>\n", ConfVar::m_szKey);
|
||||
//NOTICE_LOG(AUDIO,"ConfVar::ConfVar(const TCHAR) > Insert <%s>\n", ConfVar::m_szKey);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ ConfVar::~ConfVar()
|
||||
ConfBool::ConfBool( bool * pbData, TCHAR * szKey, ConfMode mode, bool bDefault ) : ConfVar( szKey, mode )
|
||||
{
|
||||
// MessageBox( 0, TEXT( "no const @ ConfBool" ), TEXT( "" ), 0 );
|
||||
//INFO_LOG(AUDIO,"ConfBool(TCHAR) > Get <%s>\n", szKey);
|
||||
//NOTICE_LOG(AUDIO,"ConfBool(TCHAR) > Get <%s>\n", szKey);
|
||||
|
||||
m_pbData = pbData;
|
||||
m_bDefault = bDefault;
|
||||
@ -112,7 +112,7 @@ ConfBool::ConfBool( bool * pbData, TCHAR * szKey, ConfMode mode, bool bDefault )
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ConfBool::ConfBool( bool * pbData, const TCHAR * szKey, ConfMode mode, bool bDefault ) : ConfVar( szKey, mode )
|
||||
{
|
||||
//INFO_LOG(AUDIO,"ConfBool(TCHAR) > Get <%s>\n", szKey);
|
||||
//NOTICE_LOG(AUDIO,"ConfBool(TCHAR) > Get <%s>\n", szKey);
|
||||
|
||||
m_pbData = pbData;
|
||||
m_bDefault = bDefault;
|
||||
@ -127,7 +127,7 @@ ConfBool::ConfBool( bool * pbData, const TCHAR * szKey, ConfMode mode, bool bDef
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ConfBool::Read()
|
||||
{
|
||||
//INFO_LOG(AUDIO,"ConfBool::Read() > Begin <m_bRead:%i> and <szIniPath:%s>\n", m_bRead, szIniPath);
|
||||
//NOTICE_LOG(AUDIO,"ConfBool::Read() > Begin <m_bRead:%i> and <szIniPath:%s>\n", m_bRead, szIniPath);
|
||||
|
||||
if( m_bRead || !szIniPath ) return;
|
||||
|
||||
@ -507,13 +507,13 @@ ConfString::ConfString( TCHAR * szData, const TCHAR * szKey, ConfMode mode, TCHA
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ConfString::Read()
|
||||
{
|
||||
//INFO_LOG(AUDIO, "ConfString::Read() > Begin\n");
|
||||
//NOTICE_LOG(AUDIO, "ConfString::Read() > Begin\n");
|
||||
|
||||
if( m_bRead || !szIniPath ) return;
|
||||
|
||||
GetPrivateProfileString( SECTION, m_szKey, m_szDefault, m_szData, m_iMaxLen, szIniPath );
|
||||
|
||||
//INFO_LOG(AUDIO, "ConfString::Read() > GetPrivateProfileString <%s> <%s> <%s>\n", m_szKey, m_szData, szIniPath);
|
||||
//NOTICE_LOG(AUDIO, "ConfString::Read() > GetPrivateProfileString <%s> <%s> <%s>\n", m_szKey, m_szData, szIniPath);
|
||||
|
||||
m_bRead = true;
|
||||
}
|
||||
@ -567,7 +567,7 @@ void ConfCurDir::Read()
|
||||
// Apply
|
||||
//SetCurrentDirectory( m_szData );
|
||||
|
||||
//INFO_LOG(AUDIO,"ConfCurDir::Read > End <%s>\n", m_szData);
|
||||
//NOTICE_LOG(AUDIO,"ConfCurDir::Read > End <%s>\n", m_szData);
|
||||
}
|
||||
// ==============================================================================
|
||||
|
||||
@ -581,7 +581,7 @@ void ConfCurDir::Write()
|
||||
GetCurrentDirectory( MAX_PATH, m_szData ); // Note: without trailing slash
|
||||
|
||||
// MessageBox( 0, m_szData, TEXT( "CurDir" ), 0 );
|
||||
//INFO_LOG(AUDIO,"ConfCurDir::Read <%s>\n", m_szData);
|
||||
//NOTICE_LOG(AUDIO,"ConfCurDir::Read <%s>\n", m_szData);
|
||||
|
||||
ConfString::Write();
|
||||
}
|
||||
@ -645,7 +645,7 @@ void Conf::Init()
|
||||
//_sntprintf( szIniPath, _MAX_PATH, TEXT( "%s%s%s" ), szDrive, szDir, fd.cFileName );
|
||||
_sntprintf( szIniPath, _MAX_PATH, TEXT( "%s%s%s" ), szDrive, szDir, TEXT( "Plainamp.ini" ) );
|
||||
|
||||
INFO_LOG(AUDIO,"DLL > Ini path <%s>\n", szIniPath);
|
||||
NOTICE_LOG(AUDIO,"DLL > Ini path <%s>\n", szIniPath);
|
||||
// =======================================================================================
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ InputPlugin::InputPlugin( TCHAR * szDllpath, bool bKeepLoaded ) : Plugin( szDllp
|
||||
iFiltersLen = 0;
|
||||
plugin = NULL;
|
||||
|
||||
//INFO_LOG(AUDIO,"\InputPlugin::InputPlugin > Begin\n");
|
||||
//NOTICE_LOG(AUDIO,"\InputPlugin::InputPlugin > Begin\n");
|
||||
|
||||
if( !Load() )
|
||||
{
|
||||
|
2
Externals/MusicMod/Player/Src/Main.cpp
vendored
2
Externals/MusicMod/Player/Src/Main.cpp
vendored
@ -371,7 +371,7 @@ LRESULT CALLBACK WndprocMain( HWND hwnd, UINT message, WPARAM wp, LPARAM lp )
|
||||
static bool bRemoveIcon = false;
|
||||
|
||||
#ifdef NOGUI
|
||||
//INFO_LOG(AUDIO,"DLL > Main.cpp:WndprocMain() was called. But nothing will be done. \n");
|
||||
//NOTICE_LOG(AUDIO,"DLL > Main.cpp:WndprocMain() was called. But nothing will be done. \n");
|
||||
#else
|
||||
Console::Append( TEXT( "Main.cpp:WndprocMain was called" ) );
|
||||
#endif
|
||||
|
2
Externals/MusicMod/Player/Src/Output.cpp
vendored
2
Externals/MusicMod/Player/Src/Output.cpp
vendored
@ -266,7 +266,7 @@ void Output_SetVolume( int volume )
|
||||
//_stprintf( szBuffer, TEXT( "DLL > Output_SetVolume <%i>" ), volume );
|
||||
//Console::Append( szBuffer );
|
||||
//Console::Append( TEXT( " " ) );
|
||||
//INFO_LOG(AUDIO, "DLL > Output_SetVolume <%i>\n", volume );
|
||||
//NOTICE_LOG(AUDIO, "DLL > Output_SetVolume <%i>\n", volume );
|
||||
// =======================================================================================
|
||||
|
||||
for( int i = 0; i < active_output_count; i++ )
|
||||
|
@ -248,7 +248,7 @@ bool OutputPlugin::Config( HWND hParent )
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool OutputPlugin::Start()
|
||||
{
|
||||
//INFO_LOG(AUDIO, "OutputPlugin::Start() > Begin <IsLoaded():%i> <bActive:%i> <active_output_count:%i>\n",
|
||||
//NOTICE_LOG(AUDIO, "OutputPlugin::Start() > Begin <IsLoaded():%i> <bActive:%i> <active_output_count:%i>\n",
|
||||
// IsLoaded(), bActive, active_output_count );
|
||||
|
||||
if( !IsLoaded() ) return false;
|
||||
@ -275,7 +275,7 @@ bool OutputPlugin::Start()
|
||||
Console::Append( szBuffer );
|
||||
Console::Append( TEXT( " " ) );
|
||||
#else
|
||||
INFO_LOG(AUDIO, "\n >>> Output plugin '%s' activated\n\n" , GetFilename() );
|
||||
NOTICE_LOG(AUDIO, "\n >>> Output plugin '%s' activated\n\n" , GetFilename() );
|
||||
#endif
|
||||
|
||||
bActive = true;
|
||||
|
24
Externals/MusicMod/Player/Src/Playback.cpp
vendored
24
Externals/MusicMod/Player/Src/Playback.cpp
vendored
@ -60,14 +60,14 @@ void EnableTimer( bool bEnabled )
|
||||
if( bEnabled )
|
||||
{
|
||||
SetTimer( WindowMain, TIMER_SEEK_UPDATE, 1000, NULL );
|
||||
INFO_LOG(AUDIO, "EnableTimer > Activated\n" );
|
||||
NOTICE_LOG(AUDIO, "EnableTimer > Activated\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
KillTimer( WindowMain, TIMER_SEEK_UPDATE );
|
||||
StatusReset();
|
||||
|
||||
INFO_LOG(AUDIO, "EnableTimer > Killed\n" );
|
||||
NOTICE_LOG(AUDIO, "EnableTimer > Killed\n" );
|
||||
}
|
||||
|
||||
bTimerRunning = bEnabled;
|
||||
@ -82,7 +82,7 @@ bool OpenPlay( TCHAR * szFilename, int iNumber )
|
||||
{
|
||||
// =======================================================================================
|
||||
#ifdef NOGUI
|
||||
//INFO_LOG(AUDIO, "Playback.cpp: OpenPlay > Begin <%i> <%s>\n" , iNumber, szFilename );
|
||||
//NOTICE_LOG(AUDIO, "Playback.cpp: OpenPlay > Begin <%i> <%s>\n" , iNumber, szFilename );
|
||||
#else
|
||||
TCHAR sszBuffer[ 5000 ];
|
||||
_stprintf( sszBuffer, TEXT( "Playback.cpp: OpenPlay was called <%i> <%s>" ), iNumber, szFilename );
|
||||
@ -121,14 +121,14 @@ bool OpenPlay( TCHAR * szFilename, int iNumber )
|
||||
{
|
||||
Console::Append( TEXT( "ERROR: Extension not supported" ) );
|
||||
Console::Append( " " );
|
||||
INFO_LOG(AUDIO,"OpenPlay > ERROR: Extension not supported\n");
|
||||
NOTICE_LOG(AUDIO,"OpenPlay > ERROR: Extension not supported\n");
|
||||
return false;
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Now that we know which input pugin to use we set that one as active
|
||||
InputPlugin * old_input = active_input_plugin; // Save the last one, if any
|
||||
active_input_plugin = iter->second;
|
||||
INFO_LOG(AUDIO,"OpenPlay > Input plugin '%s' activated\n", active_input_plugin->GetFilename());
|
||||
NOTICE_LOG(AUDIO,"OpenPlay > Input plugin '%s' activated\n", active_input_plugin->GetFilename());
|
||||
// =======================================================================================
|
||||
|
||||
if( old_input )
|
||||
@ -145,12 +145,12 @@ bool OpenPlay( TCHAR * szFilename, int iNumber )
|
||||
{
|
||||
Console::Append( TEXT( "ERROR: Input plugin is NULL" ) );
|
||||
Console::Append( " " );
|
||||
INFO_LOG(AUDIO,"OpenPlay > ERROR: Input plugin is NULL\n");
|
||||
NOTICE_LOG(AUDIO,"OpenPlay > ERROR: Input plugin is NULL\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Connect
|
||||
//INFO_LOG(AUDIO, "OpenPlay > OutMod\n" );
|
||||
//NOTICE_LOG(AUDIO, "OpenPlay > OutMod\n" );
|
||||
active_input_plugin->plugin->outMod = &output_server; // output->plugin;
|
||||
|
||||
// =======================================================================================
|
||||
@ -190,10 +190,10 @@ bool OpenPlay( TCHAR * szFilename, int iNumber )
|
||||
TCHAR szTitle[ 2000 ] = TEXT( "\0" );
|
||||
int length_in_ms;
|
||||
|
||||
//INFO_LOG(AUDIO, "OpenPlay > GetFileInfo\n" );
|
||||
//NOTICE_LOG(AUDIO, "OpenPlay > GetFileInfo\n" );
|
||||
active_input_plugin->plugin->GetFileInfo( szFilename, szTitle, &length_in_ms );
|
||||
|
||||
//INFO_LOG(AUDIO, "OpenPlay > Play\n" );
|
||||
//NOTICE_LOG(AUDIO, "OpenPlay > Play\n" );
|
||||
active_input_plugin->plugin->Play( szFilename );
|
||||
// =======================================================================================
|
||||
#endif
|
||||
@ -218,7 +218,7 @@ bool OpenPlay( TCHAR * szFilename, int iNumber )
|
||||
// Timer ON
|
||||
//EnableTimer( true );
|
||||
|
||||
//INFO_LOG(AUDIO, "OpenPlay > End\n" );
|
||||
//NOTICE_LOG(AUDIO, "OpenPlay > End\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -298,7 +298,7 @@ bool Playback::Play()
|
||||
Console::Append( sszBuffer );
|
||||
Console::Append( TEXT( " " ) );
|
||||
#else
|
||||
//INFO_LOG(AUDIO, "Playback::Play() > Begin <%i>\n" , bPlaying );
|
||||
//NOTICE_LOG(AUDIO, "Playback::Play() > Begin <%i>\n" , bPlaying );
|
||||
#endif
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
@ -393,7 +393,7 @@ bool Playback::Play()
|
||||
Console::Append( szBuffer );
|
||||
//Console::Append( TEXT( " " ) );
|
||||
#else
|
||||
//INFO_LOG(AUDIO, "Playback::Play() > Filename <%s>\n", szFilename);
|
||||
//NOTICE_LOG(AUDIO, "Playback::Play() > Filename <%s>\n", szFilename);
|
||||
#endif
|
||||
|
||||
// Play
|
||||
|
42
Externals/MusicMod/Player/Src/Player.cpp
vendored
42
Externals/MusicMod/Player/Src/Player.cpp
vendored
@ -119,15 +119,15 @@ void Player_Main(bool Console)
|
||||
//g_hInstance = hInstance;
|
||||
// =======================================================================================
|
||||
|
||||
//printf( "DLL > main_dll() opened\n" );
|
||||
//printf( "DLL > main_dll() opened" );
|
||||
|
||||
if (Console) Player_Console(true);
|
||||
|
||||
//MessageBox(0, "main() opened", "", 0);
|
||||
//printf( "main() opened\n" );
|
||||
INFO_LOG(AUDIO,"\n=========================================================\n\n\n" );
|
||||
//INFO_LOG(AUDIO, "DLL > Player_Main() > Begin\n" );
|
||||
INFO_LOG(AUDIO, "DLL > Settings:\n", bLoop);
|
||||
NOTICE_LOG(AUDIO,"\n=========================================================\n\n\n" );
|
||||
//NOTICE_LOG(AUDIO, "DLL > Player_Main() > Begin\n" );
|
||||
NOTICE_LOG(AUDIO, "DLL > Settings:", bLoop);
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
@ -137,8 +137,8 @@ void Player_Main(bool Console)
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
INFO_LOG(AUDIO, "DLL > Loop: %i\n", bLoop);
|
||||
INFO_LOG(AUDIO, "DLL > WarnPluginsMissing: %i\n", bWarnPluginsMissing);
|
||||
NOTICE_LOG(AUDIO, "DLL > Loop: %i", bLoop);
|
||||
NOTICE_LOG(AUDIO, "DLL > WarnPluginsMissing: %i", bWarnPluginsMissing);
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// =======================================================================================
|
||||
@ -170,7 +170,7 @@ void Player_Main(bool Console)
|
||||
memcpy( szPluginDir, szHomeDir, iHomeDirLen * sizeof( TCHAR ) );
|
||||
memcpy( szPluginDir + iHomeDirLen, TEXT( "PluginsMusic" ), 12 * sizeof( TCHAR ) );
|
||||
szPluginDir[ iHomeDirLen + 12 ] = TEXT( '\0' );
|
||||
INFO_LOG(AUDIO,"DLL > Plugindir: %s\n", szPluginDir);
|
||||
NOTICE_LOG(AUDIO,"DLL > Plugindir: %s", szPluginDir);
|
||||
// =======================================================================================
|
||||
#ifndef NOGUI
|
||||
Font::Create();
|
||||
@ -183,7 +183,7 @@ void Player_Main(bool Console)
|
||||
//GlobalVolume = Playback::Volume::Get(); // Don't bother with this for now
|
||||
//GlobalCurrentVolume = GlobalVolume;
|
||||
//Output_SetVolume( GlobalVolume );
|
||||
INFO_LOG(AUDIO,"DLL > Volume: %i\n\n", GlobalVolume);
|
||||
NOTICE_LOG(AUDIO,"DLL > Volume: %i\n", GlobalVolume);
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -206,10 +206,10 @@ void Player_Main(bool Console)
|
||||
Plugin::FindAll<DspPlugin> ( szPluginDir, TEXT( "dsp_*.dll" ), false );
|
||||
Plugin::FindAll<GenPlugin> ( szPluginDir, TEXT( "gen_*.dll" ), true );
|
||||
|
||||
//INFO_LOG(AUDIO, "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
//NOTICE_LOG(AUDIO, "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
PluginManager::Fill();
|
||||
|
||||
//INFO_LOG(AUDIO, "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
//NOTICE_LOG(AUDIO, "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
|
||||
|
||||
|
||||
@ -251,26 +251,26 @@ void Player_Main(bool Console)
|
||||
// Check the plugins
|
||||
if( input_plugins.empty() )
|
||||
{
|
||||
INFO_LOG(AUDIO,"\n *** Warning: No valid input plugins found\n\n");
|
||||
NOTICE_LOG(AUDIO,"\n *** Warning: No valid input plugins found\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(AUDIO," >>> These valid input plugins were found:\n");
|
||||
NOTICE_LOG(AUDIO," >>> These valid input plugins were found:");
|
||||
for(int i = 0; i < input_plugins.size(); i++)
|
||||
INFO_LOG(AUDIO," %i: %s\n", (i + 1), input_plugins.at(i)->GetFilename());
|
||||
INFO_LOG(AUDIO,"\n");
|
||||
NOTICE_LOG(AUDIO," %i: %s", (i + 1), input_plugins.at(i)->GetFilename());
|
||||
NOTICE_LOG(AUDIO,"\n");
|
||||
}
|
||||
|
||||
// The input plugins are never activated here, they are activate for each file
|
||||
if( !active_input_plugin || !active_input_plugin->plugin )
|
||||
{
|
||||
// INFO_LOG(AUDIO,"The input plugin is not activated yet\n");
|
||||
// NOTICE_LOG(AUDIO,"The input plugin is not activated yet\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
//const int ms_len = active_input_plugin->plugin->GetLength();
|
||||
//const int ms_cur = active_input_plugin->plugin->GetOutputTime();
|
||||
//INFO_LOG(AUDIO,"We are at <%i of %i>\n", ms_cur, ms_len);
|
||||
//NOTICE_LOG(AUDIO,"We are at <%i of %i>\n", ms_cur, ms_len);
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------
|
||||
if( active_output_count > 0 )
|
||||
@ -281,11 +281,11 @@ void Player_Main(bool Console)
|
||||
{
|
||||
res_temp = active_output_plugins[ i ]->plugin->GetOutputTime();
|
||||
}
|
||||
INFO_LOG(AUDIO,"Playback progress <%i>\n", res_temp);*/
|
||||
NOTICE_LOG(AUDIO,"Playback progress <%i>\n", res_temp);*/
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(AUDIO,"\n *** Warning: The output plugin is not working\n\n");
|
||||
NOTICE_LOG(AUDIO,"\n *** Warning: The output plugin is not working\n\n");
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
@ -293,14 +293,14 @@ void Player_Main(bool Console)
|
||||
// Start the timer
|
||||
if(!TimerCreated && bLoop) // Only create this the first time
|
||||
{
|
||||
//INFO_LOG(AUDIO,"Created the timer\n");
|
||||
//NOTICE_LOG(AUDIO,"Created the timer\n");
|
||||
MakeTime();
|
||||
TimerCreated = true;
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
INFO_LOG(AUDIO, "\n=========================================================\n\n" );
|
||||
//INFO_LOG(AUDIO, "DLL > main_dll() > End\n\n\n" );
|
||||
NOTICE_LOG(AUDIO, "\n=========================================================\n\n" );
|
||||
//NOTICE_LOG(AUDIO, "DLL > main_dll() > End\n\n\n" );
|
||||
|
||||
//std::cin.get();
|
||||
}
|
||||
|
32
Externals/MusicMod/Player/Src/PlayerExport.cpp
vendored
32
Externals/MusicMod/Player/Src/PlayerExport.cpp
vendored
@ -60,21 +60,21 @@ void AddFileToPlaylist(char * a)
|
||||
|
||||
void Player_Play(char * FileName)
|
||||
{
|
||||
INFO_LOG(AUDIO,"Play file <%s>\n", FileName);
|
||||
NOTICE_LOG(AUDIO,"Play file '%s'", FileName);
|
||||
|
||||
// Check if the file exists
|
||||
if(GetFileAttributes(FileName) == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
INFO_LOG(AUDIO,"Warning: The file <%s> does not exist. Something is wrong.\n", FileName);
|
||||
NOTICE_LOG(AUDIO,"Warning: The file '%s' does not exist. Something is wrong.", FileName);
|
||||
return;
|
||||
}
|
||||
|
||||
Playback::Stop();
|
||||
//INFO_LOG(AUDIO,"Stop\n");
|
||||
//NOTICE_LOG(AUDIO,"Stop\n");
|
||||
playlist->RemoveAll();
|
||||
//INFO_LOG(AUDIO,"RemoveAll\n");
|
||||
//NOTICE_LOG(AUDIO,"RemoveAll\n");
|
||||
AddFileToPlaylist(FileName);
|
||||
//INFO_LOG(AUDIO,"addfiletoplaylist\n");
|
||||
//NOTICE_LOG(AUDIO,"addfiletoplaylist\n");
|
||||
|
||||
// Play the file
|
||||
Playback::Play();
|
||||
@ -84,7 +84,7 @@ void Player_Play(char * FileName)
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Set volume. This must probably be done after the dll is loaded.
|
||||
//Output_SetVolume( Playback::Volume::Get() );
|
||||
//INFO_LOG(AUDIO,"Volume(%i)\n", Playback::Volume::Get());
|
||||
//NOTICE_LOG(AUDIO,"Volume(%i)\n", Playback::Volume::Get());
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
GlobalPause = false;
|
||||
@ -93,7 +93,7 @@ void Player_Play(char * FileName)
|
||||
void Player_Stop()
|
||||
{
|
||||
Playback::Stop();
|
||||
//INFO_LOG(AUDIO,"Stop\n");
|
||||
//NOTICE_LOG(AUDIO,"Stop\n");
|
||||
playlist->RemoveAll();
|
||||
|
||||
CurrentlyPlayingFile = "";
|
||||
@ -106,13 +106,13 @@ void Player_Pause()
|
||||
{
|
||||
if (!GlobalPause)
|
||||
{
|
||||
INFO_LOG(AUDIO,"DLL > Pause\n");
|
||||
NOTICE_LOG(AUDIO,"DLL > Pause\n");
|
||||
Playback::Pause();
|
||||
GlobalPause = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(AUDIO,"DLL > UnPause from Pause\n");
|
||||
NOTICE_LOG(AUDIO,"DLL > UnPause from Pause\n");
|
||||
Player_Unpause();
|
||||
GlobalPause = false;
|
||||
}
|
||||
@ -120,7 +120,7 @@ void Player_Pause()
|
||||
|
||||
void Player_Unpause()
|
||||
{
|
||||
INFO_LOG(AUDIO,"DLL > UnPause\n");
|
||||
NOTICE_LOG(AUDIO,"DLL > UnPause\n");
|
||||
Playback::Play();
|
||||
GlobalPause = false;
|
||||
}
|
||||
@ -136,7 +136,7 @@ void Player_Unpause()
|
||||
void Player_Mute(int Vol)
|
||||
{
|
||||
if(GlobalVolume == -1) GlobalVolume = Vol;
|
||||
INFO_LOG(AUDIO,"DLL > Mute <%i> <%i>\n", GlobalVolume, GlobalMute);
|
||||
NOTICE_LOG(AUDIO,"DLL > Mute <%i> <%i>\n", GlobalVolume, GlobalMute);
|
||||
|
||||
GlobalMute = !GlobalMute;
|
||||
|
||||
@ -144,15 +144,15 @@ void Player_Mute(int Vol)
|
||||
if(GlobalMute)
|
||||
{
|
||||
Output_SetVolume( 0 );
|
||||
INFO_LOG(AUDIO,"DLL > Volume <%i>\n", GlobalMute);
|
||||
NOTICE_LOG(AUDIO,"DLL > Volume <%i>\n", GlobalMute);
|
||||
}
|
||||
else
|
||||
{
|
||||
Output_SetVolume( GlobalVolume );
|
||||
INFO_LOG(AUDIO,"DLL > Volume <%i>\n", GlobalMute);
|
||||
NOTICE_LOG(AUDIO,"DLL > Volume <%i>\n", GlobalMute);
|
||||
}
|
||||
|
||||
//INFO_LOG(AUDIO,"Volume(%i)\n", Playback::Volume::Get());
|
||||
//NOTICE_LOG(AUDIO,"Volume(%i)\n", Playback::Volume::Get());
|
||||
}
|
||||
///////////////////////////////////////
|
||||
|
||||
@ -161,11 +161,13 @@ void Player_Volume(int Vol)
|
||||
{
|
||||
GlobalVolume = Vol;
|
||||
Output_SetVolume( GlobalVolume );
|
||||
//INFO_LOG(AUDIO,"DLL > Volume <%i> <%i>\n", GlobalVolume, GlobalCurrentVolume);
|
||||
//NOTICE_LOG(AUDIO,"DLL > Volume <%i> <%i>\n", GlobalVolume, GlobalCurrentVolume);
|
||||
}
|
||||
|
||||
void ShowConsole()
|
||||
{
|
||||
ConsoleListener *console = LogManager::GetInstance()->getConsoleListener();
|
||||
console->Open(100, 2000, "MusicMod");
|
||||
// Console::Open(100, 2000, "MusicMod", true); // give room for 2000 rows
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
|
||||
if( 0 > iIndex || iIndex >= ( int )_database.size() )
|
||||
{
|
||||
INFO_LOG(AUDIO,"SetCurIndex > Return");
|
||||
NOTICE_LOG(AUDIO,"SetCurIndex > Return");
|
||||
return;
|
||||
}
|
||||
|
||||
|
12
Externals/MusicMod/Player/Src/Timer.cpp
vendored
12
Externals/MusicMod/Player/Src/Timer.cpp
vendored
@ -48,7 +48,7 @@ extern bool GlobalPause;
|
||||
void CALLBACK Update(unsigned int,unsigned int,unsigned long,unsigned long,unsigned long)
|
||||
#endif
|
||||
{
|
||||
//INFO_LOG(AUDIO,"DLL > Update() > Begin (%i)\n", active_input_plugin);
|
||||
//NOTICE_LOG(AUDIO,"DLL > Update() > Begin (%i)\n", active_input_plugin);
|
||||
|
||||
// --------------------------------
|
||||
// Manage restart when playback for a file has reached the end of the file
|
||||
@ -56,7 +56,7 @@ extern bool GlobalPause;
|
||||
// Check if the input plugin is activated
|
||||
if(!active_input_plugin || !active_input_plugin->plugin)
|
||||
{
|
||||
//INFO_LOG(AUDIO,"The input plugin is not activated yet\n");
|
||||
//NOTICE_LOG(AUDIO,"The input plugin is not activated yet\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -73,20 +73,20 @@ extern bool GlobalPause;
|
||||
if ( progress > 0.7 ) // Only show this if we are getting close to the end, for bugtesting
|
||||
// basically
|
||||
{
|
||||
//INFO_LOG(AUDIO,"Playback progress <%i of %i>\n", ms_cur, ms_len);
|
||||
//NOTICE_LOG(AUDIO,"Playback progress <%i of %i>\n", ms_cur, ms_len);
|
||||
}
|
||||
|
||||
// Because cur never go all the way to len we can't use a == comparison. Insted of this
|
||||
// we could also check if the location is the same as right before.
|
||||
if(ms_cur > ms_len - 1000 && !GlobalPause) // avoid restarting in cases where we just pressed pause
|
||||
{
|
||||
INFO_LOG(AUDIO,"Restart <%s>\n", CurrentlyPlayingFile.c_str());
|
||||
NOTICE_LOG(AUDIO,"Restart <%s>\n", CurrentlyPlayingFile.c_str());
|
||||
Player_Play((char *)CurrentlyPlayingFile.c_str());
|
||||
}
|
||||
}
|
||||
// --------------
|
||||
|
||||
//INFO_LOG(AUDIO,"Make new time\n");
|
||||
//NOTICE_LOG(AUDIO,"Make new time\n");
|
||||
MakeTime(); // Make a new one
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ int MainTimer()
|
||||
// cout << ".";
|
||||
//}
|
||||
|
||||
//INFO_LOG(AUDIO,"MakeTime\n");
|
||||
//NOTICE_LOG(AUDIO,"MakeTime\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user