mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
icecast2/win32 updates from oddsock.
svn path=/trunk/icecast/; revision=3878
This commit is contained in:
parent
07de3c2dd7
commit
7a519ab76e
@ -12,18 +12,19 @@ Class1=CIcecast2winApp
|
||||
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 @@ Filter=N
|
||||
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 @@ Control3=IDOK,button,1342373889
|
||||
[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
|
||||
@ -132,3 +134,9 @@ Command1=ID__DELETEFROMGLOBALSTATS
|
||||
Command2=ID__MAKETHISSTATTHEWINDOWTITLE
|
||||
CommandCount=2
|
||||
|
||||
[MNU:IDR_TRAY]
|
||||
Type=1
|
||||
Class=CIcecast2winDlg
|
||||
Command1=ID_BLANK_RESTORE
|
||||
CommandCount=1
|
||||
|
||||
|
@ -69,6 +69,8 @@ BOOL CIcecast2winApp::InitInstance()
|
||||
|
||||
// SetDialogBkColor(BGCOLOR,TEXTCOLOR);
|
||||
|
||||
m_pIconList[0] = LoadIcon (MAKEINTRESOURCE(IDR_MAINFRAME));
|
||||
|
||||
int nResponse = dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
|
@ -145,6 +145,14 @@ SOURCE=.\TabPageSSL.cpp
|
||||
|
||||
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"
|
||||
|
||||
@ -223,10 +231,6 @@ SOURCE=.\res\Icecast2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\icecast2logo.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\icecast2logo2.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -79,7 +79,7 @@ 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", 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 @@ BEGIN
|
||||
"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
|
||||
@ -233,6 +235,14 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDR_TRAY MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Blank"
|
||||
BEGIN
|
||||
MENUITEM "Restore", ID_BLANK_RESTORE
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -42,6 +42,9 @@ bool g_tailError = false;
|
||||
void CollectStats(stats_event_t *event);
|
||||
CString gConfigurationSave;
|
||||
|
||||
char gTitleSource[1024] = "";
|
||||
char gTitleName[1024] = "";
|
||||
|
||||
#define MAXSTATSPERSOURCE 30
|
||||
#define MAXSOURCES 1024
|
||||
|
||||
@ -64,6 +67,7 @@ typedef struct tagMainElement {
|
||||
CString source;
|
||||
long numStats;
|
||||
Element stats[MAXSTATSPERSOURCE];
|
||||
int populated;
|
||||
} MainElement;
|
||||
|
||||
typedef struct tagMainElementAdditional {
|
||||
@ -82,6 +86,7 @@ extern "C" {
|
||||
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 @@ CIcecast2winDlg::CIcecast2winDlg(CWnd* pParent /*=NULL*/)
|
||||
//}}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 @@ BEGIN_MESSAGE_MAP(CIcecast2winDlg, CResizableDialog)
|
||||
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 @@ BOOL CIcecast2winDlg::OnInitDialog()
|
||||
|
||||
runningBitmap.LoadBitmap(IDB_BITMAP6);
|
||||
stoppedBitmap.LoadBitmap(IDB_BITMAP5);
|
||||
m_SS.SetFont(&labelFont, TRUE);
|
||||
//m_SS.SetFont(&labelFont, TRUE);
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
@ -530,6 +540,7 @@ void CIcecast2winDlg::OnFileExit()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
|
||||
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
@ -615,16 +626,13 @@ void CollectStats(stats_event_t *event)
|
||||
|
||||
}
|
||||
|
||||
|
||||
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 @@ void CollectStats(stats_event_t *event)
|
||||
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,164 +862,169 @@ void CIcecast2winDlg::UpdateStatsLists()
|
||||
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 (strlen(gStats[i].source) > 0) {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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)) {
|
||||
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 = 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gStats[i].populated) {
|
||||
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 = m;
|
||||
lvi.iSubItem = 2;
|
||||
lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].value;
|
||||
statusTab.m_GlobalStatList.SetItem(&lvi);
|
||||
inthere2 = 1;
|
||||
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 (!inthere2) {
|
||||
LVITEM lvi;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (strcmp(gStats[i].source, "Global Stat")) {
|
||||
// If Not Global STat
|
||||
for (k=0;k < statsTab.m_SourceListCtrl.GetItemCount();k++) {
|
||||
|
||||
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)) {
|
||||
statsTab.m_SourceListCtrl.GetItemText(k, 0, item, sizeof(item));
|
||||
if (!strcmp(gStats[i].source, item)) {
|
||||
inthere = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!inthere) {
|
||||
LVITEM lvi;
|
||||
if (gStats[i].source != "") {
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LVITEM 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)) {
|
||||
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_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 = 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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 = m;
|
||||
lvi.iSubItem = 2;
|
||||
lvi.pszText = (LPTSTR)(LPCTSTR)gAdditionalGlobalStats.stats[l].value;
|
||||
statusTab.m_GlobalStatList.SetItem(&lvi);
|
||||
inthere2 = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!inthere2) {
|
||||
LVITEM lvi;
|
||||
|
||||
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 ((!strcmp(gAdditionalGlobalStats.stats[l].source, gTitleSource)) &&
|
||||
(!strcmp(gAdditionalGlobalStats.stats[l].name, gTitleName))) {
|
||||
gAdditionalGlobalStats.stats[l].titleFlag = 1;
|
||||
}
|
||||
|
||||
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 < 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);
|
||||
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);
|
||||
}
|
||||
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 ((!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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1047,14 +1080,27 @@ void CIcecast2winDlg::config_write()
|
||||
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 @@ void CIcecast2winDlg::config_read()
|
||||
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::OnSize(UINT nType, int cx, int cy)
|
||||
|
||||
}
|
||||
|
||||
void CIcecast2winDlg::OnPutthisstatinthetitle()
|
||||
|
||||
LONG CIcecast2winDlg::OnTrayNotify ( WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
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
|
||||
|
||||
}
|
||||
|
@ -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 @@ public:
|
||||
CFont labelFont;
|
||||
CBitmap runningBitmap;
|
||||
CBitmap stoppedBitmap;
|
||||
CTrayNot* m_pTray;
|
||||
BOOL m_bHidden;
|
||||
int m_iconSwap;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -101,7 +106,11 @@ protected:
|
||||
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()
|
||||
};
|
||||
|
@ -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.
|
||||
|
||||
|
@ -41,7 +41,7 @@ RSC=rc.exe
|
||||
# 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
|
||||
@ -145,6 +145,14 @@ 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
|
||||
|
@ -13,7 +13,7 @@ AllowNoIcons=yes
|
||||
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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user