Skip to content

Commit

Permalink
Merge branch 'release/0.13.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
truschival committed Dec 16, 2020
2 parents 9b4f9a0 + 59d9b4c commit 6555c1c
Show file tree
Hide file tree
Showing 35 changed files with 53 additions and 97 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/)
# Project Name
MESSAGE( STATUS "Running ${CMAKE_COMMAND} v${CMAKE_VERSION}" )
PROJECT(DigitalRooster
VERSION 0.13.0
VERSION 0.13.1
DESCRIPTION "A digital alarm clock and podcast player"
LANGUAGES CXX C
)
Expand Down
2 changes: 1 addition & 1 deletion include/UpdateTask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#ifndef _UPDATETASK_HPP_
#define _UPDATETASK_HPP_

#include <httpclient.hpp>
#include <memory>
#include <chrono>

#include <QObject>
#include <QString>
#include <QTimer>

#include "httpclient.hpp"

namespace DigitalRooster {
class PodcastSource;
Expand Down
4 changes: 2 additions & 2 deletions include/mediaplayerproxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ class MediaPlayerProxy : public MediaPlayer {

private:
virtual bool is_seekable() const override;
virtual bool is_muted() const;
virtual bool is_muted() const override;
virtual int do_get_volume() const override;
virtual qint64 do_get_duration() const override;
virtual qint64 do_get_position() const override;
virtual QMediaPlayer::MediaStatus do_media_status() const override;
virtual QMediaPlayer::State do_playback_state() const override;
virtual QMediaPlayer::Error do_error() const;
virtual QMediaPlayer::Error do_error() const override;
virtual void do_set_media(
std::shared_ptr<DigitalRooster::PlayableItem> media) override;
virtual void do_set_playlist(QMediaPlaylist* playlist) override;
Expand Down
1 change: 0 additions & 1 deletion include/podcast_serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#define _PODCASTSERIALIZER_HPP_

#include <QDir>
#include <QFile>
#include <QJsonArray>
#include <QJsonObject>
#include <QObject>
Expand Down
6 changes: 2 additions & 4 deletions libsrc/PodcastSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
*/

#include <QCryptographicHash>
#include <QDateTime>
#include <QLoggingCategory>
#include <QMediaPlayer>
#include <QStandardPaths>

#include <algorithm>
#include <memory>
Expand Down Expand Up @@ -260,7 +257,8 @@ void PodcastSource::set_image_url(const QUrl& uri) {
}
/* if we don't have a local copy or the file name changed - download it*/
if (!QFile(image_file_path).exists() ||
QUrl::fromLocalFile(image_file_path).fileName() != create_image_file_name(uri)){
QUrl::fromLocalFile(image_file_path).fileName() !=
create_image_file_name(uri)) {
trigger_image_download();
}
}
Expand Down
5 changes: 1 addition & 4 deletions libsrc/UpdateTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
*/

#include <QLoggingCategory>
#include <cstdio>
#include <httpclient.hpp>
#include <rss2podcastsource.hpp>
#include <stdexcept>

#include "PodcastSource.hpp"
#include "UpdateTask.hpp"
#include "rss2podcastsource.hpp"

using namespace DigitalRooster;
static Q_LOGGING_CATEGORY(CLASS_LC, "DigitalRooster.UpdateTask");
Expand Down
2 changes: 1 addition & 1 deletion libsrc/alarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <QLoggingCategory>
#include <QUrl>
#include <stdexcept>

#include "PlayableItem.hpp"
#include "alarm.hpp"
Expand Down
4 changes: 0 additions & 4 deletions libsrc/alarmdispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include <QDebug>
#include <QLoggingCategory>
#include <QMediaPlayer>
#include <QVector>
#include <chrono>
#include <memory>

#include "IAlarmStore.hpp"
#include "alarm.hpp"
#include "alarmdispatcher.hpp"
#include "mediaplayerproxy.hpp"
#include "timeprovider.hpp"

using namespace DigitalRooster;
Expand Down
3 changes: 1 addition & 2 deletions libsrc/alarmmonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


#include <QLoggingCategory>
#include <QMediaPlayer>

#include "alarm.hpp"
#include "alarmmonitor.hpp"
Expand Down Expand Up @@ -82,7 +81,7 @@ void AlarmMonitor::set_state(MonitorState next_state) {
}

/*****************************************************************************/
void AlarmMonitor::alarm_triggered(const DigitalRooster::Alarm* alarm) {
void AlarmMonitor::alarm_triggered(const DigitalRooster::Alarm* alarm) {
qCDebug(CLASS_LC) << Q_FUNC_INFO;
set_state(ExpectingAlarm);
mpp.set_media(alarm->get_media());
Expand Down
6 changes: 1 addition & 5 deletions libsrc/brightnesscontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include <QAudio>
#include <QLoggingCategory>
#include <QTimerEvent>

#include <algorithm>
#include <chrono>
#include <cmath>
#include <memory>
#include <numeric>

#include "util.hpp"
#include "IBrightnessStore.hpp"
#include "IHardware.hpp"
#include "brightnesscontrol.hpp"
#include "util.hpp"

using namespace DigitalRooster;

Expand Down
1 change: 0 additions & 1 deletion libsrc/configuration_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <QTime>

#include <chrono>
#include <iostream>
#include <stdexcept>

#include "PlayableItem.hpp"
Expand Down
2 changes: 0 additions & 2 deletions libsrc/hardware_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include <QDir>
#include <QFileInfo>
#include <QLoggingCategory>
#include <QProcessEnvironment>

Expand Down
4 changes: 2 additions & 2 deletions libsrc/hardwarecontrol_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace Hal;
static Q_LOGGING_CATEGORY(CLASS_LC, "DigitalRooster.HardwareControl");

// need for definition in cpp file
Hal::IHardware::~IHardware()= default;
Hal::IHardware::~IHardware() = default;

/*****************************************************************************/
HardwareControlStub::~HardwareControlStub() {
Expand Down Expand Up @@ -48,6 +48,6 @@ AlsValue HardwareControlStub::read_als_sensor() {

/*****************************************************************************/
void HardwareControlStub::set_backlight(int brightness) {
qCInfo(CLASS_LC) << Q_FUNC_INFO;
qCInfo(CLASS_LC) << Q_FUNC_INFO;
}
/*****************************************************************************/
2 changes: 0 additions & 2 deletions libsrc/httpclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include <QDebug>
#include <QLoggingCategory>

#include <vector>

#include "appconstants.hpp"
Expand Down
12 changes: 7 additions & 5 deletions libsrc/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
*/

#include <memory>
#include <stdexcept>
#include <system_error>

#include <QFile>
#include <QDateTime>
#include <QDebug>
#include <QFile>
#include <QLoggingCategory>

#include "logger.hpp"
Expand Down Expand Up @@ -57,9 +59,9 @@ void setup_logger_file(const QString& filename) {
qDebug() << Q_FUNC_INFO;
qDebug() << "Logging to " << filename;
logfile = std::make_shared<QFile>(filename);
if(! logfile->open(QIODevice::WriteOnly | QIODevice::Append| QIODevice::Text)){
throw std::system_error(
make_error_code(std::errc::bad_file_descriptor),
if (!logfile->open(
QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
throw std::system_error(make_error_code(std::errc::bad_file_descriptor),
logfile->errorString().toStdString());
};
qInstallMessageHandler(messageHandler);
Expand All @@ -77,4 +79,4 @@ void setup_logger_stdout() {
/*****************************************************************************/


} // namespace
} // namespace DigitalRooster
8 changes: 4 additions & 4 deletions libsrc/mediaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <QLoggingCategory>

#include "util.hpp"
#include "mediaplayer.hpp"
#include "util.hpp"

using namespace DigitalRooster;

Expand All @@ -33,12 +33,12 @@ void MediaPlayer::set_muted(bool muted) {

/*****************************************************************************/
void MediaPlayer::set_volume(int volume) {
qCDebug(CLASS_LC) << Q_FUNC_INFO << volume;
if (! value_in_0_100(volume)) {
qCDebug(CLASS_LC) << Q_FUNC_INFO << volume;
if (!value_in_0_100(volume)) {
qCWarning(CLASS_LC) << "invalid volume (must be 0..100%)";
return;
}
return do_set_volume(volume);
return do_set_volume(volume);
}

/*****************************************************************************/
Expand Down
11 changes: 5 additions & 6 deletions libsrc/mediaplayerproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include "mediaplayerproxy.hpp"
#include "PlayableItem.hpp"
#include <QAudio>
#include <QDebug>
#include <QLoggingCategory>
#include <QMediaMetaData>
#include <QMediaPlayer>

#include <QMediaMetaData>
#include "PlayableItem.hpp"
#include "mediaplayerproxy.hpp"

using namespace DigitalRooster;

static Q_LOGGING_CATEGORY(CLASS_LC, "DigitalRooster.MediaPlayerProxy");
Expand Down Expand Up @@ -123,7 +122,7 @@ void MediaPlayerProxy::do_seek(qint64 incr) {
qCDebug(CLASS_LC) << Q_FUNC_INFO;
if (seekable()) {
set_position(get_position() + incr);
}
}
};

/*****************************************************************************/
Expand Down
7 changes: 2 additions & 5 deletions libsrc/playableitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include <QDebug>
#include <QLoggingCategory>
#include <QUrl>
#include <QUuid>
#include <stdexcept>

#include "PlayableItem.hpp"
#include "appconstants.hpp"
Expand All @@ -23,8 +21,7 @@ PlayableItem::PlayableItem(const QUuid& uid)

/***********************************************************************/

PlayableItem::PlayableItem(
QString name, QUrl url, const QUuid& uid)
PlayableItem::PlayableItem(QString name, QUrl url, const QUuid& uid)
: id(uid)
, display_name(std::move(name))
, media_url(std::move(url)){};
Expand Down
7 changes: 3 additions & 4 deletions libsrc/podcast_serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
#include <QFile>
#include <QImage>
#include <QLoggingCategory>
#include <QUuid>
#include <exception>
#include <stdexcept>

#include "PodcastSource.hpp"
#include "appconstants.hpp"
Expand Down Expand Up @@ -44,7 +43,7 @@ void PodcastSerializer::restore_info() {
auto cache_file = cache_dir.filePath(ps->get_id_string());
try {
read_from_file(ps, cache_file);
} catch (std::system_error& exc) {
} catch (std::system_error&) {
qCWarning(CLASS_LC) << "Cache file not found" << cache_file;
} catch (PodcastSourceJSonCorrupted& jsexc) {
qCWarning(CLASS_LC) << "corrupted JSON in file" << cache_file
Expand Down Expand Up @@ -215,7 +214,7 @@ void DigitalRooster::parse_podcast_source_from_json(
}
if (ps->get_last_updated().isValid() &&
ps->get_last_updated() > timestamp) {
qCDebug(CLASS_LC) << "podcast source is newer than stored information";
qCDebug(CLASS_LC) << "PodcastSource newer than cache";
} else {
// need to update podcast source data
auto title = tl_obj[JSON_KEY_TITLE].toString();
Expand Down
1 change: 0 additions & 1 deletion libsrc/powercontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include <QAudio>
#include <QLoggingCategory>

#include "powercontrol.hpp"
Expand Down
4 changes: 1 addition & 3 deletions libsrc/sleeptimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
* Licensed under GNU PUBLIC LICENSE Version 3 or later
*/

#include <QDebug>
#include <QLoggingCategory>
#include <QMediaPlayer>
#include <QTimerEvent>
#include <chrono>
#include <memory>

#include "alarm.hpp"
#include "sleeptimer.hpp"
Expand Down Expand Up @@ -63,7 +61,7 @@ void SleepTimer::reset_timer() {
}

/*****************************************************************************/
void SleepTimer::alarm_triggered(const DigitalRooster::Alarm* alarm) {
void SleepTimer::alarm_triggered(const DigitalRooster::Alarm* alarm) {
qCDebug(CLASS_LC) << Q_FUNC_INFO;
activity = SleepTimer::Alarm;
sleep_timer.setInterval(alarm->get_timeout());
Expand Down
4 changes: 2 additions & 2 deletions libsrc/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QLoggingCategory>
#include <QString>
#include <QUrl>
#include <QUuid>

#include <QString>
#include <stdexcept>

#include "appconstants.hpp"
#include "logger.hpp"
Expand Down
1 change: 0 additions & 1 deletion libsrc/volume_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <QLoggingCategory>

#include "configuration_manager.hpp"
#include "volume_button.hpp"

using namespace DigitalRooster;
Expand Down
Loading

0 comments on commit 6555c1c

Please sign in to comment.