Archived
1 parent
200fb5c4e1
commit
31fab8ccf1
2 files changed
+19
-19
No files matched your search
Binary file not shown.
@@ -30,9 +30,9 @@ using std::vector;
|
||||
//STRING TABLE
|
||||
#define PROGRAM_NAME L"ClickPlay"
|
||||
#define NOT_PLAYING_LABEL L"-"
|
||||
#define PLAY_LABEL L"Play"
|
||||
#define PAUSE_LABEL L"Pause"
|
||||
#define NO_DIR_LOADED_LABEL L"No directory"
|
||||
#define PLAY_LABEL L"Odtwarzaj"
|
||||
#define PAUSE_LABEL L"Pauza"
|
||||
#define NO_DIR_LOADED_LABEL L"Brak katalogu"
|
||||
|
||||
//GLOBAL VARS
|
||||
HFONT hFont = CreateFont(18, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Segoe UI"));
|
||||
@@ -124,20 +124,20 @@ int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLin
|
||||
void CreateControls(HWND window) {
|
||||
dirLabel = CreateWindowEx(0, L"STATIC", NO_DIR_LOADED_LABEL, WS_CHILD | WS_VISIBLE, 10, 10, 250, 40, window, (HMENU)IDC_DIRLABEL, globalInstance, NULL);
|
||||
SendMessage(dirLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
browseButton = CreateWindowEx(0, L"BUTTON", L"Browse", WS_CHILD | WS_VISIBLE, 275, 10, 100, 30, window, (HMENU)IDC_BROWSEBTN, globalInstance, NULL);
|
||||
browseButton = CreateWindowEx(0, L"BUTTON", L"Przegl¹daj", WS_CHILD | WS_VISIBLE, 275, 10, 100, 30, window, (HMENU)IDC_BROWSEBTN, globalInstance, NULL);
|
||||
SendMessage(browseButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
filesListCtrl = CreateWindowEx(0, L"LISTBOX", NULL, LBS_NOTIFY | LBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_VSCROLL, 0, 50, 380, 425, window, (HMENU)IDC_LIST, globalInstance, NULL);
|
||||
SendMessage(filesListCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
searchBox = CreateWindowEx(0, L"EDIT", L"", WS_CHILD | WS_VISIBLE, 0, 460, 300, 25, window, (HMENU)IDC_SEARCH, globalInstance, NULL);
|
||||
SendMessage(searchBox, EM_SETCUEBANNER, FALSE, (LPARAM)L"Search for files...");
|
||||
SendMessage(searchBox, EM_SETCUEBANNER, FALSE, (LPARAM)L"Wyszukaj pliki...");
|
||||
SendMessage(searchBox, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
searchBtn = CreateWindowEx(0, L"BUTTON", L"Search", WS_CHILD | WS_VISIBLE, 300, 460, 80, 25, window, (HMENU)IDC_SEARCHBTN, globalInstance, NULL);
|
||||
searchBtn = CreateWindowEx(0, L"BUTTON", L"Szukaj", WS_CHILD | WS_VISIBLE, 300, 460, 80, 25, window, (HMENU)IDC_SEARCHBTN, globalInstance, NULL);
|
||||
SendMessage(searchBtn, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
npLabel = CreateWindowEx(0, L"STATIC", NOT_PLAYING_LABEL, SS_CENTER | WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, -5, 485, 400, 25, window, (HMENU)IDC_NPLABEL, globalInstance, NULL);
|
||||
SendMessage(npLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
playButton = CreateWindowEx(0, L"BUTTON", PLAY_LABEL, WS_CHILD | WS_VISIBLE, 75, 515, 100, 30, window, (HMENU)IDC_PLAYBTN, globalInstance, NULL);
|
||||
SendMessage(playButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
stopButton = CreateWindowEx(0, L"BUTTON", L"Stop", WS_CHILD | WS_VISIBLE, 195, 515, 100, 30, window, (HMENU)IDC_STOPBTN, globalInstance, NULL);
|
||||
stopButton = CreateWindowEx(0, L"BUTTON", L"Zatrzymaj", WS_CHILD | WS_VISIBLE, 195, 515, 100, 30, window, (HMENU)IDC_STOPBTN, globalInstance, NULL);
|
||||
SendMessage(stopButton, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ int LoadSelection(int index) {
|
||||
WIN32_FIND_DATA fileData;
|
||||
HANDLE fileExist = FindFirstFile(fullPath.c_str(), &fileData);
|
||||
if (fileExist == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(mainWindow, L"Selected file not found. Please make sure that it exists or it has not been moved or deleted. Press F5 to refresh the list and remove invalid entries.", L"File not found", MB_ICONERROR);
|
||||
MessageBox(mainWindow, L"Wskazany plik nie zosta³ odnaleziony. Upewnij siê, ¿e nie zosta³ przeniesiony lub usuniêty. Naciœnij klawisz F5, aby odœwie¿yæ listê i pozbyæ siê niedzia³aj¹cych pozycji.", L"Nie znaleziono pliku", MB_ICONERROR);
|
||||
return -2;
|
||||
}
|
||||
else {
|
||||
@@ -183,7 +183,7 @@ int LoadSelection(int index) {
|
||||
|
||||
if (mciSendString(fullCommand, NULL, 0, mainWindow) != 0) {
|
||||
UnloadSelection();
|
||||
MessageBox(mainWindow, L"Something went wrong while trying to play this file. Please make sure that the file is not corrupted.", L"File loading error", MB_ICONERROR);
|
||||
MessageBox(mainWindow, L"Nieznany b³¹d uniemo¿liwia odtworzenie tego pliku. SprawdŸ czy plik nie jest uszkodzony.", L"B³¹d wczytywania", MB_ICONERROR);
|
||||
return -4;
|
||||
}
|
||||
selected = index;
|
||||
@@ -191,7 +191,7 @@ int LoadSelection(int index) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"State access violation. The program will shut down.", L"Critical error", MB_ICONERROR);
|
||||
MessageBox(mainWindow, L"Naruszenie dostêpu do stanu programu. Proces zostanie zakoñczony.", L"B³¹d krytyczny", MB_ICONERROR);
|
||||
ExitProcess(0);
|
||||
return -3;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ int LoadDir(wstring dir) {
|
||||
}
|
||||
}
|
||||
if (files.empty()) {
|
||||
MessageBox(mainWindow, L"It looks like there are no files that can be opened by ClickPlay. Please choose another folder and try again.", L"No files", MB_ICONEXCLAMATION);
|
||||
MessageBox(mainWindow, L"Wygl¹da na to, ¿e w tym katalogu nie ma ¿adnych plików, które mog¹ zostaæ otwarte przez program. Wybierz inny folder i spróbuj ponownie.", L"Brak plików", MB_ICONEXCLAMATION);
|
||||
files.clear();
|
||||
return -3;
|
||||
}
|
||||
@@ -258,12 +258,12 @@ int LoadDir(wstring dir) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"Cannot access this directory.", L"Incorrect directory", MB_ICONERROR);
|
||||
MessageBox(mainWindow, L"Program nie mo¿e uzyskaæ dostêpu do wskazanego katalogu.", L"Nieprawid³owy katalog", MB_ICONERROR);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageBox(mainWindow, L"There is no directory loaded. Use the BROWSE button to load a directory.", L"No directory", MB_ICONERROR);
|
||||
MessageBox(mainWindow, L"Nie wczytano katalogu. U¿yj przycisku PRZEGL¥DAJ, aby za³adaowaæ katalog.", L"Brak katalogu", MB_ICONERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -273,7 +273,7 @@ int FolderBrowseDialog(HWND window) {
|
||||
BROWSEINFO dialog = { 0 };
|
||||
dialog.hwndOwner = window;
|
||||
dialog.ulFlags = BIF_NEWDIALOGSTYLE;
|
||||
dialog.lpszTitle = L"Pick a folder, that will be opened by the program...";
|
||||
dialog.lpszTitle = L"Wybierz katalog, który ma zostaæ otwarty przez program...";
|
||||
LPITEMIDLIST pid = SHBrowseForFolder(&dialog);
|
||||
TCHAR currentPath[MAX_PATH];
|
||||
if (pid != 0) {
|
||||
@@ -321,7 +321,7 @@ int SearchDir(wstring phrase) {
|
||||
}
|
||||
}
|
||||
if (results.empty()) {
|
||||
MessageBox(mainWindow, L"There are no files that match the entered phrase.", L"No files", MB_ICONEXCLAMATION);
|
||||
MessageBox(mainWindow, L"Nie znaleziono plików zawieraj¹cych wpisan¹ frazê.", L"Brak plików", MB_ICONEXCLAMATION);
|
||||
currentSearchPhrase.clear();
|
||||
return -1;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
}
|
||||
|
||||
if (playerState != 0) {
|
||||
MessageBox(mainWindow, L"An error occurred while playing this file. Please make sure that the file is not corrupted.", L"Playback error", MB_ICONERROR);
|
||||
MessageBox(mainWindow, L"Nie uda³o siê odtworzyæ wskazanego pliku. SprawdŸ czy plik nie jest uszkodzony.", L"B³¹d odtwarzania", MB_ICONERROR);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, NULL);
|
||||
break;
|
||||
}
|
||||
@@ -639,7 +639,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
case 2:
|
||||
mciSendString(L"pause mp3", NULL, 0, mainWindow);
|
||||
|
||||
wstring pauseStringWS = wstring(files[selected].cFileName) + L" [PAUSE]";
|
||||
wstring pauseStringWS = wstring(files[selected].cFileName) + L" [PAUZA]";
|
||||
LPCWSTR pauseString = pauseStringWS.c_str();
|
||||
|
||||
EnableWindow(filesListCtrl, TRUE);
|
||||
@@ -687,13 +687,13 @@ INT_PTR CALLBACK JumpToProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
sec = std::stoi(secB);
|
||||
|
||||
if (!(min >= 0 && min <= 999 && sec >= 0 && sec <= 59)) {
|
||||
MessageBox(mainWindow, L"Incorrect parameters.", L"Incorrect parameters", MB_ICONEXCLAMATION);
|
||||
MessageBox(mainWindow, L"Podane wartoœci s¹ niepoprawne", L"Niepoprawne wartoœci", MB_ICONEXCLAMATION);
|
||||
EndDialog(hwnd, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
MessageBox(mainWindow, L"Incorrect parameters.", L"Incorrect parameters", MB_ICONEXCLAMATION);
|
||||
MessageBox(mainWindow, L"Podane wartoœci s¹ niepoprawne", L"Niepoprawne wartoœci", MB_ICONEXCLAMATION);
|
||||
EndDialog(hwnd, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user