Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Multidevice ASIO output plugin for WinAMP

, 13 Feb 2009
A tiny WinAMP output DLL that uses a C++ replacement of the official ASIO SDK that supports multiple ASIO devices.
// configDlg.hpp : interface of the ConfigurationDialog class
//
////////////////////////////////////////////////////////////////////////////////

#pragma once

#include "gui.hpp"
#include "ASIODevice.hpp"
#include "resource.h"


////////////////////////////////////////////////////////////////////////////////
//
//  ConfigurationDialog
//  -------------------
//
//  Implements the Wasiona configuration control panel.
//
////////////////////////////////////////////////////////////////////////////////

class ConfigurationDialog : public ATL::CDialogImpl<ConfigurationDialog>
{
public:
    ConfigurationDialog();

    enum { IDD = IDD_CONFIGURATION };


private:  // Message map/window procedure.
    BEGIN_MSG_MAP( ConfigurationDialog )
	    COMMAND_ID_HANDLER( IDOK                 , OnOK                   )
	    COMMAND_ID_HANDLER( IDCANCEL             , OnCancel               )
        COMMAND_ID_HANDLER( ID_AddDevice         , OnAddDeviceToList      )
        COMMAND_ID_HANDLER( ID_RemoveDevice      , OnRemoveDeviceFromList )
        COMMAND_ID_HANDLER( ID_DeviceControlPanel, OnDeviceControlPanel   )
        COMMAND_CODE_HANDLER( LBN_SELCHANGE, OnChosenDevicesSelectionChange )
        COMMAND_CODE_HANDLER( LBN_SELCANCEL, OnChosenDevicesSelectionCancel )
        NOTIFY_CODE_HANDLER_EX( TBN_DROPDOWN, OnVolumeMenu )
        NOTIFY_ID_HANDLER_EX( IDC_URL, OnURL )
        MSG_WM_INITDIALOG( OnInitDialog )
    END_MSG_MAP()

private: // Message/event handlers.
    // Handler prototypes (uncomment arguments if needed):
    //	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    //	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
    //	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

    bool OnInitDialog( HWND defaultFocusControl, LPARAM lInitParam );
    void OnDestroy();

    LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
    LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

    LRESULT OnAddDeviceToList             ( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL & bHandled );
    LRESULT OnRemoveDeviceFromList        ( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL & bHandled );
    LRESULT OnChosenDevicesSelectionChange( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL & bHandled );
    LRESULT OnChosenDevicesSelectionCancel( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL & bHandled );
    LRESULT OnDeviceControlPanel          ( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL & bHandled );
    LRESULT OnVolumeMenu                  ( NMHDR const *                                             );
    LRESULT OnURL                         ( NMHDR const *                                             );
    
private:
    InDialogPropertySheet       & devicesSheet()       { return asioDevices_  ; }
    InDialogPropertySheet const & devicesSheet() const { return const_cast<ConfigurationDialog &>( *this ).asioDevices_; }
    ASIODriverList        const & driverList  () const { return asioDrivers_; }
    WTL::CListBox               & chosenDevices() { assert( chosenDevices_ && ::IsWindow( chosenDevices_ ) ); return chosenDevices_; }

    void closeDialog( int returnCode );
    void enableDeviceDependentButtons( bool const enable = true );
    void enableOKButton();
    void setDeviceListChanged() { deviceListChanged_ = true; enableOKButton(); }
    void setNewVolumeControler( unsigned long const newVolumeControler );

private:
    ASIODriverList        const asioDrivers_       ;
    InDialogPropertySheet       asioDevices_       ;
    WTL::CListBox               chosenDevices_     ;
    WTL::CToolBarCtrl           addRemoveToolbar_  ;
    WTL::CToolBarCtrl           setupToolbar_      ;
    bool                        deviceListChanged_ ;
    unsigned long               newVolumeControler_;
};

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)

About the Author

Domagoj Šarić
Software Developer Little Endian Ltd.
Croatia Croatia
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 13 Feb 2009
Article Copyright 2009 by Domagoj Šarić
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid