Common: Moved Windows console functions to common
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1887 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
1 parent
7f9ce70b33
commit
ae9cfbd8e3
70 files changed
+1337
-2987
No files matched your search
@@ -45,6 +45,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\Source\Core\Common\Src"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_SECURE_SCL=0"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="0"
|
||||
@@ -211,6 +212,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\..\..\Source\Core\Common\Src"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_SECURE_SCL=0"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -346,6 +348,169 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="DebugFast|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\..\..\Source\Core\Common\Src"
|
||||
PreprocessorDefinitions="WIN32;DEBUGFAST;_WINDOWS;_SECURE_SCL=0"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/NODEFAULTLIB:msvcrt"
|
||||
AdditionalDependencies="libzlib1.lib comctl32.lib winmm.lib"
|
||||
OutputFile="$(OutDir)/Plainamp.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="Lib"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="0"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
EntryPointSymbol=""
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="DebugFast|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libzlib1.lib comctl32.lib winmm.lib"
|
||||
OutputFile="$(OutDir)/Plainamp.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="Lib"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="0"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
EntryPointSymbol=""
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
||||
@@ -34,7 +34,7 @@ const TCHAR * SECTION = TEXT( "Plainamp" );
|
||||
ConfVar::ConfVar( TCHAR * szKey, ConfMode mode )
|
||||
{
|
||||
// MessageBox( 0, TEXT( "no const @ ConfVar" ), TEXT( "" ), 0 );
|
||||
//wprintf("ConfVar::ConfVar(TCHAR) > Got <%s>\n", szKey);
|
||||
//Console::Print("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 )
|
||||
{
|
||||
//wprintf("ConfVar::ConfVar(const TCHAR) > Got <%s>\n", szKey);
|
||||
//Console::Print("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 ) );
|
||||
|
||||
//wprintf("ConfVar::ConfVar(const TCHAR) > Insert <%s>\n", ConfVar::m_szKey);
|
||||
//Console::Print("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 );
|
||||
//wprintf("ConfBool(TCHAR) > Get <%s>\n", szKey);
|
||||
//Console::Print("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 )
|
||||
{
|
||||
//wprintf("ConfBool(TCHAR) > Get <%s>\n", szKey);
|
||||
//Console::Print("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()
|
||||
{
|
||||
//wprintf("ConfBool::Read() > Begin <m_bRead:%i> and <szIniPath:%s>\n", m_bRead, szIniPath);
|
||||
//Console::Print("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()
|
||||
{
|
||||
//wprintf( "ConfString::Read() > Begin\n");
|
||||
//Console::Print( "ConfString::Read() > Begin\n");
|
||||
|
||||
if( m_bRead || !szIniPath ) return;
|
||||
|
||||
GetPrivateProfileString( SECTION, m_szKey, m_szDefault, m_szData, m_iMaxLen, szIniPath );
|
||||
|
||||
//wprintf( "ConfString::Read() > GetPrivateProfileString <%s> <%s> <%s>\n", m_szKey, m_szData, szIniPath);
|
||||
//Console::Print( "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 );
|
||||
|
||||
//wprintf("ConfCurDir::Read > End <%s>\n", m_szData);
|
||||
//Console::Print("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 );
|
||||
//wprintf("ConfCurDir::Read <%s>\n", m_szData);
|
||||
//Console::Print("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" ) );
|
||||
|
||||
wprintf("DLL > We got the ini path <%s>\n", szIniPath);
|
||||
Console::Print("DLL > Ini path <%s>\n", szIniPath);
|
||||
// =======================================================================================
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Include
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
#include "../../Common/Src/Console.h" // Local common
|
||||
#include "../../../../Source/Core/Common/Src/ConsoleWindow.h" // Global common
|
||||
/////////////////////////
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ InputPlugin::InputPlugin( TCHAR * szDllpath, bool bKeepLoaded ) : Plugin( szDllp
|
||||
iFiltersLen = 0;
|
||||
plugin = NULL;
|
||||
|
||||
//wprintf("\InputPlugin::InputPlugin > Begin\n");
|
||||
//Console::Print("\InputPlugin::InputPlugin > Begin\n");
|
||||
|
||||
if( !Load() )
|
||||
{
|
||||
|
||||
@@ -371,7 +371,7 @@ LRESULT CALLBACK WndprocMain( HWND hwnd, UINT message, WPARAM wp, LPARAM lp )
|
||||
static bool bRemoveIcon = false;
|
||||
|
||||
#ifdef NOGUI
|
||||
//wprintf("DLL > Main.cpp:WndprocMain() was called. But nothing will be done. \n");
|
||||
//Console::Print("DLL > Main.cpp:WndprocMain() was called. But nothing will be done. \n");
|
||||
#else
|
||||
Console::Append( TEXT( "Main.cpp:WndprocMain was called" ) );
|
||||
#endif
|
||||
|
||||
@@ -266,7 +266,7 @@ void Output_SetVolume( int volume )
|
||||
//_stprintf( szBuffer, TEXT( "DLL > Output_SetVolume <%i>" ), volume );
|
||||
//Console::Append( szBuffer );
|
||||
//Console::Append( TEXT( " " ) );
|
||||
//wprintf( "DLL > Output_SetVolume <%i>\n", volume );
|
||||
//Console::Print( "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()
|
||||
{
|
||||
//wprintf( "OutputPlugin::Start() > Begin <IsLoaded():%i> <bActive:%i> <active_output_count:%i>\n",
|
||||
//Console::Print( "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
|
||||
wprintf( "\n >>> Output plugin '%s' activated\n\n" , GetFilename() );
|
||||
Console::Print( "\n >>> Output plugin '%s' activated\n\n" , GetFilename() );
|
||||
#endif
|
||||
|
||||
bActive = true;
|
||||
|
||||
@@ -60,14 +60,14 @@ void EnableTimer( bool bEnabled )
|
||||
if( bEnabled )
|
||||
{
|
||||
SetTimer( WindowMain, TIMER_SEEK_UPDATE, 1000, NULL );
|
||||
wprintf( "EnableTimer > Activated\n" );
|
||||
Console::Print( "EnableTimer > Activated\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
KillTimer( WindowMain, TIMER_SEEK_UPDATE );
|
||||
StatusReset();
|
||||
|
||||
wprintf( "EnableTimer > Killed\n" );
|
||||
Console::Print( "EnableTimer > Killed\n" );
|
||||
}
|
||||
|
||||
bTimerRunning = bEnabled;
|
||||
@@ -82,7 +82,7 @@ bool OpenPlay( TCHAR * szFilename, int iNumber )
|
||||
{
|
||||
// =======================================================================================
|
||||
#ifdef NOGUI
|
||||
//wprintf( "Playback.cpp: OpenPlay > Begin <%i> <%s>\n" , iNumber, szFilename );
|
||||
//Console::Print( "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( " " );
|
||||
wprintf("OpenPlay > ERROR: Extension not supported\n");
|
||||
Console::Print("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;
|
||||
wprintf("OpenPlay > Input plugin '%s' activated\n", active_input_plugin->GetFilename());
|
||||
Console::Print("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( " " );
|
||||
wprintf("OpenPlay > ERROR: Input plugin is NULL\n");
|
||||
Console::Print("OpenPlay > ERROR: Input plugin is NULL\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Connect
|
||||
//wprintf( "OpenPlay > OutMod\n" );
|
||||
//Console::Print( "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;
|
||||
|
||||
//wprintf( "OpenPlay > GetFileInfo\n" );
|
||||
//Console::Print( "OpenPlay > GetFileInfo\n" );
|
||||
active_input_plugin->plugin->GetFileInfo( szFilename, szTitle, &length_in_ms );
|
||||
|
||||
//wprintf( "OpenPlay > Play\n" );
|
||||
//Console::Print( "OpenPlay > Play\n" );
|
||||
active_input_plugin->plugin->Play( szFilename );
|
||||
// =======================================================================================
|
||||
#endif
|
||||
@@ -218,7 +218,7 @@ bool OpenPlay( TCHAR * szFilename, int iNumber )
|
||||
// Timer ON
|
||||
//EnableTimer( true );
|
||||
|
||||
//wprintf( "OpenPlay > End\n" );
|
||||
//Console::Print( "OpenPlay > End\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ bool Playback::Play()
|
||||
Console::Append( sszBuffer );
|
||||
Console::Append( TEXT( " " ) );
|
||||
#else
|
||||
//wprintf( "Playback::Play() > Begin <%i>\n" , bPlaying );
|
||||
//Console::Print( "Playback::Play() > Begin <%i>\n" , bPlaying );
|
||||
#endif
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
@@ -393,7 +393,7 @@ bool Playback::Play()
|
||||
Console::Append( szBuffer );
|
||||
//Console::Append( TEXT( " " ) );
|
||||
#else
|
||||
//wprintf( "Playback::Play() > Filename <%s>\n", szFilename);
|
||||
//Console::Print( "Playback::Play() > Filename <%s>\n", szFilename);
|
||||
#endif
|
||||
|
||||
// Play
|
||||
|
||||
@@ -125,8 +125,9 @@ void Player_Main(bool Console)
|
||||
|
||||
//MessageBox(0, "main() opened", "", 0);
|
||||
//printf( "main() opened\n" );
|
||||
wprintf( "\n=========================================================\n\n" );
|
||||
wprintf( "DLL > Player_Main() > Begin\n" );
|
||||
Console::Print( "\n=========================================================\n\n\n" );
|
||||
//Console::Print( "DLL > Player_Main() > Begin\n" );
|
||||
Console::Print( "DLL > Settings:\n", bLoop);
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
@@ -135,9 +136,9 @@ void Player_Main(bool Console)
|
||||
Conf::Init( );
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
wprintf( "\n\nDLL > Settings:\n", bLoop);
|
||||
wprintf( "DLL > Loop: %i\n", bLoop);
|
||||
wprintf( "DLL > WarnPluginsMissing: %i\n", bWarnPluginsMissing);
|
||||
|
||||
Console::Print( "DLL > Loop: %i\n", bLoop);
|
||||
Console::Print( "DLL > WarnPluginsMissing: %i\n", bWarnPluginsMissing);
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// =======================================================================================
|
||||
@@ -169,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' );
|
||||
wprintf("DLL > Plugindir: %s\n", szPluginDir);
|
||||
Console::Print("DLL > Plugindir: %s\n", szPluginDir);
|
||||
// =======================================================================================
|
||||
#ifndef NOGUI
|
||||
Font::Create();
|
||||
@@ -182,7 +183,7 @@ void Player_Main(bool Console)
|
||||
//GlobalVolume = Playback::Volume::Get(); // Don't bother with this for now
|
||||
//GlobalCurrentVolume = GlobalVolume;
|
||||
//Output_SetVolume( GlobalVolume );
|
||||
wprintf("DLL > Volume: %i\n\n", GlobalVolume);
|
||||
Console::Print("DLL > Volume: %i\n\n", GlobalVolume);
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -205,10 +206,10 @@ void Player_Main(bool Console)
|
||||
Plugin::FindAll<DspPlugin> ( szPluginDir, TEXT( "dsp_*.dll" ), false );
|
||||
Plugin::FindAll<GenPlugin> ( szPluginDir, TEXT( "gen_*.dll" ), true );
|
||||
|
||||
//wprintf( "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
//Console::Print( "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
PluginManager::Fill();
|
||||
|
||||
//wprintf( "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
//Console::Print( "Winmain.cpp > PluginManager::Fill()\n" );
|
||||
|
||||
|
||||
|
||||
@@ -250,26 +251,26 @@ void Player_Main(bool Console)
|
||||
// Check the plugins
|
||||
if( input_plugins.empty() )
|
||||
{
|
||||
wprintf("\n *** Warning: No valid input plugins found\n\n");
|
||||
Console::Print("\n *** Warning: No valid input plugins found\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintf(" >>> These valid input plugins were found:\n");
|
||||
Console::Print(" >>> These valid input plugins were found:\n");
|
||||
for(int i = 0; i < input_plugins.size(); i++)
|
||||
wprintf(" %i: %s\n", (i + 1), input_plugins.at(i)->GetFilename());
|
||||
wprintf("\n");
|
||||
Console::Print(" %i: %s\n", (i + 1), input_plugins.at(i)->GetFilename());
|
||||
Console::Print("\n");
|
||||
}
|
||||
|
||||
// The input plugins are never activated here, they are activate for each file
|
||||
if( !active_input_plugin || !active_input_plugin->plugin )
|
||||
{
|
||||
// wprintf("The input plugin is not activated yet\n");
|
||||
// Console::Print("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();
|
||||
//wprintf("We are at <%i of %i>\n", ms_cur, ms_len);
|
||||
//Console::Print("We are at <%i of %i>\n", ms_cur, ms_len);
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------
|
||||
if( active_output_count > 0 )
|
||||
@@ -280,11 +281,11 @@ void Player_Main(bool Console)
|
||||
{
|
||||
res_temp = active_output_plugins[ i ]->plugin->GetOutputTime();
|
||||
}
|
||||
wprintf("Playback progress <%i>\n", res_temp);*/
|
||||
Console::Print("Playback progress <%i>\n", res_temp);*/
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintf("\n *** Warning: The output plugin is not working\n\n");
|
||||
Console::Print("\n *** Warning: The output plugin is not working\n\n");
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
@@ -292,14 +293,14 @@ void Player_Main(bool Console)
|
||||
// Start the timer
|
||||
if(!TimerCreated && bLoop) // Only create this the first time
|
||||
{
|
||||
//wprintf("Created the timer\n");
|
||||
//Console::Print("Created the timer\n");
|
||||
MakeTime();
|
||||
TimerCreated = true;
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
wprintf( "\n=========================================================\n\n" );
|
||||
//wprintf( "DLL > main_dll() > End\n\n\n" );
|
||||
Console::Print( "\n=========================================================\n\n" );
|
||||
//Console::Print( "DLL > main_dll() > End\n\n\n" );
|
||||
|
||||
//std::cin.get();
|
||||
}
|
||||
@@ -376,4 +377,4 @@ void close()
|
||||
|
||||
//return 0;
|
||||
}
|
||||
// =======================================================================================
|
||||
// =======================================================================================
|
||||
@@ -4,9 +4,10 @@
|
||||
// ¯¯¯¯¯¯¯¯¯¯
|
||||
#include <iostream> // System
|
||||
|
||||
#include "../../../../Source/Core/Common/Src/Common.h" // Global common
|
||||
#include "Common.h" // Global common
|
||||
#include "ConsoleWindow.h"
|
||||
|
||||
#include "../../Common/Src/Console.h" // Local common
|
||||
//#include "../../Common/Src/Console.h" // Local common
|
||||
|
||||
#include "OutputPlugin.h" // Local
|
||||
#include "Playback.h"
|
||||
@@ -30,7 +31,7 @@ bool Initialized = false;
|
||||
|
||||
|
||||
// -------------------------
|
||||
/* We keep the file in the playlist, even though we currently only every have one file here
|
||||
/* We keep the file in the playlist, even though we currently only ever have one file here
|
||||
at a time */
|
||||
// ---------
|
||||
void AddFileToPlaylist(char * a)
|
||||
@@ -59,21 +60,21 @@ void AddFileToPlaylist(char * a)
|
||||
|
||||
void Player_Play(char * FileName)
|
||||
{
|
||||
wprintf("Play file <%s>\n", FileName);
|
||||
Console::Print("Play file <%s>\n", FileName);
|
||||
|
||||
// Check if the file exists
|
||||
if(GetFileAttributes(FileName) == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
wprintf("Warning: The file <%s> does not exist. Something is wrong.\n", FileName);
|
||||
Console::Print("Warning: The file <%s> does not exist. Something is wrong.\n", FileName);
|
||||
return;
|
||||
}
|
||||
|
||||
Playback::Stop();
|
||||
//wprintf("Stop\n");
|
||||
//Console::Print("Stop\n");
|
||||
playlist->RemoveAll();
|
||||
//wprintf("RemoveAll\n");
|
||||
//Console::Print("RemoveAll\n");
|
||||
AddFileToPlaylist(FileName);
|
||||
//wprintf("addfiletoplaylist\n");
|
||||
//Console::Print("addfiletoplaylist\n");
|
||||
|
||||
// Play the file
|
||||
Playback::Play();
|
||||
@@ -83,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() );
|
||||
//wprintf("Volume(%i)\n", Playback::Volume::Get());
|
||||
//Console::Print("Volume(%i)\n", Playback::Volume::Get());
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
GlobalPause = false;
|
||||
@@ -92,7 +93,7 @@ void Player_Play(char * FileName)
|
||||
void Player_Stop()
|
||||
{
|
||||
Playback::Stop();
|
||||
//wprintf("Stop\n");
|
||||
//Console::Print("Stop\n");
|
||||
playlist->RemoveAll();
|
||||
|
||||
CurrentlyPlayingFile = "";
|
||||
@@ -105,13 +106,13 @@ void Player_Pause()
|
||||
{
|
||||
if (!GlobalPause)
|
||||
{
|
||||
wprintf("DLL > Pause\n");
|
||||
Console::Print("DLL > Pause\n");
|
||||
Playback::Pause();
|
||||
GlobalPause = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintf("DLL > UnPause from Pause\n");
|
||||
Console::Print("DLL > UnPause from Pause\n");
|
||||
Player_Unpause();
|
||||
GlobalPause = false;
|
||||
}
|
||||
@@ -119,7 +120,7 @@ void Player_Pause()
|
||||
|
||||
void Player_Unpause()
|
||||
{
|
||||
wprintf("DLL > UnPause\n");
|
||||
Console::Print("DLL > UnPause\n");
|
||||
Playback::Play();
|
||||
GlobalPause = false;
|
||||
}
|
||||
@@ -135,7 +136,7 @@ void Player_Unpause()
|
||||
void Player_Mute(int Vol)
|
||||
{
|
||||
if(GlobalVolume == -1) GlobalVolume = Vol;
|
||||
wprintf("DLL > Mute <%i> <%i>\n", GlobalVolume, GlobalMute);
|
||||
Console::Print("DLL > Mute <%i> <%i>\n", GlobalVolume, GlobalMute);
|
||||
|
||||
GlobalMute = !GlobalMute;
|
||||
|
||||
@@ -143,15 +144,15 @@ void Player_Mute(int Vol)
|
||||
if(GlobalMute)
|
||||
{
|
||||
Output_SetVolume( 0 );
|
||||
wprintf("DLL > Volume <%i>\n", GlobalMute);
|
||||
Console::Print("DLL > Volume <%i>\n", GlobalMute);
|
||||
}
|
||||
else
|
||||
{
|
||||
Output_SetVolume( GlobalVolume );
|
||||
wprintf("DLL > Volume <%i>\n", GlobalMute);
|
||||
Console::Print("DLL > Volume <%i>\n", GlobalMute);
|
||||
}
|
||||
|
||||
//wprintf("Volume(%i)\n", Playback::Volume::Get());
|
||||
//Console::Print("Volume(%i)\n", Playback::Volume::Get());
|
||||
}
|
||||
///////////////////////////////////////
|
||||
|
||||
@@ -160,12 +161,12 @@ void Player_Volume(int Vol)
|
||||
{
|
||||
GlobalVolume = Vol;
|
||||
Output_SetVolume( GlobalVolume );
|
||||
//wprintf("DLL > Volume <%i> <%i>\n", GlobalVolume, GlobalCurrentVolume);
|
||||
//Console::Print("DLL > Volume <%i> <%i>\n", GlobalVolume, GlobalCurrentVolume);
|
||||
}
|
||||
|
||||
void ShowConsole()
|
||||
{
|
||||
StartConsoleWin(100, 2000, "MusicMod"); // give room for 2000 rows
|
||||
Console::Open(100, 2000, "MusicMod", true); // give room for 2000 rows
|
||||
}
|
||||
|
||||
|
||||
@@ -177,4 +178,4 @@ void Player_Console(bool Console)
|
||||
#if defined (_WIN32)
|
||||
FreeConsole();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
if( 0 > iIndex || iIndex >= ( int )_database.size() )
|
||||
{
|
||||
wprintf("SetCurIndex > Return");
|
||||
Console::Print("SetCurIndex > Return");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ extern bool GlobalPause;
|
||||
void CALLBACK Update(unsigned int,unsigned int,unsigned long,unsigned long,unsigned long)
|
||||
#endif
|
||||
{
|
||||
//wprintf("DLL > Update() > Begin (%i)\n", active_input_plugin);
|
||||
//Console::Print("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)
|
||||
{
|
||||
//wprintf("The input plugin is not activated yet\n");
|
||||
//Console::Print("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
|
||||
{
|
||||
//wprintf("Playback progress <%i of %i>\n", ms_cur, ms_len);
|
||||
//Console::Print("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
|
||||
{
|
||||
wprintf("Restart <%s>\n", CurrentlyPlayingFile.c_str());
|
||||
Console::Print("Restart <%s>\n", CurrentlyPlayingFile.c_str());
|
||||
Player_Play((char *)CurrentlyPlayingFile.c_str());
|
||||
}
|
||||
}
|
||||
// --------------
|
||||
|
||||
//wprintf("Make new time\n");
|
||||
//Console::Print("Make new time\n");
|
||||
MakeTime(); // Make a new one
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ int MainTimer()
|
||||
// cout << ".";
|
||||
//}
|
||||
|
||||
//wprintf("MakeTime\n");
|
||||
//Console::Print("MakeTime\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
///////////////////////////
|
||||
///////////////////////////
|
||||
Reference in new issue
Block a user