xref: /haiku/src/add-ons/media/media-add-ons/mixer/ByteSwap.h (revision d9cebac2b77547b7064f22497514eecd2d047160)
1 /*
2  * Copyright 2003-2007 Marcus Overhagen
3  * Copyright 2007 Haiku Inc. All rights reserved.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef _BYTE_SWAP_H
7 #define _BYTE_SWAP_H
8 
9 #include <SupportDefs.h>
10 
11 class ByteSwap
12 {
13 	public:
14 							ByteSwap(uint32 format);
15 							~ByteSwap();
16 
17 		void				Swap(void *buffer, size_t bytecount);
18 
19 	private:
20 		void 				(*fFunc)(void *, size_t);
21 };
22 
23 inline void
24 ByteSwap::Swap(void *buffer, size_t bytecount)
25 {
26 	(*fFunc)(buffer, bytecount);
27 }
28 #endif
29