comparison src/track/media.cpp @ 78:1ce00c1c8ddc

dep/animia: update to upstream
author Paper <mrpapersonic@gmail.com>
date Wed, 11 Oct 2023 12:16:15 -0400
parents 3364fadc8a36
children 825506f0e221
comparison
equal deleted inserted replaced
77:6f7385bd334c 78:1ce00c1c8ddc
3 #include "anitomy/anitomy.h" 3 #include "anitomy/anitomy.h"
4 #include "core/filesystem.h" 4 #include "core/filesystem.h"
5 #include "core/strings.h" 5 #include "core/strings.h"
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 #include <QDebug>
8 9
9 namespace Track { 10 namespace Track {
10 namespace Media { 11 namespace Media {
11 12
12 Filesystem::Path GetCurrentPlaying() { 13 Filesystem::Path GetCurrentPlaying() {
13 /* getting all open files */ 14 /* getting all open files */
14 std::vector<int> pids = Animia::get_all_pids(); 15 std::vector<int> pids = Animia::get_all_pids();
15 for (int i : pids) { 16 for (int i : pids) {
16 if (Animia::get_process_name(i) == "mpc-hc64.exe") { 17 if (Animia::get_process_name(i) == "vlc") {
17 std::vector<std::string> files = Animia::filter_system_files(Animia::get_open_files(i)); 18 std::vector<std::string> files = Animia::filter_system_files(Animia::get_open_files(i));
18 for (std::string s : files) { 19 for (std::string s : files) {
20 qDebug() << Strings::ToQString(s);
19 Filesystem::Path p(s); 21 Filesystem::Path p(s);
20 if (p.Extension() == "mkv") 22 if (p.Extension() == "mp4")
21 return p; 23 return p;
22 } 24 }
23 } 25 }
24 } 26 }
25 return Filesystem::Path(); 27 return Filesystem::Path();