-
Notifications
You must be signed in to change notification settings - Fork 1
/
clplayer.hpp
41 lines (37 loc) · 939 Bytes
/
clplayer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "clplayer/clplayer.hpp"
#include "util.hpp"
inline Cmd* get_player(
std::string video,
std::string audio,
std::string player,
int perload = 0) {
if (perload) {
return new Nothing();
}
if (audio.length()) {
if (not_exist(audio)) {
audio = video;
}
if (!player.length()) {
player = "ffmpeg";
}
} else if (player.length()) {
audio = video;
} else {
return new Nothing();
}
if (player == "auto" || player == "ffmpeg" || player == "ffplay") {
return new FFplayPlayer(audio);
}
if (player == "mpv") {
return new MpvPlayer(audio);
}
if (player == "mpg123" || player == "mpg") {
return new Mpg123Player(audio);
}
if (player == "cmus" || player == "cmus-remote") {
return new CmusPlayer(audio);
}
throws("Bad Player!!: " + player);
}