Click here to Skip to main content
15,892,199 members
Articles / Desktop Programming / MFC

SDI (Sound Device Interface)--A library for Auditory Display

Rate me:
Please Sign up or sign in to vote.
4.60/5 (3 votes)
2 May 20046 min read 110.4K   3.7K   45  
A GDI-like API for 3D positioning of speech, and MIDI composition using a single string.
/******************************************************************
News Everywhere 1.0

Copyright (c) 2004 by ����  
All rights reserved.

This file is part of NewsEverywhere.

    NewsEverywhere is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    NewsEverywhere is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with NewsEverywhere; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

For any suggestion or failure report, please contact me by:
e-mail: jonathan1983@126.com
////////////////////////////////////////////////////////////////////////////////
File Name: NewsEverywhereMFCDlg.h


********************************************************************/

#if !defined(AFX_NEWSEVERYWHEREMFCDLG_H__01004941_66EF_4E88_9233_160B5F528BBB__INCLUDED_)
#define AFX_NEWSEVERYWHEREMFCDLG_H__01004941_66EF_4E88_9233_160B5F528BBB__INCLUDED_

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


#include "NewsBar.h"

#include "parser.h"
#include <wininet.h>

#include "sdi.h"

/////////////////////////////////////////////////////////////////////////////
// CNewsEverywhereMFCDlg dialog



class CNewsEverywhereMFCDlg : public CDialog
{
// Construction
public:
	CNewsEverywhereMFCDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CNewsEverywhereMFCDlg)
	enum { IDD = IDD_NEWSEVERYWHEREMFC_DIALOG };
	CButton	m_switchHotkey;
	CSliderCtrl	m_speed;
	CComboBox	m_category;
	CComboBox	m_site;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNewsEverywhereMFCDlg)
	public:
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CNewsEverywhereMFCDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnCloseupSite();
	afx_msg void OnCloseupCategory();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnMenu();
	afx_msg void OnExit();
	afx_msg void OnReleasedcaptureSpeed(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSwitchHotkey();
	//}}AFX_MSG
	afx_msg LRESULT OnKeyCaptured(WPARAM wParam, LPARAM lParam);
	afx_msg void    OnTitleSelected(UINT nID);
	afx_msg void    OnGotoTitle();
	afx_msg void    OnGotoContent();
	afx_msg LRESULT	OnSysbarNotification(WPARAM wParam, LPARAM lParam);
	LRESULT OnPlayContent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnSwitchTitle(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnSwitchContent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnTitleUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnTitleDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	DECLARE_MESSAGE_MAP()
public:
	CNewsBar m_newsBar;
	HOOKPROC  m_hookProc;
	HMODULE   m_hSUIInput;
	HHOOK     m_hHook;

private:
	int GetTestText(int nType, PTSTR psText);
	void Minimize();
	void GotoPage(int nIndex);
	void PlayContent(int nIndex);
	void PlayTitle();
	int GetUrlText(PTSTR psBuffer,DWORD dwSize, PCTSTR psUrl);
	void ParseCategory();
	DWORD m_dwStatus;

	int	 m_nBGMIndex;
	int  m_nParserSel;
	int  m_nCategorySel;
	int  m_nTitleSel;
	int  m_nPrevPlayItem;		// Index of source
	int  m_nPrevPlayContent;	// Index of source

	// Item(Title) Displaying
	TITLE*			m_pTitle;
	int				m_nTitle;
	int				m_nTitleCurPlay;
	CRITICAL_SECTION m_cs;

	int				m_nContentCurPlay;

	// Parser Variables
	INT				m_nParser;
	PARSERDESC**	m_pParserDesc;
	DWORD			m_dwLanguage;
	HMODULE*		m_pParserModule;
	
	HINTERNET		m_hRoot;

	PTSTR			m_psPrevContent;

	// SDI Sound Object
	HSPEECH			m_hTitle;
	HSPEECH			m_hContent;
	HEARCON			m_hEarcon;

	HWND m_hWnd;
	CRect m_rcPrev;
	HDC  m_hDC;
	int  m_nPrevMixMode;

	int  EnumerateParser();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NEWSEVERYWHEREMFCDLG_H__01004941_66EF_4E88_9233_160B5F528BBB__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
Engineer
China China
A student at Zhejiang University, Zhejiang, China.
Major in Automation.
Now I want to study machine vision and robotics, but I'm really consumed with choices between hardware and software, and between research and engineering.
I'll be glad if you can give some suggestions.

Comments and Discussions