• PUDN用户
    了解作者
  • Visual C++
    开发工具
  • 449KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 89
    下载次数
  • 2009-04-08 17:12
    上传日期
网络视频监控源代码,用VC6.0开发,用很大的参考意义
NET-VIDEO.rar
  • 网络视频project
  • Mixer
  • VolumeOutWave.cpp
    14.1KB
  • VolumeInXXX.cpp
    17.3KB
  • VolumeOutMaster.cpp
    14.6KB
  • prj
  • Debug
  • nettalk.opt
    72KB
  • G729a.lib
    94.1KB
  • nettalk.ncb
    153KB
  • nettalk.dsw
    533B
  • Main.dsp
    18.8KB
  • Codec
  • CodecMgr.cpp
    4.9KB
  • output
  • main
  • include
  • SlideBar.h
    899B
  • VolumeOutMaster.h
    1.8KB
  • TrayNotify.h
    2.2KB
  • VolumeInXXX.h
    2.2KB
  • DataBase.h
    411B
  • CmdMgr.h
    849B
  • AudioRec.h
    849B
  • AVIOMgr.h
    8.1KB
  • WaveShow.h
    1.6KB
  • Hash.h
    1.2KB
  • AVFile.h
    1.3KB
  • Splash.h
    649B
  • RippleWnd.h
    1.3KB
  • UDPSocket.h
    1.7KB
  • AudioPlay.h
    699B
  • G729a.h
    1.2KB
  • CoolBtn.h
    996B
  • VideoCapture.h
    854B
  • CodecMgr.h
    1.3KB
  • AddrBook.h
    1016B
  • GDIX.H
    1.5KB
  • NewMsgBox.h
    1.1KB
  • WaveOut.h
    1.1KB
  • VolumeOutWave.h
    1.8KB
  • Common.h
    717B
  • ddutil.h
    1KB
  • GraphDlg.h
    1.1KB
  • MsgBox.h
    975B
  • Main.h
    4.9KB
  • IVolume.h
    834B
  • wavein.h
    1.4KB
  • VolumeCtrl.h
    764B
  • MsgTalk.h
    1.1KB
  • VideoWnd.h
    1.5KB
  • WndX.h
    8.2KB
  • WndX
  • WndX.cpp
    13.8KB
  • UDPSocket.cpp
    5.6KB
  • Hash.cpp
    3.5KB
  • GDIX.CPP
    6.8KB
  • TrayNotify.cpp
    4.6KB
  • UI
  • RippleWnd.cpp
    7.2KB
  • GraphDlg.cpp
    7KB
  • VideoWnd.cpp
    15.3KB
  • AddrBook.cpp
    6.3KB
  • SlideBar.cpp
    4.5KB
  • CoolBtn.cpp
    5.3KB
  • Splash.cpp
    1.7KB
  • NewMsgBox.cpp
    3.9KB
  • MsgTalk.cpp
    6.3KB
  • ddutil.cpp
    8KB
  • MsgBox.cpp
    6.4KB
  • AVIO
  • AudioPlay.cpp
    1.9KB
  • AVIOMgr.cpp
    28KB
  • WaveShow.cpp
    6.3KB
  • VideoCapture.cpp
    3.3KB
  • wavein.cpp
    2.7KB
  • AudioRec.cpp
    2.9KB
  • VolumeCtrl.cpp
    3.2KB
  • WaveOut.cpp
    2.7KB
  • Main
  • res
  • close1.bmp
    1.2KB
  • video2.bmp
    110.7KB
  • call3.bmp
    2.6KB
  • saveframe2.bmp
    1.2KB
  • video_onoff5.bmp
    1.3KB
  • min3.bmp
    1.2KB
  • videotitle4.bmp
    2.7KB
  • addr1.bmp
    2.6KB
  • videotitle3.bmp
    2.7KB
  • addr3.bmp
    2.6KB
  • video_local3.bmp
    1.3KB
  • Thumbs.db
    100KB
  • call1.bmp
    2.6KB
  • help3.bmp
    1.2KB
  • zoom2.bmp
    1.2KB
  • video3.bmp
    31.2KB
  • about3.bmp
    1.2KB
  • face.bmp
    64KB
  • video_outview3.bmp
    1.3KB
内容介绍
//NetTalk /*------------------------------------------------------------------------------*\ ============================= 模块名称: Main.cpp ============================= [版权] 2000-2002 115软件工厂 版权所有 \*------------------------------------------------------------------------------*/ #include "wndx.h" #include <Windowsx.h> #include <VFW.h> #include <stdio.h> #include "waveshow.h" #include "resource.h" #include "Splash.h" #include "AVIOMgr.h" #include "VolumeOutWave.h" #include "VolumeInXXX.h" #include "VideoWnd.h" #include "TrayNotify.h" #include "SlideBar.h" #include "AddrBook.h" #include "GraphDlg.h" #include "RippleWnd.h" #include "NewMsgBox.h" #include "MsgTalk.h" #include "Main.h" /*------------------------------------------------------------------------------*/ #define PORT 1159//the default port is 1159 CMainWnd MainWnd; CAVIOMgr AVIO; SETUP CSetupDlg::Setup; /*------------------------------------------------------------------------------*/ // int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow) { //初始化WndX系统 InitXSystem(hInstance); /* INITIALIZE COMMON CONTROLS */ INITCOMMONCONTROLSEX iccex; iccex.dwICC = ICC_WIN95_CLASSES; iccex.dwSize = sizeof(INITCOMMONCONTROLSEX); InitCommonControlsEx(&iccex); //确保只有一个实例 HANDLE hMutex=CreateMutex(0,FALSE,"NETTALK_MUTEX_ONCE"); if(hMutex) { if(GetLastError()==ERROR_ALREADY_EXISTS) return 0; } //显示软件封面 CSplash* Splash=new CSplash(3000); Splash->CreateSplash(IDD_SPLASH); //初始化Socket InitializeSocket(); //初始化AVIO(将Socket绑定到某个Port) if(!AVIO.Init(PORT)) { //如果失败,退出 CMsgBox::MessageBox(0,IDS_ERR_INIT,IDS_ERR,0,IDI_ERR); return 0; } //创建主窗口 MainWnd.Create(LPCTSTR(IDD_MAIN_DLG),0); // AVIO.SetMainWnd(MainWnd); MSG msg; while(GetMessage(&msg,0,0,0)) { PreTranslateMessageX(&msg); TranslateMessage(&msg); DispatchMessage(&msg); } AVIO.Destroy(); CleanUpSocket(); return msg.wParam; } /*------------------------------------------------------------------------------*/ CMainWnd::CMainWnd() { m_bHilightTitleBar=0; SetRect(&m_rcDataRate,20,218,140,231); SetRect(&m_rcFps,10,175,45,189); SetRect(&m_rcVideo,6,28,182,172); m_bmpVideo=0; m_bSendVideo=TRUE; } /*------------------------------------------------------------------------------*/ CMainWnd::~CMainWnd() { } /*------------------------------------------------------------------------------*/ //主窗口消息 LRESULT CMainWnd::WndProc(UINT uMsg,WPARAM wParam,LPARAM lParam) { switch(uMsg) { case WM_HOTKEY://热键弹出 if(wParam==1) { ShowWindow(m_hWnd,SW_SHOWNORMAL); SetForegroundWindow(m_hWnd); SetActiveWindow(m_hWnd); } break; case WM_USER_SETUP: OnSetup((SETUP*)lParam); break; case WM_TRAYNOTIFY: OnTrayNotify(wParam,lParam); break; case IOM_AUDIO: OnAudioData((BOOL)wParam,(CAVIOMgr*)lParam); break; case WM_INITDIALOG: return OnInitDialog(); case WM_DESTROY: OnDestroy(); break; case WM_CLOSE: OnClose(); break; case WM_LBUTTONDOWN: { POINT point; point.x=GET_X_LPARAM(lParam); point.y=GET_Y_LPARAM(lParam); OnLButtonDown(wParam,point); }break; case WM_LBUTTONUP: { POINT point; point.x=GET_X_LPARAM(lParam); point.y=GET_Y_LPARAM(lParam); OnLButtonUp(wParam,point); }break; case WM_MOUSEMOVE: { POINT point; point.x=GET_X_LPARAM(lParam); point.y=GET_Y_LPARAM(lParam); OnMouseMove(wParam,point); }break; case WM_COMMAND: return OnCommand(wParam,lParam); break; case WM_ERASEBKGND: OnEraseBkgnd((HDC)wParam); return TRUE; case WM_TIMER: OnTimer(wParam); break; case WM_SETCURSOR: return OnSetCursor((HWND)wParam,LOWORD(lParam),HIWORD(lParam)); break; case WM_CTLCOLOREDIT: return (LRESULT)OnCtrlColorEdit((HDC)wParam,(HWND)lParam); break; case WM_CTLCOLORSTATIC: return (LRESULT)OnCtrlColorStatic((HDC)wParam,(HWND)lParam); break; case IOM_NOTIFY: OnIOMNotify(wParam,lParam); break; case WM_SLD: { if(((HWND)lParam)==((HWND)m_sldAudioOut)) { //设置输出音量 m_VoOutCtrl.SetCurrentVolume((m_VoOutCtrl.GetMaximalVolume()-m_VoOutCtrl.GetMinimalVolume())*m_sldAudioOut.GetPos()/100); } else if(((HWND)lParam)==((HWND)m_sldAudioIn)) { //设置输入音量 m_VoInCtrl.SetCurrentVolume((m_VoInCtrl.GetMaximalVolume()-m_VoInCtrl.GetMinimalVolume())*m_sldAudioIn.GetPos()/100); } else if(((HWND)lParam)==((HWND)m_sldVideoQ)) { //设置视频质量 m_VQ=m_sldVideoQ.GetPos(); AVIO.SetVideoQuality(m_VQ); } } break; default: return CDialogX::WndProc(uMsg,wParam,lParam); } return TRUE; } /*------------------------------------------------------------------------------*/ BOOL CMainWnd::OnInitDialog() { HDC hdc=GetDC(m_hWnd); m_bmpVideo=CreateCompatibleBitmap(hdc,176,144); ReleaseDC(m_hWnd,hdc); //set window region POINT pt[13]={{0,10},{10,0},{262,0},{262,32},{269,39},{269,160}, {265,164},{265,228},{256,237},{20,237},{11,228},{11,221},{0,210}}; HRGN hRgn=CreatePolygonRgn(pt,13,ALTERNATE); SetWindowRgn(m_hWnd,hRgn,FALSE); //set window style DWORD dwStyle=GetWindowLong(m_hWnd,GWL_STYLE); SetWindowLong(m_hWnd,GWL_STYLE,dwStyle|WS_SYSMENU|WS_MINIMIZEBOX); //set window caption and icon SetWindowText(m_hWnd,"NetTalk"); SendMessage(m_hWnd,WM_SETICON,ICON_BIG,(LPARAM)LoadIcon(hInstX,LPCTSTR(IDI_MAIN))); //title bar region POINT pt2[5]={{11,4},{170,4},{151,23},{4,23},{4,11}}; m_hrgnTitle=CreatePolygonRgn(pt2,5,ALTERNATE); m_TrayNotify.SetHwnd(m_hWnd); m_TrayNotify.SetIcon(LoadIcon(hInstX,LPCTSTR(IDI_MAIN))); m_TrayNotify.SetTip("NetTalk-115软件工厂"); m_TrayNotify.SetMsg(WM_TRAYNOTIFY); m_TrayNotify.SetID(1); m_TrayNotify.ShowIcon(TRUE); // m_hbCtrlBg=CreateSolidBrush(0); m_hbFpsBg=CreateSolidBrush(0x00b9b4b3); //initialize buttons(load the bitmaps,set the position) m_btnCall.LoadBitmaps(IDB_CALL1,IDB_CALL2,IDB_CALL3); m_btnCall.Associate(m_hWnd,IDC_CALL); SetWindowPos(m_btnCall,0,0,0,64,24,SWP_NOMOVE); m_btnHang.LoadBitmaps(IDB_HANG1,IDB_HANG2,IDB_HANG3); m_btnHang.Associate(m_hWnd,IDC_HANG); SetWindowPos(m_btnHang,0,0,0,64,24,SWP_NOMOVE); m_btnAddr.LoadBitmaps(IDB_ADDR1,IDB_ADDR2,IDB_ADDR3); m_btnAddr.Associate(m_hWnd,IDC_ADDR); SetWindowPos(m_btnAddr,0,0,0,64,24,SWP_NOMOVE); m_btnSetup.LoadBitmaps(IDB_SETUP1,IDB_SETUP2,IDB_SETUP3); m_btnSetup.Associate(m_hWnd,IDC_SETUP); SetWindowPos(m_btnSetup,0,0,0,64,24,SWP_NOMOVE); m_btnClose.LoadBitmaps(IDB_CLOSE1,IDB_CLOSE2,IDB_CLOSE3); m_btnClose.Associate(m_hWnd,IDC_CLOSE); SetWindowPos(m_btnClose,0,0,0,11,11,SWP_NOMOVE); m_btnMin.LoadBitmaps(IDB_MIN1,IDB_MIN2,IDB_MIN3); m_btnMin.Associate(m_hWnd,IDC_MIN); SetWindowPos(m_btnMin,0,0,0,11,11,SWP_NOMOVE); m_btnHelp.LoadBitmaps(IDB_HELP1,IDB_HELP2,IDB_HELP3); m_btnHelp.Associate(m_hWnd,IDC_HP); SetWindowPos(m_btnHelp,0,0,0,11,11,SWP_NOMOVE); m_btnAbout.LoadBitmaps(IDB_ABOUT1,IDB_ABOUT2,IDB_ABOUT3); m_btnAbout.Associate(m_hWnd,IDC_ABOUT); SetWindowPos(m_btnAbout,0,0,0,11,11,SWP_NOMOVE); m_btnLocal.LoadBitmaps(IDB_VIDEO_LOCAL1,IDB_VIDEO_LOCAL2,IDB_VIDEO_LOCAL3); m_btnLocal.Associate(m_hWnd,IDC_VIDEO_LOCAL); SetWindowPos(m_btnLocal,0,0,0,15,15,SWP_NOMOVE); m_btnOnoff.LoadBitmaps(IDB_VIDEO_ONOFF4,IDB_VIDEO_ONOFF5,IDB_VIDEO_ONOFF6); m_btnOnoff.Associate(m_hWnd,IDC_VIDEO_ONOFF); SetWindowPos(m_btnOnoff,0,0,0,15,15,SWP_NOMOVE); m_btnOutview.LoadBitmaps(IDB_VIDEO_OUTVIEW1,IDB_VIDEO_OUTVIEW2,IDB_VIDEO_OUTVIEW3); m_btnOutview.Associate(m_hWnd,IDC_VIDEO_OUTVIEW); SetWindowPos(m_btnOutview,0,0,0,15,15,SWP_NOMOVE); m_btnMsg.
评论
    相关推荐