File: InstrumentSoundType.h

package info (click to toggle)
libexadrums 0.7.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 652 kB
  • sloc: cpp: 6,970; ansic: 220; makefile: 160; sh: 12
file content (66 lines) | stat: -rw-r--r-- 1,402 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * InstrumentSoundType.h
 *
 *  Created on: 15 Feb 2016
 *      Author: jeremy
 */

#ifndef SOURCE_SOUND_INSTRUMENTSOUNDTYPE_H_
#define SOURCE_SOUND_INSTRUMENTSOUNDTYPE_H_

#include "../Util/Enums.h"

#include <string>
#include <sstream>
#include <type_traits>

namespace Sound
{

	enum class InstrumentSoundType
	{

		Default,
		RimShot,
		ClosingHiHat,

		First = Default,
		Last = ClosingHiHat

	};


	inline std::ostream& operator<<(std::ostream& o, const InstrumentSoundType& x)
	{

		std::string os;

		switch (x)
		{

		case InstrumentSoundType::Default:		os = "DrumHead";	break;
		case InstrumentSoundType::RimShot:		os = "RimShot";		break;
		case InstrumentSoundType::ClosingHiHat:	os = "ClosingHiHat";break;


		default: break;

		}

		return o << os;
	}

	inline InstrumentSoundType operator++(InstrumentSoundType& x) { return x = static_cast<InstrumentSoundType>(std::underlying_type_t<InstrumentSoundType>(x) + 1); };
	inline InstrumentSoundType operator*(InstrumentSoundType x) { return x; };
	inline InstrumentSoundType begin(InstrumentSoundType x) { return InstrumentSoundType::First; };
	inline InstrumentSoundType end(InstrumentSoundType x) { InstrumentSoundType l = InstrumentSoundType::Last; return ++l; };

	inline std::istream& operator>>(std::istream& is, InstrumentSoundType& x)
	{
		return Util::StreamToEnum(is, x);
	}

}


#endif /* SOURCE_SOUND_INSTRUMENTSOUNDTYPE_H_ */