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~ (-13 / +10 lines)
Lines 30-55 Link Here
30
  return s;
30
  return s;
31
}
31
}
32
32
33
Sound::Sound()
33
Sound::Sound() :
34
  ctx(0)
34
{
35
{
36
  ca_context_create(&ctx);
35
}
37
}
36
38
37
Sound::~Sound()
39
Sound::~Sound()
38
{
40
{
41
  if (ctx)
42
    ca_context_destroy(ctx);
39
}
43
}
40
44
41
void Sound::play(const std::string &name)
45
void Sound::play(const std::string &name)
42
{
46
{
43
  int id;
47
  if (ctx)
44
  
48
    ca_context_play(ctx, 0,
45
  cache_map::iterator i = cache.find(name);
49
      CA_PROP_MEDIA_FILENAME,         (MONSTER_MASHER_SOUND_DIR + name).c_str(),
46
  if (i != cache.end())
50
      CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
47
    id = i->second;
51
      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
}
52
}

Return to bug 348605