mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
MusicMod: Stop function
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1787 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -50,10 +50,11 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Start console window
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Width and height is the size of console window, if you specify fname,
|
||||
// the output will also be writton to this file. The file pointer is automatically closed
|
||||
// when you close the app
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Width and height is the size of console window, if you specify fname, the output will
|
||||
also be writton to this file. The file pointer is automatically closed
|
||||
when you close the application. */
|
||||
// ---------------------
|
||||
void StartConsoleWin(int width, int height, char* fname)
|
||||
{
|
||||
#ifdef MM_DEBUG
|
||||
@ -64,13 +65,19 @@ void StartConsoleWin(int width, int height, char* fname)
|
||||
AllocConsole();
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
//SetConsoleTitle("Debug Window");
|
||||
// Set console window title
|
||||
SetConsoleTitle(fname);
|
||||
|
||||
// Get window handle to write to
|
||||
__hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
COORD co = {width,height};
|
||||
// Create coordinates table
|
||||
COORD co = {width, height};
|
||||
|
||||
// Set the innteral letter space
|
||||
SetConsoleScreenBufferSize(__hStdOut, co);
|
||||
|
||||
// Set the window width and height
|
||||
SMALL_RECT coo = {0,0, (width - 1),50}; // Top, left, right, bottom
|
||||
SetConsoleWindowInfo(__hStdOut, TRUE, &coo);
|
||||
#endif
|
||||
@ -94,33 +101,36 @@ void StartConsoleWin(int width, int height, char* fname)
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int wprintf(char *fmt, ...)
|
||||
{
|
||||
#ifdef MM_DEBUG
|
||||
char s[300];
|
||||
va_list argptr;
|
||||
int cnt;
|
||||
#ifdef MM_DEBUG
|
||||
char s[500]; // Bigget message size
|
||||
va_list argptr;
|
||||
int cnt;
|
||||
|
||||
va_start(argptr, fmt);
|
||||
cnt = vsprintf(s, fmt, argptr);
|
||||
va_end(argptr);
|
||||
va_start(argptr, fmt);
|
||||
cnt = vsprintf(s, fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
DWORD cCharsWritten;
|
||||
DWORD cCharsWritten;
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
#ifndef MM_DEBUG_FILEONLY
|
||||
if(__hStdOut)
|
||||
WriteConsole(__hStdOut, s, strlen(s), &cCharsWritten, NULL);
|
||||
#endif
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------
|
||||
// Write to console
|
||||
// --------------
|
||||
#ifndef MM_DEBUG_FILEONLY
|
||||
if(__hStdOut)
|
||||
WriteConsole(__hStdOut, s, strlen(s), &cCharsWritten, NULL);
|
||||
#endif
|
||||
// ----------------------------
|
||||
|
||||
// Write to file
|
||||
if(__fStdOut)
|
||||
{
|
||||
fprintf(__fStdOut, s);
|
||||
fflush(__fStdOut); // Write file now
|
||||
//fflush(__fStdOut); // Write file now, don't wait
|
||||
}
|
||||
|
||||
return(cnt);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
return(cnt);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
/////////////////////////////
|
@ -297,18 +297,19 @@ CFrame::MM_UpdateGUI()
|
||||
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Play and stop music
|
||||
// ---------------------------------------------------------------------------------------
|
||||
void
|
||||
CFrame::MM_OnPlay()
|
||||
{
|
||||
//MessageBox(0, "CFrame::OnPlay > Begin", "", 0);
|
||||
wprintf("\nCFrame::OnPlayMusicMod > Begin\n");
|
||||
|
||||
//wprintf("\nCFrame::OnPlayMusicMod > Begin\n");
|
||||
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
if (Core::GetState() == Core::CORE_RUN)
|
||||
{
|
||||
wprintf("CFrame::OnPlayMusicMod > Pause\n");
|
||||
//wprintf("CFrame::OnPlayMusicMod > Pause\n");
|
||||
if(!MusicMod::GlobalPause) // we may has set this elsewhere
|
||||
{
|
||||
MusicMod::GlobalPause = true;
|
||||
@ -316,12 +317,11 @@ CFrame::MM_OnPlay()
|
||||
{
|
||||
Player_Pause();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintf("CFrame::OnPlayMusicMod > Play\n");
|
||||
//wprintf("CFrame::OnPlayMusicMod > Play\n");
|
||||
if(MusicMod::GlobalPause) // we may has set this elsewhere
|
||||
{
|
||||
MusicMod::GlobalPause = false;
|
||||
@ -332,9 +332,15 @@ CFrame::MM_OnPlay()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
CFrame::MM_OnStop()
|
||||
{
|
||||
Player_Stop();
|
||||
MusicMod::GlobalPause = false;
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
|
@ -79,7 +79,6 @@ void StructSort (std::vector <MyFilesStructure> &MyFiles)
|
||||
{
|
||||
for (int j = i + 1; j < MyFiles.size(); j++)
|
||||
{
|
||||
//if (printerStock[ i ].brand > printerStock[ j ].brand) //comparing brands
|
||||
if (MyFiles[ i ].offset > MyFiles[ j ].offset) //comparing cost
|
||||
{
|
||||
temp = MyFiles[ i ]; // Swapping entire struct
|
||||
@ -92,7 +91,6 @@ void StructSort (std::vector <MyFilesStructure> &MyFiles)
|
||||
|
||||
for (long i=1; i<(long)MyFiles.size(); ++i)
|
||||
{
|
||||
//cout << printerStock.at(i).brand.c_str() << printerStock.at(i).cost << "\n";
|
||||
std::cout << i << " " << MyFiles[i].path.c_str() << "#" << MyFiles[i].offset << "\n";
|
||||
}
|
||||
|
||||
@ -122,19 +120,21 @@ void Main(std::string FileName)
|
||||
MyFiles.at(i).path = my_pFileSystem->m_FileInfoVector.at(i).m_FullPath;
|
||||
}
|
||||
|
||||
// Sort the files by offset
|
||||
StructSort(MyFiles);
|
||||
|
||||
// These things below will not need to be updated after a new game is started
|
||||
if (dllloaded) return;
|
||||
|
||||
Player_Main(bShowConsole); // Call the DLL for the first time
|
||||
// Call the DLL for the first time
|
||||
Player_Main(bShowConsole);
|
||||
//play_file("c:\\demo36_02.ast");
|
||||
wprintf("DLL loaded\n");
|
||||
dllloaded = true; // Do this once
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Make Music directory
|
||||
// -------------------------
|
||||
LPSECURITY_ATTRIBUTES attr;
|
||||
attr = NULL;
|
||||
MusicPath = "Music\\";
|
||||
@ -272,13 +272,10 @@ void CheckFile(u64 offset, u64 size)
|
||||
// ---------------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
//wprintf("Blob.cpp:Read <%i> <%i> <%i> <%i>\n", offset, size, out_ptr);
|
||||
} // This ends the entire filescan
|
||||
// =======================================================================================
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
} // end of namespace
|
@ -87,6 +87,18 @@ void Player_Play(char * FileName)
|
||||
GlobalPause = false;
|
||||
}
|
||||
|
||||
void Player_Stop()
|
||||
{
|
||||
Playback::Stop();
|
||||
//wprintf("Stop\n");
|
||||
playlist->RemoveAll();
|
||||
|
||||
CurrentlyPlayingFile = "";
|
||||
|
||||
GlobalPause = false;
|
||||
}
|
||||
|
||||
|
||||
void Player_Pause()
|
||||
{
|
||||
if (!GlobalPause)
|
||||
@ -146,7 +158,7 @@ void Player_Volume(int a)
|
||||
|
||||
void ShowConsole()
|
||||
{
|
||||
StartConsoleWin(100, 2000, "MusicMod"); // give room for 2000 rows
|
||||
//StartConsoleWin(100, 2000, "MusicMod"); // give room for 2000 rows
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,6 +41,7 @@ void MakeTime();
|
||||
EXPORT void Player_Main(bool Console);
|
||||
EXPORT void Player_Console(bool Console);
|
||||
EXPORT void Player_Play(char *);
|
||||
EXPORT void Player_Stop();
|
||||
EXPORT void Player_Pause();
|
||||
EXPORT void Player_Unpause();
|
||||
EXPORT void Player_Mute();
|
||||
|
Reference in New Issue
Block a user