23 |
23 |
#include <audacious/i18n.h>
|
24 |
24 |
#include <audacious/plugin.h>
|
25 |
25 |
#include <audacious/debug.h>
|
|
26 |
#include <audacious/preferences.h>
|
|
27 |
#include <audacious/misc.h>
|
26 |
28 |
|
27 |
29 |
#include "config.h"
|
28 |
30 |
#include "event.h"
|
... | ... | |
47 |
49 |
"You should have received a copy of the GNU General Public License "
|
48 |
50 |
"along with this program. If not, see <http://www.gnu.org/licenses/>.";
|
49 |
51 |
|
|
52 |
static const char * const notify_defaults[] = {
|
|
53 |
"actions", "TRUE",
|
|
54 |
"silent", "FALSE",
|
|
55 |
NULL};
|
|
56 |
|
|
57 |
|
|
58 |
static const PreferencesWidget notify_widgets[] = {
|
|
59 |
{WIDGET_CHK_BTN, N_("Activate controls inside of the notification"),
|
|
60 |
.cfg_type = VALUE_BOOLEAN, .csect = "notify", .cname = "actions"},
|
|
61 |
{WIDGET_CHK_BTN, N_("Silent mode (don't show the notification if activated"),
|
|
62 |
.cfg_type = VALUE_BOOLEAN, .csect = "notify", .cname = "silent"},
|
|
63 |
};
|
|
64 |
|
|
65 |
static const PluginPreferences notify_prefs = {
|
|
66 |
.widgets = notify_widgets,
|
|
67 |
.n_widgets = G_N_ELEMENTS (notify_widgets)};
|
|
68 |
|
|
69 |
|
|
70 |
|
50 |
71 |
AUD_GENERAL_PLUGIN
|
51 |
72 |
(
|
52 |
73 |
.name = N_("Desktop Notifications"),
|
53 |
74 |
.domain = PACKAGE,
|
54 |
75 |
.about_text = plugin_about,
|
55 |
76 |
.init = plugin_init,
|
|
77 |
.prefs = & notify_prefs,
|
56 |
78 |
.cleanup = plugin_cleanup
|
57 |
79 |
)
|
58 |
80 |
|
... | ... | |
61 |
83 |
gboolean plugin_init (void)
|
62 |
84 |
{
|
63 |
85 |
AUDDBG("started!\n");
|
64 |
|
if(!osd_init()) {
|
|
86 |
aud_config_set_defaults ("notify", notify_defaults);
|
|
87 |
void* notif = osd_init();
|
|
88 |
if(!notif) {
|
65 |
89 |
AUDDBG("osd_init failed!\n");
|
66 |
90 |
return FALSE;
|
67 |
91 |
}
|
68 |
|
event_init();
|
|
92 |
event_init(notif);
|
69 |
93 |
|
70 |
94 |
plugin_active = 1;
|
71 |
95 |
return TRUE;
|