Click here to Skip to main content
15,894,343 members
Articles / Desktop Programming / MFC

Simple Mixer Control Wrapper

Rate me:
Please Sign up or sign in to vote.
4.54/5 (12 votes)
9 Jan 2000 215.4K   2.6K   42  
A small audio mixer control wrapper
//////////////////////////////////////////////////////////////////////
// AlexfMixer.h: interface for the CAlexfMixer class.
// CAlexfMixer - simple mixer control wrapper
// Copyright (C) Alexander Fedorov 1999
// You may do whatever you want with this code, as long as you include this
// copyright notice in your implementation files.
// If you wish to add new classes to this collection, feel free to do so.
// But please send me your code so that I can update the collection.
// Comments and bug reports: lamer2000@usa.net
//////////////////////////////////////////////////////////////////////
//                                      ,     ,     ,
//                                      `$,    $,   `$,      ;
//                                       `$+   `$,   `$,    d;     ,
//                                        `$b,  `$,   $$,  d$'   ,$
//                                         `$$+  l$+  ;$$ d$$   ,$'    ,
//  $$$$,  $$  $$  $$, $$  $$ ,$'           `$$b,;$$b,$$$$$$; ,d$$   ,$
//  $$  $  $$  $$  $$$,$$  $$,$'             `$$$b$$$$$$$$$$$$$$$; ,d$'
//  $$  $  $$  $$  $$`$$$  $$$$,              `$$$*""""~~""^+$$$$$$$$P    ,,
//  $$$$'  $$  $$  $$ `$$  $$`$$,             *^              ~^"$$$$;_,s$'
//  $$     `$$$$'  $$  $$  $$ `$$,          ,^                    `$$$$$$'    _
//                                         ,'                       `$$$'  ,y$"
//                                         '                         `$$,y$$"
//      $$, $$  ,$$$$, $$$$$$             (                           `$$$$'
//      $$$,$$  $$  $$   $$             ,^       ,,,         ,,,yyyyy,,`$$$$$#=-
//      $$`$$$  $$  $$   $$             `\,  ,,/'^  ``      `$$$$$$$$$$d;$$$~
//      $$ `$$  $$  $$   $$              /' ,$$*=``-     `$b`?$$$$$$$$$$;$$$b,
//      $$  $$  `$$$$'   $$            ,'   `^*;-=''    `$$$$$$$#$$$$$$$;$$$+$b.
//                                    (,,,;,             `+$+",+y+`?$$$$;$b,
//                                     `;``"                 ]$& $';$$$$d$$$b,
//  $$$$$,  $$$$$  ,$$$$,  $$$$$,     ,yyy,,                �@@&`'d$$$$d$P""+$,
//  $$  $$  $$     $$  $$  $$  $$     \?`^"$@by,            ~+>^,$$$$$d$$b,
//  $$  $$  $$$$   $$  $$  $$  $$     ,&~`^"+?~#`        ,yb, ,?$$$$$d$$$$b,
//  $$  $$  $$     $$$$$$  $$  $$    '   $    ,      ,,yd$$$$$-+-$$$d$$~~"+;
//  $$  $$  $$     $$  $$  $$  $$   /   '$, $$$yyyyy$$$$$" ,$$$�$$$d$$$b,
//  $$$$$'  $$$$$  $$  $$  $$$$$'  `-=##$$$$$$$$$$$$$$^~  ,$$$$$$$R$'~  ~`
//                                       ~~"$$$$$$$$$'   ,$$$$$$$D$'
//                                           `#$$$$$'   ,$$$`,$$Z$$
//                                             `#$$'   ,$@P',$$o$$'
//                                               `'=*yd$$P',$$N$P'
//                                                    ~~~"�$+"~
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ALEXFMIXER_H__4FC2F321_07F3_11D3_9864_CB4A97E7D6CA__INCLUDED_)
#define AFX_ALEXFMIXER_H__4FC2F321_07F3_11D3_9864_CB4A97E7D6CA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <mmsystem.h>

// Thanks to Langis Pitre
#define NO_SOURCE ((MIXERLINE_COMPONENTTYPE_SRC_LAST + 1))

class CAlexfMixer
{
protected:
	HMIXER m_HMixer;
	INT m_iMixerControlID;
	MMRESULT mmr;
	DWORD m_dwChannels;
	BOOL m_bSuccess;
	void ZeroAll();
public:
	BOOL IsOk() {return m_bSuccess;};
	BOOL On();
	BOOL Off();
	DWORD GetControlValue();
	BOOL SetControlValue(DWORD dw);
	CAlexfMixer(DWORD DstType, DWORD SrcType, DWORD ControlType);
	CAlexfMixer(HWND hwnd, DWORD DstType, DWORD SrcType, DWORD ControlType);
	virtual ~CAlexfMixer();
};

#endif // !defined(AFX_ALEXFMIXER_H__4FC2F321_07F3_11D3_9864_CB4A97E7D6CA__INCLUDED_)

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer SEO
Russian Federation Russian Federation
AlexF's Blog in Russian
Owner Spy competition analysis
Rating Burner Rating of blogs

Comments and Discussions