Archived
menu
This commit is contained in:
1 parent
e7ef2d7eaf
commit
33002f81d8
3 files changed
+26
-2
No files matched your search
Binary file not shown.
+5
-1
@@ -15,6 +15,10 @@
|
|||||||
#define IDC_MENU 200
|
#define IDC_MENU 200
|
||||||
#define ID_PLIK_OD32774 32774
|
#define ID_PLIK_OD32774 32774
|
||||||
#define ID_REFRESH 32775
|
#define ID_REFRESH 32775
|
||||||
|
#define ID_OPCJE_ODTWARZAJPOKLIKNI32776 32776
|
||||||
|
#define ID_OPCJE_POWTARZAJ 32777
|
||||||
|
#define ID_OPCJE_ONCLICK 32778
|
||||||
|
#define ID_OPCJE_LOOP 32779
|
||||||
#define IDC_STATIC -1
|
#define IDC_STATIC -1
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
@@ -23,7 +27,7 @@
|
|||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NO_MFC 1
|
#define _APS_NO_MFC 1
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||||
#define _APS_NEXT_COMMAND_VALUE 32776
|
#define _APS_NEXT_COMMAND_VALUE 32780
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||||
#define _APS_NEXT_SYMED_VALUE 110
|
#define _APS_NEXT_SYMED_VALUE 110
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ TCHAR* selected = NULL;
|
|||||||
*/
|
*/
|
||||||
int currentState = -1;
|
int currentState = -1;
|
||||||
BOOL isAutoPlayEnabled = TRUE;
|
BOOL isAutoPlayEnabled = TRUE;
|
||||||
|
BOOL isLoopEnabled = FALSE;
|
||||||
|
|
||||||
//CONTROLS
|
//CONTROLS
|
||||||
HWND mainWindow;
|
HWND mainWindow;
|
||||||
@@ -50,6 +51,7 @@ HWND playButton;
|
|||||||
HWND stopButton;
|
HWND stopButton;
|
||||||
HWND npLabel;
|
HWND npLabel;
|
||||||
HWND autoPlayCheck;
|
HWND autoPlayCheck;
|
||||||
|
HWND loopCheck;
|
||||||
HMENU menuBar;
|
HMENU menuBar;
|
||||||
|
|
||||||
//HOOKS
|
//HOOKS
|
||||||
@@ -87,7 +89,7 @@ void CreateControls(HWND window) {
|
|||||||
SendMessage(dirLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
SendMessage(dirLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
browseButton = EzCreateButton(L"Przegl¹daj", 275, 10, 100, 30, window, NULL);
|
browseButton = EzCreateButton(L"Przegl¹daj", 275, 10, 100, 30, window, NULL);
|
||||||
SendMessage(browseButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
SendMessage(browseButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
filesListCtrl = CreateWindowEx(0, L"LISTBOX", NULL, LBS_STANDARD | WS_CHILD | WS_VISIBLE, 0, 50, 400, 425, window, (HMENU)IDC_LIST, NULL, NULL);
|
filesListCtrl = CreateWindowEx(0, L"LISTBOX", NULL, LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_VSCROLL, 0, 50, 400, 425, window, (HMENU)IDC_LIST, NULL, NULL);
|
||||||
SendMessage(filesListCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);
|
SendMessage(filesListCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
npLabel = EzCreateLabel(NOT_PLAYING_LABEL, -5, 460, 400, 30, window, SS_CENTER | WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE);
|
npLabel = EzCreateLabel(NOT_PLAYING_LABEL, -5, 460, 400, 30, window, SS_CENTER | WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE);
|
||||||
SendMessage(npLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
SendMessage(npLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
@@ -98,6 +100,9 @@ void CreateControls(HWND window) {
|
|||||||
autoPlayCheck = CreateWindowEx(NULL, L"BUTTON", L"Odtwarzaj automatycznie", BS_CHECKBOX | WS_VISIBLE | WS_CHILD | SS_CENTER | SS_CENTERIMAGE, 105, 485, 170, 30, window, NULL, NULL, NULL);
|
autoPlayCheck = CreateWindowEx(NULL, L"BUTTON", L"Odtwarzaj automatycznie", BS_CHECKBOX | WS_VISIBLE | WS_CHILD | SS_CENTER | SS_CENTERIMAGE, 105, 485, 170, 30, window, NULL, NULL, NULL);
|
||||||
SendMessage(autoPlayCheck, BM_SETCHECK, BST_CHECKED, NULL);
|
SendMessage(autoPlayCheck, BM_SETCHECK, BST_CHECKED, NULL);
|
||||||
SendMessage(autoPlayCheck, WM_SETFONT, (WPARAM)hFont, TRUE);
|
SendMessage(autoPlayCheck, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
|
loopCheck = CreateWindowEx(NULL, L"BUTTON", L"Pêtla", BS_CHECKBOX | WS_VISIBLE | WS_CHILD | SS_CENTER | SS_CENTERIMAGE, 300, 485, 50, 30, window, NULL, NULL, NULL);
|
||||||
|
SendMessage(loopCheck, BM_SETCHECK, BST_UNCHECKED, NULL);
|
||||||
|
SendMessage(loopCheck, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
filesListScroll = CreateWindowEx(0, L"SCROLLBAR", NULL, WS_CHILD | WS_VISIBLE | SBS_VERT, 300, 50, 50, 425, NULL, NULL, NULL, NULL);
|
filesListScroll = CreateWindowEx(0, L"SCROLLBAR", NULL, WS_CHILD | WS_VISIBLE | SBS_VERT, 300, 50, 50, 425, NULL, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
void GetFiles(TCHAR* path, wstring ext) {
|
void GetFiles(TCHAR* path, wstring ext) {
|
||||||
@@ -160,8 +165,13 @@ void Play(TCHAR* path, TCHAR* fileName) {
|
|||||||
|
|
||||||
//PLAY THE SOUND
|
//PLAY THE SOUND
|
||||||
mciSendString(fullCommand, NULL, 0, NULL);
|
mciSendString(fullCommand, NULL, 0, NULL);
|
||||||
|
if (isLoopEnabled) {
|
||||||
|
mciSendString(L"play mp3 repeat", NULL, 0, mainWindow);
|
||||||
|
}
|
||||||
|
else {
|
||||||
mciSendString(L"play mp3 notify", NULL, 0, mainWindow);
|
mciSendString(L"play mp3 notify", NULL, 0, mainWindow);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
MessageBox(mainWindow, L"Podczas odtwarzania wyst¹pi³ b³¹d. SprawdŸ czy podany plik istnieje.", L"Wyst¹pi³ b³¹d", MB_ICONERROR);
|
MessageBox(mainWindow, L"Podczas odtwarzania wyst¹pi³ b³¹d. SprawdŸ czy podany plik istnieje.", L"Wyst¹pi³ b³¹d", MB_ICONERROR);
|
||||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||||
@@ -227,6 +237,16 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||||||
isAutoPlayEnabled = TRUE;
|
isAutoPlayEnabled = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ((HWND)lParam == loopCheck) {
|
||||||
|
if (isLoopEnabled) {
|
||||||
|
SendMessage(loopCheck, BM_SETCHECK, BST_UNCHECKED, NULL);
|
||||||
|
isLoopEnabled = FALSE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SendMessage(loopCheck, BM_SETCHECK, BST_CHECKED, NULL);
|
||||||
|
isLoopEnabled = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ((HWND)lParam == stopButton) {
|
else if ((HWND)lParam == stopButton) {
|
||||||
mciSendString(L"close mp3", NULL, 0, NULL);
|
mciSendString(L"close mp3", NULL, 0, NULL);
|
||||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||||
|
|||||||
Reference in new issue
Block a user