DELTA 6129 3969 123
SVN  ““<{ …? ƒ ‡…?€v …\�‚$’kfc_fc_play(const char *const tag, const char *const fullpath,
                    bool repeat, audio_finished_callback cbfcENDREP
DELTA 17122 100571 7132
SVN  àV�…h‚,®5 …G ƒ �5…Gƒ �3†m€‚ �	‰0€�D I–@ …1‹ €� IÙ?€�| ��; IÙ? I’ €L q�@¡ IÙ?€� L�@“ YÙ? �~•	œ �£(€ƒ �¦O” h§e€� L�@¯ MÙ@€‚? �5·a€L �¼*€k �W»^´ L�@ �+ª€‚( �@¬Oš ƒ®€I S±?€ƒ> �³D€†3 „7½n� XÙ@€‚ L�@¢ MÙ@€X L�@ �Â· XÃ0œ NÃ€„  ‚PÅ… L�@ž MÙ@€q L�@ž MÙ@€q L�@ ‚È2€ƒ R–> ƒ-Í=€V �Ì0 ‰(Ò;€�! R–> ƒaÜufc_and#include "client_main.h"
#include "options.h"

#include "audio.h"

#define MAX_NUM_PLUGINS		2
#define SNDSPEC_SUFFIX		".soundspec"
#define MUSICSPEC_SUFFIX        ".musicspec"

/* keep it open throughout */
static struct section_file *ss_tagfile = NULL;
static struct section_file *ms_static struct mfcb_data
{
  struct section_file *sfile;
  const char *tag;
} mfcb;

static bool audio_play_tag(struct section_file *sfile,
                           const char *tag, bool repeat);audiosets of given type available
  on the system by searching all data directories for files matching
  suffix.
  The list is NULL-terminated/
static const struct strvec *get_audio_speclist(const char *suffix,
                                               struct strvec **audio_list)
{
  if (NULL == *audio_list) {
    *audio_list = fileinfolist(get_data_dirs(), suffix);
  }

  return *audiosound_list = NULL;

  return get_audio_speclist(SNDSPEC_SUFFIX, &sound_list)musicsets available on the system/
const struct strvec *get_musicset_list(void)
{
  static struct strvec *music_list = NULL;

  return get_audio_speclist(MUSICSPEC_SUFFIX, &music_list)****
  Add a pluginaudio set. Returns NULL if
 audiospec_fullname(const char *audioset_name,
                                      bool music)
{
  const char *suffix = music ? MUSICSPEC_SUFFIX : SNDSPEC_SUFFIX;
  const char *audioset_default = music ? "stdmusic" : "stdsounds";/* Do not i18n! */
  char *fname = fc_malloc(strlen(audioset_name) + strlen(suffix) + 1);
  const char *dname;

  sprintf(fname, "%s%s", audioset_name, suffixaudioset_name, audioaudioset \"%s\", trying \"%s\".",
            audioset_name, audioset_default);

  return audiospec_fullname(audioset_default, music)****
  Check capabilities of the audio specfilestatic bool check_audiofile_capstr(struct section_file *sfile,
                                   const char *filename,
                                   const char *our_cap,
                                   const char *opt_path)
{
  const char *file_capstr;

  file_capstr = secfile_lookup_str(sfile, "%s", opt_pathour_cap, file_capstr)) {
    log_fatal("Audio spec-file appears incompatibleour_cap);
    exit(EXIT_FAILURE);
  }
  if (!has_capabilities(file_capstr, our_cap)) {
    log_fatal("Audioour_cap);
    exit(EXIT_FAILURE);
  }

  return TRUEoundset_name,
                     const char *const musicset_name,
		     const char *const prefered_plugin_name)
{
  const char *ss_filename;
  const char *ms_filename;
  char us_ss_capstr[] = "+Freeciv-soundspec-Devel-2014.Mar.13";
  char us_ms_capstr[] = "+Freeciv-musicspec-Devel-2014.Mar.13ss_tagfile = NULL;
    ms_ss_tagfile = NULL;
    ms_tagfile = NULL;
    return;
  }
  if (!soundsetif (!musicset_name) {
    log_fatal("No music spec-file given!");
    exit(EXIT_FAILURE);
  }
  log_verbose("Initializing sound using %s and %s...",
              soundset_name, musicset_name);
  ss_filename = audiospec_fullname(soundset_name, FALSE);
  ms_filename = audiospec_fullname(musicset_name, TRUE);
  if (!ss_filename || !ms_filename) {
    log_error("Cannot find audio spec-file \"%s\" or \"%s\"",
              soundset_name, musicsethttp://www.freeciv.org/wiki/Sounds");
    log_normal(_("Proceeding with sound support disabled."));
    ss_tagfile = NULL;
    ms_tagfile = NULL;
    return;
  }
  if (!(ss_tagfile = secfile_load(ss_filename, TRUE))) {
    log_fatal(_("Could not load sound spec-file '%s':\n%s"), ss_filename,
              secfile_error());
    exit(EXIT_FAILURE);
  }
  if (!(ms_tagfile = secfile_load(ms_filename, TRUE))) {
    log_fatal(_("Could not load music spec-file '%s':\n%s"), ms_filename,
              secfile_error());
    exit(EXIT_FAILURE);
  }

  check_audiofile_capstr(ss_tagfile, ss_filename, us_ss_capstr,
                         "soundspec.options");

  free((void *) ss_filename);

  check_audiofile_capstr(ms_tagfile, ms_filename, us_ms_capstr,
                         "musicspec.options");

  free((void *) ms_Switch soundsetrestart(const char *soundset_name, const char *musicset_name)
{
  audio_stop(); /* Fade down old one */

  sz_strlcpy(sound_set_name, soundset_name);
  sz_strlcpy(music_set_name, musicset_name);
  audio_real_init(sound_set_name, music_set_name, sound_plugin_name)****
  Callback to start new trackstatic void music_finished_callback(void)
{
  audio_play_tag(mfcb.sfile, mfcb.tag, TRUE)struct section_file *sfile,
                             audio_finished_callback cbsfile) {
    soundfile = secfile_lookup_str(sfile, "files.%s", tag);
    if (soundfile == NULL) {
      const char *files[MAX_ALT_AUDIO_FILES];
      int i;

      for (i = 0; i < MAX_ALT_AUDIO_FILES; i++) {
        files[i] = secfile_lookup_str(sfile, "files.%s_%d", tag, i);
        if (files[i] == NULL) {
          break;
        }
      }

      if (i > 0) {
        soundfile = files[fc_rand(i)];
        if (repeat) {
          mfcb.sfile = sfile;
          mfcb.tag = tag;
          cb = music_finished_callback;
        }
      }
    }, cb)****
  Play tag from sound setstatic bool audio_play_sound_tag(const char *tag, bool repeat)
{
  return audio_play_tag(ss_tagfile, tag, repeat)****
  Play tag from music setstatic bool audio_play_music_tag(const char *tag, bool repeat)
{
  return audio_play_tag(ms_tagfile, tag, repeat)if (options.sound_enable_effects) {
    fc_assert_ret(tag != NULL);

    log_debug("audio_play_sound('%s', '%s')", tag, pretty_alt_tag);

    /* try playing primary tag first, if not go to alternative tag */
    if (!audio_play_sound_tag(tag, FALSE)
        && !audio_play_sound_tag(alt_tag, FALSE)) {
      log_verbose( "Neither of tags %s or %s found", tag, pretty_alt_tag);
    }
  }music_tag(tag, TRUE)
      && !audio_play_music_tag(alt_tag, TRUE)) {
    log_verbose(ss_tagfile) {
    secfile_destroy(ss_tagfile);
    ss_tagfile = NULL;
  }
  if (NULL != ms_tagfile) {
    secfile_destroy(ms_tagfile);
    ms_tagfile = NULL;
  }ENDREP
DELTA 19354 0 172
SVN  ¹y»‚ �# €v ‚?�o€� ¥“a‚ }¸|fc_play(const char *const tag, const char *const fullpath,
                    bool repeat, audio_finished_callback cbif (cb == NULL) {
      Mix_PlayMusic(mus, -1);	/* -1 means loop forever */
    } else {
      Mix_PlayMusic(mus, 0);
      Mix_HookMusicFinished(cb);
    }fcENDREP
DELTA 22180 528 706
SVN  �L‘Y"‚" ‡ €Y ‚K‡¬ u‰Vž PŠ;¾ �‹€A ƒŒJ#define MAX_ALT_AUDIO_FILES             5

typedef void (*audio_finished_callback)(void);,
                audio_finished_callback cbconst struct strvec *get_musicoundspec_name,
                     const char *const musicset  void audio_restart(const char *soundset_name, const char *musicENDREP
id: 139.5ck.r24817/7168
type: file
pred: 139.5ck.r24790/296551
count: 40
text: 24817 182 6255 17128 814227aa5293c63d0320992a4d6434ef
props: 10416 5336 111 0 227f1557f5d66bc46d32e4db301b2671
cpath: /trunk/client/audio.c
copyroot: 15280 /trunk

id: 13f.5ck.r24817/7411
type: file
pred: 13f.5ck.r19354/73618
count: 15
text: 24817 6468 312 7564 2a749f4075bb9cff25fb411af6bfe0b4
props: 10418 271 111 0 3d57169d64a739976bce7d2e578e29eb
cpath: /trunk/client/audio_sdl.c
copyroot: 15280 /trunk

id: 13a.5ck.r24817/7655
type: file
pred: 13a.5ck.r24622/22496
count: 10
text: 24817 6805 336 2265 dac464de80222203461d2150267b5364
props: 10416 6039 110 0 7d181b70073f10d0c5a58c73a72d4f04
cpath: /trunk/client/audio.h
copyroot: 15280 /trunk

id: 13d.5ck.r24817/7896
type: file
pred: 13d.5ck.r19259/462511
count: 6
text: 24817 0 155 2492 960673174e5f5222b52ef4297f12aa15
props: 6129 145041 110 0 7d181b70073f10d0c5a58c73a72d4f04
cpath: /trunk/client/audio_none.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 23
file 5f.5ck.r24745/7729
K 6
agents
V 22
dir zf.5ck.r23835/2132
K 11
attribute.c
V 23
file xh.5ck.r23771/1181
K 11
attribute.h
V 24
file xi.5ck.r18863/23649
K 7
audio.c
V 24
file 139.5ck.r24817/7168
K 7
audio.h
V 24
file 13a.5ck.r24817/7655
K 12
audio_none.c
V 24
file 13d.5ck.r24817/7896
K 12
audio_none.h
V 25
file 13e.5ck.r18863/20841
K 11
audio_sdl.c
V 24
file 13f.5ck.r24817/7411
K 11
audio_sdl.h
V 25
file 13g.5ck.r18863/23885
K 17
chatline_common.c
V 26
file 14q.5ck.r24790/306703
K 17
chatline_common.h
V 25
file 14r.5ck.r18863/23155
K 16
citydlg_common.c
V 25
file z4.5ck.r24790/318430
K 16
citydlg_common.h
V 24
file z5.5ck.r18863/18619
K 13
cityrepdata.c
V 25
file mb.5ck.r24790/282697
K 13
cityrepdata.h
V 24
file mc.5ck.r18863/19121
K 13
client_main.c
V 25
file 2f.5cp.r24790/274459
K 13
client_main.h
V 24
file hz.5cq.r24622/12216
K 8
climap.c
V 24
file 197.5ck.r20232/3008
K 8
climap.h
V 25
file 198.5ck.r18863/24126
K 9
climisc.c
V 25
file d5.5ck.r24790/274730
K 9
climisc.h
V 24
file i0.5ck.r23027/96165
K 8
clinet.c
V 25
file hc.5ck.r24790/297725
K 8
clinet.h
V 24
file i1.5ck.r18863/24866
K 15
colors_common.c
V 24
file 33a.5ck.r22855/3020
K 15
colors_common.h
V 24
file 33b.5ck.r24136/6711
K 19
connectdlg_common.c
V 23
file 2fw.5ck.r24352/536
K 19
connectdlg_common.h
V 25
file 2fx.5ck.r19154/53802
K 9
control.c
V 25
file gz.5ck.r24790/283459
K 9
control.h
V 23
file i2.5ck.r24693/5723
K 7
dummy.c
V 23
file 4f9.5ck.r15641/551
K 12
dummycxx.cpp
V 23
file 6kr.5ck.r18947/939
K 8
editor.c
V 23
file 3bg.5ck.r24534/200
K 8
editor.h
V 23
file 3bh.5ck.r23105/702
K 11
ggzclient.c
V 26
file 394.5ck.r20126/104106
K 11
ggzclient.h
V 25
file 395.5ck.r18863/21083
K 17
global_worklist.c
V 26
file 4i6.5ck.r19259/493810
K 17
global_worklist.h
V 25
file 4i7.5ck.r18863/22960
K 6
goto.c
V 25
file vu.5ck.r24790/296980
K 6
goto.h
V 24
file vv.5ck.r23027/81018
K 11
gui-gtk-2.0
V 24
dir zs.5ck.r24790/306455
K 11
gui-gtk-3.0
V 24
dir zs.5g7.r24790/292383
K 6
gui-qt
V 23
dir 6ie.5ck.r24807/4571
K 7
gui-sdl
V 25
dir 16t.5ck.r24790/281273
K 8
gui-sdl2
V 25
dir 16t.5l8.r24790/318167
K 8
gui-stub
V 23
dir mh.5ck.r24696/18341
K 7
gui-xaw
V 24
dir 9o.5ck.r24790/311543
K 14
gui_cbsetter.c
V 25
file a3c.5ck.r24696/18584
K 14
gui_cbsetter.h
V 25
file a3d.5ck.r20753/37736
K 15
gui_interface.c
V 25
file 6jm.5ir.r24696/14940
K 15
gui_interface.h
V 25
file 6jn.5is.r24696/15156
K 10
helpdata.c
V 24
file h1.5ck.r24814/10601
K 10
helpdata.h
V 24
file i3.5ck.r24476/20844
K 7
include
V 23
dir b8.5ck.r24696/14699
K 19
luaconsole_common.c
V 22
file 75z.5ck.r20372/58
K 19
luaconsole_common.h
V 25
file 760.5ck.r20306/31022
K 9
luascript
V 23
dir 761.5ck.r24745/8494
K 16
mapctrl_common.c
V 26
file 15m.5ck.r24790/297469
K 16
mapctrl_common.h
V 25
file 15n.5ck.r19893/12504
K 16
mapview_common.c
V 25
file z2.5ck.r24790/297969
K 16
mapview_common.h
V 23
file z3.5ck.r24711/3555
K 19
messagewin_common.c
V 26
file 14s.5ck.r24790/282945
K 19
messagewin_common.h
V 25
file 14t.5ck.r18863/21579
K 7
music.c
V 26
file zmc.5ck.r24790/296794
K 7
music.h
V 24
file zme.5ck.r24516/5407
K 9
options.c
V 25
file dc.5ck.r24790/281708
K 9
options.h
V 25
file i4.5ck.r24790/281953
K 17
overview_common.c
V 26
file 2yk.5ck.r24790/283201
K 17
overview_common.h
V 26
file 2yl.5ck.r24790/283707
K 10
packhand.c
V 24
file n.5ck.r24790/297222
K 10
packhand.h
V 24
file i5.5ck.r18863/20596
K 15
plrdlg_common.c
V 23
file 14u.5ck.r23426/823
K 15
plrdlg_common.h
V 25
file 14v.5ck.r18863/21328
K 17
repodlgs_common.c
V 25
file 11i.5ck.r22325/76263
K 17
repodlgs_common.h
V 25
file 11j.5ck.r19589/11861
K 9
reqtree.c
V 26
file 2ym.5ck.r24790/282199
K 9
reqtree.h
V 24
file 2yn.5ck.r24150/6004
K 9
servers.c
V 23
file 33x.5ck.r24702/573
K 9
servers.h
V 25
file 33y.5ck.r20478/36372
K 6
text.c
V 25
file 2g3.5ck.r24459/13040
K 6
text.h
V 25
file 2g4.5ck.r24459/13284
K 15
themes_common.c
V 25
file 352.5ck.r19354/73121
K 15
themes_common.h
V 25
file 353.5ck.r18863/22710
K 10
tilespec.c
V 25
file hl.5ck.r24790/282447
K 10
tilespec.h
V 24
file i6.5ck.r24567/21304
K 19
unitselect_common.c
V 24
file 76v.5ck.r20397/3580
K 19
unitselect_common.h
V 24
file 76w.5ck.r20397/3746
K 14
update_queue.c
V 25
file 4jw.5ck.r22413/14226
K 14
update_queue.h
V 25
file 4jx.5ck.r18863/22078
K 10
voteinfo.c
V 26
file 4fe.5ck.r24790/281519
K 10
voteinfo.h
V 25
file 4ff.5ck.r18863/22523
END
ENDREP
id: d.5ck.r24817/12521
type: dir
pred: d.5ck.r24814/15237
count: 6000
text: 24817 8140 4368 4368 2e1dfadedd59591ba6b942a99d743964
props: 23990 857 387 0 afe872b7fe8919650a535e373916e1f7
cpath: /trunk/client
copyroot: 15280 /trunk

PLAIN
K 9
ABOUT-NLS
V 24
file fu.5ck.r23462/85000
K 7
AUTHORS
V 24
file 5u.5ck.r22143/14016
K 7
COPYING
V 19
file 1h.0.r9643/400
K 9
ChangeLog
V 26
file 6l.5ck.r22811/6091752
K 7
INSTALL
V 22
file 6.5ck.r24055/8187
K 11
Makefile.am
V 23
file 59.5ck.r24665/2620
K 4
NEWS
V 24
file 6m.5ck.r23374/75525
K 6
README
V 20
file 7.0.r4421/96382
K 2
ai
V 23
dir 8.5ck.r24803/148804
K 10
autogen.sh
V 23
file 12o.5ck.r24091/228
K 9
bootstrap
V 23
dir 2p5.5ck.r24665/4665
K 6
client
V 22
dir d.5ck.r24817/12521
K 6
common
V 22
dir p.5ck.r24814/10372
K 12
configure.ac
V 24
file 149.5ck.r24665/2382
K 4
data
V 21
dir w.5ck.r24815/4590
K 12
dependencies
V 23
dir 2yu.5ck.r23968/4002
K 11
diff_ignore
V 23
file qq.5ck.r24665/2850
K 3
doc
V 24
dir k7.5ck.r24803/134995
K 10
fc_version
V 26
file 2lo.5en.r24803/149032
K 2
m4
V 23
dir 12p.5ck.r24684/2342
K 7
scripts
V 22
dir 2yo.5ck.r24495/862
K 6
server
V 21
dir z.5ck.r24808/5138
K 5
tests
V 23
dir 2g9.5ck.r23807/1326
K 5
tools
V 23
dir 4pj.5js.r24802/1085
K 12
translations
V 25
dir t0a.5ck.r24806/206575
K 7
utility
V 23
dir 1c.5ck.r24682/13588
K 3
vms
V 25
dir u9.5ck.r21528/1396085
K 5
win32
V 23
dir 2eu.5ck.r24543/3121
END
ENDREP
id: 3.5ck.r24817/13925
type: dir
pred: 3.5ck.r24815/5993
count: 17346
text: 24817 12752 1160 1160 8bc95c4a04d390cff9c836afb4e98578
props: 23244 4830 282 0 e4bb46e81629a60eef613b169b23a9ea
cpath: /trunk
copyroot: 15280 /trunk

PLAIN
K 8
branches
V 19
dir 1.0.r24816/6644
K 4
tags
V 19
dir 2.0.r24394/6245
K 5
trunk
V 22
dir 3.5ck.r24817/13925
K 7
website
V 21
dir 3ge.0.r22980/2263
END
ENDREP
id: 0.0.r24817/14317
type: dir
pred: 0.0.r24816/6964
count: 24817
text: 24817 14151 153 153 5306744f3f2ea81bb1683fbe7dd0a213
cpath: /
copyroot: 0 /

13d.5ck.t24816-1 modify true false /trunk/client/audio_none.c

139.5ck.t24816-1 modify true false /trunk/client/audio.c

13f.5ck.t24816-1 modify true false /trunk/client/audio_sdl.c

13a.5ck.t24816-1 modify true false /trunk/client/audio.h


14317 14466
