MusicMod: Added music modification, it currently only works in Windows

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1736 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-01-03 01:38:44 +00:00
parent 55db229929
commit 264056972d
69 changed files with 5299 additions and 511 deletions

View File

@ -51,9 +51,12 @@
#include "Config.h"
#include "Core.h"
#if defined(HAVE_WX) && HAVE_WX
#include "ConfigMain.h"
#include "Frame.h"
#include "CodeWindow.h"
#include "ConfigMain.h"
#include "Frame.h"
#include "CodeWindow.h"
#ifdef MUSICMOD
#include "../../../Branches/MusicMod/Main/Src/Main.h" // MusicMod
#endif
#endif
static std::string s_DataBasePath_EUR = "Data_EUR";
@ -204,6 +207,16 @@ bool BootCore(const std::string& _rFilename)
#else
Core::SetState(Core::CORE_RUN);
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// Music mod
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef MUSICMOD
MusicMod::Main(StartUp.m_strFilename);
#endif
///////////////////////////////////
return true;
}

View File

@ -55,6 +55,7 @@ extern "C" {
#include "../resources/toolbar_plugin_pad.c"
#include "../resources/toolbar_refresh.c"
#include "../resources/toolbar_stop.c"
#include "../resources/Boomy.h"
};
@ -96,6 +97,14 @@ EVT_MENU(IDM_CONFIG_GFX_PLUGIN, CFrame::OnPluginGFX)
EVT_MENU(IDM_CONFIG_DSP_PLUGIN, CFrame::OnPluginDSP)
EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnPluginPAD)
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnPluginWiimote)
#ifdef MUSICMOD
EVT_MENU(IDM_MUTE, CFrame::MM_OnMute)
EVT_MENU(IDM_MUSIC_PLAY, CFrame::MM_OnPause)
EVT_COMMAND_SCROLL(IDS_VOLUME, CFrame::MM_OnVolume)
EVT_MENU(IDT_LOG, CFrame::MM_OnLog)
#endif
EVT_MENU(IDM_BROWSE, CFrame::OnBrowse)
EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard)
EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow)
@ -283,8 +292,10 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar)
toolBar->AddTool(wxID_REFRESH, _T("Refresh"), m_Bitmaps[Toolbar_Refresh], _T("Refresh"));
toolBar->AddTool(IDM_BROWSE, _T("Browse"), m_Bitmaps[Toolbar_Browse], _T("Browse for an ISO directory..."));
toolBar->AddSeparator();
m_pToolPlay = toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play"));
toolBar->AddTool(IDM_STOP, _T("Stop"), m_Bitmaps[Toolbar_Stop], _T("Stop"));
#ifdef _WIN32
toolBar->AddTool(IDM_TOGGLE_FULLSCREEN, _T("Fullscr."), m_Bitmaps[Toolbar_FullScreen], _T("Toggle Fullscreen"));
@ -298,6 +309,16 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar)
toolBar->AddSeparator();
toolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
//////////////////////////////////////////////////
// Music mod
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef MUSICMOD
MM_PopulateGUI();
#endif
///////////////////////
// after adding the buttons to the toolbar, must call Realize() to reflect
// the changes
toolBar->Realize();
@ -314,7 +335,7 @@ void CFrame::RecreateToolbar()
SetToolBar(NULL);
style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR);
theToolBar = CreateToolBar(style, ID_TOOLBAR);
PopulateToolbar(theToolBar);
SetToolBar(theToolBar);
@ -322,6 +343,7 @@ void CFrame::RecreateToolbar()
}
void CFrame::InitBitmaps()
{
// load orignal size 48x48
@ -337,12 +359,17 @@ void CFrame::InitBitmaps()
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(toolbar_plugin_pad_png);
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(toolbar_fullscreen_png);
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(toolbar_help_png);
#ifdef MUSICMOD
m_Bitmaps[Toolbar_Log] = wxGetBitmapFromMemory(Toolbar_Log_png);
MM_InitBitmaps();
#endif
// scale to 24x24 for toolbar
for (size_t n = Toolbar_FileOpen; n < WXSIZEOF(m_Bitmaps); n++)
// Scale to 24x24 for toolbar. Toolbar_Log is already 24x24
for (size_t n = Toolbar_FileOpen; n <= Toolbar_Help; n++)
{
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(24, 24));
}
}
}
@ -468,6 +495,11 @@ void CFrame::OnHelp(wxCommandEvent& event)
// -------------
void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
{
#ifdef MUSICMOD // Music modification
MM_OnPlay();
#endif
// shuffle2: wxBusyInfo is meant to be created on the stack
// and only stay around for the life of the scope it's in.
// If that is not what we want, find another solution. I don't
@ -715,6 +747,10 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
// -------------
void CFrame::UpdateGUI()
{
#ifdef MUSICMOD
MM_UpdateGUI();
#endif
// Save status
bool initialized = Core::GetState() != Core::CORE_UNINITIALIZED;
bool running = Core::GetState() == Core::CORE_RUN;
@ -750,6 +786,7 @@ void CFrame::UpdateGUI()
m_pToolPlay->SetLabel(_("Pause"));
}
m_pMenuItemPlay->SetText(_("&Pause"));
}
else
{
@ -760,6 +797,7 @@ void CFrame::UpdateGUI()
m_pToolPlay->SetLabel(_("Play"));
}
m_pMenuItemPlay->SetText(_("&Play"));
}
if (GetToolBar() != NULL) GetToolBar()->Realize();
@ -781,5 +819,7 @@ void CFrame::UpdateGUI()
m_GameListCtrl->Hide();
}
}
theToolBar->Realize();
}

View File

@ -1,3 +1,21 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __FRAME_H_
#define __FRAME_H_
@ -50,6 +68,25 @@ class CFrame : public wxFrame
wxBoxSizer* sizerPanel;
CGameListCtrl* m_GameListCtrl;
wxPanel* m_Panel;
wxToolBar* theToolBar;
wxToolBarToolBase* m_ToolPlay;
//////////////////////////////////////////////////////////////////////////////////////////
// Music mod
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef MUSICMOD
wxToolBarToolBase* mm_ToolMute, * mm_ToolPlay, * mm_ToolLog;
void MM_UpdateGUI(); void MM_PopulateGUI(); void MM_InitBitmaps();
void MM_OnPlay();
void MM_OnMute(wxCommandEvent& event);
void MM_OnPause(wxCommandEvent& event);
void MM_OnVolume(wxScrollEvent& event);
void MM_OnLog(wxCommandEvent& event);
#endif
///////////////////////////////////
enum EBitmaps
{
@ -57,14 +94,17 @@ class CFrame : public wxFrame
Toolbar_Refresh,
Toolbar_Browse,
Toolbar_Play,
Toolbar_Stop,
Toolbar_Stop, Toolbar_Stop_Dis,
Toolbar_Pause,
Toolbar_PluginOptions,
Toolbar_PluginGFX,
Toolbar_PluginDSP,
Toolbar_PluginDSP, Toolbar_PluginDSP_Dis,
Toolbar_PluginPAD,
Toolbar_FullScreen,
Toolbar_Help,
#ifdef MUSICMOD
Toolbar_Log, Toolbar_Log_Dis,
#endif
Bitmaps_Max,
END
};

View File

@ -15,10 +15,31 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
////////////////////////////////////////////////////////////////////////////////////////
// File description
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
This file is global in the DolphinWX and DebuggerWX projects.
////////////////////////*/
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include "Common.h"
////////////////////////////////////////////////////////////////////////////////////////
// Build with music modification
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#include "../../../Branches/MusicMod/Main/Src/Setup.h" // Define MUSICMOD here
//////////////////////////
enum
{
IDM_LOADSTATE = 200, // File
@ -56,6 +77,13 @@ enum
IDM_HELPWEBSITE,
IDM_HELPGOOGLECODE,
#ifdef MUSICMOD // Music modification
IDM_MUTE,
IDM_MUSIC_PLAY,
IDS_VOLUME, IDS_VOLUME_LABEL, IDS_VOLUME_PANEL,
IDT_LOG,
#endif
IDM_CONFIG_MAIN,
IDM_CONFIG_GFX_PLUGIN,
IDM_CONFIG_DSP_PLUGIN,
@ -93,44 +121,43 @@ enum
//#ifndef WX_PRECOMP
#if defined(HAVE_WX) && HAVE_WX
#include <wx/wx.h>
//#endif
#include <wx/wx.h>
//#endif
#include <wx/toolbar.h>
#include <wx/log.h>
#include <wx/image.h>
#include <wx/aboutdlg.h>
#include <wx/filedlg.h>
#include <wx/spinctrl.h>
#include <wx/srchctrl.h>
#include <wx/listctrl.h>
#include <wx/progdlg.h>
#include <wx/imagpng.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/cmdline.h>
#include <wx/busyinfo.h>
#include <wx/toolbar.h>
#include <wx/log.h>
#include <wx/image.h>
#include <wx/aboutdlg.h>
#include <wx/filedlg.h>
#include <wx/spinctrl.h>
#include <wx/srchctrl.h>
#include <wx/listctrl.h>
#include <wx/progdlg.h>
#include <wx/imagpng.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/cmdline.h>
#include <wx/busyinfo.h>
// define this to use XPMs everywhere (by default, BMPs are used under Win)
// BMPs use less space, but aren't compiled into the executable on other platforms
#if USE_XPM_BITMAPS && defined (__WXMSW__) && !wxUSE_XPM_IN_MSW
#error You need to enable XPM support to use XPM bitmaps with toolbar!
#endif // USE_XPM_BITMAPS
// Define this to use XPMs everywhere (by default, BMPs are used under Win)
// BMPs use less space, but aren't compiled into the executable on other platforms
#if USE_XPM_BITMAPS && defined (__WXMSW__) && !wxUSE_XPM_IN_MSW
#error You need to enable XPM support to use XPM bitmaps with toolbar!
#endif // USE_XPM_BITMAPS
//
// custom message macro
//
//
// custom message macro
//
#define EVT_HOST_COMMAND(id, fn) \
DECLARE_EVENT_TABLE_ENTRY(\
wxEVT_HOST_COMMAND, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent(wxCommandEventFunction, &fn), \
(wxObject*) NULL \
),
#define EVT_HOST_COMMAND(id, fn) \
DECLARE_EVENT_TABLE_ENTRY(\
wxEVT_HOST_COMMAND, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent(wxCommandEventFunction, &fn), \
(wxObject*) NULL \
),
extern const wxEventType wxEVT_HOST_COMMAND;
extern const wxEventType wxEVT_HOST_COMMAND;
#endif
#endif
#endif // HAVE_WX
#endif // _GLOBALS_H