Sha256: c64f2d7b7069ac1052c4ae577494b6fed06fcd7c4b6ebcdd49a8cd32ada2454c

Contents?: true

Size: 1.31 KB

Versions: 12

Compression:

Stored size: 1.31 KB

Contents

// -*- c++ -*-
#pragma once
#ifndef __BEEPS_SOUND_H__
#define __BEEPS_SOUND_H__


#include <xot/pimpl.h>
#include <beeps/defs.h>


namespace Beeps
{


	class Processor;


	class SoundPlayer
	{

		public:

			enum State
			{

				STATE_UNKNOWN = 0,

				PLAYING,

				PAUSED,

				STOPPED

			};// State

			SoundPlayer ();

			~SoundPlayer ();

			void play ();

			void pause ();

			void rewind ();

			void stop ();

			State state () const;

			void set_gain (float gain);

			float    gain () const;

			void set_loop (bool loop);

			bool     loop () const;

			operator bool () const;

			bool operator ! () const;

			struct Data;

			Xot::PSharedImpl<Data> self;

	};// SoundPlayer


	class Sound
	{

		public:

			Sound ();

			Sound (
				Processor* processor, float seconds,
				uint nchannels = 1, double sample_rate = 0);

			~Sound ();

			SoundPlayer play ();

			double sample_rate () const;

			uint nchannels () const;

			float seconds () const;

			void set_gain (float gain);

			float    gain () const;

			void set_loop (bool loop);

			bool     loop () const;

			void save (const char* path) const;

			operator bool () const;

			bool operator ! () const;

			struct Data;

			Xot::PSharedImpl<Data> self;

	};// Sound


	void stop_all_sound_players ();

	Sound load_sound (const char* path);


}// Beeps


#endif//EOH

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
beeps-0.3.3 include/beeps/sound.h
beeps-0.3.2 include/beeps/sound.h
beeps-0.3.1 include/beeps/sound.h
beeps-0.3 include/beeps/sound.h
beeps-0.2.1 include/beeps/sound.h
beeps-0.2 include/beeps/sound.h
beeps-0.1.46 include/beeps/sound.h
beeps-0.1.45 include/beeps/sound.h
beeps-0.1.44 include/beeps/sound.h
beeps-0.1.43 include/beeps/sound.h
beeps-0.1.42 include/beeps/sound.h
beeps-0.1.41 include/beeps/sound.h