Files
raDIYo/raDIYoglobals.h
2025-08-05 22:36:00 +02:00

80 lines
3.6 KiB
C++

/***************************************************************************
source::worx raDIYo
Copyright © 2020-2022 c.holzheuer
chris@sourceworx.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
***************************************************************************/
#ifndef RADIYOGLOBALS_H
#define RADIYOGLOBALS_H
#include <QVector>
#include <QColor>
#include <QString>
#include <QMediaPlayer>
#include <QMetaType>
using SWColorVec = QVector<QColor>;
using SWValVec = QVector<float>;
QString readResource( const QString& fileName );
QString formatInt(int value, int len );
/**
* @brief Globale Konstanten und Voreinstellungen.
*/
namespace raDIYo
{
// basics
[[maybe_unused]] constexpr static const char* KeyPlayerVolume = "PlayerVolume";
[[maybe_unused]] constexpr static const char* KeySongsDir = "SongsDir";
[[maybe_unused]] constexpr static const char* SongsDir = "/my.raDIYo/";
[[maybe_unused]] constexpr static const char* SenderFile = "/my.raDIYo.csv";
[[maybe_unused]] constexpr static const char* KeySongsPath = "SongsPath";
[[maybe_unused]] constexpr static const char* KeySenderPath = "SenderFile";
[[maybe_unused]] constexpr static const char* MountDir = "/media/";
[[maybe_unused]] constexpr static const char* ResSenderList = ":/data/radiyo.senderlist.csv";
[[maybe_unused]] constexpr static const char* ResTitleStyle = ":/data/radiyo.titlelabel.css";
[[maybe_unused]] constexpr static const char* KeyDefaultSender = "DefaultSender";
[[maybe_unused]] constexpr static const char* DefaultSender = "egoFM;http://streams.egofm.de/egoFM-hq";
[[maybe_unused]] constexpr static const int DefaultVolume = 20; // 20%
// alarm handling
[[maybe_unused]] constexpr static const char* KeyAlarmEnabled = "AlarmEnabled";
[[maybe_unused]] constexpr static const bool AlarmEnabled = false;
[[maybe_unused]] constexpr static const char* KeyAlarmRepeat = "AlarmRepeat";
[[maybe_unused]] constexpr static const bool AlarmRepeat = false;
[[maybe_unused]] constexpr static const char* KeyWeekdaysOnly = "WeekdaysOnly";
[[maybe_unused]] constexpr static const bool WeekdaysOnly = true;
[[maybe_unused]] constexpr static const char* KeyAlarmHour = "AlarmHour";
[[maybe_unused]] constexpr static const int AlarmHour = 05;
[[maybe_unused]] constexpr static const char* KeyAlarmMinute = "AlarmMinute";
[[maybe_unused]] constexpr static const int AlarmMinute = 59;
// optik, haptik :)
[[maybe_unused]] constexpr static const char* FontDir = ":/fonts/";
[[maybe_unused]] constexpr static const char* NoMedia = "(no media)";
[[maybe_unused]] constexpr static const int IdleTimeOut = 20000; // 20 sec
[[maybe_unused]] constexpr static const int HighlightWidth = 3;
// restart etc.
[[maybe_unused]] constexpr static const char* CmdShutDown = "sudo halt";
[[maybe_unused]] constexpr static const char* CmdReboot = "sudo reboot";
[[maybe_unused]] constexpr static const char* CmdRestart = "kill -9 `pidof raDIYo`; x-terminal-emulator -e /home/pi/raDIYo/raDIYo";
[[maybe_unused]] constexpr static const char* CmdVolume = "/usr/bin/amixer -q sset 'Master' %0% ";
}
#endif // RADIYOGLOBALS_H