diff options
author | Werner Schweer <ws.seh.de> | 2006-08-30 08:00:14 +0000 |
---|---|---|
committer | Werner Schweer <ws.seh.de> | 2006-08-30 08:00:14 +0000 |
commit | 0ae9156025140a5aeea1a73f613dde40b300e711 (patch) | |
tree | 259af4594ea2763ee20c18c38c1d6289f9aae940 | |
parent | 8fe66c63bc5e3e5c565753f529d437d1d43bf27b (diff) |
add new files
-rw-r--r-- | muse/midiplugins/dump/CMakeLists.txt | 40 | ||||
-rw-r--r-- | muse/midiplugins/dump/dump.cpp | 48 | ||||
-rw-r--r-- | muse/midiplugins/dump/dump.h | 28 |
3 files changed, 116 insertions, 0 deletions
diff --git a/muse/midiplugins/dump/CMakeLists.txt b/muse/midiplugins/dump/CMakeLists.txt new file mode 100644 index 00000000..a78026ff --- /dev/null +++ b/muse/midiplugins/dump/CMakeLists.txt @@ -0,0 +1,40 @@ +#============================================================================= +# MusE +# Linux Music Editor +# $Id:$ +# +# Copyright (C) 2002-2006 by Werner Schweer and others +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#============================================================================= + +add_library ( dump SHARED + dump.cpp + ) + +target_link_libraries( dump + midiplugin awl + ${QT_LIBRARIES} + ) + +# - tell cmake to name target dump.so instead of +# libdump.so +# - use precompiled header files +# +set_target_properties ( dump + PROPERTIES PREFIX "" + COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all-pic.h" + ) + +install_targets ( /lib/${MusE_INSTALL_NAME}/midiplugins/ dump ) + diff --git a/muse/midiplugins/dump/dump.cpp b/muse/midiplugins/dump/dump.cpp new file mode 100644 index 00000000..8c27e114 --- /dev/null +++ b/muse/midiplugins/dump/dump.cpp @@ -0,0 +1,48 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: filter.cpp,v 1.10 2005/11/06 17:49:34 wschweer Exp $ +// +// dump- simple midi event dump for testing purposes +// +// (C) Copyright 2006 Werner Schweer (ws@seh.de) +//========================================================= + +#include "dump.h" +#include "midi.h" + +//--------------------------------------------------------- +// process +//--------------------------------------------------------- + +void Dump::process(unsigned, unsigned, MPEventList* il, MPEventList* ol) + { + for (iMPEvent i = il->begin(); i != il->end(); ++i) { + printf("Event %6d ch:%2d type:%2d 0x%02x 0x%02x\n", i->time(), i->channel(), + i->type(), i->dataA(), i->dataB()); + ol->insert(*i); + } + } + +//--------------------------------------------------------- +// inst +//--------------------------------------------------------- + +static Mempi* instantiate(const char* name, const MempiHost* h) + { + return new Dump(name, h); + } + +extern "C" { + static MEMPI descriptor = { + "Dump", + "MusE Simple Midi Event Dump", + "0.1", // version string + MEMPI_FILTER, // plugin type + MEMPI_MAJOR_VERSION, MEMPI_MINOR_VERSION, + instantiate + }; + + const MEMPI* mempi_descriptor() { return &descriptor; } + } + diff --git a/muse/midiplugins/dump/dump.h b/muse/midiplugins/dump/dump.h new file mode 100644 index 00000000..3a739c1f --- /dev/null +++ b/muse/midiplugins/dump/dump.h @@ -0,0 +1,28 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: filter.h,v 1.4 2005/06/12 08:18:37 wschweer Exp $ +// +// dump- simple midi event dump for testing purposes +// +// (C) Copyright 2006 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __DUMP_H__ +#define __DUMP_H__ + +#include "../libmidiplugin/mempi.h" + +//--------------------------------------------------------- +// dump - simple midi event dump +//--------------------------------------------------------- + +class Dump : public Mempi { + virtual void process(unsigned, unsigned, MPEventList*, MPEventList*); + + public: + Dump(const char* name, const MempiHost* h) :Mempi(name, h) {} + }; + +#endif + |