src/mixer.cpp
author KUDr
Fri, 12 Jan 2007 15:43:00 +0000
changeset 5620 eab6f02899a0
parent 5587 167d9a91ef02
child 6201 bee01dc45e39
permissions -rw-r--r--
(svn r8079) -Fix [YAPF]: float division by zero when calculating stats (YAPF cache hit ratio). Caused BSOD on Win9x. (thanks 3iff for report, Darkvater for help)
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1891
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1891
diff changeset
     2
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
     3
#include "stdafx.h"
1891
862800791170 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1498
diff changeset
     4
#include "openttd.h"
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
     5
#include "mixer.h"
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
     6
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
     7
struct MixerChannel {
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
     8
	bool active;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
     9
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    10
	// pointer to allocated buffer memory
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    11
	int8 *memory;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    12
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    13
	// current position in memory
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    14
	uint32 pos;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    15
	uint32 frac_pos;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    16
	uint32 frac_speed;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    17
	uint32 samples_left;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    18
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    19
	// Mixing volume
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    20
	uint volume_left;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    21
	uint volume_right;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    22
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    23
	uint flags;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    24
};
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    25
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
    26
static MixerChannel _channels[8];
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
    27
static uint32 _play_rate;
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    28
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    29
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    30
static void mix_int8_to_int16(MixerChannel *sc, int16 *buffer, uint samples)
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    31
{
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    32
	int8 *b;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    33
	uint32 frac_pos;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    34
	uint32 frac_speed;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    35
	uint volume_left;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    36
	uint volume_right;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    37
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    38
	if (samples > sc->samples_left) samples = sc->samples_left;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    39
	sc->samples_left -= samples;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    40
	assert(samples > 0);
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    41
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    42
	b = sc->memory + sc->pos;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    43
	frac_pos = sc->frac_pos;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    44
	frac_speed = sc->frac_speed;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    45
	volume_left = sc->volume_left;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    46
	volume_right = sc->volume_right;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    47
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    48
	if (frac_speed == 0x10000) {
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    49
		// Special case when frac_speed is 0x10000
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    50
		do {
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    51
			buffer[0] += *b * volume_left >> 8;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    52
			buffer[1] += *b * volume_right >> 8;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    53
			b++;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    54
			buffer += 2;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    55
		} while (--samples > 0);
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    56
	} else {
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    57
		do {
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    58
			buffer[0] += *b * volume_left >> 8;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    59
			buffer[1] += *b * volume_right >> 8;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    60
			buffer += 2;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    61
			frac_pos += frac_speed;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    62
			b += frac_pos >> 16;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    63
			frac_pos &= 0xffff;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    64
		} while (--samples > 0);
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    65
	}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    66
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    67
	sc->frac_pos = frac_pos;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    68
	sc->pos = b - sc->memory;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    69
}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    70
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    71
static void MxCloseChannel(MixerChannel *mc)
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    72
{
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    73
	if (mc->flags & MX_AUTOFREE) free(mc->memory);
1497
4fc9f620d3e0 (svn r2001) Resolve a race condition which could lead to dropped a sound and a memory leak
tron
parents: 1496
diff changeset
    74
	mc->active = false;
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    75
	mc->memory = NULL;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    76
}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    77
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
    78
void MxMixSamples(void *buffer, uint samples)
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    79
{
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    80
	MixerChannel *mc;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    81
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    82
	// Clear the buffer
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    83
	memset(buffer, 0, sizeof(int16) * 2 * samples);
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    84
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    85
	// Mix each channel
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
    86
	for (mc = _channels; mc != endof(_channels); mc++) {
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    87
		if (mc->active) {
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5584
diff changeset
    88
			mix_int8_to_int16(mc, (int16*)buffer, samples);
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    89
			if (mc->samples_left == 0) MxCloseChannel(mc);
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    90
		}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    91
	}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    92
}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    93
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
    94
MixerChannel *MxAllocateChannel(void)
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    95
{
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    96
	MixerChannel *mc;
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
    97
	for (mc = _channels; mc != endof(_channels); mc++)
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    98
		if (mc->memory == NULL) {
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
    99
			mc->active = false;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   100
			return mc;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   101
		}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   102
	return NULL;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   103
}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   104
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   105
void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, uint size, uint rate, uint flags)
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   106
{
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   107
	mc->memory = mem;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   108
	mc->flags = flags;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   109
	mc->frac_pos = 0;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   110
	mc->pos = 0;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   111
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
   112
	mc->frac_speed = (rate << 16) / _play_rate;
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   113
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   114
	// adjust the magnitude to prevent overflow
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   115
	while (size & 0xFFFF0000) {
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   116
		size >>= 1;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   117
		rate = (rate >> 1) + 1;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   118
	}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   119
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
   120
	mc->samples_left = size * _play_rate / rate;
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   121
}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   122
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   123
void MxSetChannelVolume(MixerChannel *mc, uint left, uint right)
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   124
{
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   125
	mc->volume_left = left;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   126
	mc->volume_right = right;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   127
}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   128
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   129
1498
508395d0639a (svn r2002) Rename MxActivate to MxActivateChannel, which is more appropriate
tron
parents: 1497
diff changeset
   130
void MxActivateChannel(MixerChannel* mc)
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   131
{
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   132
	mc->active = true;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   133
}
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   134
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   135
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   136
bool MxInitialize(uint rate)
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   137
{
2977
97c1c76b499a (svn r3552) Remove the global variable _mixer
tron
parents: 2186
diff changeset
   138
	_play_rate = rate;
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   139
	return true;
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff changeset
   140
}