Mercurial > minori
comparison src/track/media.cc @ 108:2004b41d4a59
*: huge commit
1. WORKING LOCALIZATION + translation for Spanish and British English
2. idk like 2 changes for the dark theme :)
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Sun, 05 Nov 2023 23:31:49 -0500 |
| parents | 8b65c417c225 |
| children | ab191e28e69d |
comparison
equal
deleted
inserted
replaced
| 107:49c8d1976869 | 108:2004b41d4a59 |
|---|---|
| 2 #include "track/constants.h" | 2 #include "track/constants.h" |
| 3 #include "animia.h" | 3 #include "animia.h" |
| 4 #include "anitomy/anitomy.h" | 4 #include "anitomy/anitomy.h" |
| 5 #include "core/filesystem.h" | 5 #include "core/filesystem.h" |
| 6 #include "core/strings.h" | 6 #include "core/strings.h" |
| 7 #include <QDebug> | |
| 8 #include <string> | 7 #include <string> |
| 9 #include <unordered_map> | 8 #include <unordered_map> |
| 10 #include <vector> | 9 #include <vector> |
| 11 | 10 |
| 12 namespace Track { | 11 namespace Track { |
| 15 Filesystem::Path GetCurrentPlaying() { | 14 Filesystem::Path GetCurrentPlaying() { |
| 16 /* getting all open files */ | 15 /* getting all open files */ |
| 17 std::vector<int> pids = Animia::get_all_pids(); | 16 std::vector<int> pids = Animia::get_all_pids(); |
| 18 for (int i : pids) { | 17 for (int i : pids) { |
| 19 for (const std::string& player : media_players) { | 18 for (const std::string& player : media_players) { |
| 20 if (Animia::get_process_name(i) == player) { | 19 if (Animia::get_process_name(i) != player) |
| 21 std::vector<std::string> files = Animia::filter_system_files(Animia::get_open_files(i)); | 20 continue; |
| 22 for (const std::string& f : files) { | 21 for (const std::string& f : Animia::filter_system_files(Animia::get_open_files(i))) { |
| 23 Filesystem::Path p(f); | 22 Filesystem::Path p(f); |
| 24 for (const std::string& ext : media_extensions) { | 23 for (const std::string& ext : media_extensions) { |
| 25 if (p.Extension() == ext) | 24 if (p.Extension() == ext) |
| 26 return p; | 25 return p; |
| 27 } | |
| 28 } | 26 } |
| 29 } | 27 } |
| 30 } | 28 } |
| 31 } | 29 } |
| 32 return Filesystem::Path(); | 30 return Filesystem::Path(); |
