Click here to Skip to main content
15,885,546 members
Articles / Desktop Programming / WTL

Multidevice ASIO output plugin for WinAMP

Rate me:
Please Sign up or sign in to vote.
4.80/5 (9 votes)
13 Feb 2009CDDL27 min read 48.1K   728   23  
A tiny WinAMP output DLL that uses a C++ replacement of the official ASIO SDK that supports multiple ASIO devices.
#pragma once

#include "stdafx.h"

#ifdef TINY_ATL

    #undef __STDC_WANT_SECURE_LIB__
    #undef __STDC_SECURE_LIB__

    //  Ugly hacks to disable SEH and synchronization (since WTL does not
    // provide a cleaner way) which are not needed for the simple usage that
    // TINY_ATL is meant for.
    #define __try
    #define __except( x ) if (0)
    #define __finally
    #define RaiseException( dwExceptionCode, dwExceptionFlags, nNumberOfArguments, lpArguments ) dwExceptionFlags; nNumberOfArguments; lpArguments; ::exit( dwExceptionCode )
    #define EnterCriticalSection(      pCS ) CRITICAL_SECTION; pCS;
    #define InitializeCriticalSection( pCS ) CRITICAL_SECTION; pCS;
    #define LeaveCriticalSection(      pCS ) CRITICAL_SECTION; pCS;
    #define DeleteCriticalSection(     pCS ) CRITICAL_SECTION; pCS;

    // atlapp.h: #error WTL requires that _ATL_NO_COMMODULE is not defined
    //#define _ATL_NO_COMMODULE

    #define _ATL_MIN_CRT    // WTL still seems to use/allow it.

    #define ATLENSURE ATLVERIFY

    #define AtlThrow exit

#endif

#include <atlbase.h>
#include <atlapp.h>

#include <atlwin.h>

#include <atlcrack.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlframe.h>
#include <atlmisc.h>

#ifdef TINY_ATL

    // TINY_ATL hacks cleanup.
    #undef __try
    #undef __except
    #undef __finally
    #undef RaiseException
    #undef EnterCriticalSection
    #undef InitializeCriticalSection
    #undef LeaveCriticalSection
    #undef DeleteCriticalSection

#endif

namespace WTL
{
bool Initialize( HINSTANCE, DWORD commonControlFlags = 0, CMessageLoop * pDefaultMessageLoop = 0 );
void Uninitialize();

CMessageLoop & DefaultMessageLoop();
}


bool InitializeCOM( DWORD comInitializationFlags );

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
Software Developer Little Endian Ltd.
Croatia Croatia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions