Tidy up some code.
This commit is contained in:
parent
4582c8600c
commit
2f6f55c2bb
|
@ -16,7 +16,7 @@ before_install:
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- sudo apt-get -y install ccache build-essential git qt512-meta-minimal qt512quickcontrols qt512quickcontrols2 qt512svg qt512x11extras qt512graphicaleffects qt512svg libgl1-mesa-dev libmpv-dev libgl1-mesa-dev x11proto-xext-dev libx11-dev python3-setuptools
|
- sudo apt-get -y install build-essential git qt512-meta-minimal qt512quickcontrols qt512quickcontrols2 qt512svg qt512x11extras qt512graphicaleffects qt512svg libgl1-mesa-dev libmpv-dev libgl1-mesa-dev x11proto-xext-dev libx11-dev python3-setuptools
|
||||||
- sudo apt-get build-dep mpv
|
- sudo apt-get build-dep mpv
|
||||||
- source /opt/qt*/bin/qt*-env.sh
|
- source /opt/qt*/bin/qt*-env.sh
|
||||||
|
|
||||||
|
|
|
@ -69,12 +69,6 @@ set(SOURCES
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
find_program(CCACHE_FOUND cache)
|
|
||||||
if(CCACHE_FOUND)
|
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
||||||
endif(CCACHE_FOUND)
|
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE DEBUG)
|
set(CMAKE_BUILD_TYPE DEBUG)
|
||||||
|
|
||||||
option(DEBUG "debugging out" OFF)
|
option(DEBUG "debugging out" OFF)
|
||||||
|
|
|
@ -151,7 +151,7 @@ MPVBackend::MPVBackend(QQuickItem* parent)
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
usedirect = settings.value("Backend/direct", false).toBool();
|
usedirect = settings.value("Backend/direct", false).toBool();
|
||||||
|
|
||||||
mpv_set_option_string(mpv, "terminal", "false");
|
mpv_set_option_string(mpv, "terminal", "true");
|
||||||
mpv_set_option_string(mpv, "msg-level", "all=v");
|
mpv_set_option_string(mpv, "msg-level", "all=v");
|
||||||
|
|
||||||
// Fix?
|
// Fix?
|
||||||
|
|
|
@ -27,12 +27,17 @@ initLogger(std::string name)
|
||||||
QString logFile = settings.value("Logging/logFile", "/tmp/KittehPlayer.log").toString();
|
QString logFile = settings.value("Logging/logFile", "/tmp/KittehPlayer.log").toString();
|
||||||
|
|
||||||
std::vector<spdlog::sink_ptr> sinks;
|
std::vector<spdlog::sink_ptr> sinks;
|
||||||
|
|
||||||
|
|
||||||
sinks.push_back(std::make_shared<spdlog::sinks::stdout_color_sink_mt>());
|
sinks.push_back(std::make_shared<spdlog::sinks::stdout_color_sink_mt>());
|
||||||
sinks.push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(
|
auto fileLogger = std::make_shared<spdlog::sinks::basic_file_sink_mt>(logFile.toUtf8().constData());
|
||||||
logFile.toUtf8().constData()));
|
fileLogger->set_level(spdlog::level::trace);
|
||||||
|
sinks.push_back(fileLogger);
|
||||||
auto console = std::make_shared<spdlog::logger>(name, begin(sinks), end(sinks));
|
auto console = std::make_shared<spdlog::logger>(name, begin(sinks), end(sinks));
|
||||||
console->set_pattern("[%l][%n] %v%$");
|
console->set_pattern("[%l][%n] %v%$");
|
||||||
spdlog::register_logger(console);
|
spdlog::register_logger(console);
|
||||||
|
console->set_level(spdlog::level::debug);
|
||||||
|
|
||||||
|
|
||||||
return spdlog::get(name);
|
return spdlog::get(name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,34 +48,28 @@ MenuBar {
|
||||||
trackLang = trackLang == undefined ? "" : trackLang
|
trackLang = trackLang == undefined ? "" : trackLang
|
||||||
var trackTitle = track["title"] == undefined ? "" : track["title"] + " "
|
var trackTitle = track["title"] == undefined ? "" : track["title"] + " "
|
||||||
var component = Qt.createComponent("TrackItem.qml")
|
var component = Qt.createComponent("TrackItem.qml")
|
||||||
|
var menu, menuGroup, itemText, type;
|
||||||
if (trackType == "sub") {
|
if (trackType == "sub") {
|
||||||
var action = component.createObject(subMenu, {
|
menu = subMenu;
|
||||||
"text": trackLang,
|
menuGroup = subMenuGroup;
|
||||||
"trackID": String(trackID),
|
itemText = trackLang;
|
||||||
"trackType": "sid",
|
|
||||||
"checked": track["selected"]
|
|
||||||
})
|
|
||||||
action.ActionGroup.group = subMenuGroup
|
|
||||||
subMenu.addAction(action)
|
|
||||||
} else if (trackType == "audio") {
|
} else if (trackType == "audio") {
|
||||||
var action = component.createObject(audioMenu, {
|
menu = audioMenu;
|
||||||
"text": trackTitle + trackLang,
|
menuGroup = audioMenuGroup;
|
||||||
"trackID": String(trackID),
|
itemText = trackTitle + trackLang;
|
||||||
"trackType": "aid",
|
|
||||||
"checked": track["selected"]
|
|
||||||
})
|
|
||||||
action.ActionGroup.group = audioMenuGroup
|
|
||||||
audioMenu.addAction(action)
|
|
||||||
} else if (trackType == "video") {
|
} else if (trackType == "video") {
|
||||||
var action = component.createObject(videoMenu, {
|
menu = videoMenu;
|
||||||
"text": "Video " + trackID + trackTitle,
|
menuGroup = videoMenuGroup;
|
||||||
"trackID": String(trackID),
|
itemText = "Video " + trackID + trackTitle;
|
||||||
"trackType": "vid",
|
|
||||||
"checked": track["selected"]
|
|
||||||
})
|
|
||||||
action.ActionGroup.group = videoMenuGroup
|
|
||||||
videoMenu.addAction(action)
|
|
||||||
}
|
}
|
||||||
|
var action = component.createObject(menu, {
|
||||||
|
"text": itemText,
|
||||||
|
"trackID": String(trackID),
|
||||||
|
"trackType": trackType == "sub" ? "sid" : trackType == "video" ? "vid" : "aid",
|
||||||
|
"checked": track["selected"]
|
||||||
|
})
|
||||||
|
action.ActionGroup.group = menuGroup
|
||||||
|
videoMenu.addAction(action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,9 +324,11 @@ MenuBar {
|
||||||
audioDeviceMenu.addAction(action)
|
audioDeviceMenu.addAction(action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ScrollView {
|
||||||
ActionGroup {
|
clip: true
|
||||||
id: audioDeviceMenuGroup
|
ActionGroup {
|
||||||
|
id: audioDeviceMenuGroup
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue