Show glue.cpp syntax highlighted
/***************************************************************************
glue.cpp - Export symbols for engine
-------------------
begin : Wed Mar 17 2004
copyright : (C) 2004 by Reality Rift Studios
email : mattias@realityrift.com
***************************************************************************
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is the NeoEngine, NeoDevALSA, glue.cpp
The Initial Developer of the Original Code is Mattias Jansson.
Portions created by Mattias Jansson are Copyright (C) 2004
Reality Rift Studios. All Rights Reserved.
***************************************************************************/
#include "device.h"
#include "link.h"
#include <neoengine/core.h>
#include <neoengine/module.h>
using namespace NeoEngine;
namespace NeoALSA
{
#define ALSAEXPORT
ModuleStatic *g_pkStaticModule = 0;
ALSAEXPORT void GetVersion( std::string *pstrName, int *piMajor, int *piMinor, int *piRevision )
{
std::string strDevInfo =
# ifdef _DEBUG
"ALSA [DEBUG]";
# else
"ALSA";
# endif
*pstrName = strDevInfo;
*piMajor = NEOENGINEVERSION_MAJOR;
*piMinor = NEOENGINEVERSION_MINOR;
*piRevision = NEOENGINEVERSION_REVISION;
}
ALSAEXPORT int Initialize()
{
return 0;
}
ALSAEXPORT int Shutdown()
{
delete g_pkStaticModule;
return 0;
}
ALSAEXPORT NeoEngine::AudioDevice *CreateDevice( FileManager *pkFileManager )
{
return new NeoALSA::AudioDevice( pkFileManager );
}
Link::Link()
{
#if defined(WIN32) && defined(_DEBUG)
g_pkStaticModule = new ModuleStatic( "neodevalsa_debug" );
#else
g_pkStaticModule = new ModuleStatic( "neodevalsa" );
#endif
g_pkStaticModule->m_Symbols.Insert( "GetVersion", (void**)GetVersion );
g_pkStaticModule->m_Symbols.Insert( "Initialize", (void**)Initialize );
g_pkStaticModule->m_Symbols.Insert( "Shutdown", (void**)Shutdown );
g_pkStaticModule->m_Symbols.Insert( "CreateDevice", (void**)CreateDevice );
NeoEngine::Core::GetModuleManager()->InsertModule( g_pkStaticModule );
}
};
See more files for this project here