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 committed 2009-01-03 01:38:44 +00:00
1 parent 55db229929
commit 264056972d
69 files changed
+5299 -511

No files matched your search

+53 -17
View File
@@ -1,13 +1,13 @@
////////////////////////////////////////////////////////////////////////////////
// Plainamp, Open source Winamp core
//
// Copyright © 2005 Sebastian Pipping <[email protected]>
//
// --> http://www.hartwork.org
//
// This source code is released under the GNU General Public License (GPL).
// See GPL.txt for details. Any non-GPL usage is strictly forbidden.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Plainamp, Open source Winamp core
//
// Copyright © 2005 Sebastian Pipping <[email protected]>
//
// --> http://www.hartwork.org
//
// This source code is released under the GNU General Public License (GPL).
// See GPL.txt for details. Any non-GPL usage is strictly forbidden.
////////////////////////////////////////////////////////////////////////////////
#include "Playlist.h"
@@ -96,9 +96,12 @@ bool Playlist::Create()
{
if( WindowPlaylist ) return false;
// If this is not called a crash occurs
PlaylistView::Create();
/*
#ifndef NOGUI
RECT ClientMain;
GetClientRect( WindowMain, &ClientMain );
@@ -134,15 +137,22 @@ bool Playlist::Create()
{
SetWindowLong( WindowPlaylist, GWL_WNDPROC, ( LONG )WndprocPlaylist );
}
*/
Font::Apply( WindowPlaylist );
#endif NOGUI
TCHAR * szPlaylistMind = new TCHAR[ iHomeDirLen + 12 + 1 ];
memcpy( szPlaylistMind, szHomeDir, iHomeDirLen * sizeof( TCHAR ) );
memcpy( szPlaylistMind + iHomeDirLen, TEXT( "Plainamp.m3u" ), 12 * sizeof( TCHAR ) );
szPlaylistMind[ iHomeDirLen + 12 ] = TEXT( '\0' );
Playlist::AppendPlaylistFile( szPlaylistMind );
return true;
@@ -920,6 +930,10 @@ bool Playlist_DialogBoth( bool bOpenOrSave )
playlist->RemoveAll();
Playlist::AppendPlaylistFile( szFilename );
Playback::Play();
Console::Append( TEXT( "Playlist.cpp:Playlist_DialogBoth() called Playback::Play()" ) );
Console::Append( TEXT( " " ) );
}
}
else
@@ -960,6 +974,9 @@ bool Playlist::DialogSaveAs()
////////////////////////////////////////////////////////////////////////////////
bool Playlist::AppendPlaylistFile( TCHAR * szFilename )
{
// Open playlist file
HANDLE hFile = CreateFile(
szFilename, // LPCTSTR lpFileName
@@ -971,15 +988,20 @@ bool Playlist::AppendPlaylistFile( TCHAR * szFilename )
NULL // HANDLE hTemplateFile
);
// This will happen if there is no Playlist.m3u
/*
if( hFile == INVALID_HANDLE_VALUE )
{
// MessageBox( 0, TEXT( "Could not read playlist file" ), TEXT( "Error" ), MB_ICONERROR );
//Console::Append( "We got INVALID_HANDLE_VALUE" );
return false;
}
const bool bEmptyBefore = ( playlist->GetSize() == 0 );
*/
// Disable this
//const bool bEmptyBefore = ( playlist->GetSize() == 0 );
// =======================================================================================
// Remove filename from <szFilename> so we can
// use it as relative directory root
TCHAR * szWalk = szFilename + _tcslen( szFilename ) - 1;
@@ -1002,6 +1024,7 @@ bool Playlist::AppendPlaylistFile( TCHAR * szFilename )
char * rawdata = new char[ iSizeBytes + 1 ]; // One more so we can write '\0' on EOF
DWORD iBytesRead;
// =======================================================================================
// Read whole file
ReadFile(
hFile, // HANDLE hFile
@@ -1040,20 +1063,32 @@ bool Playlist::AppendPlaylistFile( TCHAR * szFilename )
if( ( end - beg > 2 ) && ( *beg != '#' ) )
{
TCHAR * szKeep;
if( beg[ 1 ] == ':' )
{
// TODO: Better detection, network path?
// Absolute path
// Absolute path, skip this
/*
const int iLen = end - beg;
TCHAR szBuffer[ 5000 ];
_stprintf( szBuffer, TEXT( "iLen <%i>" ), iLen );
Console::Append( szBuffer );
szKeep = new TCHAR[ iLen + 1 ];
ToTchar( szKeep, beg, iLen );
szKeep[ iLen ] = TEXT( '\0' );
*/
}
else
{
// Skip initial so we don't get a double backslash in between
while( ( beg[ 0 ] == '\\' ) && ( beg < end ) ) beg++;
// Relative path
@@ -1220,7 +1255,8 @@ TCHAR * Playlist::GetFilename( int iIndex )
return ( entry ? entry->szFilename : NULL );
*/
//TCHAR * szFilename = "C:\Files\Spel och spelfusk\Console\Gamecube\Code\vgmstream (isolate ast)\Music\demo36_02.ast";
//return szFilename;
return ( TCHAR * )playlist->Get( iIndex );
}