资源简介
此文件是一个音乐播放器的源程序,设计实现播放mp3格式的文件,在vc++中可以直接调试运行,对编程初学者有很好的启发作用。

代码片段和文件信息
//////////////////////////////////////////////////////////////////////
// AlexfMixer.cpp: implementation of 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
//////////////////////////////////////////////////////////////////////
// download by http://www.codefans.net
#include “stdafx.h“
#include “AlexfMixer.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
void CAlexfMixer::ZeroAll()
{
m_HMixer = NULL;
m_iMixerControlID = 0;
mmr = MMSYSERR_NOERROR;
m_dwChannels = 0;
m_bSuccess = FALSE;
}
CAlexfMixer::CAlexfMixer(DWORD DstType DWORD SrcType DWORD ControlType)
{
ZeroAll();
if(mixerGetNumDevs() < 1) return;
mmr = mixerOpen(&m_HMixer 0 0 0L CALLBACK_NULL);
if (mmr != MMSYSERR_NOERROR) return;
// get dwLineID
MIXERLINE mxl;
mxl.cbStruct = sizeof(MIXERLINE);
// DstType
mxl.dwComponentType = DstType;
if (mixerGetLineInfo((HMIXEROBJ)m_HMixer &mxl MIXER_objectF_HMIXER | MIXER_GETLINEINFOF_COMPONENTTYPE)
!= MMSYSERR_NOERROR) return;
// SrcType
if( SrcType != NO_SOURCE )
{
UINT nconn = mxl.cConnections;
DWORD DstIndex = mxl.dwDestination;
for( UINT j = 0; j < nconn; j++ )
{
mxl.cbStruct = sizeof( MIXERLINE );
mxl.dwSource = j;
mxl.dwDestination = DstIndex;
if(mixerGetLineInfo( ( HMIXEROBJ )m_HMixer
&mxl MIXER_GETLINEINFOF_SOURCE ) != MMSYSERR_NOERROR) return;
if( mxl.dwComponentType == SrcType ) break;
}
}
// get dwControlID
MIXERCONTROL mxc;
MIXERLINECONTROLS mxlc;
mxlc.cbStruct = sizeof(MIXERLINECONTROLS);
mxlc.dwLineID = mxl.dwLineID;
mxlc.dwControlType = ControlType;
mxlc.cControls = 1;
mxlc.cbmxctrl = sizeof(MIXERCONTROL);
mxlc.pamxctrl = &mxc;
if (mixerGetLineControls((HMIXEROBJ)m_HMixer &mxlc MIXER_objectF_HMIXER | MIXER_GETLINECONTROLSF_ONEBYTYPE) != MMSYSERR_NOERROR) return;
m_iMixerControlID = mxc.dwControlID;
m_dwChannels = mxl.cChannels;
m_bSuccess = TRUE;
}
CAlexfMixer::CAlexfMixer(HWND hwnd DWORD DstType DWORD SrcType DWORD ControlType)
{
ZeroAll();
if(mixerGetNumDevs() < 1) return;
mmr = mixerOpen(&m_HMixer 0 (DWORD)hwnd 0L CALLBACK_WINDOW);
if (mmr != MMSYSERR_NOERROR) return;
// get dwLineID
MIXERLINE mxl;
mxl.cbStruct = sizeof(MIXERLINE);
// DstType
mxl.dwComponentType = DstType;
if (mixerGetLineInfo((HMIXEROBJ)m_HMixer &mxl MIXER_objectF_HMIXER | MIXER_GETLINEINFOF_COMPONENTTYPE)
!
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5349 2009-10-06 14:03 MusicPla
文件 3801 1999-05-17 03:06 MusicPla
文件 1956 2003-01-26 20:45 MusicPla
文件 59344 2009-10-06 14:03 MusicPla
文件 9852 2003-01-11 22:48 MusicPla
文件 11660 2002-11-08 13:51 MusicPla
文件 796 1998-11-24 16:33 MusicPla
文件 11478 2009-10-06 14:03 MusicPla
文件 5149 2002-11-10 07:56 MusicPla
文件 8790 2009-10-06 14:03 MusicPla
文件 1820 2003-01-25 22:56 MusicPla
文件 245780 2011-06-23 19:13 MusicPla
文件 2869 2011-06-23 19:18 MusicPla
文件 2113 2009-10-06 14:04 MusicPla
文件 5127 2003-01-26 20:44 MusicPla
文件 537 2003-01-12 14:02 MusicPla
文件 1335 2003-01-12 14:02 MusicPla
文件 326 2011-06-23 19:15 MusicPla
文件 82944 2011-06-23 19:18 MusicPla
文件 49664 2011-06-23 19:18 MusicPla
文件 2347 2011-06-23 19:11 MusicPla
文件 7802 2003-01-26 17:54 MusicPla
文件 18805 2009-10-06 14:04 MusicPla
文件 3548 2003-01-26 20:02 MusicPla
文件 7690 2009-10-06 14:04 MusicPla
文件 4220 2003-01-13 20:19 MusicPla
文件 4058 1998-11-24 19:16 MusicPla
文件 308 2003-01-18 11:59 MusicPla
文件 31798 2003-01-14 17:03 MusicPla
文件 17014 2003-01-14 17:05 MusicPla
............此处省略16个文件信息
- 上一篇:欧姆龙 PLC 通讯 dll
- 下一篇:14个经典DSP实验测试程序_C语言
相关资源
- 国际象棋的qt源代码
- C语言开发实战宝典
- 小甲鱼C语言课件 源代码
- c语言看发的网络协议 ,源代码
- C语言实现的DES对称加密算法
- 数据结构,迷宫问题C语言版源代码
- C语言 学生信息管理系统 源代码
- C语言版3D魔方游戏源代码
- qt媒体播放器
- QT5开发及源代码
- QT视频播放器(基于FFmpeg)
- USB CAN Tool 源代码(LabVIEW 2011环境)
- 超声波水表源代码
- 一个模糊PID温度控制算法源代码
- 数据结构 图的遍历源代码
- 数据结构实验源代码集
- TCP/IP客户端和服务器端源代码,好用
- MFC视频播放器源码(支持avi/wma/mp3等格
- 交互式计算机图形学 第六版 OpenGL源代
- 数据结构教程李春葆第五版书中例题
- 三次样条插值类源代码!
- diy写字机grbl v1.1源代码
- C语言常用算法源代码
- 关于LED制作的源代码合集(38套)
-
STM32-ba
se64加密源代码 - 51超声波避障源代码
- 一个C++实现的源代码行数统计工具
- ZZULIOJ部分答案C语言免费.7z
- 吉他调音软件源代码
- 连连看源代码C语言版
评论
共有 条评论