Line 0
Link Here
|
|
|
1 |
// ProcSoundPlayer.cc --- Sound player |
2 |
// |
3 |
// Copyright (C) 2016 Tobias Kortkamp |
4 |
// Copyright (C) 2002 - 2011, 2013 Rob Caelers & Raymond Penners |
5 |
// All rights reserved. |
6 |
// |
7 |
// This program is free software: you can redistribute it and/or modify |
8 |
// it under the terms of the GNU General Public License as published by |
9 |
// the Free Software Foundation, either version 3 of the License, or |
10 |
// (at your option) any later version. |
11 |
// |
12 |
// This program is distributed in the hope that it will be useful, |
13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
// GNU General Public License for more details. |
16 |
// |
17 |
// You should have received a copy of the GNU General Public License |
18 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 |
// |
20 |
|
21 |
#ifdef HAVE_CONFIG_H |
22 |
#include "config.h" |
23 |
#endif |
24 |
|
25 |
#include "debug.hh" |
26 |
|
27 |
#include "IConfigurator.hh" |
28 |
#include "ICore.hh" |
29 |
#include "CoreFactory.hh" |
30 |
|
31 |
#include "ProcSoundPlayer.hh" |
32 |
#include "SoundPlayer.hh" |
33 |
#include "Sound.hh" |
34 |
#include "Util.hh" |
35 |
#include <debug.hh> |
36 |
|
37 |
#include <glib.h> |
38 |
|
39 |
using namespace std; |
40 |
using namespace workrave; |
41 |
|
42 |
ProcSoundPlayer::ProcSoundPlayer() {} |
43 |
ProcSoundPlayer::~ProcSoundPlayer() {} |
44 |
|
45 |
void |
46 |
ProcSoundPlayer::init(ISoundDriverEvents *events) |
47 |
{ |
48 |
this->events = events; |
49 |
} |
50 |
|
51 |
bool |
52 |
ProcSoundPlayer::capability(SoundCapability cap) |
53 |
{ |
54 |
return cap == SOUND_CAP_EDIT |
55 |
|| cap == SOUND_CAP_VOLUME |
56 |
|| cap == SOUND_CAP_EOS_EVENT; |
57 |
} |
58 |
|
59 |
void |
60 |
ProcSoundPlayer::play_sound(SoundEvent snd) |
61 |
{ |
62 |
(void) snd; |
63 |
TRACE_ENTER_MSG("ProcSoundPlayer::play_sound", snd); |
64 |
TRACE_EXIT(); |
65 |
} |
66 |
|
67 |
void |
68 |
ProcSoundPlayer::play_sound(std::string wavfile) |
69 |
{ |
70 |
TRACE_ENTER_MSG("ProcSoundPlayer::play_sound", wavfile); |
71 |
|
72 |
gchar *argv[3]; |
73 |
argv[0] = "workrave-sound-helper"; |
74 |
argv[1] = (gchar*)wavfile.c_str(); |
75 |
argv[2] = NULL; |
76 |
|
77 |
g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, |
78 |
NULL, NULL, NULL, NULL); |
79 |
|
80 |
events->eos_event(); |
81 |
TRACE_EXIT(); |
82 |
} |
83 |
|
84 |
bool |
85 |
ProcSoundPlayer::get_sound_enabled(SoundEvent snd, bool &enabled) |
86 |
{ |
87 |
(void) snd; |
88 |
(void) enabled; |
89 |
|
90 |
return false; |
91 |
} |
92 |
|
93 |
void |
94 |
ProcSoundPlayer::set_sound_enabled(SoundEvent snd, bool enabled) |
95 |
{ |
96 |
(void) snd; |
97 |
(void) enabled; |
98 |
} |
99 |
|
100 |
bool |
101 |
ProcSoundPlayer::get_sound_wav_file(SoundEvent snd, std::string &wav_file) |
102 |
{ |
103 |
(void) snd; |
104 |
(void) wav_file; |
105 |
return false; |
106 |
} |
107 |
|
108 |
void |
109 |
ProcSoundPlayer::set_sound_wav_file(SoundEvent snd, const std::string &wav_file) |
110 |
{ |
111 |
(void) snd; |
112 |
(void) wav_file; |
113 |
} |