xref: /haiku/src/add-ons/media/media-add-ons/mixer/ByteSwap.h (revision d5cd5d63ff0ad395989db6cf4841a64d5b545d1d)
1 #ifndef _BYTE_SWAP_H
2 #define _BYTE_SWAP_H
3 
4 /* Copyright (C) 2003 Marcus Overhagen
5  * Released under terms of the MIT license.
6  *
7  * A simple byte order swapping class for the audio mixer.
8  */
9 
10 class ByteSwap
11 {
12 public:
13 	ByteSwap(uint32 format);
14 	~ByteSwap();
15 
16 	void Swap(void *buffer, size_t bytecount);
17 
18 private:
19 	void (*fFunc)(void *, size_t);
20 };
21 
22 inline void
23 ByteSwap::Swap(void *buffer, size_t bytecount)
24 {
25 	(*fFunc)(buffer, bytecount);
26 }
27 
28 #endif
29