Sha256: e70e5f5bdb0754b9c97e3d095180c18dd1e587203fc914dc6f7dbbbb97f64eba

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 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:

			SoundPlayer ();

			~SoundPlayer ();

			void play ();

			void pause ();

			void rewind ();

			void stop ();

			bool is_playing () const;

			bool is_paused () const;

			bool is_stopped () 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

6 entries across 6 versions & 1 rubygems

Version Path
beeps-0.1.40 include/beeps/sound.h
beeps-0.1.39 include/beeps/sound.h
beeps-0.1.38 include/beeps/sound.h
beeps-0.1.37 include/beeps/sound.h
beeps-0.1.36 include/beeps/sound.h
beeps-0.1.35 include/beeps/sound.h