Click here to Skip to main content
15,886,362 members
Articles / Desktop Programming / Win32

Windows Audio Mixer API Wrapper Library

Rate me:
Please Sign up or sign in to vote.
4.11/5 (12 votes)
20 Oct 2008CPOL5 min read 122.3K   5K   27  
A small wrapper library to programmatically interact with standard audio controls
// -----------------------------------------------------------------------------
// ControlsDialog.h
//
//  Copyright (C) 2008 Peter C. Studt
//
//  This software is provided 'as-is', without any express or implied
//  warranty.  In no event will the author be held liable for any damages
//  arising from the use of this software. It can be redistributed and/or 
//  modified under the terms of The Code Project Open License (CPOL)
//
// -----------------------------------------------------------------------------

#pragma once

// CControlsDialog dialog

// -----------------------------------------------------------------------------
class CControlsDialog : public CDialog
{
	DECLARE_DYNAMIC(CControlsDialog)

public:
	CControlsDialog(CWnd* pParent = NULL);   // standard constructor
	virtual ~CControlsDialog();

	void SetDisplayValues( MIXERCONTROL* sMcData );
	void SetCustomDlgData() ;
	void SetTitle(CString csTitle) ;

// Dialog Data
	enum { IDD = IDD_CONTROLS_DIALOG };

protected:
	MIXERCONTROL mMixerControl ;
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

	// 14 Text fields in dialog: 
    UINT	mdwControlID		;	// IDC_STATIC_CONTROL_ID		dw ID value
    CString	mdwControlType		;	// IDC_STATIC_CS_CT				Custom, comprised of a 
	CString	mcsControlType_Class;	// IDC_STATIC_CS_CT_CLASS		Class field and a
	CString mcsControlType_Type	;	// IDC_STATIC_CS_CT_TYPE		Type field
    CString	mcsFdwControl		;	// IDC_STATIC_CS_FDW_CONTROL	Custom, can be any combination of:
	CString	mcsFwdControl_Dis	;	// IDC_STATIC_CS_DISABLED		MIXERCONTROL_CONTROLF_DISABLED
	CString	mcsFwdControl_Mult	;	// IDC_STATIC_CS_MULTIPLE		MIXERCONTROL_CONTROLF_MULTIPLE
	CString	mcsFwdControl_Unif	;	// IDC_STATIC_CS_UNIFORM		MIXERCONTROL_CONTROLF_UNIFORM
    UINT	mcMultipleItems		;	// IDC_STATIC_CS_MULTIPLE_ITEMS	Items per channel 
    CString	mszShortName		;	// IDC_STATIC_CS_SZ_SHORT_NAME  
    CString	mszName				;	// IDC_STATIC_CS_SZ_NAME  
	UINT	mBoundsMin			;	// IDC_STATIC_BOUNDS_MIN  
	UINT	mBoundsMax			;	// IDC_STATIC_BOUNDS_MAX  
	UINT	mMetrics			;	// IDC_STATIC_METRICS			DWORD, cSteps or cbCustomData, 
									//								typically the number of steps in the 
									//								"Bounds" range.
} ;

// -----------------------------------------------------------------------------

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 Code Project Open License (CPOL)


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions