Archived
Compare commits
7
Commits
1.1.0
...
1.2.0_FINAL
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d372671f1b | ||
|
|
f80714542d | ||
|
|
d1fd4a6eea | ||
|
|
a20fad4635 | ||
|
|
aefd8e6434 | ||
|
|
7da19e19e0 | ||
|
|
d5b22fc6b2 |
No files matched your search
@@ -6,7 +6,7 @@
|
||||
name="CompanyName.ProductName.YourApplication"
|
||||
type="win32"
|
||||
/>
|
||||
<description>PAiPlayer - A school project that helps me learn C++</description>
|
||||
<description>ClickPlay - a simple C++ music player</description>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -180,8 +180,8 @@ int LoadSelection(int index) {
|
||||
LPCWSTR fullCommand = fullCommandS.c_str();
|
||||
|
||||
if (mciSendString(fullCommand, NULL, 0, mainWindow) != 0) {
|
||||
MessageBox(mainWindow, L"Nieznany b³¹d uniemo¿liwia odtworzenie tego pliku. SprawdŸ czy plik nie jest uszkodzony.", L"B³¹d wczytywania", MB_ICONERROR);
|
||||
UnloadSelection();
|
||||
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;
|
||||
@@ -291,16 +291,23 @@ int FolderBrowseDialog(HWND window) {
|
||||
}
|
||||
|
||||
//SEARCH DIRECTORY
|
||||
void SearchDir(wstring phrase) {
|
||||
/*ERROR CODES
|
||||
* -1 - no files found
|
||||
* -2 - LoadDir error
|
||||
* -3 - empty input
|
||||
*/
|
||||
int SearchDir(wstring phrase) {
|
||||
//PERFORM CHECKING
|
||||
if (path.empty()) {
|
||||
return;
|
||||
return -2;
|
||||
}
|
||||
//RELOAD DIR
|
||||
LoadDir(path);
|
||||
if (LoadDir(path) != 0) {
|
||||
return -2;
|
||||
}
|
||||
//PREPARE
|
||||
if (phrase.empty()) {
|
||||
return;
|
||||
return -3;
|
||||
}
|
||||
vector<WIN32_FIND_DATA> results;
|
||||
//GET FILES
|
||||
@@ -311,12 +318,13 @@ void SearchDir(wstring phrase) {
|
||||
}
|
||||
if (results.empty()) {
|
||||
MessageBox(mainWindow, L"Nie znaleziono plików zawieraj¹cych wpisan¹ frazê.", L"Brak plików", MB_ICONEXCLAMATION);
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
std::sort(results.begin(), results.end(), alphabeticSort);
|
||||
files = results;
|
||||
//ADD FILTERED CONTENT
|
||||
GenerateList(files);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//GET SEARCH PHRASE FROM searchBox
|
||||
@@ -365,11 +373,18 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IDC_SEARCHBTN:
|
||||
SearchDir(GetSearchPhrase());
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
if (SearchDir(GetSearchPhrase()) == -2) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
break;
|
||||
case IDC_PLAYBTN:
|
||||
switch (currentState) {
|
||||
@@ -377,6 +392,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
if (LoadSelection(GetIndex()) == 0) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, NULL);
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
SendMessage(mainWindow, STATE_CHANGE, 2, NULL);
|
||||
@@ -402,7 +420,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
}
|
||||
if (SendMessage(searchBox, WM_GETTEXTLENGTH, 0, 0) > 0) {
|
||||
SearchDir(GetSearchPhrase());
|
||||
if (SearchDir(GetSearchPhrase()) == -2) {
|
||||
SendMessage(mainWindow, STATE_CHANGE, -1, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ID_OPCJE_ONCLICK:
|
||||
@@ -438,6 +458,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
}
|
||||
if (!path.empty() && !files.empty()) {
|
||||
GenerateList(files);
|
||||
if (selected != -1) {
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, selected, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ID_PLIK_CLOSEDIR:
|
||||
@@ -458,9 +481,13 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
srand(time(NULL));
|
||||
//LOAD AND PLAY
|
||||
randIndex = rand() % files.size();
|
||||
LoadSelection(randIndex);
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, randIndex, 0);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, 0);
|
||||
if (LoadSelection(randIndex) == 0) {
|
||||
SendMessage(filesListCtrl, LB_SETCURSEL, randIndex, 0);
|
||||
SendMessage(mainWindow, STATE_CHANGE, 1, 0);
|
||||
}
|
||||
else {
|
||||
SendMessage(mainWindow, STATE_CHANGE, 0, 0);
|
||||
}
|
||||
break;
|
||||
case ID_OPCJE_AUTOPLAY:
|
||||
if (isAutoPlayEnabled) {
|
||||
|
||||
Reference in new issue
Block a user