diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-10-08 20:50:52 +0200 | 
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-10-08 20:50:52 +0200 | 
| commit | a21ab2d9260bd4cb1af1de0b8cd4cad9e9687861 (patch) | |
| tree | 4b449b45a05e2a5bd33859eaa2c7b1e7cf1bcca6 /src | |
| parent | 30c2b53047b11b1517fa44b49adc52bc5119649c (diff) | |
Move event.h and audiotypes.h into src and get rid of the obsolete include folder.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.am | 3 | ||||
| -rw-r--r-- | src/audiotypes.h | 35 | ||||
| -rw-r--r-- | src/drumgizmo.cc | 4 | ||||
| -rw-r--r-- | src/event.h | 45 | ||||
| -rw-r--r-- | src/inputprocessor.cc | 4 | ||||
| -rw-r--r-- | src/inputprocessor.h | 2 | 
6 files changed, 87 insertions, 6 deletions
| diff --git a/src/Makefile.am b/src/Makefile.am index 3ecdc76..16a952e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,6 @@  noinst_LTLIBRARIES = libdg.la  libdg_la_CPPFLAGS = \ -	-I$(top_srcdir)/include -I$(top_srcdir)/hugin \  	-I$(top_srcdir)/hugin -I$(top_srcdir)/pugixml/src \  	$(SSEFLAGS) \  	$(ZITA_CPPFLAGS) $(SNDFILE_CFLAGS) $(PTHREAD_CFLAGS) @@ -47,6 +46,7 @@ EXTRA_DIST = \  	$(nodist_libdg_la_SOURCES) \  	atomic.h \  	audio.h \ +	audiotypes.h \  	audiocache.h \  	audiocacheeventhandler.h \  	audiocachefile.h \ @@ -67,6 +67,7 @@ EXTRA_DIST = \  	drumgizmo.h \  	drumkit.h \  	drumkitloader.h \ +	event.h \  	events.h \  	inputfilter.h \  	inputprocessor.h \ diff --git a/src/audiotypes.h b/src/audiotypes.h new file mode 100644 index 0000000..5add8cd --- /dev/null +++ b/src/audiotypes.h @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + *            sample.h + * + *  Fri Jun  3 12:12:17 CEST 2011 + *  Copyright 2011 Bent Bisballe Nyeng + *  deva@aasimon.org + ****************************************************************************/ + +/* + *  This file is part of DrumGizmo. + * + *  DrumGizmo is free software; you can redistribute it and/or modify + *  it under the terms of the GNU Lesser General Public License as published by + *  the Free Software Foundation; either version 3 of the License, or + *  (at your option) any later version. + * + *  DrumGizmo is distributed in the hope that it will be useful, + *  but WITHOUT ANY WARRANTY; without even the implied warranty of + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + *  GNU Lesser General Public License for more details. + * + *  You should have received a copy of the GNU Lesser General Public License + *  along with DrumGizmo; if not, write to the Free Software + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA. + */ +#pragma once + +//typedef signed short int sample_t; +typedef float sample_t; + +typedef unsigned int channels_t; +typedef unsigned int channel_t; + +typedef float level_t; diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 2c543cd..0e374f2 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -139,7 +139,7 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)  		resample_ratio = 1.0;  	} -	if (settings_getter.audition_counter.hasChanged()) +	if(settings_getter.audition_counter.hasChanged())  	{  		settings_getter.audition_counter.getValue();  		auto instrument_name = settings.audition_instrument.load(); @@ -154,7 +154,7 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)  			}  		} -		events.emplace_back(event_t{TYPE_ONSET, instrument_index, 0, velocity}); +		events.push_back({EventType::OnSet, instrument_index, 0, velocity});  	}  	bool active_events_left = diff --git a/src/event.h b/src/event.h new file mode 100644 index 0000000..2b10e44 --- /dev/null +++ b/src/event.h @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + *            event.h + * + *  Fri Jun  3 12:10:50 CEST 2011 + *  Copyright 2011 Bent Bisballe Nyeng + *  deva@aasimon.org + ****************************************************************************/ + +/* + *  This file is part of DrumGizmo. + * + *  DrumGizmo is free software; you can redistribute it and/or modify + *  it under the terms of the GNU Lesser General Public License as published by + *  the Free Software Foundation; either version 3 of the License, or + *  (at your option) any later version. + * + *  DrumGizmo is distributed in the hope that it will be useful, + *  but WITHOUT ANY WARRANTY; without even the implied warranty of + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + *  GNU Lesser General Public License for more details. + * + *  You should have received a copy of the GNU Lesser General Public License + *  along with DrumGizmo; if not, write to the Free Software + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA. + */ +#pragma once + +#include <cstddef> + +//! Event types +enum class EventType +{ +	OnSet, +	Stop, +}; + +//! POD datatype for input event transport. +struct event_t +{ +	EventType type; //!< The type of the event. +	std::size_t instrument; //!< The instrument number. +	std::size_t offset; //!< The offset position in the input buffer +	float velocity; //!< The velocity if the type is a note on [0; 1] +}; diff --git a/src/inputprocessor.cc b/src/inputprocessor.cc index 0adc389..c004933 100644 --- a/src/inputprocessor.cc +++ b/src/inputprocessor.cc @@ -57,7 +57,7 @@ bool InputProcessor::process(std::vector<event_t>& events,  {  	for(auto& event: events)  	{ -		if(event.type == TYPE_ONSET) +		if(event.type == EventType::OnSet)  		{  			if(!processOnset(event, pos, resample_ratio))  			{ @@ -181,7 +181,7 @@ bool InputProcessor::processOnset(event_t& event,  bool InputProcessor::processStop(event_t& event)  { -	if(event.type == TYPE_STOP) +	if(event.type == EventType::Stop)  	{  		is_stopping = true;  	} diff --git a/src/inputprocessor.h b/src/inputprocessor.h index 95fdfdb..794ca54 100644 --- a/src/inputprocessor.h +++ b/src/inputprocessor.h @@ -56,7 +56,7 @@ public:  private:  	DrumKit& kit;  	std::list<Event*>* activeevents; -	bool is_stopping; ///< Is set to true when a TYPE_STOP event has been seen. +	bool is_stopping; ///< Is set to true when a EventType::Stop event has been seen.  	bool processOnset(event_t& event, std::size_t pos, double resample_ratio);  	bool processStop(event_t& event); | 
