diff --git a/win32/Icecast2win.clw b/win32/Icecast2win.clw index 10beb989..6f99270b 100755 --- a/win32/Icecast2win.clw +++ b/win32/Icecast2win.clw @@ -1,142 +1,152 @@ -; CLW file contains information for the MFC ClassWizard - -[General Info] -Version=1 -LastClass=CIcecast2winDlg -LastTemplate=CDialog -NewFileInclude1=#include "stdafx.h" -NewFileInclude2=#include "Icecast2win.h" - -ClassCount=6 -Class1=CIcecast2winApp -Class2=CIcecast2winDlg -Class3=CAboutDlg - -ResourceCount=9 -Resource1=IDR_MENU3 -Resource2=IDR_MAINFRAME -Resource3=IDD_ABOUTBOX -Resource4=IDD_STATSDIALOG -Class4=CStatus -Resource5=IDR_MENU2 -Class5=CConfigTab -Class6=CStatsTab -Resource6=IDD_SSTATUS -Resource7=IDD_CONFIGDIALOG -Resource8=IDD_ICECAST2WIN_DIALOG -Resource9=IDR_TRAY - -[CLS:CIcecast2winApp] -Type=0 -HeaderFile=Icecast2win.h -ImplementationFile=Icecast2win.cpp -Filter=N - -[CLS:CIcecast2winDlg] -Type=0 -HeaderFile=Icecast2winDlg.h -ImplementationFile=Icecast2winDlg.cpp -Filter=C -LastObject=IDC_HIDESYSTRAY -BaseClass=CResizableDialog -VirtualFilter=dWC - -[CLS:CAboutDlg] -Type=0 -HeaderFile=Icecast2winDlg.h -ImplementationFile=Icecast2winDlg.cpp -Filter=D - -[DLG:IDD_ABOUTBOX] -Type=1 -Class=CAboutDlg -ControlCount=3 -Control1=IDC_STATIC,static,1342177283 -Control2=IDC_STATIC,static,1342308480 -Control3=IDOK,button,1342373889 - -[DLG:IDD_ICECAST2WIN_DIALOG] -Type=1 -Class=CIcecast2winDlg -ControlCount=8 -Control1=IDC_MAINTAB,SysTabControl32,1342177280 -Control2=IDC_START,button,1342242816 -Control3=IDC_AUTOSTART,button,1342251011 -Control4=IDC_STATIC,static,1342177294 -Control5=IDC_SERVERSTATUS,static,1342177294 -Control6=IDC_STATIC_SS,static,1342308865 -Control7=IDC_STATICBLACK,static,1342177294 -Control8=IDC_HIDESYSTRAY,button,1342242816 - -[DLG:IDD_SSTATUS] -Type=1 -Class=CStatus -ControlCount=5 -Control1=IDC_FILLER2,static,1342308352 -Control2=IDC_GLOBALSTAT_LIST,SysListView32,1350631425 -Control3=IDC_STATIC_GS,static,1342308353 -Control4=IDC_STATIC_RUN,static,1342308352 -Control5=IDC_RUNNINGFOR,static,1342308352 - -[CLS:CStatus] -Type=0 -HeaderFile=Status.h -ImplementationFile=Status.cpp -BaseClass=CTabPageSSL -Filter=D -LastObject=ID_POPUP_ADDTOGLOBALSTATLIST -VirtualFilter=dWC - -[DLG:IDD_CONFIGDIALOG] -Type=1 -Class=CConfigTab -ControlCount=1 -Control1=IDC_CONFIG,edit,1352732868 - -[CLS:CConfigTab] -Type=0 -HeaderFile=ConfigTab.h -ImplementationFile=ConfigTab.cpp -BaseClass=CTabPageSSL -Filter=D -VirtualFilter=dWC -LastObject=IDC_CONFIG - -[DLG:IDD_STATSDIALOG] -Type=1 -Class=CStatsTab -ControlCount=5 -Control1=IDC_STATSLIST,SysListView32,1350631425 -Control2=IDC_SOURCELIST,SysListView32,1350631425 -Control3=IDC_FILLER1,static,1342308352 -Control4=IDC_STATIC_SLS,static,1342308353 -Control5=IDC_STATIC,static,1342308352 - -[CLS:CStatsTab] -Type=0 -HeaderFile=StatsTab.h -ImplementationFile=StatsTab.cpp -BaseClass=CTabPageSSL -Filter=D -VirtualFilter=dWC -LastObject=IDC_SOURCELIST - -[MNU:IDR_MENU2] -Type=1 -Class=? -Command1=ID_POPUP_ADDTOGLOBALSTATLIST -CommandCount=1 - -[MNU:IDR_MENU3] -Type=1 -Class=? -Command1=ID__DELETEFROMGLOBALSTATS -Command2=ID__MAKETHISSTATTHEWINDOWTITLE -CommandCount=2 - -[MNU:IDR_TRAY] -Type=1 -Class=CIcecast2winDlg -Command1=ID_BLANK_RESTORE -CommandCount=1 - +; CLW file contains information for the MFC ClassWizard + +[General Info] +Version=1 +LastClass=CIcecast2winDlg +LastTemplate=CDialog +NewFileInclude1=#include "stdafx.h" +NewFileInclude2=#include "Icecast2win.h" + +ClassCount=6 +Class1=CIcecast2winApp +Class2=CIcecast2winDlg +Class3=CAboutDlg + +ResourceCount=10 +Resource1=IDD_ABOUTBOX +Resource2=IDR_MAINFRAME +Resource3=IDR_MENU3 +Resource4=IDR_TRAY +Class4=CStatus +Resource5=IDR_MENU2 +Class5=CConfigTab +Class6=CStatsTab +Resource6=IDD_SSTATUS +Resource7=IDD_CONFIGDIALOG +Resource8=IDD_ICECAST2WIN_DIALOG +Resource9=IDD_STATSDIALOG +Resource10=IDR_MENU4 + +[CLS:CIcecast2winApp] +Type=0 +HeaderFile=Icecast2win.h +ImplementationFile=Icecast2win.cpp +Filter=N + +[CLS:CIcecast2winDlg] +Type=0 +HeaderFile=Icecast2winDlg.h +ImplementationFile=Icecast2winDlg.cpp +Filter=C +LastObject=ID_ABOUT_HELP +BaseClass=CResizableDialog +VirtualFilter=dWC + +[CLS:CAboutDlg] +Type=0 +HeaderFile=Icecast2winDlg.h +ImplementationFile=Icecast2winDlg.cpp +Filter=D + +[DLG:IDD_ABOUTBOX] +Type=1 +Class=CAboutDlg +ControlCount=3 +Control1=IDC_STATIC,static,1342177283 +Control2=IDC_STATIC,static,1342308480 +Control3=IDOK,button,1342373889 + +[DLG:IDD_ICECAST2WIN_DIALOG] +Type=1 +Class=CIcecast2winDlg +ControlCount=8 +Control1=IDC_MAINTAB,SysTabControl32,1342177280 +Control2=IDC_START,button,1342242816 +Control3=IDC_AUTOSTART,button,1342251011 +Control4=IDC_STATIC,static,1342177294 +Control5=IDC_SERVERSTATUS,static,1342177294 +Control6=IDC_STATIC_SS,static,1342308865 +Control7=IDC_STATICBLACK,static,1342177294 +Control8=IDC_HIDESYSTRAY,button,1342242816 + +[DLG:IDD_SSTATUS] +Type=1 +Class=CStatus +ControlCount=5 +Control1=IDC_FILLER2,static,1342308352 +Control2=IDC_GLOBALSTAT_LIST,SysListView32,1350631425 +Control3=IDC_STATIC_GS,static,1342308353 +Control4=IDC_STATIC_RUN,static,1342308352 +Control5=IDC_RUNNINGFOR,static,1342308352 + +[CLS:CStatus] +Type=0 +HeaderFile=Status.h +ImplementationFile=Status.cpp +BaseClass=CTabPageSSL +Filter=D +LastObject=ID_POPUP_ADDTOGLOBALSTATLIST +VirtualFilter=dWC + +[DLG:IDD_CONFIGDIALOG] +Type=1 +Class=CConfigTab +ControlCount=1 +Control1=IDC_CONFIG,edit,1352732868 + +[CLS:CConfigTab] +Type=0 +HeaderFile=ConfigTab.h +ImplementationFile=ConfigTab.cpp +BaseClass=CTabPageSSL +Filter=D +VirtualFilter=dWC +LastObject=IDC_CONFIG + +[DLG:IDD_STATSDIALOG] +Type=1 +Class=CStatsTab +ControlCount=5 +Control1=IDC_STATSLIST,SysListView32,1350631425 +Control2=IDC_SOURCELIST,SysListView32,1350631425 +Control3=IDC_FILLER1,static,1342308352 +Control4=IDC_STATIC_SLS,static,1342308353 +Control5=IDC_STATIC,static,1342308352 + +[CLS:CStatsTab] +Type=0 +HeaderFile=StatsTab.h +ImplementationFile=StatsTab.cpp +BaseClass=CTabPageSSL +Filter=D +VirtualFilter=dWC +LastObject=IDC_SOURCELIST + +[MNU:IDR_MENU2] +Type=1 +Class=? +Command1=ID_POPUP_ADDTOGLOBALSTATLIST +CommandCount=1 + +[MNU:IDR_MENU3] +Type=1 +Class=? +Command1=ID__DELETEFROMGLOBALSTATS +Command2=ID__MAKETHISSTATTHEWINDOWTITLE +CommandCount=2 + +[MNU:IDR_TRAY] +Type=1 +Class=CIcecast2winDlg +Command1=ID_BLANK_RESTORE +CommandCount=1 + +[MNU:IDR_MENU4] +Type=1 +Class=CIcecast2winDlg +Command1=ID_FILE_EXIT +Command2=ID_FILE_EDITCONFIGURATION +Command3=ID_ABOUT_HELP +Command4=ID_ABOUT_CREDITS +CommandCount=4 + diff --git a/win32/Icecast2win.cpp b/win32/Icecast2win.cpp index faad96ee..2dd64d79 100644 --- a/win32/Icecast2win.cpp +++ b/win32/Icecast2win.cpp @@ -1,89 +1,89 @@ -// Icecast2win.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "Icecast2win.h" -#include "Icecast2winDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CIcecast2winApp - -BEGIN_MESSAGE_MAP(CIcecast2winApp, CWinApp) - //{{AFX_MSG_MAP(CIcecast2winApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG - ON_COMMAND(ID_HELP, CWinApp::OnHelp) -END_MESSAGE_MAP() - -#include "colors.h" -///////////////////////////////////////////////////////////////////////////// -// CIcecast2winApp construction - -CIcecast2winApp::CIcecast2winApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CIcecast2winApp object - -CIcecast2winApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CIcecast2winApp initialization - -BOOL CIcecast2winApp::InitInstance() -{ - AfxEnableControlContainer(); - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - - if (strlen(m_lpCmdLine) > 0) { - strcpy(m_configFile, m_lpCmdLine); - } - else { - strcpy(m_configFile, ".\\icecast.xml"); - } - - - -#ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL -#else - Enable3dControlsStatic(); // Call this when linking to MFC statically -#endif - - CIcecast2winDlg dlg; - m_pMainWnd = &dlg; - -// SetDialogBkColor(BGCOLOR,TEXTCOLOR); - - m_pIconList[0] = LoadIcon (MAKEINTRESOURCE(IDR_MAINFRAME)); - - int nResponse = dlg.DoModal(); - if (nResponse == IDOK) - { - // TODO: Place code here to handle when the dialog is - // dismissed with OK - } - else if (nResponse == IDCANCEL) - { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} +// Icecast2win.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "Icecast2win.h" +#include "Icecast2winDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CIcecast2winApp + +BEGIN_MESSAGE_MAP(CIcecast2winApp, CWinApp) + //{{AFX_MSG_MAP(CIcecast2winApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG + ON_COMMAND(ID_HELP, CWinApp::OnHelp) +END_MESSAGE_MAP() + +#include "colors.h" +///////////////////////////////////////////////////////////////////////////// +// CIcecast2winApp construction + +CIcecast2winApp::CIcecast2winApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CIcecast2winApp object + +CIcecast2winApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CIcecast2winApp initialization + +BOOL CIcecast2winApp::InitInstance() +{ + AfxEnableControlContainer(); + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + + if (strlen(m_lpCmdLine) > 0) { + strcpy(m_configFile, m_lpCmdLine); + } + else { + strcpy(m_configFile, ".\\icecast.xml"); + } + + + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + CIcecast2winDlg dlg; + m_pMainWnd = &dlg; + +// SetDialogBkColor(BGCOLOR,TEXTCOLOR); + + m_pIconList[0] = LoadIcon (MAKEINTRESOURCE(IDR_MAINFRAME)); + + int nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} diff --git a/win32/Icecast2win.dsp b/win32/Icecast2win.dsp index 18036a6b..49a59bbb 100644 --- a/win32/Icecast2win.dsp +++ b/win32/Icecast2win.dsp @@ -1,270 +1,270 @@ -# Microsoft Developer Studio Project File - Name="Icecast2win" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=Icecast2win - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "Icecast2win.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "Icecast2win.mak" CFG="Icecast2win - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Icecast2win - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "Icecast2win - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Icecast2win - Win32 Release" - -# PROP BASE Use_MFC 5 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 5 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "../src" /I "../src/httpp" /I "../src/thread" /I "../src/log" /I "../src/avl" /I "../src/net" /I "src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 Releaseicecast\icecast.lib ..\..\oggvorbis-win32sdk-1.0\lib\ogg_static.lib ..\..\oggvorbis-win32sdk-1.0\lib\vorbis_static.lib ..\..\libxml2\lib\libxml2.lib ..\..\libxslt\lib\libxslt.lib ..\..\iconv\lib\iconv.lib ..\..\pthreads\pthreadVSE.lib ws2_32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/Icecast2.exe" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "Icecast2win - Win32 Debug" - -# PROP BASE Use_MFC 5 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "../src" /I "../src/httpp" /I "../src/thread" /I "../src/log" /I "../src/avl" /I "../src/net" /I "src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_WIN32" /D "_AFXDLL" /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Debugicecast\icecast.lib ..\..\oggvorbis-win32sdk-1.0\lib\ogg_static_d.lib ..\..\oggvorbis-win32sdk-1.0\lib\vorbis_static_d.lib ..\..\libxml2\lib\libxml2.lib ..\..\libxslt\lib\libxslt.lib ..\..\iconv\lib\iconv.lib ..\..\pthreads\pthreadVSE.lib ws2_32.lib winmm.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"LIBCMTD.lib" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "Icecast2win - Win32 Release" -# Name "Icecast2win - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ConfigTab.cpp -# End Source File -# Begin Source File - -SOURCE=.\Icecast2win.cpp -# End Source File -# Begin Source File - -SOURCE=.\Icecast2win.rc -# End Source File -# Begin Source File - -SOURCE=.\Icecast2winDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\ResizableDialog.cpp -# End Source File -# Begin Source File - -SOURCE=.\ResizableDialog.h -# End Source File -# Begin Source File - -SOURCE=.\StatsTab.cpp -# End Source File -# Begin Source File - -SOURCE=.\Status.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# Begin Source File - -SOURCE=.\TabCtrlSSL.cpp -# End Source File -# Begin Source File - -SOURCE=.\TabCtrlSSL.h -# End Source File -# Begin Source File - -SOURCE=.\TabPageSSL.cpp -# End Source File -# Begin Source File - -SOURCE=.\TabPageSSL.h -# End Source File -# Begin Source File - -SOURCE=.\Traynot.cpp -# End Source File -# Begin Source File - -SOURCE=.\TRAYNOT.H -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\colors.h -# End Source File -# Begin Source File - -SOURCE=.\ConfigTab.h -# End Source File -# Begin Source File - -SOURCE=.\Icecast2win.h -# End Source File -# Begin Source File - -SOURCE=.\Icecast2winDlg.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - -SOURCE=.\StatsTab.h -# End Source File -# Begin Source File - -SOURCE=.\Status.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\bitmap1.bmp -# End Source File -# Begin Source File - -SOURCE=.\bitmap2.bmp -# End Source File -# Begin Source File - -SOURCE=.\black.bmp -# End Source File -# Begin Source File - -SOURCE=.\cursor1.cur -# End Source File -# Begin Source File - -SOURCE=.\cursor2.cur -# End Source File -# Begin Source File - -SOURCE=.\green1.ico -# End Source File -# Begin Source File - -SOURCE=.\icecast.ico -# End Source File -# Begin Source File - -SOURCE=.\Icecast2.ico -# End Source File -# Begin Source File - -SOURCE=.\res\Icecast2.ico -# End Source File -# Begin Source File - -SOURCE=.\icecast2logo2.bmp -# End Source File -# Begin Source File - -SOURCE=.\res\Icecast2win.ico -# End Source File -# Begin Source File - -SOURCE=.\res\Icecast2win.rc2 -# End Source File -# Begin Source File - -SOURCE=.\ico00001.ico -# End Source File -# Begin Source File - -SOURCE=.\icon1.ico -# End Source File -# Begin Source File - -SOURCE=.\icon2.ico -# End Source File -# Begin Source File - -SOURCE=.\running.bmp -# End Source File -# Begin Source File - -SOURCE=.\stopped.bmp -# End Source File -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="Icecast2win" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=Icecast2win - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Icecast2win.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Icecast2win.mak" CFG="Icecast2win - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Icecast2win - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "Icecast2win - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Icecast2win - Win32 Release" + +# PROP BASE Use_MFC 5 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 5 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "../src" /I "../src/httpp" /I "../src/thread" /I "../src/log" /I "../src/avl" /I "../src/net" /I "src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 Releaseicecast\icecast.lib ..\..\oggvorbis-win32sdk-1.0\lib\ogg_static.lib ..\..\oggvorbis-win32sdk-1.0\lib\vorbis_static.lib ..\..\libxml2\lib\libxml2.lib ..\..\libxslt\lib\libxslt.lib ..\..\iconv\lib\iconv.lib ..\..\pthreads\pthreadVSE.lib ws2_32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/Icecast2.exe" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "Icecast2win - Win32 Debug" + +# PROP BASE Use_MFC 5 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "../src" /I "../src/httpp" /I "../src/thread" /I "../src/log" /I "../src/avl" /I "../src/net" /I "src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_WIN32" /D "_AFXDLL" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 Debugicecast\icecast.lib ..\..\oggvorbis-win32sdk-1.0\lib\ogg_static_d.lib ..\..\oggvorbis-win32sdk-1.0\lib\vorbis_static_d.lib ..\..\libxml2\lib\libxml2.lib ..\..\libxslt\lib\libxslt.lib ..\..\iconv\lib\iconv.lib ..\..\pthreads\pthreadVSE.lib ws2_32.lib winmm.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"LIBCMTD.lib" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "Icecast2win - Win32 Release" +# Name "Icecast2win - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\ConfigTab.cpp +# End Source File +# Begin Source File + +SOURCE=.\Icecast2win.cpp +# End Source File +# Begin Source File + +SOURCE=.\Icecast2win.rc +# End Source File +# Begin Source File + +SOURCE=.\Icecast2winDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\ResizableDialog.cpp +# End Source File +# Begin Source File + +SOURCE=.\ResizableDialog.h +# End Source File +# Begin Source File + +SOURCE=.\StatsTab.cpp +# End Source File +# Begin Source File + +SOURCE=.\Status.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\TabCtrlSSL.cpp +# End Source File +# Begin Source File + +SOURCE=.\TabCtrlSSL.h +# End Source File +# Begin Source File + +SOURCE=.\TabPageSSL.cpp +# End Source File +# Begin Source File + +SOURCE=.\TabPageSSL.h +# End Source File +# Begin Source File + +SOURCE=.\Traynot.cpp +# End Source File +# Begin Source File + +SOURCE=.\TRAYNOT.H +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\colors.h +# End Source File +# Begin Source File + +SOURCE=.\ConfigTab.h +# End Source File +# Begin Source File + +SOURCE=.\Icecast2win.h +# End Source File +# Begin Source File + +SOURCE=.\Icecast2winDlg.h +# End Source File +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# Begin Source File + +SOURCE=.\StatsTab.h +# End Source File +# Begin Source File + +SOURCE=.\Status.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\bitmap1.bmp +# End Source File +# Begin Source File + +SOURCE=.\bitmap2.bmp +# End Source File +# Begin Source File + +SOURCE=.\black.bmp +# End Source File +# Begin Source File + +SOURCE=.\cursor1.cur +# End Source File +# Begin Source File + +SOURCE=.\cursor2.cur +# End Source File +# Begin Source File + +SOURCE=.\green1.ico +# End Source File +# Begin Source File + +SOURCE=.\icecast.ico +# End Source File +# Begin Source File + +SOURCE=.\Icecast2.ico +# End Source File +# Begin Source File + +SOURCE=.\res\Icecast2.ico +# End Source File +# Begin Source File + +SOURCE=.\icecast2logo2.bmp +# End Source File +# Begin Source File + +SOURCE=.\res\Icecast2win.ico +# End Source File +# Begin Source File + +SOURCE=.\res\Icecast2win.rc2 +# End Source File +# Begin Source File + +SOURCE=.\ico00001.ico +# End Source File +# Begin Source File + +SOURCE=.\icon1.ico +# End Source File +# Begin Source File + +SOURCE=.\icon2.ico +# End Source File +# Begin Source File + +SOURCE=.\running.bmp +# End Source File +# Begin Source File + +SOURCE=.\stopped.bmp +# End Source File +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/win32/Icecast2win.h b/win32/Icecast2win.h index af1ac2f8..4f1788b3 100644 --- a/win32/Icecast2win.h +++ b/win32/Icecast2win.h @@ -1,50 +1,52 @@ -// Icecast2win.h : main header file for the ICECAST2WIN application -// - -#if !defined(AFX_ICECAST2WIN_H__76A528C9_A424_4417_BFDF_0E556A9EE4F1__INCLUDED_) -#define AFX_ICECAST2WIN_H__76A528C9_A424_4417_BFDF_0E556A9EE4F1__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#ifndef __AFXWIN_H__ -#error include 'stdafx.h' before including this file for PCH -#endif - -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CIcecast2winApp: -// See Icecast2win.cpp for the implementation of this class -// - -class CIcecast2winApp : public CWinApp -{ -public: - char m_configFile[1024]; - CIcecast2winApp(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CIcecast2winApp) - public: - virtual BOOL InitInstance(); - //}}AFX_VIRTUAL - -// Implementation - - //{{AFX_MSG(CIcecast2winApp) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_ICECAST2WIN_H__76A528C9_A424_4417_BFDF_0E556A9EE4F1__INCLUDED_) +// Icecast2win.h : main header file for the ICECAST2WIN application +// + +#if !defined(AFX_ICECAST2WIN_H__76A528C9_A424_4417_BFDF_0E556A9EE4F1__INCLUDED_) +#define AFX_ICECAST2WIN_H__76A528C9_A424_4417_BFDF_0E556A9EE4F1__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef __AFXWIN_H__ +#error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CIcecast2winApp: +// See Icecast2win.cpp for the implementation of this class +// + +class CIcecast2winApp : public CWinApp +{ +public: + char m_configFile[1024]; + HICON m_pIconList[2]; + CIcecast2winApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CIcecast2winApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL + +// Implementation + + //{{AFX_MSG(CIcecast2winApp) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +extern CIcecast2winApp theApp; +#endif // !defined(AFX_ICECAST2WIN_H__76A528C9_A424_4417_BFDF_0E556A9EE4F1__INCLUDED_) diff --git a/win32/Icecast2win.rc b/win32/Icecast2win.rc index 6062b65d..af62d9f9 100644 --- a/win32/Icecast2win.rc +++ b/win32/Icecast2win.rc @@ -1,283 +1,301 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif //_WIN32\r\n" - "#include ""res\\Icecast2win.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About Icecast2win" -FONT 8, "MS Sans Serif" -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 - LTEXT "Icecast 2 Win32",IDC_STATIC,40,10,119,8,SS_NOPREFIX - DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP -END - -IDD_ICECAST2WIN_DIALOG DIALOGEX 0, 0, 318, 249 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_APPWINDOW -CAPTION "icecast2" -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Tab1",IDC_MAINTAB,"SysTabControl32",0x0,0,48,318,201 - PUSHBUTTON "Start Server",IDC_START,17,31,56,14 - CONTROL "Start Server on Application Startup",IDC_AUTOSTART, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,76, - 29,81,17 - CONTROL 159,IDC_STATIC,"Static",SS_BITMAP,0,0,117,20 - CONTROL 151,IDC_SERVERSTATUS,"Static",SS_BITMAP,173,32,65,18, - WS_EX_CLIENTEDGE - CTEXT "Server Status",IDC_STATIC_SS,172,23,65,10, - SS_CENTERIMAGE - CONTROL 150,IDC_STATICBLACK,"Static",SS_BITMAP,116,0,200,20 - PUSHBUTTON "Hide To Systray",IDC_HIDESYSTRAY,257,22,58,12 -END - -IDD_SSTATUS DIALOG DISCARDABLE 0, 0, 320, 210 -STYLE WS_CHILD -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "",IDC_FILLER2,0,199,319,11 - CONTROL "List1",IDC_GLOBALSTAT_LIST,"SysListView32",LVS_REPORT | - WS_BORDER | WS_TABSTOP,9,34,300,147 - CTEXT "Global Statistics",IDC_STATIC_GS,9,9,300,21 - LTEXT "Server Has Been Running For ",IDC_STATIC_RUN,46,184,100, - 8 - LTEXT "",IDC_RUNNINGFOR,149,184,156,8 -END - -IDD_CONFIGDIALOG DIALOG DISCARDABLE 0, 0, 320, 210 -STYLE WS_CHILD -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_CONFIG,0,0,320,210,ES_MULTILINE | ES_AUTOVSCROLL | - ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL -END - -IDD_STATSDIALOG DIALOG DISCARDABLE 0, 0, 320, 210 -STYLE WS_CHILD -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "List1",IDC_STATSLIST,"SysListView32",LVS_REPORT | - WS_BORDER | WS_TABSTOP,142,34,149,160 - CONTROL "List2",IDC_SOURCELIST,"SysListView32",LVS_REPORT | - WS_BORDER | WS_TABSTOP,9,34,111,159 - LTEXT "",IDC_FILLER1,0,199,320,11 - CTEXT "Source Level Statistics",IDC_STATIC_SLS,9,7,300,15 - LTEXT "Click source to view statistics",IDC_STATIC,18,25,111,8 -END - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "Icecast2win MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "Icecast2win\0" - VALUE "LegalCopyright", "Copyright (C) 2001\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "Icecast2win.EXE\0" - VALUE "ProductName", "Icecast2win Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_ABOUTBOX, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 228 - TOPMARGIN, 7 - BOTTOMMARGIN, 48 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_BITMAP4 BITMAP DISCARDABLE "black.bmp" -IDB_BITMAP5 BITMAP DISCARDABLE "stopped.bmp" -IDB_BITMAP6 BITMAP DISCARDABLE "running.bmp" -IDB_BITMAP7 BITMAP DISCARDABLE "icecast2logo2.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "icecast.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU2 MENU DISCARDABLE -BEGIN - POPUP "Popup" - BEGIN - MENUITEM "Add To Global Stat List", ID_POPUP_ADDTOGLOBALSTATLIST - END -END - -IDR_MENU3 MENU DISCARDABLE -BEGIN - POPUP " " - BEGIN - MENUITEM "Delete From Global Stats", ID__DELETEFROMGLOBALSTATS - MENUITEM "Make this stat the window title", - ID__MAKETHISSTATTHEWINDOWTITLE - - END -END - -IDR_TRAY MENU DISCARDABLE -BEGIN - POPUP "Blank" - BEGIN - MENUITEM "Restore", ID_BLANK_RESTORE - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ABOUTBOX "&About Icecast2win..." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif //_WIN32 -#include "res\Icecast2win.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif //_WIN32\r\n" + "#include ""res\\Icecast2win.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Icecast2win" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 + LTEXT "Icecast 2 Win32",IDC_STATIC,40,10,119,8,SS_NOPREFIX + DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP +END + +IDD_ICECAST2WIN_DIALOG DIALOGEX 0, 0, 318, 249 +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_APPWINDOW +CAPTION "icecast2" +MENU IDR_MENU4 +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Tab1",IDC_MAINTAB,"SysTabControl32",0x0,0,48,318,201 + PUSHBUTTON "Start Server",IDC_START,17,31,56,14 + CONTROL "Start Server on Application Startup",IDC_AUTOSTART, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,76, + 29,81,17 + CONTROL 159,IDC_STATIC,"Static",SS_BITMAP,0,0,117,20 + CONTROL 151,IDC_SERVERSTATUS,"Static",SS_BITMAP,173,32,65,18, + WS_EX_CLIENTEDGE + CTEXT "Server Status",IDC_STATIC_SS,172,23,65,10, + SS_CENTERIMAGE + CONTROL 150,IDC_STATICBLACK,"Static",SS_BITMAP,116,0,200,20 + PUSHBUTTON "Hide To Systray",IDC_HIDESYSTRAY,257,22,58,12 +END + +IDD_SSTATUS DIALOG DISCARDABLE 0, 0, 320, 210 +STYLE WS_CHILD +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "",IDC_FILLER2,0,199,319,11 + CONTROL "List1",IDC_GLOBALSTAT_LIST,"SysListView32",LVS_REPORT | + WS_BORDER | WS_TABSTOP,9,34,300,147 + CTEXT "Global Statistics",IDC_STATIC_GS,9,6,300,10 + LTEXT "Server Has Been Running For ",IDC_STATIC_RUN,46,184,100, + 8 + LTEXT "",IDC_RUNNINGFOR,149,184,156,8 +END + +IDD_CONFIGDIALOG DIALOG DISCARDABLE 0, 0, 320, 210 +STYLE WS_CHILD +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_CONFIG,0,0,320,210,ES_MULTILINE | ES_AUTOVSCROLL | + ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL +END + +IDD_STATSDIALOG DIALOG DISCARDABLE 0, 0, 320, 210 +STYLE WS_CHILD +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "List1",IDC_STATSLIST,"SysListView32",LVS_REPORT | + WS_BORDER | WS_TABSTOP,142,34,149,160 + CONTROL "List2",IDC_SOURCELIST,"SysListView32",LVS_REPORT | + WS_BORDER | WS_TABSTOP,9,34,111,159 + LTEXT "",IDC_FILLER1,0,199,320,11 + CTEXT "Source Level Statistics",IDC_STATIC_SLS,9,7,300,10 + LTEXT "Click source to view statistics",IDC_STATIC,18,25,111,8 +END + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "\0" + VALUE "FileDescription", "Icecast2win MFC Application\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "Icecast2win\0" + VALUE "LegalCopyright", "Copyright (C) 2001\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "Icecast2win.EXE\0" + VALUE "ProductName", "Icecast2win Application\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 228 + TOPMARGIN, 7 + BOTTOMMARGIN, 48 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_BITMAP4 BITMAP DISCARDABLE "black.bmp" +IDB_BITMAP5 BITMAP DISCARDABLE "stopped.bmp" +IDB_BITMAP6 BITMAP DISCARDABLE "running.bmp" +IDB_BITMAP7 BITMAP DISCARDABLE "icecast2logo2.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "icecast.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU2 MENU DISCARDABLE +BEGIN + POPUP "Popup" + BEGIN + MENUITEM "Add To Global Stat List", ID_POPUP_ADDTOGLOBALSTATLIST + END +END + +IDR_MENU3 MENU DISCARDABLE +BEGIN + POPUP " " + BEGIN + MENUITEM "Delete From Global Stats", ID__DELETEFROMGLOBALSTATS + MENUITEM "Make this stat the window title", + ID__MAKETHISSTATTHEWINDOWTITLE + + END +END + +IDR_TRAY MENU DISCARDABLE +BEGIN + POPUP "Blank" + BEGIN + MENUITEM "Restore", ID_BLANK_RESTORE + END +END + +IDR_MENU4 MENU DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "E&xit", ID_FILE_EXIT + END + POPUP "C&onfiguration" + BEGIN + MENUITEM "&Edit Configuration", ID_FILE_EDITCONFIGURATION + END + POPUP "&About" + BEGIN + MENUITEM "H&elp", ID_ABOUT_HELP + MENUITEM "Cr&edits", ID_ABOUT_CREDITS + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUTBOX "&About Icecast2win..." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif //_WIN32 +#include "res\Icecast2win.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/win32/Icecast2winDlg.cpp b/win32/Icecast2winDlg.cpp index 982b8fdf..6783bdbb 100644 --- a/win32/Icecast2winDlg.cpp +++ b/win32/Icecast2winDlg.cpp @@ -1,1254 +1,1149 @@ -// Icecast2winDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "Icecast2win.h" -#include "Icecast2winDlg.h" -#include -#include "ResizableDialog.h" - -#include -#include -#include -#include - -extern "C" { -#include "thread.h" -#include "avl.h" -#include "log.h" -#include "global.h" -#include "httpp.h" -#include "sock.h" -#include "connection.h" -#include "refbuf.h" -#include "client.h" -#include "stats.h" -} - - -#include - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -CEdit *g_accessControl; -CEdit *g_errorControl; -CIcecast2winDlg *g_mainDialog; -bool g_tailAccess = false; -bool g_tailError = false; -void CollectStats(stats_event_t *event); -CString gConfigurationSave; - -char gTitleSource[1024] = ""; -char gTitleName[1024] = ""; - -#define MAXSTATSPERSOURCE 30 -#define MAXSOURCES 1024 - -typedef struct tagElement { - CString name; - CString value; - int titleFlag; -} Element; - -typedef struct tagElementAdditional { - CString source; - CString name; - CString value; - int titleFlag; -} ElementAdditional; - - -typedef struct tagMainElement { -// char source[1024]; - CString source; - long numStats; - Element stats[MAXSTATSPERSOURCE]; - int populated; -} MainElement; - -typedef struct tagMainElementAdditional { - long numStats; - ElementAdditional stats[MAXSTATSPERSOURCE]; -} MainElementAdditional; - - -MainElement gStats[MAXSOURCES]; -MainElement gGlobalStats; -MainElementAdditional gAdditionalGlobalStats; - -long numMainStats; - -extern "C" { - int main(int argc, char **argv); -} - - -void AddToAdditionalGlobalStats(CString source, CString name) { - int foundit = 0; - for (int i=0;iUpdateStatsLists(); -} - -void ClearTitleAdditionalGlobalStats(CString source, CString name) { - int foundit = 0; - int i,j; - for (i=0;iUpdateStatsLists(); -} -void AddToTitleAdditionalGlobalStats(CString source, CString name) { - int foundit = 0; - int i,j; - for (i=0;iUpdateStatsLists(); -} - -void RemoveFromAdditionalGlobalStats(CString source, CString name) { - int foundit = 0; - for (int i=0;iUpdateStatsLists(); -} -///////////////////////////////////////////////////////////////////////////// -// CAboutDlg dialog used for App About - -class CAboutDlg : public CResizableDialog -{ -public: - CAboutDlg(); - -// Dialog Data - //{{AFX_DATA(CAboutDlg) - enum { IDD = IDD_ABOUTBOX }; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAboutDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - //{{AFX_MSG(CAboutDlg) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -CAboutDlg::CAboutDlg() : CResizableDialog(CAboutDlg::IDD) -{ - //{{AFX_DATA_INIT(CAboutDlg) - //}}AFX_DATA_INIT -} - -void CAboutDlg::DoDataExchange(CDataExchange* pDX) -{ - CResizableDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAboutDlg) - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CAboutDlg, CResizableDialog) - //{{AFX_MSG_MAP(CAboutDlg) - // No message handlers - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CIcecast2winDlg dialog - -CIcecast2winDlg::CIcecast2winDlg(CWnd* pParent /*=NULL*/) - : CResizableDialog(CIcecast2winDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CIcecast2winDlg) - m_AccessEdit = _T(""); - m_ErrorEdit = _T(""); - m_ConfigEdit = _T(""); - m_ServerStatus = _T(""); - m_SourcesConnected = _T(""); - m_NumClients = _T(""); - m_StatsEdit = _T(""); - m_Autostart = FALSE; - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - m_pTray = NULL; -} - -void CIcecast2winDlg::DoDataExchange(CDataExchange* pDX) -{ - CResizableDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CIcecast2winDlg) - DDX_Control(pDX, IDC_STATIC_SS, m_SS); - DDX_Control(pDX, IDC_SERVERSTATUS, m_ServerStatusBitmap); - DDX_Control(pDX, IDC_START, m_StartButton); - DDX_Control(pDX, IDC_MAINTAB, m_MainTab); - DDX_Check(pDX, IDC_AUTOSTART, m_Autostart); - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CIcecast2winDlg, CResizableDialog) - //{{AFX_MSG_MAP(CIcecast2winDlg) - ON_WM_SYSCOMMAND() - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_NOTIFY(TCN_SELCHANGE, IDC_MAINTAB, OnSelchangeMaintab) - ON_COMMAND(ID_FILE_EXIT, OnFileExit) - ON_WM_TIMER() - ON_COMMAND(ID_FILE_STARTSERVER, OnFileStartserver) - ON_COMMAND(ID_FILE_STOPSERVER, OnFileStopserver) - ON_BN_CLICKED(IDC_START, OnStart) - ON_WM_CLOSE() - ON_WM_SIZE() - ON_BN_CLICKED(IDC_HIDESYSTRAY, OnHidesystray) - ON_COMMAND(ID_BLANK_RESTORE, OnBlankRestore) - ON_MESSAGE(WM_TRAY_NOTIFY, OnTrayNotify) - ON_WM_DESTROY() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CIcecast2winDlg message handlers - -#include "colors.h" - -BOOL CIcecast2winDlg::OnInitDialog() -{ - CResizableDialog::OnInitDialog(); - - // Add "About..." menu item to system menu. - - // IDM_ABOUTBOX must be in the system command range. - ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); - ASSERT(IDM_ABOUTBOX < 0xF000); - - CMenu* pSysMenu = GetSystemMenu(FALSE); - if (pSysMenu != NULL) - { - CString strAboutMenu; - strAboutMenu.LoadString(IDS_ABOUTBOX); - if (!strAboutMenu.IsEmpty()) - { - pSysMenu->AppendMenu(MF_SEPARATOR); - pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); - } - } - - - g_mainDialog = this; -// statsTab.SetDialogBkColor(BGCOLOR,TEXTCOLOR); - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - // TODO: Add extra initialization here - - config_read(); - - statsTab.m_colSource0Width = m_colSource0Width; - statsTab.m_colStats0Width = m_colStats0Width; - statsTab.m_colStats1Width = m_colStats1Width; - statusTab.m_colStats0Width = m_colGStats0Width; - statusTab.m_colStats1Width = m_colGStats1Width; - statusTab.m_colStats2Width = m_colGStats2Width; - - - - configTab.Create(IDD_CONFIGDIALOG, this); - statsTab.Create(IDD_STATSDIALOG, this); - statusTab.Create(IDD_SSTATUS, this); - - int nPageID = 0; - m_MainTab.AddSSLPage (_T("Server Status"), nPageID, (CTabPageSSL *)&statusTab); - nPageID++; - m_MainTab.AddSSLPage (_T("Configuration"), nPageID, (CTabPageSSL *)&configTab); - nPageID++; - m_MainTab.AddSSLPage (_T("Stats"), nPageID, (CTabPageSSL *)&statsTab); - nPageID++; - - - labelFont.CreateFont(24,0, 0, 0, FW_BOLD, 0, 0, 0, 0, OUT_TT_PRECIS, 0, PROOF_QUALITY, 0, "Arial"); - - runningBitmap.LoadBitmap(IDB_BITMAP6); - stoppedBitmap.LoadBitmap(IDB_BITMAP5); - //m_SS.SetFont(&labelFont, TRUE); - - UpdateData(FALSE); - - LoadConfig(); - - AddAnchor(IDC_MAINTAB, TOP_LEFT, BOTTOM_RIGHT); - AddAnchor(IDC_STATICBLACK, TOP_LEFT, TOP_RIGHT); - - EnableSaveRestore("icecast2win", "positions"); - - - - if (m_Autostart) { - OnStart(); - } - return TRUE; // return TRUE unless you set the focus to a control -} - -void CIcecast2winDlg::OnSysCommand(UINT nID, LPARAM lParam) -{ - if ((nID & 0xFFF0) == IDM_ABOUTBOX) - { - CAboutDlg dlgAbout; - dlgAbout.DoModal(); - } - else - { - CResizableDialog::OnSysCommand(nID, lParam); - } -} - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void CIcecast2winDlg::OnPaint() -{ - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CResizableDialog::OnPaint(); - } -} - - -// The system calls this to obtain the cursor to display while the user drags -// the minimized window. -HCURSOR CIcecast2winDlg::OnQueryDragIcon() -{ - return (HCURSOR) m_hIcon; -} - -void CIcecast2winDlg::OnSelchangeMaintab(NMHDR* pNMHDR, LRESULT* pResult) -{ - // TODO: Add your control notification handler code here - - /* - if (m_MainTab.GetCurSel() == 0) { - EnableControl(IDC_NUMBER_CLIENTS); - EnableControl(IDC_SERVERSTATUS); - EnableControl(IDC_SOURCES_CONNECTED); - m_ConfigEditCtrl.ShowWindow(SW_HIDE); - m_StatsEditCtrl.ShowWindow(SW_HIDE); - } - if (m_MainTab.GetCurSel() == 99) { - DisableControl(IDC_NUMBER_CLIENTS); - DisableControl(IDC_SERVERSTATUS); - DisableControl(IDC_SOURCES_CONNECTED); - m_ConfigEditCtrl.ShowWindow(SW_HIDE); - m_StatsEditCtrl.ShowWindow(SW_HIDE); - } - if (m_MainTab.GetCurSel() == 99) { - DisableControl(IDC_NUMBER_CLIENTS); - DisableControl(IDC_SERVERSTATUS); - DisableControl(IDC_SOURCES_CONNECTED); - m_ConfigEditCtrl.ShowWindow(SW_HIDE); - m_StatsEditCtrl.ShowWindow(SW_HIDE); - } - if (m_MainTab.GetCurSel() == 1) { - DisableControl(IDC_NUMBER_CLIENTS); - DisableControl(IDC_SERVERSTATUS); - DisableControl(IDC_SOURCES_CONNECTED); - m_ConfigEditCtrl.ShowWindow(SW_SHOW); - m_StatsEditCtrl.ShowWindow(SW_HIDE); - LoadConfig(); - ParseConfig(); - } - if (m_MainTab.GetCurSel() == 2) { - DisableControl(IDC_NUMBER_CLIENTS); - DisableControl(IDC_SERVERSTATUS); - DisableControl(IDC_SOURCES_CONNECTED); - m_ConfigEditCtrl.ShowWindow(SW_HIDE); - m_StatsEditCtrl.ShowWindow(SW_SHOW); - if (global.running == ICE_RUNNING) { - CString statData; - for (int i=0;im_configFile, "r"); - if (filep) { - while (!feof(filep)) { - memset(buffer, '\000', sizeof(buffer)); - fgets(buffer, sizeof(buffer), filep); - if (strlen(buffer) > 0) { - char *p1 = strstr(buffer, "\r\n"); - if (p1) { - *p1 = '\000'; - } - else { - buffer[strlen(buffer)-1] = '\000'; - } - configTab.m_Config = configTab.m_Config + buffer; - configTab.m_Config += "\r\n"; - } - } - } - else { - configTab.m_Config = " \ -\r\n \ - Here and There\r\n\ - nobody@me.org\r\n\ - \r\n\ - 100\r\n\ - 2\r\n\ - 5\r\n\ - 30\r\n\ - 15\r\n\ - 10\r\n\ - \r\n\ - changeme\r\n\ - \r\n\ - 5\r\n\ - \r\n\ - yp.icecast.org\r\n\ - 15\r\n\ - \r\n\ - \r\n\ - 0.0.0.0\r\n\ - 8000\r\n\ - \r\n\ - ./\r\n\ - ./\r\n\ - ./webroot\r\n\ - \r\n\ - \r\n\ - access.log\r\n\ - error.log\r\n\ - \r\n\ -\r\n\ -"; - } - gConfigurationSave = configTab.m_Config; - configTab.UpdateData(FALSE); - -} - - -void CIcecast2winDlg::OnFileExit() -{ - // TODO: Add your command handler code here - - - DestroyWindow(); -} - - -void CIcecast2winDlg::ParseConfig() -{ - char access[2046] = ""; - char error[2046] = ""; - char logdir[2046] = ""; - - memset(access, '\000', sizeof(access)); - memset(error, '\000', sizeof(error)); - memset(logdir, '\000', sizeof(logdir)); - - getTag(m_ConfigEdit.GetBuffer(0), "logdir", logdir); - getTag(m_ConfigEdit.GetBuffer(0), "accesslog", access); - getTag(m_ConfigEdit.GetBuffer(0), "errorlog", error); - - m_AccessLog = logdir; - m_AccessLog += access; - m_ErrorLog = logdir; - m_ErrorLog += error; - -} - -void CIcecast2winDlg::getTag(char *pbuf, char *ptag, char *dest) -{ - char openTag[256] = ""; - char closeTag[256] = ""; - - sprintf(openTag, "<%s>", ptag); - sprintf(closeTag, "", ptag); - - char *p1; - p1 = strstr(pbuf, openTag); - if (p1) { - p1 = p1 + strlen(openTag); - char *p2; - p2 = strstr(p1, closeTag); - if (p2) { - strncpy(dest, p1, p2-p1); - } - } -} - - -void CIcecast2winDlg::EnableControl(UINT control) -{ - CWnd *pWnd; - pWnd = GetDlgItem(control); - ::ShowWindow(pWnd->GetSafeHwnd(), SW_SHOW); -} - -void CIcecast2winDlg::DisableControl(UINT control) -{ - CWnd *pWnd; - pWnd = GetDlgItem(control); - ::ShowWindow(pWnd->GetSafeHwnd(), SW_HIDE); -} - - - -void CollectStats(stats_event_t *event) -{ - Element tempElement; - char tempSource[1024] = ""; - - tempElement.name = ""; - tempElement.value = ""; - -// memset(&tempElement, '\000', sizeof(tempElement)); - - if (event->name != NULL) { - //strcpy(tempElement.name, event->name); - tempElement.name = event->name; - } - if (event->value != NULL) { - //strcpy(tempElement.value, event->value); - tempElement.value = event->value; - } - if (event->source != NULL) { - strcpy(tempSource, event->source); - - } - - int foundit = 0; - for (int i=0;iname != NULL) { - if (!strcmp(event->name, "listeners")) { - if (event->value == NULL) { - // source has disconnected... - for (int i=0;istatsTab.m_SourceListCtrl.DeleteAllItems(); - g_mainDialog->statsTab.m_StatsListCtrl.DeleteAllItems(); - break; - } - } - } - } - } - g_mainDialog->UpdateStatsLists(); - -} -bool g_collectingStats = false; - -void StartStats(void *dummy) -{ - while (global.running != ICE_RUNNING) { - Sleep(500); - } - while (global.running == ICE_RUNNING) { - if (global.running == ICE_RUNNING) { -// memset(&gStats, '\000', sizeof(gStats)); - for (int j=0;jserverStart)); - main(argc, (char **)argv); -// g_mainDialog->StopServer(); - global.running = ICE_HALTING; - _endthread(); - - -} -void CIcecast2winDlg::OnFileStartserver() -{ - // TODO: Add your command handler code here - CIcecast2winApp *myApp = (CIcecast2winApp *)AfxGetApp(); - - if (gConfigurationSave == "") { - gConfigurationSave = m_ConfigEdit; - } - - if (global.running == ICE_RUNNING) { - MessageBox("Server already running", "Error", MB_OK); - } - else { - m_ConfigEditCtrl.SetReadOnly(TRUE); - LoadConfig(); - ParseConfig(); - SetTimer(0, 500, NULL); - _beginthread(StartServer, 0, (void *)(LPCSTR)myApp->m_configFile); -// _beginthread(StartTailAccessLog, 0, (void *)0); -// _beginthread(StartTailErrorLog, 0, (void *)0); - // EDZ - _beginthread(StartStats, 0, (void *)CollectStats); - } -} - -void CIcecast2winDlg::OnFileStopserver() -{ - // TODO: Add your command handler code here - ; -} - -bool infocus = false; - -void CIcecast2winDlg::StopServer() -{ - KillTimer(0); - configTab.m_ConfigCtrl.SetReadOnly(FALSE); - global.running = ICE_HALTING; - m_StartButton.SetWindowText("Start Server"); - m_StartButton.SetState(0); - m_ServerStatusBitmap.SetBitmap(HBITMAP(stoppedBitmap)); - statusTab.m_RunningFor = "Not running"; - statusTab.UpdateData(FALSE); - - - -} - - -void CIcecast2winDlg::OnStart() -{ - CIcecast2winApp *myApp = (CIcecast2winApp *)AfxGetApp(); - - // TODO: Add your control notification handler code here - if (global.running == ICE_RUNNING) { - StopServer(); - } - else { - configTab.m_ConfigCtrl.SetReadOnly(TRUE); - ParseConfig(); - SetTimer(0, 500, NULL); - _beginthread(StartServer, 0, (void *)(LPCSTR)myApp->m_configFile); - // EDZ - _beginthread(StartStats, 0, (void *)CollectStats); - } - -} - -void CIcecast2winDlg::UpdateStatsLists() -{ - char item[1024] = ""; - int l = 0; - - for (int i=0;i 0) { - char *p1 = strchr(buf, '|'); - if (p1) { - char tmpSource[1024] = ""; - char tmpName[1024] = ""; - memset(tmpSource, '\000', sizeof(tmpSource)); - memset(tmpName, '\000', sizeof(tmpName)); - - - strncpy(tmpSource, buf, p1-buf); - p1++; - strcpy(tmpName, p1); - - - strcpy(gTitleSource, tmpSource); - strcpy(gTitleName, tmpName); - } - } - */ - -} - -void CIcecast2winDlg::OnClose() -{ - // TODO: Add your message handler code here and/or call default - config_write(); - CResizableDialog::OnClose(); -} - -void CIcecast2winDlg::OnSize(UINT nType, int cx, int cy) -{ - CResizableDialog::OnSize(nType, cx, cy); - - int border1 = 0; - int border2 = 78; - // TODO: Add your message handler code here - if (m_MainTab.m_hWnd) { - CRect rect; - GetClientRect (&rect); - m_MainTab.ResizeDialog(0, rect.Width()-border1, rect.Height()-border2); - m_MainTab.ResizeDialog(1, rect.Width()-border1, rect.Height()-border2); - m_MainTab.ResizeDialog(2, rect.Width()-border1, rect.Height()-border2); - } - -} - - -LONG CIcecast2winDlg::OnTrayNotify ( WPARAM wParam, LPARAM lParam ) -{ - switch (lParam) { - case WM_RBUTTONDOWN: - { - CMenu menu ; - // Load and Verify Menu - VERIFY(menu.LoadMenu(IDR_TRAY)); - CMenu* pPopup = menu.GetSubMenu (0) ; - ASSERT(pPopup != NULL); - - // Get the cursor position - POINT pt ; - GetCursorPos (&pt) ; - - // Fix Microsofts' BUG!!!! - SetForegroundWindow(); - - /////////////////////////////////// - // Display The Menu - pPopup->TrackPopupMenu(TPM_LEFTALIGN | - TPM_RIGHTBUTTON,pt.x, pt.y, AfxGetMainWnd()); - break ; - } - case WM_LBUTTONDBLCLK: - ////////////////////////////////// - // Unhide our Window - if (m_bHidden) { - ShowWindow (SW_RESTORE); - } - //OnUnHide() ; - break ; - } - - return (0) ; -} - -void CIcecast2winDlg::OnHidesystray() -{ - // TODO: Add your control notification handler code here - OnHide(); - theApp.HideApplication(); -} -void CIcecast2winDlg::OnHide() -{ - // TODO: Add your control notification handler code here - m_pTray = new CTrayNot (this,WM_TRAY_NOTIFY, NULL,theApp.m_pIconList); - m_pTray->SetState(0); - m_bHidden = TRUE; - -} - -void CIcecast2winDlg::OnBlankRestore() -{ - // TODO: Add your command handler code here - if (m_bHidden) { - ShowWindow (SW_RESTORE); - } - -} - -void CIcecast2winDlg::OnDestroy() -{ - CResizableDialog::OnDestroy(); - - if (m_pTray) { - delete m_pTray ; - m_pTray = NULL ; - } - // TODO: Add your message handler code here - -} +// Icecast2winDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "Icecast2win.h" +#include "Icecast2winDlg.h" +#include +#include "ResizableDialog.h" + +#include +#include +#include +#include + +extern "C" { +#include "thread.h" +#include "avl.h" +#include "log.h" +#include "global.h" +#include "httpp.h" +#include "sock.h" +#include "connection.h" +#include "refbuf.h" +#include "client.h" +#include "stats.h" +} + + +#include + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +CEdit *g_accessControl; +CEdit *g_errorControl; +CIcecast2winDlg *g_mainDialog; +bool g_tailAccess = false; +bool g_tailError = false; +void CollectStats(stats_event_t *event); +CString gConfigurationSave; + +char gTitleSource[1024] = ""; +char gTitleName[1024] = ""; + +#define MAXSTATSPERSOURCE 30 +#define MAXSOURCES 1024 + +typedef struct tagElement { + CString name; + CString value; + int titleFlag; +} Element; + +typedef struct tagElementAdditional { + CString source; + CString name; + CString value; + int titleFlag; +} ElementAdditional; + + +typedef struct tagMainElement { + CString source; + long numStats; + Element stats[MAXSTATSPERSOURCE]; + int populated; +} MainElement; + +typedef struct tagMainElementAdditional { + long numStats; + ElementAdditional stats[MAXSTATSPERSOURCE]; +} MainElementAdditional; + + +MainElement gStats[MAXSOURCES]; +MainElement gGlobalStats; +MainElementAdditional gAdditionalGlobalStats; + +long numMainStats; + +extern "C" { + int main(int argc, char **argv); +} + + +void AddToAdditionalGlobalStats(CString source, CString name) { + int foundit = 0; + for (int i=0;iUpdateStatsLists(); +} + +void ClearTitleAdditionalGlobalStats(CString source, CString name) { + int foundit = 0; + int i,j; + for (i=0;iUpdateStatsLists(); +} +void AddToTitleAdditionalGlobalStats(CString source, CString name) { + int foundit = 0; + int i,j; + for (i=0;iUpdateStatsLists(); +} + +void RemoveFromAdditionalGlobalStats(CString source, CString name) { + int foundit = 0; + for (int i=0;iUpdateStatsLists(); +} +///////////////////////////////////////////////////////////////////////////// +// CAboutDlg dialog used for App About + +class CAboutDlg : public CResizableDialog +{ +public: + CAboutDlg(); + +// Dialog Data + //{{AFX_DATA(CAboutDlg) + enum { IDD = IDD_ABOUTBOX }; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CAboutDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + //{{AFX_MSG(CAboutDlg) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CResizableDialog(CAboutDlg::IDD) +{ + //{{AFX_DATA_INIT(CAboutDlg) + //}}AFX_DATA_INIT +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CResizableDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CAboutDlg) + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CResizableDialog) + //{{AFX_MSG_MAP(CAboutDlg) + // No message handlers + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// CIcecast2winDlg dialog + +CIcecast2winDlg::CIcecast2winDlg(CWnd* pParent /*=NULL*/) + : CResizableDialog(CIcecast2winDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CIcecast2winDlg) + m_AccessEdit = _T(""); + m_ErrorEdit = _T(""); + m_ConfigEdit = _T(""); + m_ServerStatus = _T(""); + m_SourcesConnected = _T(""); + m_NumClients = _T(""); + m_StatsEdit = _T(""); + m_Autostart = FALSE; + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + m_pTray = NULL; +} + +void CIcecast2winDlg::DoDataExchange(CDataExchange* pDX) +{ + CResizableDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CIcecast2winDlg) + DDX_Control(pDX, IDC_STATIC_SS, m_SS); + DDX_Control(pDX, IDC_SERVERSTATUS, m_ServerStatusBitmap); + DDX_Control(pDX, IDC_START, m_StartButton); + DDX_Control(pDX, IDC_MAINTAB, m_MainTab); + DDX_Check(pDX, IDC_AUTOSTART, m_Autostart); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CIcecast2winDlg, CResizableDialog) + //{{AFX_MSG_MAP(CIcecast2winDlg) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_NOTIFY(TCN_SELCHANGE, IDC_MAINTAB, OnSelchangeMaintab) + ON_COMMAND(ID_FILE_EXIT, OnFileExit) + ON_WM_TIMER() + ON_COMMAND(ID_FILE_STARTSERVER, OnFileStartserver) + ON_COMMAND(ID_FILE_STOPSERVER, OnFileStopserver) + ON_BN_CLICKED(IDC_START, OnStart) + ON_WM_CLOSE() + ON_WM_SIZE() + ON_BN_CLICKED(IDC_HIDESYSTRAY, OnHidesystray) + ON_COMMAND(ID_BLANK_RESTORE, OnBlankRestore) + ON_MESSAGE(WM_TRAY_NOTIFY, OnTrayNotify) + ON_WM_DESTROY() + ON_COMMAND(ID_FILE_EDITCONFIGURATION, OnFileEditconfiguration) + ON_COMMAND(ID_ABOUT_HELP, OnAboutHelp) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CIcecast2winDlg message handlers + +#include "colors.h" + +BOOL CIcecast2winDlg::OnInitDialog() +{ + CResizableDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + CString strAboutMenu; + strAboutMenu.LoadString(IDS_ABOUTBOX); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + + g_mainDialog = this; + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + // TODO: Add extra initialization here + config_read(); + + statsTab.m_colSource0Width = m_colSource0Width; + statsTab.m_colStats0Width = m_colStats0Width; + statsTab.m_colStats1Width = m_colStats1Width; + statusTab.m_colStats0Width = m_colGStats0Width; + statusTab.m_colStats1Width = m_colGStats1Width; + statusTab.m_colStats2Width = m_colGStats2Width; + + statsTab.Create(IDD_STATSDIALOG, this); + statusTab.Create(IDD_SSTATUS, this); + + int nPageID = 0; + m_MainTab.AddSSLPage (_T("Server Status"), nPageID, (CTabPageSSL *)&statusTab); + nPageID++; + m_MainTab.AddSSLPage (_T("Source Level Stats"), nPageID, (CTabPageSSL *)&statsTab); + nPageID++; + + + labelFont.CreateFont(24,0, 0, 0, FW_BOLD, 0, 0, 0, 0, OUT_TT_PRECIS, 0, PROOF_QUALITY, 0, "Arial"); + + runningBitmap.LoadBitmap(IDB_BITMAP6); + stoppedBitmap.LoadBitmap(IDB_BITMAP5); + + UpdateData(FALSE); + + LoadConfig(); + + AddAnchor(IDC_MAINTAB, TOP_LEFT, BOTTOM_RIGHT); + AddAnchor(IDC_STATICBLACK, TOP_LEFT, TOP_RIGHT); + + EnableSaveRestore("icecast2win", "positions"); + + m_pTray = NULL; + + if (m_Autostart) { + OnStart(); + } + return TRUE; // return TRUE unless you set the focus to a control +} + +void CIcecast2winDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CResizableDialog::OnSysCommand(nID, lParam); + } +} + +// If you add a minimize button to your dialog, you will need the code below +// to draw the icon. For MFC applications using the document/view model, +// this is automatically done for you by the framework. + +void CIcecast2winDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CResizableDialog::OnPaint(); + } +} + + +// The system calls this to obtain the cursor to display while the user drags +// the minimized window. +HCURSOR CIcecast2winDlg::OnQueryDragIcon() +{ + return (HCURSOR) m_hIcon; +} + +void CIcecast2winDlg::OnSelchangeMaintab(NMHDR* pNMHDR, LRESULT* pResult) +{ + // TODO: Add your control notification handler code here + + *pResult = 0; +} + +void CIcecast2winDlg::LoadConfig() +{ + FILE *filep; + char buffer[2046] = ""; + CIcecast2winApp *myApp = (CIcecast2winApp *)AfxGetApp(); + + configTab.m_Config = ""; + filep = fopen(myApp->m_configFile, "r"); + if (filep) { + fclose(filep); + } + else { + MessageBox("Unable to load config file (" + CString(myApp->m_configFile) + ") unable to start", NULL, MB_OK); + } + +} + + +void CIcecast2winDlg::OnFileExit() +{ + // TODO: Add your command handler code here + DestroyWindow(); +} + + + +void CIcecast2winDlg::getTag(char *pbuf, char *ptag, char *dest) +{ + char openTag[256] = ""; + char closeTag[256] = ""; + + sprintf(openTag, "<%s>", ptag); + sprintf(closeTag, "", ptag); + + char *p1; + p1 = strstr(pbuf, openTag); + if (p1) { + p1 = p1 + strlen(openTag); + char *p2; + p2 = strstr(p1, closeTag); + if (p2) { + strncpy(dest, p1, p2-p1); + } + } +} + + +void CIcecast2winDlg::EnableControl(UINT control) +{ + CWnd *pWnd; + pWnd = GetDlgItem(control); + ::ShowWindow(pWnd->GetSafeHwnd(), SW_SHOW); +} + +void CIcecast2winDlg::DisableControl(UINT control) +{ + CWnd *pWnd; + pWnd = GetDlgItem(control); + ::ShowWindow(pWnd->GetSafeHwnd(), SW_HIDE); +} + + + +void CollectStats(stats_event_t *event) +{ + Element tempElement; + char tempSource[1024] = ""; + + tempElement.name = ""; + tempElement.value = ""; + + if (event->name != NULL) { + tempElement.name = event->name; + } + if (event->value != NULL) { + tempElement.value = event->value; + } + if (event->source != NULL) { + strcpy(tempSource, event->source); + + } + + int foundit = 0; + for (int i=0;iname != NULL) { + if (!strcmp(event->name, "listeners")) { + if (event->value == NULL) { + // source has disconnected... + for (int i=0;istatsTab.m_SourceListCtrl.DeleteAllItems(); + g_mainDialog->statsTab.m_StatsListCtrl.DeleteAllItems(); + break; + } + } + } + } + } + g_mainDialog->UpdateStatsLists(); + +} +bool g_collectingStats = false; + +void StartStats(void *dummy) +{ + while (global.running != ICE_RUNNING) { + Sleep(500); + } + while (global.running == ICE_RUNNING) { + if (global.running == ICE_RUNNING) { + for (int j=0;jserverStart)); + int ret = main(argc, (char **)argv); + if (ret) { + MessageBox(NULL, "Unable to start server", NULL, MB_OK); + } + global.running = ICE_HALTING; + _endthread(); + + +} +void CIcecast2winDlg::OnFileStartserver() +{ + // TODO: Add your command handler code here + CIcecast2winApp *myApp = (CIcecast2winApp *)AfxGetApp(); + + if (gConfigurationSave == "") { + gConfigurationSave = m_ConfigEdit; + } + + if (global.running == ICE_RUNNING) { + MessageBox("Server already running", "Error", MB_OK); + } + else { + m_ConfigEditCtrl.SetReadOnly(TRUE); + LoadConfig(); + SetTimer(0, 500, NULL); + _beginthread(StartServer, 0, (void *)(LPCSTR)myApp->m_configFile); + _beginthread(StartStats, 0, (void *)CollectStats); + } +} + +void CIcecast2winDlg::OnFileStopserver() +{ + // TODO: Add your command handler code here + ; +} + +bool infocus = false; + +void CIcecast2winDlg::StopServer() +{ + KillTimer(0); + global.running = ICE_HALTING; + m_StartButton.SetWindowText("Start Server"); + m_StartButton.SetState(0); + m_ServerStatusBitmap.SetBitmap(HBITMAP(stoppedBitmap)); + statusTab.m_RunningFor = "Not running"; + statusTab.UpdateData(FALSE); + + + +} + + +void CIcecast2winDlg::OnStart() +{ + CIcecast2winApp *myApp = (CIcecast2winApp *)AfxGetApp(); + + // TODO: Add your control notification handler code here + if (global.running == ICE_RUNNING) { + StopServer(); + } + else { + SetTimer(0, 500, NULL); + _beginthread(StartServer, 0, (void *)(LPCSTR)myApp->m_configFile); + _beginthread(StartStats, 0, (void *)CollectStats); + } + +} + +void CIcecast2winDlg::UpdateStatsLists() +{ + char item[1024] = ""; + int l = 0; + + for (int i=0;iSetTIP((LPSTR)(LPCSTR)windowTitle); + } + } + } + } + else { + // If Global Stat + for (k=0;k < gStats[i].numStats;k++) { + inthere = 0; + for (l=0;l < statusTab.m_GlobalStatList.GetItemCount();l++) { + + statusTab.m_GlobalStatList.GetItemText(l, 1, item, sizeof(item)); + if (!strcmp(gStats[i].stats[k].name, item)) { + inthere = 1; + break; + } + } + if (!inthere) { + LVITEM lvi; + + lvi.mask = LVIF_IMAGE | LVIF_TEXT; + lvi.iItem = statsTab.m_SourceListCtrl.GetItemCount(); + lvi.iSubItem = 0; + lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].source; + statusTab.m_GlobalStatList.InsertItem(&lvi); + lvi.iSubItem = 1; + lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[k].name; + statusTab.m_GlobalStatList.SetItem(&lvi); + lvi.iSubItem = 2; + lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[k].value; + statusTab.m_GlobalStatList.SetItem(&lvi); + if ((!strcmp(gTitleSource, gStats[i].source)) && + (!strcmp(gTitleName, gStats[i].stats[k].name))) { + gStats[i].stats[k].titleFlag = 1; + } + + } + else { + LVITEM lvi; + + lvi.mask = LVIF_IMAGE | LVIF_TEXT; + lvi.iItem = l; + lvi.iSubItem = 2; + lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[k].value; + statusTab.m_GlobalStatList.SetItem(&lvi); + } + if (gStats[i].stats[k].titleFlag) { + CString windowTitle = gStats[i].source + " - " + gStats[i].stats[k].name + " - " + gStats[i].stats[k].value; + SetWindowText(windowTitle); + if (m_pTray) { + m_pTray->SetTIP((LPSTR)(LPCSTR)windowTitle); + } + + } + } + } + } + } +} + +char gAppName[255] = "icecast2"; +char gConfigFile[255] = "icecast2.ini"; + +void CIcecast2winDlg::config_write() +{ + char buf[255] = ""; + char buf2[1024] = ""; + + UpdateData(TRUE); + + m_colSource0Width = statsTab.m_SourceListCtrl.GetColumnWidth(0); + m_colStats0Width = statsTab.m_StatsListCtrl.GetColumnWidth(0); + m_colStats1Width = statsTab.m_StatsListCtrl.GetColumnWidth(1); + m_colGStats0Width = statusTab.m_GlobalStatList.GetColumnWidth(0); + m_colGStats1Width = statusTab.m_GlobalStatList.GetColumnWidth(1); + m_colGStats2Width = statusTab.m_GlobalStatList.GetColumnWidth(2); + + + sprintf(buf, "%d", m_colSource0Width); + WritePrivateProfileString(gAppName, "col0SourceWidth", buf, gConfigFile); + sprintf(buf, "%d", m_colStats0Width); + WritePrivateProfileString(gAppName, "col0StatsWidth", buf, gConfigFile); + sprintf(buf, "%d", m_colStats1Width); + WritePrivateProfileString(gAppName, "col1StatsWidth", buf, gConfigFile); + sprintf(buf, "%d", m_colGStats0Width); + WritePrivateProfileString(gAppName, "col0GStatsWidth", buf, gConfigFile); + sprintf(buf, "%d", m_colGStats1Width); + WritePrivateProfileString(gAppName, "col1GStatsWidth", buf, gConfigFile); + sprintf(buf, "%d", m_colGStats2Width); + WritePrivateProfileString(gAppName, "col2GStatsWidth", buf, gConfigFile); + + if (m_Autostart) { + WritePrivateProfileString(gAppName, "AutoStart", "1", gConfigFile); + } + else { + WritePrivateProfileString(gAppName, "AutoStart", "0", gConfigFile); + } + + sprintf(buf, "%d", gAdditionalGlobalStats.numStats); + WritePrivateProfileString(gAppName, "numAdditionalStats", buf, gConfigFile); + + for (int i=0;i 0) { + char *p1 = strchr(buf, '|'); + if (p1) { + char tmpSource[1024] = ""; + char tmpName[1024] = ""; + memset(tmpSource, '\000', sizeof(tmpSource)); + memset(tmpName, '\000', sizeof(tmpName)); + + + strncpy(tmpSource, buf, p1-buf); + p1++; + strcpy(tmpName, p1); + + + strcpy(gTitleSource, tmpSource); + strcpy(gTitleName, tmpName); + } + } + +} + +void CIcecast2winDlg::OnClose() +{ + // TODO: Add your message handler code here and/or call default + config_write(); + CResizableDialog::OnClose(); +} + +void CIcecast2winDlg::OnSize(UINT nType, int cx, int cy) +{ + CResizableDialog::OnSize(nType, cx, cy); + + int border1 = 0; + int border2 = 78; + // TODO: Add your message handler code here + if (m_MainTab.m_hWnd) { + CRect rect; + GetClientRect (&rect); + m_MainTab.ResizeDialog(0, rect.Width()-border1, rect.Height()-border2); + m_MainTab.ResizeDialog(1, rect.Width()-border1, rect.Height()-border2); + } + +} + + +LONG CIcecast2winDlg::OnTrayNotify ( WPARAM wParam, LPARAM lParam ) +{ + switch (lParam) { + case WM_RBUTTONDOWN: + { + CMenu menu ; + // Load and Verify Menu + VERIFY(menu.LoadMenu(IDR_TRAY)); + CMenu* pPopup = menu.GetSubMenu (0) ; + ASSERT(pPopup != NULL); + + // Get the cursor position + POINT pt ; + GetCursorPos (&pt) ; + + // Fix Microsofts' BUG!!!! + SetForegroundWindow(); + + /////////////////////////////////// + // Display The Menu + pPopup->TrackPopupMenu(TPM_LEFTALIGN | + TPM_RIGHTBUTTON,pt.x, pt.y, AfxGetMainWnd()); + break ; + } + case WM_LBUTTONDBLCLK: + ////////////////////////////////// + // Unhide our Window + if (m_bHidden) { + ShowWindow (SW_RESTORE); + } + //OnUnHide() ; + break ; + } + + return (0) ; +} + +void CIcecast2winDlg::OnHidesystray() +{ + // TODO: Add your control notification handler code here + OnHide(); + theApp.HideApplication(); +} +void CIcecast2winDlg::OnHide() +{ + // TODO: Add your control notification handler code here + if (m_pTray == NULL) { + m_pTray = new CTrayNot (this,WM_TRAY_NOTIFY, NULL,theApp.m_pIconList); + } + m_pTray->SetState(0); + m_bHidden = TRUE; + +} + +void CIcecast2winDlg::OnBlankRestore() +{ + // TODO: Add your command handler code here + if (m_bHidden) { + ShowWindow (SW_RESTORE); + } + +} + +void CIcecast2winDlg::OnDestroy() +{ + CResizableDialog::OnDestroy(); + + if (m_pTray) { + delete m_pTray ; + m_pTray = NULL ; + } + // TODO: Add your message handler code here + +} + +void CIcecast2winDlg::OnFileEditconfiguration() +{ + // TODO: Add your command handler code here + + STARTUPINFO si; + PROCESS_INFORMATION pi; + + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + + + int ok = 1; + if (global.running == ICE_RUNNING) { + MessageBox("I'm sorry, but you cannot edit the configuration file while the server is running", NULL, MB_OK); + } + else { + // Start the child process. + if( !CreateProcess( NULL, // No module name (use command line). + "notepad icecast.xml", // Command line. + NULL, // Process handle not inheritable. + NULL, // Thread handle not inheritable. + FALSE, // Set handle inheritance to FALSE. + 0, // No creation flags. + NULL, // Use parent's environment block. + NULL, // Use parent's starting directory. + &si, // Pointer to STARTUPINFO structure. + &pi ) // Pointer to PROCESS_INFORMATION structure. + ) + { + ok = 0; + } + + // Wait until child process exits. + WaitForSingleObject( pi.hProcess, INFINITE ); + + // Close process and thread handles. + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + +} + +void CIcecast2winDlg::OnAboutHelp() +{ + // TODO: Add your command handler code here + ShellExecute(NULL, "open", "doc\\icecast2.chm", NULL, NULL, SW_SHOWNORMAL); +} diff --git a/win32/Icecast2winDlg.h b/win32/Icecast2winDlg.h index 9e9754bb..83bbefa2 100644 --- a/win32/Icecast2winDlg.h +++ b/win32/Icecast2winDlg.h @@ -1,121 +1,123 @@ -// Icecast2winDlg.h : header file -// - -#if !defined(AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_) -#define AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_ - -#include "ResizableDialog.h" -#include "TabCtrlSSL.h" -#include "TabPageSSL.h" - -#include "ConfigTab.h" -#include "StatsTab.h" -#include "Status.h" -#include "TrayNot.h" - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -///////////////////////////////////////////////////////////////////////////// -// CIcecast2winDlg dialog - -class CIcecast2winDlg : public CResizableDialog -{ -// Construction -public: - time_t serverStart; - void config_read(); - void config_write(); - void UpdateStatsLists(); - CConfigTab configTab; - CStatsTab statsTab; - CStatus statusTab; - int m_colSource0Width; - int m_colStats0Width; - int m_colStats1Width; - int m_colGStats0Width; - int m_colGStats1Width; - int m_colGStats2Width; - CFont labelFont; - CBitmap runningBitmap; - CBitmap stoppedBitmap; - CTrayNot* m_pTray; - BOOL m_bHidden; - int m_iconSwap; - - - - - void StopServer(); - bool m_isRunning; - void DisableControl(UINT control); - void EnableControl(UINT control); - void getTag(char *pbuf, char *ptag, char *dest); - CString m_ErrorLog; - CString m_AccessLog; - void ParseConfig(); - void LoadConfig(); - CIcecast2winDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CIcecast2winDlg) - enum { IDD = IDD_ICECAST2WIN_DIALOG }; - CStatic m_SS; - CStatic m_ServerStatusBitmap; - CStatic m_iceLogo; - CButton m_StartButton; - CEdit m_StatsEditCtrl; - CEdit m_ConfigEditCtrl; - CEdit m_ErrorEditCtrl; - CEdit m_AccessEditCtrl; - CTabCtrlSSL m_MainTab; - CString m_AccessEdit; - CString m_ErrorEdit; - CString m_ConfigEdit; - CString m_ServerStatus; - CString m_SourcesConnected; - CString m_NumClients; - FILE *filep_accesslog; - FILE *filep_errorlog; - CString m_StatsEdit; - BOOL m_Autostart; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CIcecast2winDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - HICON m_hIcon; - - // Generated message map functions - //{{AFX_MSG(CIcecast2winDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnSysCommand(UINT nID, LPARAM lParam); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg void OnSelchangeMaintab(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnFileExit(); - afx_msg void OnTimer(UINT nIDEvent); - afx_msg void OnFileStartserver(); - afx_msg void OnFileStopserver(); - afx_msg void OnStart(); - afx_msg void OnClose(); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnHidesystray(); - afx_msg void OnHide(); - afx_msg void OnBlankRestore(); - afx_msg LONG OnTrayNotify ( WPARAM wParam, LPARAM lParam ); - afx_msg void OnDestroy(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_) +// Icecast2winDlg.h : header file +// + +#if !defined(AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_) +#define AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_ + +#include "ResizableDialog.h" +#include "TabCtrlSSL.h" +#include "TabPageSSL.h" + +#include "ConfigTab.h" +#include "StatsTab.h" +#include "Status.h" +#include "TrayNot.h" + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +///////////////////////////////////////////////////////////////////////////// +// CIcecast2winDlg dialog + +class CIcecast2winDlg : public CResizableDialog +{ +// Construction +public: + time_t serverStart; + void config_read(); + void config_write(); + void UpdateStatsLists(); + CConfigTab configTab; + CStatsTab statsTab; + CStatus statusTab; + int m_colSource0Width; + int m_colStats0Width; + int m_colStats1Width; + int m_colGStats0Width; + int m_colGStats1Width; + int m_colGStats2Width; + CFont labelFont; + CBitmap runningBitmap; + CBitmap stoppedBitmap; + CTrayNot* m_pTray; + BOOL m_bHidden; + int m_iconSwap; + + + + + void StopServer(); + bool m_isRunning; + void DisableControl(UINT control); + void EnableControl(UINT control); + void getTag(char *pbuf, char *ptag, char *dest); + CString m_ErrorLog; + CString m_AccessLog; + void ParseConfig(); + void LoadConfig(); + CIcecast2winDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CIcecast2winDlg) + enum { IDD = IDD_ICECAST2WIN_DIALOG }; + CStatic m_SS; + CStatic m_ServerStatusBitmap; + CStatic m_iceLogo; + CButton m_StartButton; + CEdit m_StatsEditCtrl; + CEdit m_ConfigEditCtrl; + CEdit m_ErrorEditCtrl; + CEdit m_AccessEditCtrl; + CTabCtrlSSL m_MainTab; + CString m_AccessEdit; + CString m_ErrorEdit; + CString m_ConfigEdit; + CString m_ServerStatus; + CString m_SourcesConnected; + CString m_NumClients; + FILE *filep_accesslog; + FILE *filep_errorlog; + CString m_StatsEdit; + BOOL m_Autostart; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CIcecast2winDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + HICON m_hIcon; + + // Generated message map functions + //{{AFX_MSG(CIcecast2winDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg void OnSelchangeMaintab(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnFileExit(); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnFileStartserver(); + afx_msg void OnFileStopserver(); + afx_msg void OnStart(); + afx_msg void OnClose(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnHidesystray(); + afx_msg void OnHide(); + afx_msg void OnBlankRestore(); + afx_msg LONG OnTrayNotify ( WPARAM wParam, LPARAM lParam ); + afx_msg void OnDestroy(); + afx_msg void OnFileEditconfiguration(); + afx_msg void OnAboutHelp(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_) diff --git a/win32/StdAfx.h b/win32/StdAfx.h index 5a3c9d5b..1c6c3ca1 100644 --- a/win32/StdAfx.h +++ b/win32/StdAfx.h @@ -1,27 +1,27 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__2C2EF8C3_43CD_47D2_A979_EC36873E602D__INCLUDED_) -#define AFX_STDAFX_H__2C2EF8C3_43CD_47D2_A979_EC36873E602D__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC Automation classes -#include // MFC support for Internet Explorer 4 Common Controls -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#define WM_TRAY_NOTIFY WM_APP+1000 -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__2C2EF8C3_43CD_47D2_A979_EC36873E602D__INCLUDED_) +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__2C2EF8C3_43CD_47D2_A979_EC36873E602D__INCLUDED_) +#define AFX_STDAFX_H__2C2EF8C3_43CD_47D2_A979_EC36873E602D__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include // MFC core and standard components +#include // MFC extensions +#include // MFC Automation classes +#include // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + +#define WM_TRAY_NOTIFY WM_APP+1000 +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__2C2EF8C3_43CD_47D2_A979_EC36873E602D__INCLUDED_) diff --git a/win32/icecast.dsp b/win32/icecast.dsp index d94d6fcd..14ce6d43 100644 --- a/win32/icecast.dsp +++ b/win32/icecast.dsp @@ -1,284 +1,284 @@ -# Microsoft Developer Studio Project File - Name="icecast" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=icecast - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "icecast.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "icecast.mak" CFG="icecast - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "icecast - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "icecast - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "icecast - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Releaseicecast" -# PROP Intermediate_Dir "Releaseicecast" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "..\src" /I "..\src/httpp" /I "..\src/thread" /I "..\src/log" /I "..\src/avl" /I "..\src/net" /I "..\src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "icecast - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debugicecast" -# PROP Intermediate_Dir "Debugicecast" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "..\src" /I "..\src/httpp" /I "..\src/thread" /I "..\src/log" /I "..\src/avl" /I "..\src/net" /I "..\src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "_WIN32" /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "icecast - Win32 Release" -# Name "icecast - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\src\avl\avl.c -# End Source File -# Begin Source File - -SOURCE=..\src\avl\avl.h -# End Source File -# Begin Source File - -SOURCE=..\src\client.c -# End Source File -# Begin Source File - -SOURCE=..\src\client.h -# End Source File -# Begin Source File - -SOURCE=..\src\compat.h -# End Source File -# Begin Source File - -SOURCE=..\src\config.c -# End Source File -# Begin Source File - -SOURCE=..\src\config.h -# End Source File -# Begin Source File - -SOURCE=..\src\connection.c -# End Source File -# Begin Source File - -SOURCE=..\src\connection.h -# End Source File -# Begin Source File - -SOURCE=..\src\format.c -# End Source File -# Begin Source File - -SOURCE=..\src\format.h -# End Source File -# Begin Source File - -SOURCE=..\src\format_mp3.c -# End Source File -# Begin Source File - -SOURCE=..\src\format_mp3.h -# End Source File -# Begin Source File - -SOURCE=..\src\format_vorbis.c -# End Source File -# Begin Source File - -SOURCE=..\src\format_vorbis.h -# End Source File -# Begin Source File - -SOURCE=..\src\fserve.c -# End Source File -# Begin Source File - -SOURCE=..\src\fserve.h -# End Source File -# Begin Source File - -SOURCE=..\src\global.c -# End Source File -# Begin Source File - -SOURCE=..\src\global.h -# End Source File -# Begin Source File - -SOURCE=..\src\httpp\httpp.c -# End Source File -# Begin Source File - -SOURCE=..\src\httpp\httpp.h -# End Source File -# Begin Source File - -SOURCE=..\src\log\log.c -# End Source File -# Begin Source File - -SOURCE=..\src\log\log.h -# End Source File -# Begin Source File - -SOURCE=..\src\logging.c -# End Source File -# Begin Source File - -SOURCE=..\src\logging.h -# End Source File -# Begin Source File - -SOURCE=..\src\main.c -# End Source File -# Begin Source File - -SOURCE=..\src\os.h -# End Source File -# Begin Source File - -SOURCE=..\src\refbuf.c -# End Source File -# Begin Source File - -SOURCE=..\src\refbuf.h -# End Source File -# Begin Source File - -SOURCE=..\src\net\resolver.c -# End Source File -# Begin Source File - -SOURCE=..\src\net\resolver.h -# End Source File -# Begin Source File - -SOURCE=..\src\sighandler.c -# End Source File -# Begin Source File - -SOURCE=..\src\sighandler.h -# End Source File -# Begin Source File - -SOURCE=..\src\slave.c -# End Source File -# Begin Source File - -SOURCE=..\src\net\sock.c -# End Source File -# Begin Source File - -SOURCE=..\src\net\sock.h -# End Source File -# Begin Source File - -SOURCE=..\src\source.c -# End Source File -# Begin Source File - -SOURCE=..\src\source.h -# End Source File -# Begin Source File - -SOURCE=..\src\stats.c -# End Source File -# Begin Source File - -SOURCE=..\src\stats.h -# End Source File -# Begin Source File - -SOURCE=..\src\thread\thread.c -# End Source File -# Begin Source File - -SOURCE=..\src\thread\thread.h -# End Source File -# Begin Source File - -SOURCE=..\src\timing\timing.c -# End Source File -# Begin Source File - -SOURCE=..\src\util.c -# End Source File -# Begin Source File - -SOURCE=..\src\util.h -# End Source File -# Begin Source File - -SOURCE=..\src\xslt.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\src\timing\timing.h -# End Source File -# Begin Source File - -SOURCE=..\src\xslt.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="icecast" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=icecast - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "icecast.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "icecast.mak" CFG="icecast - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "icecast - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "icecast - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "icecast - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Releaseicecast" +# PROP Intermediate_Dir "Releaseicecast" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "..\src" /I "..\src/httpp" /I "..\src/thread" /I "..\src/log" /I "..\src/avl" /I "..\src/net" /I "..\src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "icecast - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debugicecast" +# PROP Intermediate_Dir "Debugicecast" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../" /I "../../libxslt/include" /I "../../iconv/include" /I "../../libxml2/include" /I "..\src" /I "..\src/httpp" /I "..\src/thread" /I "..\src/log" /I "..\src/avl" /I "..\src/net" /I "..\src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "_WIN32" /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "icecast - Win32 Release" +# Name "icecast - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\src\avl\avl.c +# End Source File +# Begin Source File + +SOURCE=..\src\avl\avl.h +# End Source File +# Begin Source File + +SOURCE=..\src\client.c +# End Source File +# Begin Source File + +SOURCE=..\src\client.h +# End Source File +# Begin Source File + +SOURCE=..\src\compat.h +# End Source File +# Begin Source File + +SOURCE=..\src\config.c +# End Source File +# Begin Source File + +SOURCE=..\src\config.h +# End Source File +# Begin Source File + +SOURCE=..\src\connection.c +# End Source File +# Begin Source File + +SOURCE=..\src\connection.h +# End Source File +# Begin Source File + +SOURCE=..\src\format.c +# End Source File +# Begin Source File + +SOURCE=..\src\format.h +# End Source File +# Begin Source File + +SOURCE=..\src\format_mp3.c +# End Source File +# Begin Source File + +SOURCE=..\src\format_mp3.h +# End Source File +# Begin Source File + +SOURCE=..\src\format_vorbis.c +# End Source File +# Begin Source File + +SOURCE=..\src\format_vorbis.h +# End Source File +# Begin Source File + +SOURCE=..\src\fserve.c +# End Source File +# Begin Source File + +SOURCE=..\src\fserve.h +# End Source File +# Begin Source File + +SOURCE=..\src\global.c +# End Source File +# Begin Source File + +SOURCE=..\src\global.h +# End Source File +# Begin Source File + +SOURCE=..\src\httpp\httpp.c +# End Source File +# Begin Source File + +SOURCE=..\src\httpp\httpp.h +# End Source File +# Begin Source File + +SOURCE=..\src\log\log.c +# End Source File +# Begin Source File + +SOURCE=..\src\log\log.h +# End Source File +# Begin Source File + +SOURCE=..\src\logging.c +# End Source File +# Begin Source File + +SOURCE=..\src\logging.h +# End Source File +# Begin Source File + +SOURCE=..\src\main.c +# End Source File +# Begin Source File + +SOURCE=..\src\os.h +# End Source File +# Begin Source File + +SOURCE=..\src\refbuf.c +# End Source File +# Begin Source File + +SOURCE=..\src\refbuf.h +# End Source File +# Begin Source File + +SOURCE=..\src\net\resolver.c +# End Source File +# Begin Source File + +SOURCE=..\src\net\resolver.h +# End Source File +# Begin Source File + +SOURCE=..\src\sighandler.c +# End Source File +# Begin Source File + +SOURCE=..\src\sighandler.h +# End Source File +# Begin Source File + +SOURCE=..\src\slave.c +# End Source File +# Begin Source File + +SOURCE=..\src\net\sock.c +# End Source File +# Begin Source File + +SOURCE=..\src\net\sock.h +# End Source File +# Begin Source File + +SOURCE=..\src\source.c +# End Source File +# Begin Source File + +SOURCE=..\src\source.h +# End Source File +# Begin Source File + +SOURCE=..\src\stats.c +# End Source File +# Begin Source File + +SOURCE=..\src\stats.h +# End Source File +# Begin Source File + +SOURCE=..\src\thread\thread.c +# End Source File +# Begin Source File + +SOURCE=..\src\thread\thread.h +# End Source File +# Begin Source File + +SOURCE=..\src\timing\timing.c +# End Source File +# Begin Source File + +SOURCE=..\src\util.c +# End Source File +# Begin Source File + +SOURCE=..\src\util.h +# End Source File +# Begin Source File + +SOURCE=..\src\xslt.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\src\timing\timing.h +# End Source File +# Begin Source File + +SOURCE=..\src\xslt.h +# End Source File +# End Group +# End Target +# End Project diff --git a/win32/icecast.xml b/win32/icecast.xml index f474325a..a90db96f 100644 --- a/win32/icecast.xml +++ b/win32/icecast.xml @@ -1,45 +1,45 @@ - - Nowhere - jack@icecast.org - - - 100 - 2 - 5 - 30 - 15 - 10 - - - hackme - - - 5 - - yp.icecast.org - 15 - - - - localhost - 8000 - - - - - - - - . - . - .\web - - - - access.log - error.log - - 4 - - - + + Nowhere + jack@icecast.org + + + 100 + 2 + 5 + 30 + 15 + 10 + + + hackme + + + 5 + + yp.icecast.org + 15 + + + + localhost + 8000 + + + + + + + + . + . + .\web + + + + access.log + error.log + + 4 + + + diff --git a/win32/icecast2.iss b/win32/icecast2.iss index 07464754..f7d6a054 100644 --- a/win32/icecast2.iss +++ b/win32/icecast2.iss @@ -1,40 +1,41 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -[Setup] -AppName=Icecast2 Win32 -AppVerName=Icecast2 -AppPublisherURL=http://www.icecast.org -AppSupportURL=http://www.icecast.org -AppUpdatesURL=http://www.icecast.org -DefaultDirName={pf}\Icecast2 Win32 -DefaultGroupName=Icecast2 Win32 -AllowNoIcons=yes -LicenseFile=..\COPYING -InfoAfterFile=..\README -OutputDir=. -OutputBaseFilename=Icecast2_win32_09222002_setup -WizardImageFile=icecast2logo2.bmp -; uncomment the following line if you want your installation to run on NT 3.51 too. -; MinVersion=4,3.51 - -[Tasks] -Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; MinVersion: 4,4 - -[Files] -Source: "Release\Icecast2.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite -Source: "..\web\status.xsl"; DestDir: "{app}\web"; CopyMode: alwaysoverwrite -Source: "..\web\status2.xsl"; DestDir: "{app}\web"; CopyMode: alwaysoverwrite -Source: "..\..\pthreads\pthreadVSE.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite -Source: "icecast.xml"; DestDir: "{app}"; CopyMode: alwaysoverwrite -Source: "..\..\iconv\lib\iconv.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite -Source: "..\..\libxslt\lib\libxslt.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite -Source: "..\..\libxml2\lib\libxml2.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite - -[Icons] - -Name: "{group}\Icecast2 Win32"; Filename: "{app}\Icecast2.exe" -Name: "{userdesktop}\Icecast2 Win32"; Filename: "{app}\Icecast2.exe"; MinVersion: 4,4; Tasks: desktopicon;WorkingDir: "{app}"; - -[Run] - +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +[Setup] +AppName=Icecast2 Win32 +AppVerName=Icecast2 +AppPublisherURL=http://www.icecast.org +AppSupportURL=http://www.icecast.org +AppUpdatesURL=http://www.icecast.org +DefaultDirName={pf}\Icecast2 Win32 +DefaultGroupName=Icecast2 Win32 +AllowNoIcons=yes +LicenseFile=..\COPYING +InfoAfterFile=..\README +OutputDir=. +OutputBaseFilename=Icecast2_win32_08282002_setup +WizardImageFile=icecast2logo2.bmp +; uncomment the following line if you want your installation to run on NT 3.51 too. +; MinVersion=4,3.51 + +[Tasks] +Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; MinVersion: 4,4 + +[Files] +Source: "Release\Icecast2.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite +Source: "..\doc\icecast2.chm"; DestDir: "{app}\doc"; CopyMode: alwaysoverwrite +Source: "..\web\status.xsl"; DestDir: "{app}\web"; CopyMode: alwaysoverwrite +Source: "..\web\status2.xsl"; DestDir: "{app}\web"; CopyMode: alwaysoverwrite +Source: "..\..\pthreads\pthreadVSE.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite +Source: "icecast.xml"; DestDir: "{app}"; CopyMode: alwaysoverwrite +Source: "..\..\iconv\lib\iconv.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite +Source: "..\..\libxslt\lib\libxslt.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite +Source: "..\..\libxml2\lib\libxml2.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite + +[Icons] + +Name: "{group}\Icecast2 Win32"; Filename: "{app}\Icecast2.exe" +Name: "{userdesktop}\Icecast2 Win32"; Filename: "{app}\Icecast2.exe"; MinVersion: 4,4; Tasks: desktopicon;WorkingDir: "{app}"; + +[Run] + diff --git a/win32/resource.h b/win32/resource.h index 54e04f9b..cf2e8dcc 100644 --- a/win32/resource.h +++ b/win32/resource.h @@ -1,72 +1,76 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Icecast2win.rc -// -#define IDM_ABOUTBOX 0x0010 -#define IDD_ABOUTBOX 100 -#define IDS_ABOUTBOX 101 -#define IDD_ICECAST2WIN_DIALOG 102 -#define IDR_MAINFRAME 128 -#define IDR_MENU1 132 -#define IDB_BITMAP1 134 -#define IDB_BITMAP2 135 -#define IDI_R 141 -#define IDI_G 142 -#define IDI_ICON1 142 -#define IDD_SERVERSTATUS 144 -#define IDD_SSTATUS 145 -#define IDD_CONFIGDIALOG 146 -#define IDD_STATSDIALOG 147 -#define IDB_BITMAP3 149 -#define IDB_BITMAP4 150 -#define IDB_BITMAP5 151 -#define IDB_BITMAP6 152 -#define IDR_MENU2 153 -#define IDR_MENU3 154 -#define IDC_CURSOR1 155 -#define IDC_CURSOR2 156 -#define IDB_BITMAP7 159 -#define IDR_TRAY 160 -#define IDC_MAINTAB 1000 -#define IDC_ERROR_EDIT 1003 -#define IDC_ACCESS_EDIT 1004 -#define IDC_CONFIG_EDIT 1006 -#define IDC_SERVERSTATUS 1008 -#define IDC_SOURCES_CONNECTED 1009 -#define IDC_NUMBER_CLIENTS 1010 -#define IDC_GROUP1 1011 -#define IDC_STATS_EDIT 1012 -#define IDC_CONFIG 1020 -#define IDC_STATSLIST 1021 -#define IDC_SOURCELIST 1022 -#define IDC_START 1023 -#define IDC_AUTOSTART 1024 -#define IDC_FILLER1 1025 -#define IDC_FILLER2 1026 -#define IDC_STATIC_SS 1029 -#define IDC_GLOBALSTAT_LIST 1030 -#define IDC_STATIC_GS 1031 -#define IDC_STATIC_SLS 1032 -#define IDC_RUNNINGFOR 1033 -#define IDC_STATIC_RUN 1034 -#define IDC_STATICBLACK 1035 -#define IDC_HIDESYSTRAY 1036 -#define ID_FILE_STARTSERVER 32771 -#define ID_FILE_EXIT 32772 -#define ID_FILE_STOPSERVER 32774 -#define ID_FILE 32775 -#define ID_POPUP_ADDTOGLOBALSTATLIST 32776 -#define ID__DELETEFROMGLOBALSTATS 32777 -#define ID__MAKETHISSTATTHEWINDOWTITLE 32779 -#define ID_BLANK_RESTORE 32780 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 161 -#define _APS_NEXT_COMMAND_VALUE 32781 -#define _APS_NEXT_CONTROL_VALUE 1037 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by Icecast2win.rc +// +#define IDM_ABOUTBOX 0x0010 +#define IDD_ABOUTBOX 100 +#define IDS_ABOUTBOX 101 +#define IDD_ICECAST2WIN_DIALOG 102 +#define IDR_MAINFRAME 128 +#define IDR_MENU1 132 +#define IDB_BITMAP1 134 +#define IDB_BITMAP2 135 +#define IDI_R 141 +#define IDI_G 142 +#define IDI_ICON1 142 +#define IDD_SERVERSTATUS 144 +#define IDD_SSTATUS 145 +#define IDD_CONFIGDIALOG 146 +#define IDD_STATSDIALOG 147 +#define IDB_BITMAP3 149 +#define IDB_BITMAP4 150 +#define IDB_BITMAP5 151 +#define IDB_BITMAP6 152 +#define IDR_MENU2 153 +#define IDR_MENU3 154 +#define IDC_CURSOR1 155 +#define IDC_CURSOR2 156 +#define IDB_BITMAP7 159 +#define IDR_TRAY 160 +#define IDR_MENU4 161 +#define IDC_MAINTAB 1000 +#define IDC_ERROR_EDIT 1003 +#define IDC_ACCESS_EDIT 1004 +#define IDC_CONFIG_EDIT 1006 +#define IDC_SERVERSTATUS 1008 +#define IDC_SOURCES_CONNECTED 1009 +#define IDC_NUMBER_CLIENTS 1010 +#define IDC_GROUP1 1011 +#define IDC_STATS_EDIT 1012 +#define IDC_CONFIG 1020 +#define IDC_STATSLIST 1021 +#define IDC_SOURCELIST 1022 +#define IDC_START 1023 +#define IDC_AUTOSTART 1024 +#define IDC_FILLER1 1025 +#define IDC_FILLER2 1026 +#define IDC_STATIC_SS 1029 +#define IDC_GLOBALSTAT_LIST 1030 +#define IDC_STATIC_GS 1031 +#define IDC_STATIC_SLS 1032 +#define IDC_RUNNINGFOR 1033 +#define IDC_STATIC_RUN 1034 +#define IDC_STATICBLACK 1035 +#define IDC_HIDESYSTRAY 1036 +#define ID_FILE_STARTSERVER 32771 +#define ID_FILE_EXIT 32772 +#define ID_FILE_STOPSERVER 32774 +#define ID_FILE 32775 +#define ID_POPUP_ADDTOGLOBALSTATLIST 32776 +#define ID__DELETEFROMGLOBALSTATS 32777 +#define ID__MAKETHISSTATTHEWINDOWTITLE 32779 +#define ID_BLANK_RESTORE 32780 +#define ID_ABOUT_HELP 32781 +#define ID_FILE_EDITCONFIGURATION 32782 +#define ID_ABOUT_CREDITS 32784 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 162 +#define _APS_NEXT_COMMAND_VALUE 32785 +#define _APS_NEXT_CONTROL_VALUE 1037 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif