Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 348605 | Differences between
and this patch

Collapse All | Expand All

(-)monster-masher-1.8.1/configure.ac~ (-1 / +2 lines)
Lines 18-24 Link Here
18
                        gconfmm-2.6 >= 2.6.0 \
18
                        gconfmm-2.6 >= 2.6.0 \
19
                        gtkmm-2.4 >= 2.6.0 \
19
                        gtkmm-2.4 >= 2.6.0 \
20
                        libgnomecanvasmm-2.6 >= 2.6.0 \
20
                        libgnomecanvasmm-2.6 >= 2.6.0 \
21
			libglademm-2.4 >= 2.4.0)
21
			libglademm-2.4 >= 2.4.0 \
22
			libcanberra)
22
AC_SUBST(DEPS_CFLAGS)
23
AC_SUBST(DEPS_CFLAGS)
23
AC_SUBST(DEPS_LIBS)
24
AC_SUBST(DEPS_LIBS)
24
25
(-)monster-masher-1.8.1/src/sound.hpp~ (-2 / +2 lines)
Lines 22-27 Link Here
22
#define SOUND_HPP
22
#define SOUND_HPP
23
23
24
#include <string>
24
#include <string>
25
#include <canberra.h>
25
26
26
#include "helpers.hpp"
27
#include "helpers.hpp"
27
28
Lines 39-46 Link Here
39
private:
40
private:
40
  Sound();
41
  Sound();
41
  
42
  
42
  typedef std::map<std::string, int> cache_map;
43
  ca_context *ctx;
43
  cache_map cache;
44
};
44
};
45
45
46
#endif
46
#endif
(-)monster-masher-1.8.1/src/sound.cpp~ (-16 / +10 lines)
Lines 18-26 Link Here
18
 * USA.
18
 * USA.
19
 */
19
 */
20
20
21
#include <libgnome/gnome-sound.h>
22
#include <esd.h>
23
24
#include "sound.hpp"
21
#include "sound.hpp"
25
22
26
23
Lines 30-55 Link Here
30
  return s;
27
  return s;
31
}
28
}
32
29
33
Sound::Sound()
30
Sound::Sound() :
31
  ctx(0)
34
{
32
{
33
  ca_context_create(&ctx);
35
}
34
}
36
35
37
Sound::~Sound()
36
Sound::~Sound()
38
{
37
{
38
  if (ctx)
39
    ca_context_destroy(ctx);
39
}
40
}
40
41
41
void Sound::play(const std::string &name)
42
void Sound::play(const std::string &name)
42
{
43
{
43
  int id;
44
  if (ctx)
44
  
45
    ca_context_play(ctx, 0,
45
  cache_map::iterator i = cache.find(name);
46
      CA_PROP_MEDIA_FILENAME,         (MONSTER_MASHER_SOUND_DIR + name).c_str(),
46
  if (i != cache.end())
47
      CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
47
    id = i->second;
48
      NULL);
48
  else {
49
    id = gnome_sound_sample_load(name.c_str(),
50
			    (MONSTER_MASHER_SOUND_DIR + name).c_str());
51
    cache.insert(make_pair(name, id));
52
  }
53
54
  esd_sample_play(gnome_sound_connection_get(), id);
55
}
49
}

Return to bug 348605