From dbbb057b25174a3a4f992308acda5dbeece589c9 Mon Sep 17 00:00:00 2001 From: Diego Rubin Date: Thu, 2 Jul 2020 07:24:41 -0300 Subject: [PATCH] feature #75 wip play sound notification with gsound --- configure.ac | 2 +- data/Makefile.am | 1 + data/alert.ogg | Bin 0 -> 22453 bytes src/Makefile.am | 1 + src/dialog_preferences.cc | 76 ++++++++++++++------------------- src/dialog_preferences.h | 51 +++++++++++----------- src/dialog_work_log_entries.cc | 3 +- src/dialog_work_log_entries.h | 2 +- src/main.cc | 1 - src/sound_player.cc | 41 ++++++++++++++++++ src/sound_player.h | 49 +++++++++++++++++++++ src/win_main.cc | 3 ++ src/win_main.h | 1 + 13 files changed, 158 insertions(+), 73 deletions(-) create mode 100644 data/alert.ogg create mode 100644 src/sound_player.cc create mode 100644 src/sound_player.h diff --git a/configure.ac b/configure.ac index 0f4f323..c730b6d 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_CONFIG_SRCDIR([src]) AC_CONFIG_MACRO_DIR([m4]) PKG_CHECK_MODULES([Gnomato],[gtkmm-3.0 >= 3.0.0, sqlite3, libnotify >= 0.7.3, - python3 >= 3.5]) + python3 >= 3.5, gsound >= 1.0.0]) IT_PROG_INTLTOOL([0.35.0]) diff --git a/data/Makefile.am b/data/Makefile.am index 954b061..ee03b67 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -3,6 +3,7 @@ ui_DATA = \ tomato.png \ tomato-green.png \ tomato-gray.png \ + alert.ogg \ gnomato.ui gsettings_SCHEMAS = com.diegorubin.gnomato.gschema.xml diff --git a/data/alert.ogg b/data/alert.ogg new file mode 100644 index 0000000000000000000000000000000000000000..04130ad533a93af912200a52c5a8c06b73a9f64d GIT binary patch literal 22453 zcmeFYcT`hP*DyLs0OD19th7r-ww15FT z09YS1PN&d^Ck)A_VZu8npz-GNDzAniM~Hx|q3tUXpLn5y9F0g@@!-CA64>u>S3Lj~ zMp0)J3KLPWN(>cKfpU>bP?_6)8B*iF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 z=WCxUPoCYQtR*nZ`Ct#HqnpGK$()pmG?%wZAa_Yg%(5rlUKw&p#Wyi}g>Suh{~#*f z?&VxzLhdVp&BTtfHm8doaZQ?kZU^v68rCPCYi zxo=`PxOvl?=U=s5phF<*Y*3o>^zw)^$wn5%^3%kIm!%@-+Kl=(=jZ$Xwoa8@@0#3C zcRF!*GGVkVr}~nCrdPsK&HkgtmZ53S$Rr_Se9URGLWxuON<;Nn5Ao%LbDm}A(a$Hz zcWZwvo-ozsd!qGIX}U|v(}(%ja!raYZtV~lZ58rL+sF7cEdX_}>R`tiV-m`uT zE0!5Wy!_OyQ82_ -* -* Gnomato 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 3 of the License, or -* (at your option) any later version. -* -* Gnomato is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see . -* -* Author: Diego Rubin -* -*/ + * dialog_preferences.cc + * Copyright (C) Diego Rubin 2011 + * + * Gnomato 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 3 of the License, or + * (at your option) any later version. + * + * Gnomato is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Author: Diego Rubin + * + */ -#include #include "dialog_preferences.h" -DialogPreferences::DialogPreferences(BaseObjectType* cobject, - const Glib::RefPtr& refGlade) -: Gtk::Dialog(cobject), - m_refGlade(refGlade) -{ +DialogPreferences::DialogPreferences(BaseObjectType *cobject, + const Glib::RefPtr &refGlade) + : Gtk::Dialog(cobject), m_refGlade(refGlade) { configs.load(); // buttons m_refGlade->get_widget("btnOk", btnOk); m_refGlade->get_widget("btnCancel", btnCancel); - // page 1 - intervals + // page 1 - intervals m_refGlade->get_widget("spnWork", spnWork); m_refGlade->get_widget("spnShortBreak", spnShortBreak); m_refGlade->get_widget("spnLongBreak", spnLongBreak); @@ -47,35 +44,29 @@ DialogPreferences::DialogPreferences(BaseObjectType* cobject, // page 2 - colors m_refGlade->get_widget("clrTimer", clrTimer); Gdk::RGBA timer; - timer.set_rgba( - configs.colorTimerRed, - configs.colorTimerGreen, - configs.colorTimerBlue); + timer.set_rgba(configs.colorTimerRed, configs.colorTimerGreen, + configs.colorTimerBlue); clrTimer->set_rgba(timer); // connect signals - btnCancel->signal_clicked().connect(sigc::mem_fun(*this,&DialogPreferences::on_button_cancel_clicked)); - btnOk->signal_clicked().connect(sigc::mem_fun(*this,&DialogPreferences::on_button_ok_clicked)); + btnCancel->signal_clicked().connect( + sigc::mem_fun(*this, &DialogPreferences::on_button_cancel_clicked)); + btnOk->signal_clicked().connect( + sigc::mem_fun(*this, &DialogPreferences::on_button_ok_clicked)); show_all(); } -DialogPreferences::~DialogPreferences() -{ -} +DialogPreferences::~DialogPreferences() {} -void DialogPreferences::on_button_cancel_clicked() -{ - hide(); -} +void DialogPreferences::on_button_cancel_clicked() { hide(); } -void DialogPreferences::on_button_ok_clicked() -{ +void DialogPreferences::on_button_ok_clicked() { configs.work_interval = spnWork->get_text(); configs.break_interval = spnShortBreak->get_text(); configs.long_interval = spnLongBreak->get_text(); configs.inactive_interval = spnInactiveInterval->get_text(); - + Gdk::RGBA timer = clrTimer->get_rgba(); configs.colorTimerRed = timer.get_red(); configs.colorTimerGreen = timer.get_green(); @@ -84,4 +75,3 @@ void DialogPreferences::on_button_ok_clicked() configs.save(); hide(); } - diff --git a/src/dialog_preferences.h b/src/dialog_preferences.h index a926112..06dd365 100644 --- a/src/dialog_preferences.h +++ b/src/dialog_preferences.h @@ -1,42 +1,43 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /*! -* dialog_preferences.h -* Copyright (C) Diego Rubin 2011 -* -* Gnomato 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 3 of the License, or -* (at your option) any later version. -* -* Gnomato is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see . -* -* Author: Diego Rubin -* -*/ + * dialog_preferences.h + * Copyright (C) Diego Rubin 2011 + * + * Gnomato 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 3 of the License, or + * (at your option) any later version. + * + * Gnomato is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Author: Diego Rubin + * + */ #ifndef _WIN_PREFERENCES_H_ #define _WIN_PREFERENCES_H_ +#include #include + #include "config.h" using namespace Gtk; -class DialogPreferences: public Gtk::Dialog -{ +class DialogPreferences : public Gtk::Dialog { public: - DialogPreferences(BaseObjectType* cobject, - const Glib::RefPtr& refGlade); + DialogPreferences(BaseObjectType *cobject, + const Glib::RefPtr &refGlade); - virtual ~DialogPreferences(); -protected: + virtual ~DialogPreferences(); +protected: private: // attributes Config configs; diff --git a/src/dialog_work_log_entries.cc b/src/dialog_work_log_entries.cc index 9381fb3..0a7f205 100644 --- a/src/dialog_work_log_entries.cc +++ b/src/dialog_work_log_entries.cc @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /*! - * dialog_preferences.cc + * dialog_work_log_entries.cc * Copyright (C) Diego Rubin 2020 * * Gnomato is free software: you can redistribute it and/or modify it @@ -21,7 +21,6 @@ */ #include "dialog_work_log_entries.h" -#include DialogWorkLogEntries::DialogWorkLogEntries( BaseObjectType *cobject, const Glib::RefPtr &refGlade) diff --git a/src/dialog_work_log_entries.h b/src/dialog_work_log_entries.h index e331430..ea493de 100644 --- a/src/dialog_work_log_entries.h +++ b/src/dialog_work_log_entries.h @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /*! - * dialog_preferences.h + * dialog_work_log_entries.h * Copyright (C) Diego Rubin 2020 * * Gnomato is free software: you can redistribute it and/or modify it diff --git a/src/main.cc b/src/main.cc index 1934211..a35df45 100644 --- a/src/main.cc +++ b/src/main.cc @@ -319,7 +319,6 @@ void migrate_database() { } int main(int argc, char **argv) { - sprintf(dbpath, "%s", dbfile().c_str()); bootstrap(); migrate_database(); diff --git a/src/sound_player.cc b/src/sound_player.cc new file mode 100644 index 0000000..4c2241d --- /dev/null +++ b/src/sound_player.cc @@ -0,0 +1,41 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ +/*! + * sound_player.cc + * Copyright (C) Diego Rubin 2020 + * + * Gnomato 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 3 of the License, or + * (at your option) any later version. + * + * Gnomato is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Author: Diego Rubin + * + */ + +#include "sound_player.h" + +SoundPlayer::SoundPlayer(string file) : file(file) { + gsound = gsound_context_new(NULL, NULL); +} + +SoundPlayer::SoundPlayer() : SoundPlayer(GNOMATO_DATADIR "/alert.ogg") {} + +SoundPlayer::~SoundPlayer() {} + +void SoundPlayer::play() { + if (!gsound) { + cout << _("Error on load gsound context") << endl; + return; + } + + gsound_context_play_simple(gsound, NULL, NULL, GSOUND_ATTR_MEDIA_FILENAME, + "phone-incoming-call", NULL); +} diff --git a/src/sound_player.h b/src/sound_player.h new file mode 100644 index 0000000..1df7a0e --- /dev/null +++ b/src/sound_player.h @@ -0,0 +1,49 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ +/*! + * sound_player.h + * Copyright (C) Diego Rubin 2020 + * + * Gnomato 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 3 of the License, or + * (at your option) any later version. + * + * Gnomato is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Author: Diego Rubin + * + */ + +#ifndef _SOUND_PLAYER_H_ +#define _SOUND_PLAYER_H_ + +#include +#include +#include +#include + +using namespace std; + +class SoundPlayer { +public: + SoundPlayer(string file); + SoundPlayer(); + + virtual ~SoundPlayer(); + + // methods + void play(); + +private: + // attributes + string file; + GSoundContext *gsound; +}; + +#endif // SOUND_PLAYER diff --git a/src/win_main.cc b/src/win_main.cc index b0cf7f1..523a858 100644 --- a/src/win_main.cc +++ b/src/win_main.cc @@ -345,6 +345,8 @@ void WinMain::notify(const char *message) { } void WinMain::notify(const char *icon, const char *message) { + SoundPlayer soundPlayer; + NotifyNotification *notMessage; GError *error = NULL; @@ -357,6 +359,7 @@ void WinMain::notify(const char *icon, const char *message) { notify_notification_set_urgency(notMessage, NOTIFY_URGENCY_NORMAL); + soundPlayer.play(); notify_notification_show(notMessage, &error); } diff --git a/src/win_main.h b/src/win_main.h index c285f8e..b289bbc 100644 --- a/src/win_main.h +++ b/src/win_main.h @@ -36,6 +36,7 @@ #include "dialog_task.h" #include "dialog_work_log_entries.h" #include "python_executor.h" +#include "sound_player.h" #include "task.h" #include "task_list.h" #include "utils.h"