13 Commits

22 changed files with 398 additions and 25 deletions

View File

@@ -25,3 +25,11 @@ endif()
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
add_subdirectory(src)
install(
PROGRAMS
install.sh
DESTINATION
.
)

View File

@@ -0,0 +1,27 @@
K1;3d1a77ec-265f-4905-2061-4f1003ee2189;O1;net.drinkingtea.nostalgia.core.Palette;4;{
"colorNames" :
[
"Color 1",
"Color 2",
"Color 3"
],
"pages" :
[
{
"colors" :
[
{
"b" : 10,
"g" : 5,
"r" : 5
},
{},
{
"b" : 31,
"g" : 31,
"r" : 31
}
]
}
]
}

View File

@@ -0,0 +1,269 @@
K1;40f7b4ac-7f90-409e-80e0-64b59b594a63;O1;net.drinkingtea.nostalgia.gfx.TileSheet;5;{
"bpp" : 4,
"defaultPalette" : "uuid://3d1a77ec-265f-4905-2061-4f1003ee2189",
"subsheet" :
{
"columns" : 2,
"name" : "Root",
"pixels" :
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
0,
0,
2,
0,
0,
2,
0,
0,
0,
0,
2,
0,
0,
2,
0,
0,
0,
0,
0,
2,
2,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
2,
0,
0,
0,
2,
0,
0,
2,
0,
0,
0,
0,
2,
0,
2,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
2,
0,
0,
0,
0,
0,
2,
0,
0,
2,
0,
0,
0,
0,
2,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"rows" : 2
}
}

18
install.sh Normal file
View File

@@ -0,0 +1,18 @@
#! /usr/bin/env bash
set -eu
dist_dir=.
install -Dm 755 $dist_dir/bin/SlideController /usr/local/bin/SlideController
install -Dm 755 $dist_dir/share/applications/net.drinkingtea.sc9k.desktop /usr/share/applications/net.drinkingtea.sc9k.desktop
cp -r $dist_dir/share/ /usr/
if command -v gtk-update-icon-cache >/dev/null 2>&1; then
sudo gtk-update-icon-cache /usr/share/icons/hicolor
fi
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y qt6-gtk-platformtheme qgnomeplatform-qt6 adwaita-qt
fi

5
release-notes.md Normal file
View File

@@ -0,0 +1,5 @@
# 1.1.0
* Add Linux app icon, desktop file, and install script
* Rename MusicScene SlidesScene and SpeakerScene to NoSlidesScene

View File

@@ -16,6 +16,7 @@ add_executable(
settingsdata.cpp
settingsdialog.cpp
slideview.cpp
sc9k.rc
)
target_link_libraries(
@@ -32,3 +33,30 @@ install(
BUNDLE DESTINATION .
)
install(
DIRECTORY
icons
DESTINATION
share
)
install(
FILES
net.drinkingtea.sc9k.desktop
DESTINATION
share/applications
)
if(UNIX)
qt_add_resources(
SlideController "app_images"
PREFIX "/"
FILES
icons/hicolor/16x16/apps/net.drinkingtea.sc9k.png
icons/hicolor/32x32/apps/net.drinkingtea.sc9k.png
icons/hicolor/64x64/apps/net.drinkingtea.sc9k.png
icons/hicolor/128x128/apps/net.drinkingtea.sc9k.png
icons/hicolor/256x256/apps/net.drinkingtea.sc9k.png
icons/hicolor/512x512/apps/net.drinkingtea.sc9k.png
)
endif()

View File

@@ -10,5 +10,5 @@
constexpr auto MaxCameraPresets = 9;
constexpr auto MaxViews = 9;
constexpr auto Version = "1.0-beta5";
constexpr auto Version = "1.1.0";

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

View File

@@ -19,6 +19,16 @@ int main(int argc, char *argv[]) {
QApplication a(argc, argv);
QApplication::setOrganizationName("DrinkingTea");
QApplication::setApplicationName("Slide Controller 9000");
#ifdef __linux
QIcon icon;
icon.addFile(":/icons/hicolor/16x16/apps/net.drinkingtea.sc9k.png");
icon.addFile(":/icons/hicolor/32x32/apps/net.drinkingtea.sc9k.png");
icon.addFile(":/icons/hicolor/64x64/apps/net.drinkingtea.sc9k.png");
icon.addFile(":/icons/hicolor/128x128/apps/net.drinkingtea.sc9k.png");
icon.addFile(":/icons/hicolor/256x256/apps/net.drinkingtea.sc9k.png");
icon.addFile(":/icons/hicolor/512x512/apps/net.drinkingtea.sc9k.png");
QApplication::setWindowIcon(icon);
#endif
MainWindow w;
w.show();
return QApplication::exec();

View File

@@ -121,18 +121,6 @@ void MainWindow::setupMenu() {
});
menu->addAction(cameraPresetAct);
}
menu->addSeparator();
auto const rebootAct = new QAction(tr("&Reboot"), this);
connect(rebootAct, &QAction::triggered, &m_cameraClient, [this] {
QMessageBox confirm(this);
confirm.setText(tr("Are you sure you want to reboot the camera? This will take about 20 seconds."));
confirm.addButton(tr("&No"), QMessageBox::ButtonRole::NoRole);
confirm.addButton(tr("&Yes"), QMessageBox::ButtonRole::YesRole);
if (confirm.exec()) {
m_cameraClient.reboot();
}
});
menu->addAction(rebootAct);
}
// help menu
{
@@ -144,7 +132,7 @@ void MainWindow::setupMenu() {
R"(Slide Controller 9000 - %1
Build date: %2
Copyright 2021 - 2024 Gary Talent (gary@drinkingtea.net)
Copyright 2021 - 2025 Gary Talent (gary@drinkingtea.net)
Slide Controller 9000 is released under the MPL 2.0
Built on Qt library under LGPL 2.0)").arg(Version, __DATE__));
about.exec();
@@ -201,8 +189,8 @@ void MainWindow::setupViewControls(QVBoxLayout *rootLyt) {
});
views.emplace_back(View{
.name = tr("Show"),
.slides = false,
.obsSlides = false,
.slides = true,
.obsSlides = true,
});
}
setupViewControlButtons(views, viewCtlLyt);

View File

@@ -0,0 +1,14 @@
[Desktop Entry]
Name=Slide Controller 9000
Comment=Slide and Live Stream Coordinator
GenericName=Slide and Live Stream Coordinator
X-GNOME-FullName=Slide Controller 9000
Type=Application
Exec=env QT_QPA_PLATFORMTHEME=gnome /usr/local/bin/SlideController
Terminal=false
X-MultipleArgs=false
Icon=net.drinkingtea.sc9k
Categories=Multimedia
Keywords=slide;controller;sc9k
StartupWMClass=SlideController
StartupNotify=false

View File

@@ -26,18 +26,18 @@ void OBSClient::setScene(QString const&scene) {
}
void OBSClient::showSlides() {
setScene("MusicScene");
setScene(SceneSlides);
}
void OBSClient::hideSlides() {
setScene("SpeakerScene");
setScene(SceneNoSlides);
}
void OBSClient::setSlidesVisible(bool state) {
if (state) {
setScene("MusicScene");
setScene(SceneSlides);
} else {
setScene("SpeakerScene");
setScene(SceneNoSlides);
}
}

View File

@@ -17,6 +17,8 @@
class OBSClient: public QObject {
Q_OBJECT
private:
static constexpr auto SceneSlides = "SlidesScene";
static constexpr auto SceneNoSlides = "NoSlidesScene";
QString m_baseUrl;
QNetworkAccessManager *m_nam = new QNetworkAccessManager(this);
QNetworkAccessManager *m_pollingNam = new QNetworkAccessManager(this);

BIN
src/sc9k.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

1
src/sc9k.rc Normal file
View File

@@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "sc9k.ico"

View File

@@ -205,12 +205,12 @@ QWidget *SettingsDialog::setupButtons(QWidget *parent) {
return root;
}
void SettingsDialog::handleApply() {
int SettingsDialog::handleApply() {
QSettings settings;
QVector<View> views;
auto const viewsErr = collectViews(views);
if (viewsErr) {
return;
return -1;
}
setViews(settings, views);
setCameraConnectionData(settings, {
@@ -227,11 +227,13 @@ void SettingsDialog::handleApply() {
});
collectVideoConfig();
setVideoConfig(settings, m_videoConfig);
return 0;
}
void SettingsDialog::handleOK() {
handleApply();
accept();
if (handleApply() == 0) {
accept();
}
}
void SettingsDialog::setupViewRow(int row, View const&view) {

View File

@@ -38,7 +38,8 @@ class SettingsDialog: public QDialog {
QWidget *setupViewConfig(QWidget *parent);
QWidget *setupImageConfig(QWidget *parent);
QWidget *setupButtons(QWidget *parent);
void handleApply();
[[nodiscard]]
int handleApply();
void handleOK();
void setupViewRow(int row, View const&view = {});
/**