[xiph-cvs] cvs commit: icecast/win32 Icecast2win.clw Icecast2win.cpp Icecast2win.dsp Icecast2win.rc Icecast2winDlg.cpp Icecast2winDlg.h StdAfx.h icecast.dsp icecast2.iss resource.h
Michael Smith
msmith at xiph.org
Sat Aug 24 23:14:47 PDT 2002
msmith 02/08/25 02:14:47
Modified: win32 Icecast2win.clw Icecast2win.cpp Icecast2win.dsp
Icecast2win.rc Icecast2winDlg.cpp Icecast2winDlg.h
StdAfx.h icecast.dsp icecast2.iss resource.h
Log:
icecast2/win32 updates from oddsock.
Revision Changes Path
1.3 +18 -10 icecast/win32/Icecast2win.clw
Index: Icecast2win.clw
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/Icecast2win.clw,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Icecast2win.clw 11 Aug 2002 03:30:30 -0000 1.2
+++ Icecast2win.clw 25 Aug 2002 06:14:47 -0000 1.3
@@ -12,18 +12,19 @@
Class2=CIcecast2winDlg
Class3=CAboutDlg
-ResourceCount=8
-Resource1=IDD_ABOUTBOX
+ResourceCount=9
+Resource1=IDR_MENU3
Resource2=IDR_MAINFRAME
-Resource3=IDD_ICECAST2WIN_DIALOG
+Resource3=IDD_ABOUTBOX
Resource4=IDD_STATSDIALOG
Class4=CStatus
-Resource5=IDD_CONFIGDIALOG
+Resource5=IDR_MENU2
Class5=CConfigTab
Class6=CStatsTab
Resource6=IDD_SSTATUS
-Resource7=IDR_MENU2
-Resource8=IDR_MENU3
+Resource7=IDD_CONFIGDIALOG
+Resource8=IDD_ICECAST2WIN_DIALOG
+Resource9=IDR_TRAY
[CLS:CIcecast2winApp]
Type=0
@@ -35,8 +36,8 @@
Type=0
HeaderFile=Icecast2winDlg.h
ImplementationFile=Icecast2winDlg.cpp
-Filter=D
-LastObject=ID__MAKETHISSTATTHEWINDOWTITLE
+Filter=C
+LastObject=IDC_HIDESYSTRAY
BaseClass=CResizableDialog
VirtualFilter=dWC
@@ -57,14 +58,15 @@
[DLG:IDD_ICECAST2WIN_DIALOG]
Type=1
Class=CIcecast2winDlg
-ControlCount=7
+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,1342308354
+Control6=IDC_STATIC_SS,static,1342308865
Control7=IDC_STATICBLACK,static,1342177294
+Control8=IDC_HIDESYSTRAY,button,1342242816
[DLG:IDD_SSTATUS]
Type=1
@@ -131,4 +133,10 @@
Command1=ID__DELETEFROMGLOBALSTATS
Command2=ID__MAKETHISSTATTHEWINDOWTITLE
CommandCount=2
+
+[MNU:IDR_TRAY]
+Type=1
+Class=CIcecast2winDlg
+Command1=ID_BLANK_RESTORE
+CommandCount=1
<p><p>1.2 +2 -0 icecast/win32/Icecast2win.cpp
Index: Icecast2win.cpp
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/Icecast2win.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Icecast2win.cpp 9 Aug 2002 15:55:01 -0000 1.1
+++ Icecast2win.cpp 25 Aug 2002 06:14:47 -0000 1.2
@@ -69,6 +69,8 @@
// SetDialogBkColor(BGCOLOR,TEXTCOLOR);
+ m_pIconList[0] = LoadIcon (MAKEINTRESOURCE(IDR_MAINFRAME));
+
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
<p><p>1.3 +8 -4 icecast/win32/Icecast2win.dsp
Index: Icecast2win.dsp
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/Icecast2win.dsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Icecast2win.dsp 11 Aug 2002 03:30:30 -0000 1.2
+++ Icecast2win.dsp 25 Aug 2002 06:14:47 -0000 1.3
@@ -145,6 +145,14 @@
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"
@@ -220,10 +228,6 @@
# Begin Source File
SOURCE=.\res\Icecast2.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\icecast2logo.bmp
# End Source File
# Begin Source File
<p><p>1.3 +13 -3 icecast/win32/Icecast2win.rc
Index: Icecast2win.rc
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/Icecast2win.rc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Icecast2win.rc 11 Aug 2002 03:30:30 -0000 1.2
+++ Icecast2win.rc 25 Aug 2002 06:14:47 -0000 1.3
@@ -79,7 +79,7 @@
WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION "icecast2"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
+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
@@ -87,10 +87,12 @@
"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,253,28,65,18,
+ CONTROL 151,IDC_SERVERSTATUS,"Static",SS_BITMAP,173,32,65,18,
WS_EX_CLIENTEDGE
- RTEXT "Server Status",IDC_STATIC_SS,163,28,86,14
+ 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
@@ -230,6 +232,14 @@
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
<p><p>1.3 +270 -134 icecast/win32/Icecast2winDlg.cpp
Index: Icecast2winDlg.cpp
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/Icecast2winDlg.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Icecast2winDlg.cpp 11 Aug 2002 03:30:30 -0000 1.2
+++ Icecast2winDlg.cpp 25 Aug 2002 06:14:47 -0000 1.3
@@ -42,6 +42,9 @@
void CollectStats(stats_event_t *event);
CString gConfigurationSave;
+char gTitleSource[1024] = "";
+char gTitleName[1024] = "";
+
#define MAXSTATSPERSOURCE 30
#define MAXSOURCES 1024
@@ -64,6 +67,7 @@
CString source;
long numStats;
Element stats[MAXSTATSPERSOURCE];
+ int populated;
} MainElement;
typedef struct tagMainElementAdditional {
@@ -82,6 +86,7 @@
int main(int argc, char **argv);
}
+
void AddToAdditionalGlobalStats(CString source, CString name) {
int foundit = 0;
for (int i=0;i<gAdditionalGlobalStats.numStats;i++) {
@@ -218,6 +223,7 @@
//}}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)
@@ -245,6 +251,10 @@
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()
@@ -314,7 +324,7 @@
runningBitmap.LoadBitmap(IDB_BITMAP6);
stoppedBitmap.LoadBitmap(IDB_BITMAP5);
- m_SS.SetFont(&labelFont, TRUE);
+ //m_SS.SetFont(&labelFont, TRUE);
UpdateData(FALSE);
@@ -530,6 +540,7 @@
{
// TODO: Add your command handler code here
+
DestroyWindow();
}
@@ -615,16 +626,13 @@
}
-
int foundit = 0;
for (int i=0;i<numMainStats;i++) {
if (!strcmp(gStats[i].source, tempSource)) {
int foundit2 = 0;
+ gStats[i].populated = 1;
for (int j=0;j<gStats[i].numStats;j++) {
-// if (!strcmp(gStats[i].stats[j].name, tempElement.name)) {
-// strcpy(gStats[i].stats[j].value, tempElement.value);
if (gStats[i].stats[j].name == tempElement.name) {
- //strcpy(gStats[i].stats[j].value, tempElement.value);
gStats[i].stats[j].value = tempElement.value;
foundit2 = 1;
@@ -642,14 +650,34 @@
if (!foundit) {
// strcpy(gStats[numMainStats].source, tempSource);
+ if (strlen(tempSource) == 0) {
+ strcpy(tempSource, "Global Stat");
+ }
gStats[numMainStats].source = tempSource;
gStats[numMainStats].stats[0].name = tempElement.name;
gStats[numMainStats].stats[0].value = tempElement.value;
+ gStats[numMainStats].populated = 1;
// memcpy(&gStats[numMainStats].stats[0], &tempElement, sizeof(tempElement));
gStats[numMainStats].numStats++;
numMainStats++;
}
+ // Process source disconnects
+ if (event->name != NULL) {
+ if (!strcmp(event->name, "listeners")) {
+ if (event->value == NULL) {
+ // source has disconnected...
+ for (int i=0;i<numMainStats;i++) {
+ if (!strcmp(gStats[i].source, tempSource)) {
+ gStats[i].populated = 0;
+ g_mainDialog->statsTab.m_SourceListCtrl.DeleteAllItems();
+ g_mainDialog->statsTab.m_StatsListCtrl.DeleteAllItems();
+ break;
+ }
+ }
+ }
+ }
+ }
g_mainDialog->UpdateStatsLists();
}
@@ -834,167 +862,172 @@
for (int i=0;i<numMainStats;i++) {
int inthere = 0;
int k = 0;
- for (l=0;l < gAdditionalGlobalStats.numStats;l++) {
- for (int m=0;m < gStats[i].numStats;m++) {
- if ((gAdditionalGlobalStats.stats[l].source == gStats[i].source) &&
- (gAdditionalGlobalStats.stats[l].name == gStats[i].stats[m].name)) {
- gAdditionalGlobalStats.stats[l].value = gStats[i].stats[m].value;
- break;
+ if (gStats[i].populated) {
+ for (l=0;l < gAdditionalGlobalStats.numStats;l++) {
+ for (int m=0;m < gStats[i].numStats;m++) {
+ if ((gAdditionalGlobalStats.stats[l].source == gStats[i].source) &&
+ (gAdditionalGlobalStats.stats[l].name == gStats[i].stats[m].name)) {
+ gAdditionalGlobalStats.stats[l].value = gStats[i].stats[m].value;
+ break;
+ }
}
}
- }
- if (strlen(gStats[i].source) > 0) {
-
- for (k=0;k < statsTab.m_SourceListCtrl.GetItemCount();k++) {
+ if (strcmp(gStats[i].source, "Global Stat")) {
+ // If Not Global STat
+ for (k=0;k < statsTab.m_SourceListCtrl.GetItemCount();k++) {
- statsTab.m_SourceListCtrl.GetItemText(k, 0, item, sizeof(item));
- if (!strcmp(gStats[i].source, item)) {
- inthere = 1;
- break;
+ statsTab.m_SourceListCtrl.GetItemText(k, 0, item, sizeof(item));
+ if (!strcmp(gStats[i].source, item)) {
+ inthere = 1;
+ break;
+ }
}
- }
- if (!inthere) {
- if (gStats[i].source != "") {
- LVITEM lvi;
-
- lvi.mask = LVIF_IMAGE | LVIF_TEXT;
- lvi.iItem = statsTab.m_SourceListCtrl.GetItemCount();
- lvi.iSubItem = 0;
- lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].source;
- statsTab.m_SourceListCtrl.InsertItem(&lvi);
+ if (!inthere) {
+ if (gStats[i].source != "") {
+ LVITEM lvi;
+
+ lvi.mask = LVIF_IMAGE | LVIF_TEXT;
+ lvi.iItem = statsTab.m_SourceListCtrl.GetItemCount();
+ lvi.iSubItem = 0;
+ lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].source;
+ statsTab.m_SourceListCtrl.InsertItem(&lvi);
+ }
}
- }
- int nItemSelected = statsTab.m_SourceListCtrl.GetSelectionMark();
- if (nItemSelected != -1) {
- memset(item, '\000', sizeof(item));
- statsTab.m_SourceListCtrl.GetItemText(nItemSelected, 0, item, sizeof(item));
- if (!strcmp(gStats[i].source, item)) {
- for (int l=0;l<gStats[i].numStats;l++) {
- int inthere2 = 0;
- char item2[1024] = "";
- for (int m=0;m < statsTab.m_StatsListCtrl.GetItemCount();m++) {
- statsTab.m_StatsListCtrl.GetItemText(m, 0, item2, sizeof(item2));
- if (!strcmp(gStats[i].stats[l].name, item2)) {
+ int nItemSelected = statsTab.m_SourceListCtrl.GetSelectionMark();
+ if (nItemSelected != -1) {
+ memset(item, '\000', sizeof(item));
+ statsTab.m_SourceListCtrl.GetItemText(nItemSelected, 0, item, sizeof(item));
+ if (!strcmp(gStats[i].source, item)) {
+ for (int l=0;l<gStats[i].numStats;l++) {
+ int inthere2 = 0;
+ char item2[1024] = "";
+ for (int m=0;m < statsTab.m_StatsListCtrl.GetItemCount();m++) {
+ statsTab.m_StatsListCtrl.GetItemText(m, 0, item2, sizeof(item2));
+ if (!strcmp(gStats[i].stats[l].name, item2)) {
+ LVITEM lvi;
+
+ lvi.mask = LVIF_TEXT;
+ lvi.iItem = m;
+ lvi.iSubItem = 1;
+ lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[l].value;
+ statsTab.m_StatsListCtrl.SetItem(&lvi);
+ inthere2 = 1;
+ break;
+ }
+ }
+ if (!inthere2) {
LVITEM lvi;
lvi.mask = LVIF_TEXT;
- lvi.iItem = m;
+ lvi.iItem = statsTab.m_StatsListCtrl.GetItemCount();
+ lvi.iSubItem = 0;
+ lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[l].name;
+ statsTab.m_StatsListCtrl.InsertItem(&lvi);
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[l].value;
statsTab.m_StatsListCtrl.SetItem(&lvi);
- inthere2 = 1;
- break;
}
}
- if (!inthere2) {
+ }
+ }
+ for (l=0;l < gAdditionalGlobalStats.numStats;l++) {
+ int inthere2 = 0;
+ char item2[1024] = "";
+ char item3[1024] = "";
+ CString itemSource;
+ CString itemName;
+ for (int m=0;m < statusTab.m_GlobalStatList.GetItemCount();m++) {
+ statusTab.m_GlobalStatList.GetItemText(m, 0, item2, sizeof(item2));
+ statusTab.m_GlobalStatList.GetItemText(m, 1, item3, sizeof(item3));
+ itemSource = item2;
+ itemName = item3;
+ if ((gAdditionalGlobalStats.stats[l].source == itemSource) &&
+ (gAdditionalGlobalStats.stats[l].name == itemName)) {
LVITEM lvi;
lvi.mask = LVIF_TEXT;
- lvi.iItem = statsTab.m_StatsListCtrl.GetItemCount();
- lvi.iSubItem = 0;
- lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[l].name;
- statsTab.m_StatsListCtrl.InsertItem(&lvi);
- lvi.iSubItem = 1;
- lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[l].value;
- statsTab.m_StatsListCtrl.SetItem(&lvi);
+ lvi.iItem = m;
+ lvi.iSubItem = 2;
+ lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].value;
+ statusTab.m_GlobalStatList.SetItem(&lvi);
+ inthere2 = 1;
+ break;
}
}
- }
- }
- for (l=0;l < gAdditionalGlobalStats.numStats;l++) {
- int inthere2 = 0;
- char item2[1024] = "";
- char item3[1024] = "";
- CString itemSource;
- CString itemName;
- for (int m=0;m < statusTab.m_GlobalStatList.GetItemCount();m++) {
- statusTab.m_GlobalStatList.GetItemText(m, 0, item2, sizeof(item2));
- statusTab.m_GlobalStatList.GetItemText(m, 1, item3, sizeof(item3));
- itemSource = item2;
- itemName = item3;
- if ((gAdditionalGlobalStats.stats[l].source == itemSource) &&
- (gAdditionalGlobalStats.stats[l].name == itemName)) {
+ if (!inthere2) {
LVITEM lvi;
lvi.mask = LVIF_TEXT;
- lvi.iItem = m;
+ lvi.iItem = statusTab.m_GlobalStatList.GetItemCount();
+ lvi.iSubItem = 0;
+ lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].source;
+ statusTab.m_GlobalStatList.InsertItem(&lvi);
+ lvi.iSubItem = 1;
+ lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].name;
+ statusTab.m_GlobalStatList.SetItem(&lvi);
lvi.iSubItem = 2;
lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].value;
statusTab.m_GlobalStatList.SetItem(&lvi);
- inthere2 = 1;
- break;
}
- }
- if (!inthere2) {
- LVITEM lvi;
+ if ((!strcmp(gAdditionalGlobalStats.stats[l].source, gTitleSource)) &&
+ (!strcmp(gAdditionalGlobalStats.stats[l].name, gTitleName))) {
+ gAdditionalGlobalStats.stats[l].titleFlag = 1;
+ }
- lvi.mask = LVIF_TEXT;
- lvi.iItem = statusTab.m_GlobalStatList.GetItemCount();
- lvi.iSubItem = 0;
- lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].source;
- statusTab.m_GlobalStatList.InsertItem(&lvi);
- lvi.iSubItem = 1;
- lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].name;
- statusTab.m_GlobalStatList.SetItem(&lvi);
- lvi.iSubItem = 2;
- lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].value;
- statusTab.m_GlobalStatList.SetItem(&lvi);
+ if (gAdditionalGlobalStats.stats[l].titleFlag) {
+ CString windowTitle = gAdditionalGlobalStats.stats[l].source + " - " + gAdditionalGlobalStats.stats[l].name + " - " + gAdditionalGlobalStats.stats[l].value;
+ SetWindowText(windowTitle);
+ }
}
}
- }
- else {
-
- 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;
+ 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;
+ if (!inthere) {
+ LVITEM lvi;
- lvi.mask = LVIF_IMAGE | LVIF_TEXT;
- lvi.iItem = statsTab.m_SourceListCtrl.GetItemCount();
- lvi.iSubItem = 0;
- lvi.pszText = "Global Stat";
- 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);
- }
- else {
- 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);
+ }
+ 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);
+ 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 ((!strcmp(gStats[i].source, gTitleSource)) &&
+ (!strcmp(gStats[i].stats[k].name, gTitleName))) {
+ gStats[i].stats[k].titleFlag = 1;
+ }
+ if (gStats[i].stats[k].titleFlag) {
+ CString windowTitle = gStats[i].source + " - " + gStats[i].stats[k].name + " - " + gStats[i].stats[k].value;
+ SetWindowText(windowTitle);
+ }
}
}
}
}
- for (l=0;l < gAdditionalGlobalStats.numStats;l++) {
- if (gAdditionalGlobalStats.stats[l].titleFlag) {
- CString windowTitle = gAdditionalGlobalStats.stats[l].source + " - " + gAdditionalGlobalStats.stats[l].name + " - " + gAdditionalGlobalStats.stats[l].value;
- SetWindowText(windowTitle);
- }
- }
- for (l=0;l < numMainStats;l++) {
- for (int k=0;k < gStats[i].numStats;k++) {
- if (gStats[i].stats[k].titleFlag) {
- CString windowTitle = gStats[i].source + " - " + gStats[i].stats[l].name + " - " + gAdditionalGlobalStats.stats[l].value;
- SetWindowText(windowTitle);
- }
- }
- }
}
char gAppName[255] = "icecast2";
@@ -1047,14 +1080,27 @@
sprintf(buf2, "AdditionalStatsName%d", i);
WritePrivateProfileString(gAppName, buf2, gAdditionalGlobalStats.stats[i].name, gConfigFile);
gAdditionalGlobalStats.stats[i].name = buf;
+
+ if (gAdditionalGlobalStats.stats[i].titleFlag) {
+ sprintf(buf2, "%s|%s", gAdditionalGlobalStats.stats[i].source, gAdditionalGlobalStats.stats[i].name);
+ WritePrivateProfileString(gAppName, "TitleName", buf2, gConfigFile);
+ }
+ }
+ for (i=0;i<numMainStats;i++) {
+ for (int k=0;k < gStats[i].numStats;k++) {
+ if (gStats[i].stats[k].titleFlag) {
+ sprintf(buf2, "%s|%s", gStats[i].source, gStats[i].stats[k].name);
+ WritePrivateProfileString(gAppName, "TitleName", buf2, gConfigFile);
+ }
+ }
}
}
void CIcecast2winDlg::config_read()
{
- char buf2[255] = "";
- char buf[255] = "";
+ char buf2[1024] = "";
+ char buf[1024] = "";
CString tempString;
m_colSource0Width = GetPrivateProfileInt(gAppName, "col0SourceWidth", 150, gConfigFile);
@@ -1084,6 +1130,28 @@
gAdditionalGlobalStats.stats[i].name = buf;
gAdditionalGlobalStats.numStats++;
}
+ GetPrivateProfileString(gAppName, "TitleName", "", buf, sizeof(buf), gConfigFile);
+
+ /*
+ if (strlen(buf) > 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);
+ }
+ }
+ */
}
@@ -1111,8 +1179,76 @@
}
-void CIcecast2winDlg::OnPutthisstatinthetitle()
+
+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
}
<p><p>1.3 +10 -1 icecast/win32/Icecast2winDlg.h
Index: Icecast2winDlg.h
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/Icecast2winDlg.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Icecast2winDlg.h 11 Aug 2002 03:30:30 -0000 1.2
+++ Icecast2winDlg.h 25 Aug 2002 06:14:47 -0000 1.3
@@ -11,6 +11,7 @@
#include "ConfigTab.h"
#include "StatsTab.h"
#include "Status.h"
+#include "TrayNot.h"
#if _MSC_VER > 1000
#pragma once
@@ -39,6 +40,10 @@
CFont labelFont;
CBitmap runningBitmap;
CBitmap stoppedBitmap;
+ CTrayNot* m_pTray;
+ BOOL m_bHidden;
+ int m_iconSwap;
+
@@ -101,7 +106,11 @@
afx_msg void OnStart();
afx_msg void OnClose();
afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnPutthisstatinthetitle();
+ 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()
};
<p><p>1.2 +1 -1 icecast/win32/StdAfx.h
Index: StdAfx.h
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/StdAfx.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StdAfx.h 9 Aug 2002 15:55:01 -0000 1.1
+++ StdAfx.h 25 Aug 2002 06:14:47 -0000 1.2
@@ -20,7 +20,7 @@
#include <afxcmn.h> // 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.
<p><p>1.3 +9 -1 icecast/win32/icecast.dsp
Index: icecast.dsp
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/icecast.dsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- icecast.dsp 11 Aug 2002 03:30:30 -0000 1.2
+++ icecast.dsp 25 Aug 2002 06:14:47 -0000 1.3
@@ -41,7 +41,7 @@
# 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 /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 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
@@ -142,6 +142,14 @@
# 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
<p><p>1.3 +1 -1 icecast/win32/icecast2.iss
Index: icecast2.iss
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/icecast2.iss,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- icecast2.iss 11 Aug 2002 03:30:30 -0000 1.2
+++ icecast2.iss 25 Aug 2002 06:14:47 -0000 1.3
@@ -13,7 +13,7 @@
LicenseFile=..\COPYING
InfoAfterFile=..\README
OutputDir=.
-OutputBaseFilename=Icecast2_win32_09082002_setup.exe
+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
<p><p>1.3 +6 -3 icecast/win32/resource.h
Index: resource.h
===================================================================
RCS file: /usr/local/cvsroot/icecast/win32/resource.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- resource.h 11 Aug 2002 03:30:30 -0000 1.2
+++ resource.h 25 Aug 2002 06:14:47 -0000 1.3
@@ -26,6 +26,7 @@
#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
@@ -49,6 +50,7 @@
#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
@@ -56,14 +58,15 @@
#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 160
-#define _APS_NEXT_COMMAND_VALUE 32780
-#define _APS_NEXT_CONTROL_VALUE 1036
+#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
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list