From c175f5d4b6c854e4cfc8f450222ccc4ed3fdef75 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Sat, 3 Jul 2021 20:44:01 +0200 Subject: [PATCH 01/24] Python bindings, second try --- src/bindings/README.md | 14 +++ src/bindings/h2core.yaml | 210 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 src/bindings/README.md create mode 100644 src/bindings/h2core.yaml diff --git a/src/bindings/README.md b/src/bindings/README.md new file mode 100644 index 000000000..e4094543e --- /dev/null +++ b/src/bindings/README.md @@ -0,0 +1,14 @@ +# Python Bindings + +To generate bindings after a change in hydrogen headers/API, +to install [HydraGen](https://github.com/charbeljc/HydraGen) + +```bash +pip3 install git+https://github.com/charbeljc/HydraGen.git +``` + +Edit include_paths in `h2core.yaml` (sorry, this is work in progress), then +```bash +cd src/bindings +hydragen h2core.yaml . +``` diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml new file mode 100644 index 000000000..7cc2f9f97 --- /dev/null +++ b/src/bindings/h2core.yaml @@ -0,0 +1,210 @@ +version: 0.1.0 +module: + name: h2core + flags: [-x, c++, -fPIC, -std=c++14, -fexceptions] + include_path: + - /usr/include/c++/10 + - /usr/include/x86_64-linux-gnu/c++/10 + - /usr/include/x86_64-linux-gnu/qt5 + - /usr/include/x86_64-linux-gnu/qt5/QtCore + - /usr/include/x86_64-linux-gnu/qt5/QtGui + - /usr/include/x86_64-linux-gnu/qt5/QtXml + - /home/rebelcat/Hack/hydrogen/src + - /home/rebelcat/Hack/hydrogen/build/src + - /usr/include/python3.9 + - /home/rebelcat/Hack/hydragen/include + - /usr/include + bindings: + H2Core::XMLNode: core/Helpers/Xml.h + H2Core::Drumkit: core/Basics/Drumkit.h + H2Core::DrumkitComponent: core/Basics/DrumkitComponent.h + H2Core::Instrument: core/Basics/Instrument.h + H2Core::InstrumentComponent: core/Basics/InstrumentComponent.h + H2Core::InstrumentLayer: core/Basics/InstrumentLayer.h + H2Core::InstrumentList: core/Basics/InstrumentList.h + H2Core::Sample: core/Basics/Sample.h + H2Core::Preferences: core/Preferences.h + H2Core::Playlist: core/Basics/Playlist.h + H2Core::Pattern: core/Basics/Pattern.h + H2Core::PatternList: core/Basics/PatternList.h + H2Core::AutomationPath: core/Basics/AutomationPath.h + H2Core::Song: core/Basics/Song.h + H2Core::Hydrogen: core/Hydrogen.h + H2Core::AudioEngine: core/AudioEngine.h + H2Core::CoreActionController: core/CoreActionController.h + H2Core::EventQueue: core/EventQueue.h + H2Core::H2Exception: core/H2Exception.h + Action: core/MidiAction.h + MidiActionManager::targeted_element: core/MidiAction.h + MidiActionManager: core/MidiAction.h + # MidiMap: core/MidiMap.h + # OscServer: core/OscServer.h + H2Core::Timeline: core/Timeline.h + H2Core::get_version: core/Version.h + H2Core::version_older_than: core/Version.h + H2Core::Effects: core/FX/Effects.h + H2Core::LadspaFX: core/FX/LadspaFX.h + H2Core::AlsaAudioDriver: core/IO/AlsaAudioDriver.h + H2Core::AlsaMidiDriver: core/IO/AlsaMidiDriver.h + H2Core::AudioOutput: core/IO/AudioOutput.h + H2Core::CoreAudioDriver: core/IO/CoreAudioDriver.h + H2Core::CoreMidiDriver: core/IO/CoreMidiDriver.h + H2Core::DiskWriterDriver: core/IO/DiskWriterDriver.h + H2Core::FakeDriver: core/IO/FakeDriver.h + H2Core::JackAudioDriver: core/IO/JackAudioDriver.h + H2Core::JackMidiDriver: core/IO/JackMidiDriver.h + H2Core::MidiInput: core/IO/MidiInput.h + H2Core::MidiMessage: core/IO/MidiCommon.h + H2Core::MidiOutput: core/IO/MidiOutput.h + H2Core::MidiPortInfo: core/IO/MidiCommon.h + H2Core::NullDriver: core/IO/NullDriver.h + # H2Core::OssDriver: core/IO/OssDriver.h + H2Core::PortAudioDriver: core/IO/PortAudioDriver.h + H2Core::PortMidiDriver: core/IO/PortMidiDriver.h + H2Core::PulseAudioDriver: core/IO/PulseAudioDriver.h + # ("Song;IO/JackAudioDriver.h", ""), + H2Core::JackAudioDriver: core/IO/JackAudioDriver.h + H2Core::TransportInfo: core/IO/TransportInfo.h + LashClient: core/Lash/LashClient.h + H2Core::LilyPond: core/Lilipond/Lilypond.h + H2Core::Sampler: core/Sampler/Sampler.h + H2Core::Synth: core/Synth/Synth.h + ban: + - QColor::QColor(QColor &&) # ban this constructor, pybind11 bark on this + - QColor::name(QColor::NameFormat) + - QColor::operator= + - H2Core::Note::match + - H2Core::Pattern::find_note + - std::thread::thread(const std::thread &) + - std::thread::operator=(const std::thread &) + - std::thread::operator=(std::thread &&) + - std::thread::thread(std::thread &&) + - std::timed_mutex::timed_mutex(const std::timed_mutex &) + - std::timed_mutex::operator= + - std::exception::operator=(std::exception &&) + - std::exception::exception(std::exception &&) + - std::__cow_string + - std::__cow_string::operator=(std::__cow_string &&) + - std::__cow_string::__cow_string(std::__cow_string &&) + - std::runtime_error::operator=(std::runtime_error &&) + - std::runtime_error::runtime_error(std::runtime_error &&) + - targeted_element + - MidiActionManager::targeted_element + - _locker_struct + - QDomNodePrivate + - QStringList + - QFileInfoPrivate + - QLibraryPrivate + - Entry + - QObject + - QFileInfo::QFileInfo(QFileInfoPrivate *) + - QFileInfo::operator=(QFileInfo &&) + - QFileInfo::exists + - H2Core::AlsaAudioDriver::AlsaAudioDriver() + - H2Core::AlsaMidiDriver::midi_action + - H2Core::JackAudioDriver::m_pClient + # std::vector + - H2Core::Synth::m_playingNotesQueue + - H2Core::Hydrogen::m_nInstrumentLookupTable + - H2Core::AlsaAudioDriver::m_pPlayback_handle + - H2Core::PortAudioDriver::m_processCallback + - H2Core::DiskWriterDriver::m_processCallback + - H2Core::AlsaAudioDriver::m_processCallback + # Qt Reduction, phase 2 + - H2Core::LadspaFX::m_pLibrary + - H2Core::AudioEngine::m_EngineMutex + - H2Core::AudioEngine::m_MutexOutputPointer + - H2Core::AudioEngine::m_LockingThread + - H2Core::AudioEngine::m_currentTickTime + - QRgba64::operator= + - QMetaType + - QStringRef + - QStringView + - QByteArray + - QChar + - QDomNode + - QFileInfo + - QLatin1String + - "*::metaObject()" + - "*::qt_metacall(QMetaObject::Call, int, void **)" + - "*::qt_static_metacall(QObject *, QMetaObject::Call, int, void **)" + cleaners: + - qtreset.h + plugins: + - pybind11/stl.h + - pybind11/numpy.h + - qtcasters.h + bind_with_lambda: + - name: QColor::name() + code: | + [](const QColor &color) { + return color.name(); + } + - name: H2Core::Sample::get_data_l() + code: | + [](const H2Core::Sample & sample) { + + size_t nframes = sample.get_frames(); + auto result = py::array_t(nframes); + py::buffer_info buf = result.request(); + float *ptr = static_cast(buf.ptr); + float *src = sample.get_data_l(); + for (size_t idx = 0; idx < nframes; idx++) { + ptr[idx] = src[idx]; + } + return result; + } + - name: H2Core::Sample::get_data_r() + code: | + [](const H2Core::Sample & sample) { + + size_t nframes = sample.get_frames(); + auto result = py::array_t(nframes); + py::buffer_info buf = result.request(); + float *ptr = static_cast(buf.ptr); + float *src = sample.get_data_r(); + for (size_t idx = 0; idx < nframes; idx++) { + ptr[idx] = src[idx]; + } + return result; + } + add_method: + - name: QColor::__repr__ + code: | + [](const QColor &color) { + return "QColor(\"" + color.name() + "\")"; + } + - name: H2Core::Song::__repr__ + code: | + [](const H2Core::Song & song) { + return ""; + } + - name: H2Core::Drumkit::__repr__ + code: | + [](const H2Core::Drumkit & drumkit) { + return ""; + } + - name: H2Core::DrumkitComponent::__repr__ + code: | + [](const H2Core::DrumkitComponent & dkc) { + return ""; + } + - name: H2Core::Instrument::__repr__ + code: | + [](const H2Core::Instrument & instrument) { + return ""; + } + - name: H2Core::Sample::__repr__ + code: | + [](const H2Core::Sample & sample) { + return ""; + } + policies: + - name: H2Core::Drumkit::get_instruments + policy: py::return_value_policy::reference_internal + - name: H2Core::Hydrogen::get_instance + policy: py::return_value_policy::reference + prolog: | + using namespace H2Core; + + # end of bindings From c794279113d06553c5c870c13b44315dabda4211 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Sat, 3 Jul 2021 23:29:23 +0200 Subject: [PATCH 02/24] ban more symbols --- src/bindings/h2core.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index 7cc2f9f97..fefb200a9 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -47,7 +47,7 @@ module: H2Core::AlsaAudioDriver: core/IO/AlsaAudioDriver.h H2Core::AlsaMidiDriver: core/IO/AlsaMidiDriver.h H2Core::AudioOutput: core/IO/AudioOutput.h - H2Core::CoreAudioDriver: core/IO/CoreAudioDriver.h + # H2Core::CoreAudioDriver: core/IO/CoreAudioDriver.h H2Core::CoreMidiDriver: core/IO/CoreMidiDriver.h H2Core::DiskWriterDriver: core/IO/DiskWriterDriver.h H2Core::FakeDriver: core/IO/FakeDriver.h @@ -128,6 +128,16 @@ module: - "*::metaObject()" - "*::qt_metacall(QMetaObject::Call, int, void **)" - "*::qt_static_metacall(QObject *, QMetaObject::Call, int, void **)" + - "H2Core::DiskWriterDriver::write" # inlined ? + - H2Core::CoreAudioDriver + - H2Core::PulseAudioDriver + - H2Core::Hydrogen::previewSample # defined in headers but no implementation + - H2Core::Hydrogen::previewInstrument # defined in headers but no implementation + - H2Core::AudioEngine::prepNoteQueue + - H2Core::AudioEngine::renderNote # inline + - H2Core::Preferences::setPreferencesOverwritePath + - H2Core::Preferences::getPreferencesOverwritePath + - H2Core::Preferences::getDataDirectory cleaners: - qtreset.h plugins: From 6e012e6b0b7ade13050fda4897ba0195fa584458 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Sat, 3 Jul 2021 23:29:54 +0200 Subject: [PATCH 03/24] compiles and loads with stock hydrogen dev branch --- src/bindings/h2core_module.cpp | 3357 ++++++++++++++++++++++++++++++++ src/bindings/h2core_module.hpp | 53 + 2 files changed, 3410 insertions(+) create mode 100644 src/bindings/h2core_module.cpp create mode 100644 src/bindings/h2core_module.hpp diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp new file mode 100644 index 000000000..5e1e0c678 --- /dev/null +++ b/src/bindings/h2core_module.cpp @@ -0,0 +1,3357 @@ +#include +namespace py = pybind11; + +using namespace H2Core; +PYBIND11_MODULE(h2core, m) { + + py::class_> _Object(m, "Object"); + _Object.def(py::init()); + _Object.def(py::init()); + _Object.def("class_name", &H2Core::Object::class_name); + _Object.def_static("set_count", &H2Core::Object::set_count, + "enable/disable class instances counting", + py::arg("flag")); + _Object.def_static("count_active", &H2Core::Object::count_active); + _Object.def_static("objects_count", &H2Core::Object::objects_count); + // [] _Object.def_static("write_objects_map_to", &H2Core::Object::write_objects_map_to, + // [] "output the full objects map to a given ostream", + // [] py::arg("out"), + // [] py::arg("map")); + _Object.def_static("write_objects_map_to_cerr", &H2Core::Object::write_objects_map_to_cerr); + _Object.def_static("bootstrap", &H2Core::Object::bootstrap, + "must be called before any Object instantiation !", + py::arg("logger"), + py::arg("count")); + _Object.def_static("logger", &H2Core::Object::logger); + _Object.def_static("getAliveObjectCount", &H2Core::Object::getAliveObjectCount, + "Returns Total numbers of objects being alive."); + // [] _Object.def_static("getObjectMap", &H2Core::Object::getObjectMap, + // [] "Returns Copy of the object map."); + // [] _Object.def_static("printObjectMapDiff", &H2Core::Object::printObjectMapDiff, + // [] "Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.", + // [] py::arg("map")); + _Object.def("toQString", &H2Core::Object::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + _Object.def("Print", &H2Core::Object::Print, + "Prints content of toQString() via DEBUGLOG", + py::arg("bShort")); + + py::class_> _Logger(m, "Logger"); + _Logger.def_static("bootstrap", &H2Core::Logger::bootstrap, + "create the logger instance if not exists, set the log level and return the instance", + py::arg("msk")); + _Logger.def_static("create_instance", &H2Core::Logger::create_instance, + "If #__instance equals 0, a new H2Core::Logger singleton will be created and stored in it."); + _Logger.def_static("get_instance", &H2Core::Logger::get_instance, + "Returns a pointer to the current H2Core::Logger singleton stored in #__instance."); + _Logger.def("should_log", &H2Core::Logger::should_log, + "return true if the level is set in the bitmask", + py::arg("lvl")); + _Logger.def_static("set_bit_mask", &H2Core::Logger::set_bit_mask, + "set the bitmask", + py::arg("msk")); + _Logger.def_static("bit_mask", &H2Core::Logger::bit_mask, + "return the current log level bit mask"); + _Logger.def("set_use_file", &H2Core::Logger::set_use_file, + "set use file flag", + py::arg("use")); + _Logger.def("use_file", &H2Core::Logger::use_file, + "return __use_file"); + _Logger.def_static("parse_log_level", &H2Core::Logger::parse_log_level, + "parse a log level string and return the corresponding bit mask", + py::arg("lvl")); + _Logger.def("log", &H2Core::Logger::log, + "the log function", + py::arg("level"), + py::arg("class_name"), + py::arg("func_name"), + py::arg("msg")); + + py::class_> _LilyPond(m, "LilyPond"); + _LilyPond.def(py::init<>()); + _LilyPond.def("extractData", &H2Core::LilyPond::extractData, + py::arg("song")); + _LilyPond.def("write", &H2Core::LilyPond::write, + py::arg("sFilename")); + + py::class_> _MidiPortInfo(m, "MidiPortInfo"); + _MidiPortInfo.def_readwrite("m_sName", &H2Core::MidiPortInfo::m_sName); + _MidiPortInfo.def_readwrite("m_nClient", &H2Core::MidiPortInfo::m_nClient); + _MidiPortInfo.def_readwrite("m_nPort", &H2Core::MidiPortInfo::m_nPort); + + py::class_> _MidiMessage(m, "MidiMessage"); + _MidiMessage.def(py::init<>()); + _MidiMessage.def_readwrite("m_type", &H2Core::MidiMessage::m_type); + _MidiMessage.def_readwrite("m_nData1", &H2Core::MidiMessage::m_nData1); + _MidiMessage.def_readwrite("m_nData2", &H2Core::MidiMessage::m_nData2); + _MidiMessage.def_readwrite("m_nChannel", &H2Core::MidiMessage::m_nChannel); + _MidiMessage.def_readwrite("m_sysexData", &H2Core::MidiMessage::m_sysexData); + + py::class_> _runtime_error(m, "runtime_error"); + _runtime_error.def(py::init()); + _runtime_error.def(py::init()); + _runtime_error.def(py::init()); + // [banned] _runtime_error.def("operator=", py::overload_cast(&std::runtime_error::operator=), + // [banned] py::arg("")); + _runtime_error.def("operator=", py::overload_cast(&std::runtime_error::operator=), + py::arg("")); + _runtime_error.def("what", &std::runtime_error::what); + + py::class_> _Event(m, "Event"); + _Event.def_readwrite("type", &H2Core::Event::type); + _Event.def_readwrite("value", &H2Core::Event::value); + + py::class_> _AudioEngineLocking(m, "AudioEngineLocking"); + _AudioEngineLocking.def(py::init<>()); + _AudioEngineLocking.def("setNeedsLock", &H2Core::AudioEngineLocking::setNeedsLock, + "The audio processing thread can modify some PatternLists. For these structures, the audio engine lock must be held for any thread to access them.", + py::arg("bNeedsLock")); + + py::class_> _QColor(m, "QColor"); + _QColor.def(py::init<>()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + _QColor.def(py::init()); + // [banned] _QColor.def("operator=", py::overload_cast(&QColor::operator=), + // [banned] py::arg("other")); + // [banned] _QColor.def("operator=", py::overload_cast(&QColor::operator=), + // [banned] py::arg("")); + // [banned] _QColor.def("operator=", py::overload_cast(&QColor::operator=), + // [banned] py::arg("color")); + _QColor.def("isValid", &QColor::isValid); + _QColor.def("name", + [](const QColor &color) { + return color.name(); +} +); + // [banned] _QColor.def("name", py::overload_cast(&QColor::name), + // [banned] py::arg("format")); + _QColor.def("setNamedColor", py::overload_cast(&QColor::setNamedColor), + py::arg("name")); + // [] _QColor.def("setNamedColor", py::overload_cast(&QColor::setNamedColor), + // [] py::arg("name")); + // [] _QColor.def("setNamedColor", py::overload_cast(&QColor::setNamedColor), + // [] py::arg("name")); + // [] _QColor.def_static("colorNames", &QColor::colorNames); + _QColor.def("spec", &QColor::spec); + _QColor.def("alpha", &QColor::alpha); + _QColor.def("setAlpha", &QColor::setAlpha, + py::arg("alpha")); + _QColor.def("alphaF", &QColor::alphaF); + _QColor.def("setAlphaF", &QColor::setAlphaF, + py::arg("alpha")); + _QColor.def("red", &QColor::red); + _QColor.def("green", &QColor::green); + _QColor.def("blue", &QColor::blue); + _QColor.def("setRed", &QColor::setRed, + py::arg("red")); + _QColor.def("setGreen", &QColor::setGreen, + py::arg("green")); + _QColor.def("setBlue", &QColor::setBlue, + py::arg("blue")); + _QColor.def("redF", &QColor::redF); + _QColor.def("greenF", &QColor::greenF); + _QColor.def("blueF", &QColor::blueF); + _QColor.def("setRedF", &QColor::setRedF, + py::arg("red")); + _QColor.def("setGreenF", &QColor::setGreenF, + py::arg("green")); + _QColor.def("setBlueF", &QColor::setBlueF, + py::arg("blue")); + _QColor.def("getRgb", &QColor::getRgb, + py::arg("r"), + py::arg("g"), + py::arg("b"), + py::arg("a")); + _QColor.def("setRgb", py::overload_cast(&QColor::setRgb), + py::arg("r"), + py::arg("g"), + py::arg("b"), + py::arg("a")); + _QColor.def("setRgb", py::overload_cast(&QColor::setRgb), + py::arg("rgb")); + _QColor.def("getRgbF", &QColor::getRgbF, + py::arg("r"), + py::arg("g"), + py::arg("b"), + py::arg("a")); + _QColor.def("setRgbF", &QColor::setRgbF, + py::arg("r"), + py::arg("g"), + py::arg("b"), + py::arg("a")); + _QColor.def("rgba64", &QColor::rgba64); + _QColor.def("setRgba64", &QColor::setRgba64, + py::arg("rgba")); + _QColor.def("rgba", &QColor::rgba); + _QColor.def("setRgba", &QColor::setRgba, + py::arg("rgba")); + _QColor.def("rgb", &QColor::rgb); + _QColor.def("hue", &QColor::hue); + _QColor.def("saturation", &QColor::saturation); + _QColor.def("hsvHue", &QColor::hsvHue); + _QColor.def("hsvSaturation", &QColor::hsvSaturation); + _QColor.def("value", &QColor::value); + _QColor.def("hueF", &QColor::hueF); + _QColor.def("saturationF", &QColor::saturationF); + _QColor.def("hsvHueF", &QColor::hsvHueF); + _QColor.def("hsvSaturationF", &QColor::hsvSaturationF); + _QColor.def("valueF", &QColor::valueF); + _QColor.def("getHsv", &QColor::getHsv, + py::arg("h"), + py::arg("s"), + py::arg("v"), + py::arg("a")); + _QColor.def("setHsv", &QColor::setHsv, + py::arg("h"), + py::arg("s"), + py::arg("v"), + py::arg("a")); + _QColor.def("getHsvF", &QColor::getHsvF, + py::arg("h"), + py::arg("s"), + py::arg("v"), + py::arg("a")); + _QColor.def("setHsvF", &QColor::setHsvF, + py::arg("h"), + py::arg("s"), + py::arg("v"), + py::arg("a")); + _QColor.def("cyan", &QColor::cyan); + _QColor.def("magenta", &QColor::magenta); + _QColor.def("yellow", &QColor::yellow); + _QColor.def("black", &QColor::black); + _QColor.def("cyanF", &QColor::cyanF); + _QColor.def("magentaF", &QColor::magentaF); + _QColor.def("yellowF", &QColor::yellowF); + _QColor.def("blackF", &QColor::blackF); + _QColor.def("getCmyk", py::overload_cast(&QColor::getCmyk), + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def("getCmyk", py::overload_cast(&QColor::getCmyk), + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def("setCmyk", &QColor::setCmyk, + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def("getCmykF", py::overload_cast(&QColor::getCmykF), + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def("getCmykF", py::overload_cast(&QColor::getCmykF), + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def("setCmykF", &QColor::setCmykF, + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def("hslHue", &QColor::hslHue); + _QColor.def("hslSaturation", &QColor::hslSaturation); + _QColor.def("lightness", &QColor::lightness); + _QColor.def("hslHueF", &QColor::hslHueF); + _QColor.def("hslSaturationF", &QColor::hslSaturationF); + _QColor.def("lightnessF", &QColor::lightnessF); + _QColor.def("getHsl", &QColor::getHsl, + py::arg("h"), + py::arg("s"), + py::arg("l"), + py::arg("a")); + _QColor.def("setHsl", &QColor::setHsl, + py::arg("h"), + py::arg("s"), + py::arg("l"), + py::arg("a")); + _QColor.def("getHslF", &QColor::getHslF, + py::arg("h"), + py::arg("s"), + py::arg("l"), + py::arg("a")); + _QColor.def("setHslF", &QColor::setHslF, + py::arg("h"), + py::arg("s"), + py::arg("l"), + py::arg("a")); + _QColor.def("toRgb", &QColor::toRgb); + _QColor.def("toHsv", &QColor::toHsv); + _QColor.def("toCmyk", &QColor::toCmyk); + _QColor.def("toHsl", &QColor::toHsl); + _QColor.def("toExtendedRgb", &QColor::toExtendedRgb); + _QColor.def("convertTo", &QColor::convertTo, + py::arg("colorSpec")); + _QColor.def_static("fromRgb_static", py::overload_cast(&QColor::fromRgb), + py::arg("rgb")); + _QColor.def_static("fromRgb_static", py::overload_cast(&QColor::fromRgb), + py::arg("r"), + py::arg("g"), + py::arg("b"), + py::arg("a")); + _QColor.def_static("fromRgba", &QColor::fromRgba, + py::arg("rgba")); + _QColor.def_static("fromRgbF", &QColor::fromRgbF, + py::arg("r"), + py::arg("g"), + py::arg("b"), + py::arg("a")); + _QColor.def_static("fromRgba64_static", py::overload_cast(&QColor::fromRgba64), + py::arg("r"), + py::arg("g"), + py::arg("b"), + py::arg("a")); + _QColor.def_static("fromRgba64_static", py::overload_cast(&QColor::fromRgba64), + py::arg("rgba")); + _QColor.def_static("fromHsv", &QColor::fromHsv, + py::arg("h"), + py::arg("s"), + py::arg("v"), + py::arg("a")); + _QColor.def_static("fromHsvF", &QColor::fromHsvF, + py::arg("h"), + py::arg("s"), + py::arg("v"), + py::arg("a")); + _QColor.def_static("fromCmyk", &QColor::fromCmyk, + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def_static("fromCmykF", &QColor::fromCmykF, + py::arg("c"), + py::arg("m"), + py::arg("y"), + py::arg("k"), + py::arg("a")); + _QColor.def_static("fromHsl", &QColor::fromHsl, + py::arg("h"), + py::arg("s"), + py::arg("l"), + py::arg("a")); + _QColor.def_static("fromHslF", &QColor::fromHslF, + py::arg("h"), + py::arg("s"), + py::arg("l"), + py::arg("a")); + _QColor.def("light", &QColor::light, + py::arg("f")); + _QColor.def("dark", &QColor::dark, + py::arg("f")); + _QColor.def("lighter", &QColor::lighter, + py::arg("f")); + _QColor.def("darker", &QColor::darker, + py::arg("f")); + _QColor.def("operator==", &QColor::operator==, + py::arg("c")); + _QColor.def("operator!=", &QColor::operator!=, + py::arg("c")); + _QColor.def_static("isValidColor_static", py::overload_cast(&QColor::isValidColor), + py::arg("name")); + // [] _QColor.def_static("isValidColor_static", py::overload_cast(&QColor::isValidColor), + // [] py::arg("")); + // [] _QColor.def_static("isValidColor_static", py::overload_cast(&QColor::isValidColor), + // [] py::arg("")); + _QColor.def("__repr__", + [](const QColor &color) { + return "QColor(\"" + color.name() + "\")"; +} +); + + py::class_> _QRgba64(m, "QRgba64"); + _QRgba64.def(py::init<>()); + _QRgba64.def_static("fromRgba64_static", py::overload_cast(&QRgba64::fromRgba64), + py::arg("c")); + _QRgba64.def_static("fromRgba64_static", py::overload_cast(&QRgba64::fromRgba64), + py::arg("red"), + py::arg("green"), + py::arg("blue"), + py::arg("alpha")); + _QRgba64.def_static("fromRgba", &QRgba64::fromRgba, + py::arg("red"), + py::arg("green"), + py::arg("blue"), + py::arg("alpha")); + _QRgba64.def_static("fromArgb32", &QRgba64::fromArgb32, + py::arg("rgb")); + _QRgba64.def("isOpaque", &QRgba64::isOpaque); + _QRgba64.def("isTransparent", &QRgba64::isTransparent); + _QRgba64.def("red", &QRgba64::red); + _QRgba64.def("green", &QRgba64::green); + _QRgba64.def("blue", &QRgba64::blue); + _QRgba64.def("alpha", &QRgba64::alpha); + _QRgba64.def("setRed", &QRgba64::setRed, + py::arg("_red")); + _QRgba64.def("setGreen", &QRgba64::setGreen, + py::arg("_green")); + _QRgba64.def("setBlue", &QRgba64::setBlue, + py::arg("_blue")); + _QRgba64.def("setAlpha", &QRgba64::setAlpha, + py::arg("_alpha")); + _QRgba64.def("red8", &QRgba64::red8); + _QRgba64.def("green8", &QRgba64::green8); + _QRgba64.def("blue8", &QRgba64::blue8); + _QRgba64.def("alpha8", &QRgba64::alpha8); + _QRgba64.def("toArgb32", &QRgba64::toArgb32); + _QRgba64.def("toRgb16", &QRgba64::toRgb16); + _QRgba64.def("premultiplied", &QRgba64::premultiplied); + _QRgba64.def("unpremultiplied", &QRgba64::unpremultiplied); + // [banned] _QRgba64.def("operator=", &QRgba64::operator=, + // [banned] py::arg("_rgba")); + + py::class_> _Synth(m, "Synth"); + _Synth.def(py::init<>()); + _Synth.def_readwrite("m_pOut_L", &H2Core::Synth::m_pOut_L); + _Synth.def_readwrite("m_pOut_R", &H2Core::Synth::m_pOut_R); + _Synth.def_static("class_name", &H2Core::Synth::class_name); + _Synth.def("noteOn", &H2Core::Synth::noteOn, + "Start playing a note", + py::arg("pNote")); + _Synth.def("noteOff", &H2Core::Synth::noteOff, + "Stop playing a note.", + py::arg("pNote")); + _Synth.def("process", &H2Core::Synth::process, + py::arg("nFrames")); + _Synth.def("setAudioOutput", &H2Core::Synth::setAudioOutput, + py::arg("pAudioOutput")); + _Synth.def("getPlayingNotesNumber", &H2Core::Synth::getPlayingNotesNumber); + + py::class_> _Note(m, "Note"); + _Note.def(py::init, int, float, float, int, float>()); + _Note.def(py::init>()); + _Note.def_static("class_name", &H2Core::Note::class_name); + _Note.def("save_to", &H2Core::Note::save_to, + py::arg("node")); + _Note.def_static("load_from", &H2Core::Note::load_from, + "load a note from an XMLNode", + py::arg("node"), + py::arg("instruments")); + _Note.def("dump", &H2Core::Note::dump, + "output details through logger with DEBUG severity"); + _Note.def("map_instrument", &H2Core::Note::map_instrument, + "find the corresponding instrument and point to it, or an empty instrument", + py::arg("instruments")); + _Note.def("get_instrument", &H2Core::Note::get_instrument, + "#__instrument accessor"); + _Note.def("has_instrument", &H2Core::Note::has_instrument, + "return true if #__instrument is set"); + _Note.def("set_instrument_id", &H2Core::Note::set_instrument_id, + "#__instrument_id setter", + py::arg("value")); + _Note.def("get_instrument_id", &H2Core::Note::get_instrument_id, + "#__instrument_id accessor"); + _Note.def("set_specific_compo_id", &H2Core::Note::set_specific_compo_id, + "#__specific_compo_id setter", + py::arg("value")); + _Note.def("get_specific_compo_id", &H2Core::Note::get_specific_compo_id, + "#__specific_compo_id accessor"); + _Note.def("set_position", &H2Core::Note::set_position, + "#__position setter", + py::arg("value")); + _Note.def("get_position", &H2Core::Note::get_position, + "#__position accessor"); + _Note.def("set_velocity", &H2Core::Note::set_velocity, + "#__velocity setter", + py::arg("value")); + _Note.def("get_velocity", &H2Core::Note::get_velocity, + "#__velocity accessor"); + _Note.def("setPan", &H2Core::Note::setPan, + "set pan of the note. assumes the input range in [-1;1]", + py::arg("val")); + _Note.def("setPanWithRangeFrom0To1", &H2Core::Note::setPanWithRangeFrom0To1, + "set pan of the note, assuming the input range in [0;1]", + py::arg("fVal")); + _Note.def("getPan", &H2Core::Note::getPan, + "get pan of the note. Output pan range: [-1;1]"); + _Note.def("getPanWithRangeFrom0To1", &H2Core::Note::getPanWithRangeFrom0To1, + "get pan of the note, scaling and translating the range from [-1;1] to [0;1]"); + _Note.def("set_lead_lag", &H2Core::Note::set_lead_lag, + "#__lead_lag setter", + py::arg("value")); + _Note.def("get_lead_lag", &H2Core::Note::get_lead_lag, + "#__lead_lag accessor"); + _Note.def("set_length", &H2Core::Note::set_length, + "#__length setter", + py::arg("value")); + _Note.def("get_length", &H2Core::Note::get_length, + "#__length accessor"); + _Note.def("set_pitch", &H2Core::Note::set_pitch, + "#__pitch setter", + py::arg("value")); + _Note.def("get_pitch", &H2Core::Note::get_pitch, + "#__pitch accessor"); + _Note.def("set_note_off", &H2Core::Note::set_note_off, + "#__note_off setter", + py::arg("value")); + _Note.def("get_note_off", &H2Core::Note::get_note_off, + "#__note_off accessor"); + _Note.def("get_midi_msg", &H2Core::Note::get_midi_msg, + "#__midi_msg accessor"); + _Note.def("set_pattern_idx", &H2Core::Note::set_pattern_idx, + "#__pattern_idx setter", + py::arg("value")); + _Note.def("get_pattern_idx", &H2Core::Note::get_pattern_idx, + "#__pattern_idx accessor"); + _Note.def("set_just_recorded", &H2Core::Note::set_just_recorded, + "#__just_recorded setter", + py::arg("value")); + _Note.def("get_just_recorded", &H2Core::Note::get_just_recorded, + "#__just_recorded accessor"); + _Note.def("get_layer_selected", &H2Core::Note::get_layer_selected, + py::arg("CompoID")); + _Note.def("set_probability", &H2Core::Note::set_probability, + py::arg("value")); + _Note.def("get_probability", &H2Core::Note::get_probability); + _Note.def("set_humanize_delay", &H2Core::Note::set_humanize_delay, + "#__humanize_delay setter", + py::arg("value")); + _Note.def("get_humanize_delay", &H2Core::Note::get_humanize_delay, + "#__humanize_delay accessor"); + _Note.def("get_cut_off", &H2Core::Note::get_cut_off, + "#__cut_off accessor"); + _Note.def("get_resonance", &H2Core::Note::get_resonance, + "#__resonance accessor"); + _Note.def("get_bpfb_l", &H2Core::Note::get_bpfb_l, + "#__bpfb_l accessor"); + _Note.def("get_bpfb_r", &H2Core::Note::get_bpfb_r, + "#__bpfb_r accessor"); + _Note.def("get_lpfb_l", &H2Core::Note::get_lpfb_l, + "#__lpfb_l accessor"); + _Note.def("get_lpfb_r", &H2Core::Note::get_lpfb_r, + "#__lpfb_r accessor"); + _Note.def("get_key", &H2Core::Note::get_key, + "#__key accessor"); + _Note.def("get_octave", &H2Core::Note::get_octave, + "#__octave accessor"); + _Note.def("get_midi_key", &H2Core::Note::get_midi_key, + "return scaled key for midi output, !!! DO NOT CHECK IF INSTRUMENT IS SET !!!"); + _Note.def("get_midi_velocity", &H2Core::Note::get_midi_velocity, + "midi velocity accessor"); + _Note.def("get_notekey_pitch", &H2Core::Note::get_notekey_pitch, + "note key pitch accessor"); + _Note.def("get_total_pitch", &H2Core::Note::get_total_pitch, + "returns"); + _Note.def("key_to_string", &H2Core::Note::key_to_string, + "return a string representation of key-octave"); + _Note.def("set_key_octave", py::overload_cast(&H2Core::Note::set_key_octave), + "parse str and set #__key and #__octave", + py::arg("str")); + _Note.def("set_key_octave", py::overload_cast(&H2Core::Note::set_key_octave), + "set #__key and #__octave only if within acceptable range", + py::arg("key"), + py::arg("octave")); + _Note.def("set_midi_info", &H2Core::Note::set_midi_info, + "set #__key, #__octave and #__midi_msg only if within acceptable range", + py::arg("key"), + py::arg("octave"), + py::arg("msg")); + _Note.def("get_adsr", &H2Core::Note::get_adsr, + "get the ADSR of the note"); + // [banned] _Note.def("match", py::overload_cast, H2Core::Note::Key, H2Core::Note::Octave>(&H2Core::Note::match), + // [banned] "return true if instrument, key and octave matches with internal", + // [banned] py::arg("instrument"), + // [banned] py::arg("key"), + // [banned] py::arg("octave")); + // [banned] _Note.def("match", py::overload_cast(&H2Core::Note::match), + // [banned] "Return true if two notes match in instrument, key and octave.", + // [banned] py::arg("pNote")); + _Note.def("compute_lr_values", &H2Core::Note::compute_lr_values, + "compute left and right output based on filters", + py::arg("val_l"), + py::arg("val_r")); + _Note.def("toQString", &H2Core::Note::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _Sampler(m, "Sampler"); + _Sampler.def(py::init<>()); + _Sampler.def_readwrite("m_pMainOut_L", &H2Core::Sampler::m_pMainOut_L); + _Sampler.def_readwrite("m_pMainOut_R", &H2Core::Sampler::m_pMainOut_R); + _Sampler.def_static("class_name", &H2Core::Sampler::class_name); + _Sampler.def_static("ratioStraightPolygonalPanLaw", &H2Core::Sampler::ratioStraightPolygonalPanLaw, + py::arg("fPan")); + _Sampler.def_static("ratioConstPowerPanLaw", &H2Core::Sampler::ratioConstPowerPanLaw, + py::arg("fPan")); + _Sampler.def_static("ratioConstSumPanLaw", &H2Core::Sampler::ratioConstSumPanLaw, + py::arg("fPan")); + _Sampler.def_static("linearStraightPolygonalPanLaw", &H2Core::Sampler::linearStraightPolygonalPanLaw, + py::arg("fPan")); + _Sampler.def_static("linearConstPowerPanLaw", &H2Core::Sampler::linearConstPowerPanLaw, + py::arg("fPan")); + _Sampler.def_static("linearConstSumPanLaw", &H2Core::Sampler::linearConstSumPanLaw, + py::arg("fPan")); + _Sampler.def_static("polarStraightPolygonalPanLaw", &H2Core::Sampler::polarStraightPolygonalPanLaw, + py::arg("fPan")); + _Sampler.def_static("polarConstPowerPanLaw", &H2Core::Sampler::polarConstPowerPanLaw, + py::arg("fPan")); + _Sampler.def_static("polarConstSumPanLaw", &H2Core::Sampler::polarConstSumPanLaw, + py::arg("fPan")); + _Sampler.def_static("quadraticStraightPolygonalPanLaw", &H2Core::Sampler::quadraticStraightPolygonalPanLaw, + py::arg("fPan")); + _Sampler.def_static("quadraticConstPowerPanLaw", &H2Core::Sampler::quadraticConstPowerPanLaw, + py::arg("fPan")); + _Sampler.def_static("quadraticConstSumPanLaw", &H2Core::Sampler::quadraticConstSumPanLaw, + py::arg("fPan")); + _Sampler.def_static("linearConstKNormPanLaw", &H2Core::Sampler::linearConstKNormPanLaw, + py::arg("fPan"), + py::arg("k")); + _Sampler.def_static("polarConstKNormPanLaw", &H2Core::Sampler::polarConstKNormPanLaw, + py::arg("fPan"), + py::arg("k")); + _Sampler.def_static("ratioConstKNormPanLaw", &H2Core::Sampler::ratioConstKNormPanLaw, + py::arg("fPan"), + py::arg("k")); + _Sampler.def_static("quadraticConstKNormPanLaw", &H2Core::Sampler::quadraticConstKNormPanLaw, + py::arg("fPan"), + py::arg("k")); + _Sampler.def_static("getRatioPan", &H2Core::Sampler::getRatioPan, + "This function is used to load old version files (v<=1.1). It returns the single pan parameter in [-1,1] from the L,R gains as it was input from the GUI (up to scale and translation, which is arbitrary). Default output is 0 (=central pan) if arguments are invalid. -----Historical Note----- Originally (version <= 1.0) pan_L,pan_R were actually gains for each channel; \"instrument\" and \"note\" pans were multiplied as in a gain CHAIN in each separate channel, so the chain killed the signal if instrument and note pans were hard-sided to opposites sides! In v1.1, pan_L and pan_R were still the members of Note/Instrument representing the pan knob position, still using the ratioStraightPolygonalPanLaw() for the correspondence (up to constant multiplication), but pan_L,pan_R were reconverted to single parameter in the Sampler, and fPan was used in the selected pan law.", + py::arg("fPan_L"), + py::arg("fPan_R")); + _Sampler.def("process", &H2Core::Sampler::process, + py::arg("nFrames"), + py::arg("pSong")); + _Sampler.def("noteOn", &H2Core::Sampler::noteOn, + "Start playing a note", + py::arg("pNote")); + _Sampler.def("noteOff", &H2Core::Sampler::noteOff, + "Stop playing a note.", + py::arg("pNote")); + _Sampler.def("midiKeyboardNoteOff", &H2Core::Sampler::midiKeyboardNoteOff, + py::arg("key")); + _Sampler.def("stopPlayingNotes", &H2Core::Sampler::stopPlayingNotes, + py::arg("pInstr")); + _Sampler.def("getPlayingNotesNumber", &H2Core::Sampler::getPlayingNotesNumber); + _Sampler.def("preview_sample", &H2Core::Sampler::preview_sample, + py::arg("pSample"), + py::arg("length")); + _Sampler.def("preview_instrument", &H2Core::Sampler::preview_instrument, + py::arg("pInstr")); + _Sampler.def("setPlayingNotelength", &H2Core::Sampler::setPlayingNotelength, + py::arg("pInstrument"), + py::arg("ticks"), + py::arg("noteOnTick")); + _Sampler.def("isInstrumentPlaying", &H2Core::Sampler::isInstrumentPlaying, + py::arg("pInstr")); + _Sampler.def("setInterpolateMode", &H2Core::Sampler::setInterpolateMode, + py::arg("mode")); + _Sampler.def("getPreviewInstrument", &H2Core::Sampler::getPreviewInstrument); + _Sampler.def("getPlaybackTrackInstrument", &H2Core::Sampler::getPlaybackTrackInstrument); + _Sampler.def("getInterpolateMode", &H2Core::Sampler::getInterpolateMode); + _Sampler.def("reinitializePlaybackTrack", &H2Core::Sampler::reinitializePlaybackTrack, + "Loading of the playback track."); + + py::class_> _TransportInfo(m, "TransportInfo"); + _TransportInfo.def(py::init<>()); + _TransportInfo.def_readwrite("m_status", &H2Core::TransportInfo::m_status); + _TransportInfo.def_readwrite("m_nFrames", &H2Core::TransportInfo::m_nFrames); + _TransportInfo.def_readwrite("m_fTickSize", &H2Core::TransportInfo::m_fTickSize); + _TransportInfo.def_readwrite("m_fBPM", &H2Core::TransportInfo::m_fBPM); + _TransportInfo.def_static("class_name", &H2Core::TransportInfo::class_name); + _TransportInfo.def("printInfo", &H2Core::TransportInfo::printInfo, + "Displays general information about the transport state in the #INFOLOG"); + +// abstract class MidiOutput + +// abstract class MidiInput + +// abstract class AudioOutput + + py::class_> _LadspaFX(m, "LadspaFX"); + _LadspaFX.def_readwrite("m_pBuffer_L", &H2Core::LadspaFX::m_pBuffer_L); + _LadspaFX.def_readwrite("m_pBuffer_R", &H2Core::LadspaFX::m_pBuffer_R); + _LadspaFX.def_readwrite("inputControlPorts", &H2Core::LadspaFX::inputControlPorts); + _LadspaFX.def_readwrite("outputControlPorts", &H2Core::LadspaFX::outputControlPorts); + _LadspaFX.def_static("class_name", &H2Core::LadspaFX::class_name); + _LadspaFX.def("connectAudioPorts", &H2Core::LadspaFX::connectAudioPorts, + py::arg("pIn_L"), + py::arg("pIn_R"), + py::arg("pOut_L"), + py::arg("pOut_R")); + _LadspaFX.def("activate", &H2Core::LadspaFX::activate); + _LadspaFX.def("deactivate", &H2Core::LadspaFX::deactivate); + _LadspaFX.def("processFX", &H2Core::LadspaFX::processFX, + py::arg("nFrames")); + _LadspaFX.def("getPluginLabel", &H2Core::LadspaFX::getPluginLabel); + _LadspaFX.def("getPluginName", &H2Core::LadspaFX::getPluginName); + _LadspaFX.def("setPluginName", &H2Core::LadspaFX::setPluginName, + py::arg("sName")); + _LadspaFX.def("getLibraryPath", &H2Core::LadspaFX::getLibraryPath); + _LadspaFX.def("isEnabled", &H2Core::LadspaFX::isEnabled); + _LadspaFX.def("setEnabled", &H2Core::LadspaFX::setEnabled, + py::arg("value")); + _LadspaFX.def_static("load", &H2Core::LadspaFX::load, + py::arg("sLibraryPath"), + py::arg("sPluginLabel"), + py::arg("nSampleRate")); + _LadspaFX.def("getPluginType", &H2Core::LadspaFX::getPluginType); + _LadspaFX.def("setVolume", &H2Core::LadspaFX::setVolume, + py::arg("fValue")); + _LadspaFX.def("getVolume", &H2Core::LadspaFX::getVolume); + + py::class_> _Effects(m, "Effects"); + _Effects.def_static("class_name", &H2Core::Effects::class_name); + _Effects.def_static("create_instance", &H2Core::Effects::create_instance, + "If #__instance equals 0, a new Effects singleton will be created and stored in it."); + _Effects.def_static("get_instance", &H2Core::Effects::get_instance, + "Returns a pointer to the current Effects singleton stored in #__instance."); + _Effects.def("getLadspaFX", &H2Core::Effects::getLadspaFX, + py::arg("nFX")); + _Effects.def("setLadspaFX", &H2Core::Effects::setLadspaFX, + py::arg("pFX"), + py::arg("nFX")); + _Effects.def("getPluginList", &H2Core::Effects::getPluginList); + _Effects.def("getLadspaFXGroup", &H2Core::Effects::getLadspaFXGroup); + + py::class_> _LadspaFXGroup(m, "LadspaFXGroup"); + _LadspaFXGroup.def(py::init()); + _LadspaFXGroup.def_static("class_name", &H2Core::LadspaFXGroup::class_name); + _LadspaFXGroup.def("getName", &H2Core::LadspaFXGroup::getName); + _LadspaFXGroup.def("addLadspaInfo", &H2Core::LadspaFXGroup::addLadspaInfo, + py::arg("pInfo")); + _LadspaFXGroup.def("getLadspaInfo", &H2Core::LadspaFXGroup::getLadspaInfo); + _LadspaFXGroup.def("addChild", &H2Core::LadspaFXGroup::addChild, + py::arg("pChild")); + _LadspaFXGroup.def("getChildList", &H2Core::LadspaFXGroup::getChildList); + _LadspaFXGroup.def("clear", &H2Core::LadspaFXGroup::clear); + _LadspaFXGroup.def_static("alphabeticOrder", &H2Core::LadspaFXGroup::alphabeticOrder, + py::arg(""), + py::arg("")); + _LadspaFXGroup.def("sort", &H2Core::LadspaFXGroup::sort); + + py::class_> _LadspaFXInfo(m, "LadspaFXInfo"); + _LadspaFXInfo.def(py::init()); + _LadspaFXInfo.def_readwrite("m_sFilename", &H2Core::LadspaFXInfo::m_sFilename); + _LadspaFXInfo.def_readwrite("m_sID", &H2Core::LadspaFXInfo::m_sID); + _LadspaFXInfo.def_readwrite("m_sLabel", &H2Core::LadspaFXInfo::m_sLabel); + _LadspaFXInfo.def_readwrite("m_sName", &H2Core::LadspaFXInfo::m_sName); + _LadspaFXInfo.def_readwrite("m_sMaker", &H2Core::LadspaFXInfo::m_sMaker); + _LadspaFXInfo.def_readwrite("m_sCopyright", &H2Core::LadspaFXInfo::m_sCopyright); + _LadspaFXInfo.def_readwrite("m_nICPorts", &H2Core::LadspaFXInfo::m_nICPorts); + _LadspaFXInfo.def_readwrite("m_nOCPorts", &H2Core::LadspaFXInfo::m_nOCPorts); + _LadspaFXInfo.def_readwrite("m_nIAPorts", &H2Core::LadspaFXInfo::m_nIAPorts); + _LadspaFXInfo.def_readwrite("m_nOAPorts", &H2Core::LadspaFXInfo::m_nOAPorts); + _LadspaFXInfo.def_static("class_name", &H2Core::LadspaFXInfo::class_name); + _LadspaFXInfo.def_static("alphabeticOrder", &H2Core::LadspaFXInfo::alphabeticOrder, + py::arg("a"), + py::arg("b")); + + py::class_> _Timeline(m, "Timeline"); + _Timeline.def(py::init<>()); + _Timeline.def_static("class_name", &H2Core::Timeline::class_name); + _Timeline.def("addTempoMarker", &H2Core::Timeline::addTempoMarker, + py::arg("nBar"), + py::arg("fBpm")); + _Timeline.def("deleteTempoMarker", &H2Core::Timeline::deleteTempoMarker, + py::arg("nBar")); + _Timeline.def("deleteAllTempoMarkers", &H2Core::Timeline::deleteAllTempoMarkers); + _Timeline.def("getTempoAtBar", &H2Core::Timeline::getTempoAtBar, + "Returns the tempo of the Song at a given bar.", + py::arg("nBar"), + py::arg("bSticky")); + _Timeline.def("getAllTempoMarkers", &H2Core::Timeline::getAllTempoMarkers, + "Returns std::vector> Provides read-only access to m_tempoMarker."); + _Timeline.def("addTag", &H2Core::Timeline::addTag, + py::arg("nBar"), + py::arg("sTag")); + _Timeline.def("deleteTag", &H2Core::Timeline::deleteTag, + py::arg("nBar")); + _Timeline.def("deleteAllTags", &H2Core::Timeline::deleteAllTags); + _Timeline.def("getTagAtBar", &H2Core::Timeline::getTagAtBar, + "Returns the tag of the Song at a given bar.", + py::arg("nBar"), + py::arg("bSticky")); + _Timeline.def("getAllTags", &H2Core::Timeline::getAllTags, + "Returns std::vector> Provides read-only access to m_tags."); + _Timeline.def("toQString", &H2Core::Timeline::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _MidiActionManager(m, "MidiActionManager"); + _MidiActionManager.def(py::init<>()); + _MidiActionManager.def_static("class_name", &MidiActionManager::class_name); + _MidiActionManager.def("handleAction", &MidiActionManager::handleAction, + "The handleAction method is the heart of the MidiActionManager class. It executes the operations that are needed to carry the desired action.", + py::arg("")); + _MidiActionManager.def_static("create_instance", &MidiActionManager::create_instance, + "If #__instance equals 0, a new MidiActionManager singleton will be created and stored in it."); + _MidiActionManager.def_static("get_instance", &MidiActionManager::get_instance, + "Returns a pointer to the current MidiActionManager singleton stored in #__instance."); + // [] _MidiActionManager.def("getActionList", &MidiActionManager::getActionList); + // [] _MidiActionManager.def("getEventList", &MidiActionManager::getEventList); + + py::class_> _Action(m, "Action"); + _Action.def(py::init()); + _Action.def_static("class_name", &Action::class_name); + _Action.def("setParameter1", &Action::setParameter1, + py::arg("text")); + _Action.def("setParameter2", &Action::setParameter2, + py::arg("text")); + _Action.def("getParameter1", &Action::getParameter1); + _Action.def("getParameter2", &Action::getParameter2); + _Action.def("getType", &Action::getType); + + py::class_> _EventQueue(m, "EventQueue"); + _EventQueue.def_readwrite("m_addMidiNoteVector", &H2Core::EventQueue::m_addMidiNoteVector); + _EventQueue.def_static("class_name", &H2Core::EventQueue::class_name); + _EventQueue.def_static("create_instance", &H2Core::EventQueue::create_instance, + "If #__instance equals 0, a new EventQueue singleton will be created and stored in it."); + _EventQueue.def_static("get_instance", &H2Core::EventQueue::get_instance, + "Returns a pointer to the current EventQueue singleton stored in #__instance."); + _EventQueue.def("push_event", &H2Core::EventQueue::push_event, + "Queues the next event into the EventQueue.", + py::arg("type"), + py::arg("nValue")); + _EventQueue.def("pop_event", &H2Core::EventQueue::pop_event, + "Reads out the next event of the EventQueue."); + + py::class_> _CoreActionController(m, "CoreActionController"); + _CoreActionController.def(py::init<>()); + _CoreActionController.def_static("class_name", &H2Core::CoreActionController::class_name); + _CoreActionController.def("setMasterVolume", &H2Core::CoreActionController::setMasterVolume, + py::arg("masterVolumeValue")); + _CoreActionController.def("setStripVolume", &H2Core::CoreActionController::setStripVolume, + py::arg("nStrip"), + py::arg("fVolumeValue"), + py::arg("bSelectStrip")); + _CoreActionController.def("setStripPan", &H2Core::CoreActionController::setStripPan, + py::arg("nStrip"), + py::arg("fValue"), + py::arg("bSelectStrip")); + _CoreActionController.def("setStripPanSym", &H2Core::CoreActionController::setStripPanSym, + py::arg("nStrip"), + py::arg("fValue"), + py::arg("bSelectStrip")); + _CoreActionController.def("setMetronomeIsActive", &H2Core::CoreActionController::setMetronomeIsActive, + py::arg("isActive")); + _CoreActionController.def("setMasterIsMuted", &H2Core::CoreActionController::setMasterIsMuted, + py::arg("isMuted")); + _CoreActionController.def("setStripIsMuted", &H2Core::CoreActionController::setStripIsMuted, + py::arg("nStrip"), + py::arg("isMuted")); + _CoreActionController.def("toggleStripIsMuted", &H2Core::CoreActionController::toggleStripIsMuted, + py::arg("nStrip")); + _CoreActionController.def("setStripIsSoloed", &H2Core::CoreActionController::setStripIsSoloed, + py::arg("nStrip"), + py::arg("isSoloed")); + _CoreActionController.def("toggleStripIsSoloed", &H2Core::CoreActionController::toggleStripIsSoloed, + py::arg("nStrip")); + _CoreActionController.def("initExternalControlInterfaces", &H2Core::CoreActionController::initExternalControlInterfaces); + _CoreActionController.def("handleOutgoingControlChange", &H2Core::CoreActionController::handleOutgoingControlChange, + py::arg("param"), + py::arg("value")); + _CoreActionController.def("newSong", &H2Core::CoreActionController::newSong, + "Create an empty #Song, which will be stored in songPath.", + py::arg("songPath")); + _CoreActionController.def("openSong", py::overload_cast(&H2Core::CoreActionController::openSong), + "Opens the #Song specified in songPath.", + py::arg("songPath")); + _CoreActionController.def("openSong", py::overload_cast(&H2Core::CoreActionController::openSong), + "Opens the #Song specified in songPath.", + py::arg("pSong")); + _CoreActionController.def("saveSong", &H2Core::CoreActionController::saveSong, + "Saves the current #Song."); + _CoreActionController.def("saveSongAs", &H2Core::CoreActionController::saveSongAs, + "Saves the current #Song to the path provided in songPath.", + py::arg("songPath")); + _CoreActionController.def("savePreferences", &H2Core::CoreActionController::savePreferences, + "Saves the current state of the #Preferences."); + _CoreActionController.def("quit", &H2Core::CoreActionController::quit, + "Triggers the shutdown of Hydrogen."); + _CoreActionController.def("activateTimeline", &H2Core::CoreActionController::activateTimeline, + "(De)activates the usage of the Timeline.", + py::arg("bActivate")); + _CoreActionController.def("addTempoMarker", &H2Core::CoreActionController::addTempoMarker, + "Adds a tempo marker to the Timeline.", + py::arg("nPosition"), + py::arg("fBpm")); + _CoreActionController.def("deleteTempoMarker", &H2Core::CoreActionController::deleteTempoMarker, + "Delete a tempo marker from the Timeline.", + py::arg("nPosition")); + _CoreActionController.def("activateJackTransport", &H2Core::CoreActionController::activateJackTransport, + "(De)activates the usage of Jack transport.", + py::arg("bActivate")); + _CoreActionController.def("activateJackTimebaseMaster", &H2Core::CoreActionController::activateJackTimebaseMaster, + "(De)activates the usage of Jack timebase master.", + py::arg("bActivate")); + _CoreActionController.def("activateSongMode", &H2Core::CoreActionController::activateSongMode, + "Switches between Song and Pattern mode of playback.", + py::arg("bActivate"), + py::arg("bTriggerEvent")); + _CoreActionController.def("activateLoopMode", &H2Core::CoreActionController::activateLoopMode, + "Toggle loop mode of playback.", + py::arg("bActivate"), + py::arg("bTriggerEvent")); + _CoreActionController.def("relocate", &H2Core::CoreActionController::relocate, + "Relocates transport to the beginning of a particular Pattern.", + py::arg("nPatternGroup")); + _CoreActionController.def("isSongPathValid", &H2Core::CoreActionController::isSongPathValid, + "Checks the path of the .h2song provided via OSC.", + py::arg("songPath")); + + py::class_> _AudioEngine(m, "AudioEngine"); + _AudioEngine.def(py::init<>()); + _AudioEngine.def_static("class_name", &H2Core::AudioEngine::class_name); + _AudioEngine.def("lock", &H2Core::AudioEngine::lock, + "Mutex locking of the AudioEngine.", + py::arg("file"), + py::arg("line"), + py::arg("function")); + _AudioEngine.def("tryLock", &H2Core::AudioEngine::tryLock, + "Mutex locking of the AudioEngine.", + py::arg("file"), + py::arg("line"), + py::arg("function")); + // [] _AudioEngine.def("tryLockFor", &H2Core::AudioEngine::tryLockFor, + // [] "Mutex locking of the AudioEngine.", + // [] py::arg("duration"), + // [] py::arg("file"), + // [] py::arg("line"), + // [] py::arg("function")); + _AudioEngine.def("unlock", &H2Core::AudioEngine::unlock, + "Mutex unlocking of the AudioEngine."); + _AudioEngine.def("assertLocked", &H2Core::AudioEngine::assertLocked, + "Assert that the calling thread is the current holder of the AudioEngine lock."); + _AudioEngine.def("destroy", &H2Core::AudioEngine::destroy); + _AudioEngine.def("start", &H2Core::AudioEngine::start, + "If the audio engine is in state #m_audioEngineState #STATE_READY, this function will - sets #m_fMasterPeak_L and #m_fMasterPeak_R to 0.0f - sets TransportInfo::m_nFrames to nTotalFrames - sets m_nSongPos and m_nPatternStartTick to -1 - m_nPatternTickPosition to 0 - sets #m_audioEngineState to #STATE_PLAYING - pushes the #EVENT_STATE #STATE_PLAYING using EventQueue::push_event()", + py::arg("bLockEngine"), + py::arg("nTotalFrames")); + _AudioEngine.def("stop", &H2Core::AudioEngine::stop, + "If the audio engine is in state #m_audioEngineState #STATE_PLAYING, this function will - sets #m_fMasterPeak_L and #m_fMasterPeak_R to 0.0f - sets #m_audioEngineState to #STATE_READY - sets #m_nPatternStartTick to -1 - deletes all copied Note in song notes queue #m_songNoteQueue and MIDI notes queue #m_midiNoteQueue - calls the _clear()_ member of #m_midiNoteQueue", + py::arg("bLockEngine")); + _AudioEngine.def("setSong", &H2Core::AudioEngine::setSong, + "Updates the global objects of the audioEngine according to new Song.", + py::arg("pNewSong")); + _AudioEngine.def("removeSong", &H2Core::AudioEngine::removeSong, + "Does the necessary cleanup of the global objects in the audioEngine."); + _AudioEngine.def("noteOn", &H2Core::AudioEngine::noteOn, + py::arg("note")); + _AudioEngine.def_static("audioEngine_process", &H2Core::AudioEngine::audioEngine_process, + "Main audio processing function called by the audio drivers whenever there is work to do.", + py::arg("nframes"), + py::arg("arg")); + _AudioEngine.def("clearNoteQueue", &H2Core::AudioEngine::clearNoteQueue); + _AudioEngine.def("processPlayNotes", &H2Core::AudioEngine::processPlayNotes, + py::arg("nframes")); + _AudioEngine.def("processTransport", &H2Core::AudioEngine::processTransport, + "Updating the TransportInfo of the audio driver.", + py::arg("nFrames")); + // [banned] _AudioEngine.def("renderNote", &H2Core::AudioEngine::renderNote, + // [banned] py::arg("pNote"), + // [banned] py::arg("nBufferSize")); + _AudioEngine.def("updateNoteQueue", &H2Core::AudioEngine::updateNoteQueue, + "Takes all notes from the current patterns, from the MIDI queue #m_midiNoteQueue, and those triggered by the metronome and pushes them onto #m_songNoteQueue for playback.", + py::arg("nFrames")); + // [banned] _AudioEngine.def("prepNoteQueue", &H2Core::AudioEngine::prepNoteQueue); + _AudioEngine.def("findPatternInTick", &H2Core::AudioEngine::findPatternInTick, + "Find a PatternList corresponding to the supplied tick position nTick.", + py::arg("nTick"), + py::arg("bLoopMode"), + py::arg("pPatternStartTick")); + _AudioEngine.def("seek", &H2Core::AudioEngine::seek, + py::arg("nFrames"), + py::arg("bLoopMode")); + _AudioEngine.def_static("computeTickSize", &H2Core::AudioEngine::computeTickSize, + py::arg("nSampleRate"), + py::arg("fBpm"), + py::arg("nResolution")); + _AudioEngine.def("getSampler", &H2Core::AudioEngine::getSampler, + "Returns #m_pSampler"); + _AudioEngine.def("getSynth", &H2Core::AudioEngine::getSynth, + "Returns #m_pSynth"); + _AudioEngine.def("getElapsedTime", &H2Core::AudioEngine::getElapsedTime, + "Returns #m_fElapsedTime"); + _AudioEngine.def("calculateElapsedTime", &H2Core::AudioEngine::calculateElapsedTime, + "Calculates the elapsed time for an arbitrary position.", + py::arg("sampleRate"), + py::arg("nFrame"), + py::arg("nResolution")); + _AudioEngine.def("updateElapsedTime", &H2Core::AudioEngine::updateElapsedTime, + "Increments #m_fElapsedTime at the end of a process cycle.", + py::arg("bufferSize"), + py::arg("sampleRate")); + _AudioEngine.def("processCheckBPMChanged", &H2Core::AudioEngine::processCheckBPMChanged, + "Update the tick size based on the current tempo without affecting the current transport position.", + py::arg("pSong")); + _AudioEngine.def("locate", &H2Core::AudioEngine::locate, + "Relocate using the audio driver and update the #m_fElapsedTime.", + py::arg("nFrame")); + _AudioEngine.def("clearAudioBuffers", &H2Core::AudioEngine::clearAudioBuffers, + "Clear all audio buffers.", + py::arg("nFrames")); + _AudioEngine.def("createDriver", &H2Core::AudioEngine::createDriver, + "Create an audio driver using audioEngine_process() as its argument based on the provided choice and calling their _init()_ function to trigger their initialization.", + py::arg("sDriver")); + _AudioEngine.def("startAudioDrivers", &H2Core::AudioEngine::startAudioDrivers, + "Creation and initialization of all audio and MIDI drivers called in Hydrogen::Hydrogen()."); + _AudioEngine.def("stopAudioDrivers", &H2Core::AudioEngine::stopAudioDrivers, + "Stops all audio and MIDI drivers."); + _AudioEngine.def("restartAudioDrivers", &H2Core::AudioEngine::restartAudioDrivers); + _AudioEngine.def("setupLadspaFX", &H2Core::AudioEngine::setupLadspaFX); + _AudioEngine.def("renameJackPorts", &H2Core::AudioEngine::renameJackPorts, + "Hands the provided Song to JackAudioDriver::makeTrackOutputs() if pSong is not a null pointer and the audio driver #m_pAudioDriver is an instance of the JackAudioDriver.", + py::arg("pSong")); + _AudioEngine.def("setAudioDriver", &H2Core::AudioEngine::setAudioDriver, + py::arg("pAudioDriver")); + _AudioEngine.def("getAudioDriver", &H2Core::AudioEngine::getAudioDriver); + _AudioEngine.def("getMidiDriver", &H2Core::AudioEngine::getMidiDriver); + _AudioEngine.def("getMidiOutDriver", &H2Core::AudioEngine::getMidiOutDriver); + _AudioEngine.def("raiseError", &H2Core::AudioEngine::raiseError, + py::arg("nErrorCode")); + _AudioEngine.def("getState", &H2Core::AudioEngine::getState); + _AudioEngine.def("setState", &H2Core::AudioEngine::setState, + py::arg("state")); + _AudioEngine.def("setMasterPeak_L", &H2Core::AudioEngine::setMasterPeak_L, + py::arg("value")); + _AudioEngine.def("getMasterPeak_L", &H2Core::AudioEngine::getMasterPeak_L); + _AudioEngine.def("setMasterPeak_R", &H2Core::AudioEngine::setMasterPeak_R, + py::arg("value")); + _AudioEngine.def("getMasterPeak_R", &H2Core::AudioEngine::getMasterPeak_R); + _AudioEngine.def("getProcessTime", &H2Core::AudioEngine::getProcessTime); + _AudioEngine.def("getMaxProcessTime", &H2Core::AudioEngine::getMaxProcessTime); + _AudioEngine.def("getSelectedPatternNumber", &H2Core::AudioEngine::getSelectedPatternNumber); + _AudioEngine.def("setSelectedPatternNumber", &H2Core::AudioEngine::setSelectedPatternNumber, + py::arg("number")); + _AudioEngine.def("setPatternStartTick", &H2Core::AudioEngine::setPatternStartTick, + py::arg("tick")); + _AudioEngine.def("setPatternTickPosition", &H2Core::AudioEngine::setPatternTickPosition, + py::arg("tick")); + _AudioEngine.def("getPatternTickPosition", &H2Core::AudioEngine::getPatternTickPosition); + _AudioEngine.def("setSongPos", &H2Core::AudioEngine::setSongPos, + py::arg("songPos")); + _AudioEngine.def("getSongPos", &H2Core::AudioEngine::getSongPos); + _AudioEngine.def("getNextPatterns", &H2Core::AudioEngine::getNextPatterns); + _AudioEngine.def("getPlayingPatterns", &H2Core::AudioEngine::getPlayingPatterns); + _AudioEngine.def("getRealtimeFrames", &H2Core::AudioEngine::getRealtimeFrames); + _AudioEngine.def("setRealtimeFrames", &H2Core::AudioEngine::setRealtimeFrames, + py::arg("nFrames")); + _AudioEngine.def("getAddRealtimeNoteTickPosition", &H2Core::AudioEngine::getAddRealtimeNoteTickPosition); + _AudioEngine.def("setAddRealtimeNoteTickPosition", &H2Core::AudioEngine::setAddRealtimeNoteTickPosition, + py::arg("tickPosition")); + _AudioEngine.def("getCurrentTickTime", &H2Core::AudioEngine::getCurrentTickTime); + + py::class_> _Hydrogen(m, "Hydrogen"); + _Hydrogen.def_readwrite("lastMidiEvent", &H2Core::Hydrogen::lastMidiEvent); + _Hydrogen.def_readwrite("lastMidiEventParameter", &H2Core::Hydrogen::lastMidiEventParameter); + _Hydrogen.def_readwrite("m_nMaxTimeHumanize", &H2Core::Hydrogen::m_nMaxTimeHumanize); + _Hydrogen.def_static("class_name", &H2Core::Hydrogen::class_name); + _Hydrogen.def_static("create_instance", &H2Core::Hydrogen::create_instance, + "Creates all the instances used within Hydrogen in the right order."); + _Hydrogen.def_static("get_instance", &H2Core::Hydrogen::get_instance, + "Returns the current Hydrogen instance #__instance.", + py::return_value_policy::reference); + _Hydrogen.def("getAudioEngine", &H2Core::Hydrogen::getAudioEngine); + _Hydrogen.def("sequencer_play", &H2Core::Hydrogen::sequencer_play, + "Start the internal sequencer"); + _Hydrogen.def("sequencer_stop", &H2Core::Hydrogen::sequencer_stop, + "Stop the internal sequencer"); + _Hydrogen.def("midi_noteOn", &H2Core::Hydrogen::midi_noteOn, + py::arg("note")); + _Hydrogen.def("sequencer_setNextPattern", &H2Core::Hydrogen::sequencer_setNextPattern, + "Adding and removing a Pattern from #m_pNextPatterns.", + py::arg("pos")); + _Hydrogen.def("sequencer_setOnlyNextPattern", &H2Core::Hydrogen::sequencer_setOnlyNextPattern, + "Clear #m_pNextPatterns and add one Pattern.", + py::arg("pos")); + _Hydrogen.def("togglePlaysSelected", &H2Core::Hydrogen::togglePlaysSelected, + "Switches playback to focused pattern."); + _Hydrogen.def("getSong", &H2Core::Hydrogen::getSong, + "Get the current song."); + _Hydrogen.def("setSong", &H2Core::Hydrogen::setSong, + "Sets the current song #__song to newSong.", + py::arg("newSong")); + _Hydrogen.def("removeSong", &H2Core::Hydrogen::removeSong); + _Hydrogen.def("addRealtimeNote", &H2Core::Hydrogen::addRealtimeNote, + py::arg("instrument"), + py::arg("velocity"), + py::arg("fPan"), + py::arg("pitch"), + py::arg("noteoff"), + py::arg("forcePlay"), + py::arg("msg1")); + _Hydrogen.def("getTickPosition", &H2Core::Hydrogen::getTickPosition, + "Returns #m_nPatternTickPosition"); + _Hydrogen.def("getRealtimeTickPosition", &H2Core::Hydrogen::getRealtimeTickPosition, + "Keep track of the tick position in realtime."); + _Hydrogen.def("getTotalFrames", &H2Core::Hydrogen::getTotalFrames); + _Hydrogen.def("setRealtimeFrames", &H2Core::Hydrogen::setRealtimeFrames, + "Sets #m_nRealtimeFrames", + py::arg("frames")); + _Hydrogen.def("getRealtimeFrames", &H2Core::Hydrogen::getRealtimeFrames, + "Returns the current realtime transport position TransportInfo::m_nFrames."); + _Hydrogen.def("getCurrentPatternList", &H2Core::Hydrogen::getCurrentPatternList, + "Returns #m_pPlayingPatterns"); + _Hydrogen.def("setCurrentPatternList", &H2Core::Hydrogen::setCurrentPatternList, + "Sets #m_pPlayingPatterns.", + py::arg("pPatternList")); + _Hydrogen.def("getNextPatterns", &H2Core::Hydrogen::getNextPatterns, + "Returns #m_pNextPatterns"); + _Hydrogen.def("getPatternPos", &H2Core::Hydrogen::getPatternPos, + "Get the position of the current Pattern in the Song."); + _Hydrogen.def("setPatternPos", &H2Core::Hydrogen::setPatternPos, + "Relocate the position to another Pattern in the Song.", + py::arg("pos")); + _Hydrogen.def("getPosForTick", &H2Core::Hydrogen::getPosForTick, + "Returns the pattern number corresponding to the tick position TickPos.", + py::arg("TickPos"), + py::arg("nPatternStartTick")); + _Hydrogen.def("resetPatternStartTick", &H2Core::Hydrogen::resetPatternStartTick, + "Move playback in Pattern mode to the beginning of the pattern."); + _Hydrogen.def("getTickForPosition", &H2Core::Hydrogen::getTickForPosition, + "Get the total number of ticks passed up to a Pattern at position pos.", + py::arg("pos")); + _Hydrogen.def("restartDrivers", &H2Core::Hydrogen::restartDrivers); + _Hydrogen.def("getAudioOutput", &H2Core::Hydrogen::getAudioOutput); + _Hydrogen.def("getMidiInput", &H2Core::Hydrogen::getMidiInput); + _Hydrogen.def("getMidiOutput", &H2Core::Hydrogen::getMidiOutput); + _Hydrogen.def("getState", &H2Core::Hydrogen::getState, + "Returns the current state of the audio engine."); + _Hydrogen.def("loadDrumkit", py::overload_cast(&H2Core::Hydrogen::loadDrumkit), + "Wrapper around loadDrumkit( Drumkit, bool ) with the conditional argument set to true.", + py::arg("pDrumkitInfo")); + _Hydrogen.def("loadDrumkit", py::overload_cast(&H2Core::Hydrogen::loadDrumkit), + "Loads the H2Core::Drumkit provided in pDrumkitInfo into the current session.", + py::arg("pDrumkitInfo"), + py::arg("conditional")); + _Hydrogen.def("instrumentHasNotes", &H2Core::Hydrogen::instrumentHasNotes, + "Test if an Instrument has some Note in the Pattern (used to test before deleting an Instrument)", + py::arg("pInst")); + _Hydrogen.def("removeInstrument", &H2Core::Hydrogen::removeInstrument, + "Delete an Instrument. If conditional is true, and there are some Pattern that are using this Instrument, it's not deleted anyway.", + py::arg("instrumentnumber"), + py::arg("conditional")); + _Hydrogen.def("getCurrentDrumkitName", &H2Core::Hydrogen::getCurrentDrumkitName, + "Returns m_sCurrentDrumkitName"); + _Hydrogen.def("setCurrentDrumkitName", &H2Core::Hydrogen::setCurrentDrumkitName, + py::arg("sName")); + _Hydrogen.def("getCurrentDrumkitLookup", &H2Core::Hydrogen::getCurrentDrumkitLookup, + "Returns m_currentDrumkitLookup"); + _Hydrogen.def("setCurrentDrumkitLookup", &H2Core::Hydrogen::setCurrentDrumkitLookup, + py::arg("lookup")); + _Hydrogen.def("raiseError", &H2Core::Hydrogen::raiseError, + py::arg("nErrorCode")); + // [banned] _Hydrogen.def("previewSample", &H2Core::Hydrogen::previewSample, + // [banned] py::arg("pSample")); + // [banned] _Hydrogen.def("previewInstrument", &H2Core::Hydrogen::previewInstrument, + // [banned] py::arg("pInstr")); + _Hydrogen.def("onTapTempoAccelEvent", &H2Core::Hydrogen::onTapTempoAccelEvent); + _Hydrogen.def("setTapTempo", &H2Core::Hydrogen::setTapTempo, + py::arg("fInterval")); + _Hydrogen.def("setBPM", &H2Core::Hydrogen::setBPM, + "Updates the speed.", + py::arg("fBPM")); + _Hydrogen.def("restartLadspaFX", &H2Core::Hydrogen::restartLadspaFX); + _Hydrogen.def("getSelectedPatternNumber", &H2Core::Hydrogen::getSelectedPatternNumber, + "Returns #m_nSelectedPatternNumber"); + _Hydrogen.def("setSelectedPatternNumber", &H2Core::Hydrogen::setSelectedPatternNumber, + "Sets #m_nSelectedPatternNumber.", + py::arg("nPat")); + _Hydrogen.def("getSelectedInstrumentNumber", &H2Core::Hydrogen::getSelectedInstrumentNumber); + _Hydrogen.def("setSelectedInstrumentNumber", &H2Core::Hydrogen::setSelectedInstrumentNumber, + py::arg("nInstrument")); + _Hydrogen.def("refreshInstrumentParameters", &H2Core::Hydrogen::refreshInstrumentParameters, + py::arg("nInstrument")); + _Hydrogen.def("renameJackPorts", &H2Core::Hydrogen::renameJackPorts, + "Calls audioEngine_renameJackPorts() if Preferences::m_bJackTrackOuts is set to true.", + py::arg("pSong")); + _Hydrogen.def("toggleOscServer", &H2Core::Hydrogen::toggleOscServer, + "Starts/stops the OSC server", + py::arg("bEnable")); + _Hydrogen.def("recreateOscServer", &H2Core::Hydrogen::recreateOscServer, + "Destroys and recreates the OscServer singleton in order to adopt a new OSC port."); + _Hydrogen.def("startNsmClient", &H2Core::Hydrogen::startNsmClient); + _Hydrogen.def("setbeatsToCount", &H2Core::Hydrogen::setbeatsToCount, + py::arg("beatstocount")); + _Hydrogen.def("getbeatsToCount", &H2Core::Hydrogen::getbeatsToCount); + _Hydrogen.def("setNoteLength", &H2Core::Hydrogen::setNoteLength, + py::arg("notelength")); + _Hydrogen.def("getNoteLength", &H2Core::Hydrogen::getNoteLength); + _Hydrogen.def("getBcStatus", &H2Core::Hydrogen::getBcStatus); + _Hydrogen.def("handleBeatCounter", &H2Core::Hydrogen::handleBeatCounter); + _Hydrogen.def("setBcOffsetAdjust", &H2Core::Hydrogen::setBcOffsetAdjust); + _Hydrogen.def("offJackMaster", &H2Core::Hydrogen::offJackMaster, + "Calling JackAudioDriver::releaseTimebaseMaster() directly from the GUI"); + _Hydrogen.def("onJackMaster", &H2Core::Hydrogen::onJackMaster, + "Calling JackAudioDriver::initTimebaseMaster() directly from the GUI"); + _Hydrogen.def("getPatternLength", &H2Core::Hydrogen::getPatternLength, + "Get the length (in ticks) of the nPattern th pattern.", + py::arg("nPattern")); + _Hydrogen.def("getNewBpmJTM", &H2Core::Hydrogen::getNewBpmJTM, + "Returns the fallback speed."); + _Hydrogen.def("setNewBpmJTM", &H2Core::Hydrogen::setNewBpmJTM, + "Set the fallback speed #m_nNewBpmJTM.", + py::arg("bpmJTM")); + _Hydrogen.def("__panic", &H2Core::Hydrogen::__panic); + _Hydrogen.def("setTimelineBpm", &H2Core::Hydrogen::setTimelineBpm, + "Updates Song::m_fBpm, TransportInfo::m_fBPM, and #m_fNewBpmJTM to the local speed."); + _Hydrogen.def("getTimelineBpm", &H2Core::Hydrogen::getTimelineBpm, + "Returns the local speed at a specific nBar in the Timeline.", + py::arg("nBar")); + _Hydrogen.def("getTimeline", &H2Core::Hydrogen::getTimeline); + _Hydrogen.def("getIsExportSessionActive", &H2Core::Hydrogen::getIsExportSessionActive); + _Hydrogen.def("startExportSession", &H2Core::Hydrogen::startExportSession, + py::arg("rate"), + py::arg("depth")); + _Hydrogen.def("stopExportSession", &H2Core::Hydrogen::stopExportSession); + _Hydrogen.def("startExportSong", &H2Core::Hydrogen::startExportSong, + py::arg("filename")); + _Hydrogen.def("stopExportSong", &H2Core::Hydrogen::stopExportSong); + _Hydrogen.def("getCoreActionController", &H2Core::Hydrogen::getCoreActionController); + _Hydrogen.def("setPlaybackTrackState", &H2Core::Hydrogen::setPlaybackTrackState, + "*********************************************************", + py::arg("state")); + _Hydrogen.def("getPlaybackTrackState", &H2Core::Hydrogen::getPlaybackTrackState, + "Wrapper around Song::getPlaybackTrackEnabled()."); + _Hydrogen.def("loadPlaybackTrack", &H2Core::Hydrogen::loadPlaybackTrack, + "Wrapper function for loading the playback track.", + py::arg("filename")); + _Hydrogen.def("getGUIState", &H2Core::Hydrogen::getGUIState, + "Returns #m_GUIState"); + _Hydrogen.def("setGUIState", &H2Core::Hydrogen::setGUIState, + py::arg("state")); + _Hydrogen.def("calculateLeadLagFactor", &H2Core::Hydrogen::calculateLeadLagFactor, + "Calculates the lookahead for a specific tick size.", + py::arg("fTickSize")); + _Hydrogen.def("calculateLookahead", &H2Core::Hydrogen::calculateLookahead, + "Calculates time offset (in frames) used to determine the notes process by the audio engine.", + py::arg("fTickSize")); + _Hydrogen.def("haveJackAudioDriver", &H2Core::Hydrogen::haveJackAudioDriver, + "Returns Whether JackAudioDriver is used as current audio driver."); + _Hydrogen.def("haveJackTransport", &H2Core::Hydrogen::haveJackTransport, + "Returns Whether JackAudioDriver is used as current audio driver and JACK transport was activated via the GUI (#Preferences::m_bJackTransportMode)."); + _Hydrogen.def("getJackTimebaseState", &H2Core::Hydrogen::getJackTimebaseState, + "Returns Whether we haveJackTransport() and there is an external JACK timebase master broadcasting us tempo information and making use disregard Hydrogen's Timeline information (see #JackAudioDriver::m_timebaseState)."); + _Hydrogen.def("isUnderSessionManagement", &H2Core::Hydrogen::isUnderSessionManagement, + "Returns NsmClient::m_bUnderSessionManagement if NSM is supported."); + _Hydrogen.def("toQString", &H2Core::Hydrogen::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _Filesystem(m, "Filesystem"); + _Filesystem.def_static("class_name", &H2Core::Filesystem::class_name); + _Filesystem.def_static("bootstrap", &H2Core::Filesystem::bootstrap, + "check user and system filesystem usability", + py::arg("logger"), + py::arg("sys_path")); + _Filesystem.def_static("sys_data_path", &H2Core::Filesystem::sys_data_path, + "returns system data path"); + _Filesystem.def_static("usr_data_path", &H2Core::Filesystem::usr_data_path, + "returns user data path"); + // [] _Filesystem.def_static("ladspa_paths", &H2Core::Filesystem::ladspa_paths, + // [] "returns user ladspa paths"); + _Filesystem.def_static("sys_config_path", &H2Core::Filesystem::sys_config_path, + "returns system config path"); + _Filesystem.def_static("usr_config_path", &H2Core::Filesystem::usr_config_path, + "returns user config path"); + _Filesystem.def_static("empty_sample_path", &H2Core::Filesystem::empty_sample_path, + "returns system empty sample file path"); + _Filesystem.def_static("empty_song_path", &H2Core::Filesystem::empty_song_path, + "returns system empty song file path"); + _Filesystem.def_static("untitled_song_file_name", &H2Core::Filesystem::untitled_song_file_name, + "returns untitled song file name"); + _Filesystem.def_static("click_file_path", &H2Core::Filesystem::click_file_path, + "Returns a string containing the path to the _click.wav_ file used in the metronome."); + _Filesystem.def_static("usr_click_file_path", &H2Core::Filesystem::usr_click_file_path, + "returns click file path from user directory if exists, otherwise from system"); + _Filesystem.def_static("drumkit_xsd_path", &H2Core::Filesystem::drumkit_xsd_path, + "returns the path to the drumkit XSD (xml schema definition) file"); + _Filesystem.def_static("pattern_xsd_path", &H2Core::Filesystem::pattern_xsd_path, + "returns the path to the pattern XSD (xml schema definition) file"); + _Filesystem.def_static("playlist_xsd_path", &H2Core::Filesystem::playlist_xsd_path, + "returns the path to the playlist pattern XSD (xml schema definition) file"); + _Filesystem.def_static("log_file_path", &H2Core::Filesystem::log_file_path, + "returns the full path (including filename) of the logfile"); + _Filesystem.def_static("img_dir", &H2Core::Filesystem::img_dir, + "returns gui image path"); + _Filesystem.def_static("doc_dir", &H2Core::Filesystem::doc_dir, + "returns documentation path"); + _Filesystem.def_static("i18n_dir", &H2Core::Filesystem::i18n_dir, + "returns internationalization path"); + _Filesystem.def_static("scripts_dir", &H2Core::Filesystem::scripts_dir, + "returns user scripts path"); + _Filesystem.def_static("songs_dir", &H2Core::Filesystem::songs_dir, + "returns user songs path"); + _Filesystem.def_static("song_path", &H2Core::Filesystem::song_path, + "returns user song path, add file extension", + py::arg("sg_name")); + _Filesystem.def_static("patterns_dir_static", py::overload_cast<>(&H2Core::Filesystem::patterns_dir), + "returns user patterns path"); + _Filesystem.def_static("patterns_dir_static", py::overload_cast(&H2Core::Filesystem::patterns_dir), + "returns user patterns path for a specific drumkit", + py::arg("dk_name")); + _Filesystem.def_static("pattern_path", &H2Core::Filesystem::pattern_path, + "returns user patterns path, add file extension", + py::arg("dk_name"), + py::arg("p_name")); + _Filesystem.def_static("plugins_dir", &H2Core::Filesystem::plugins_dir, + "returns user plugins path"); + _Filesystem.def_static("sys_drumkits_dir", &H2Core::Filesystem::sys_drumkits_dir, + "returns system drumkits path"); + _Filesystem.def_static("usr_drumkits_dir", &H2Core::Filesystem::usr_drumkits_dir, + "returns user drumkits path"); + _Filesystem.def_static("playlists_dir", &H2Core::Filesystem::playlists_dir, + "returns user playlist path"); + _Filesystem.def_static("playlist_path", &H2Core::Filesystem::playlist_path, + "returns user playlist path, add file extension", + py::arg("pl_name")); + _Filesystem.def_static("untitled_playlist_file_name", &H2Core::Filesystem::untitled_playlist_file_name, + "returns untitled playlist file name"); + _Filesystem.def_static("cache_dir", &H2Core::Filesystem::cache_dir, + "returns user cache path"); + _Filesystem.def_static("repositories_cache_dir", &H2Core::Filesystem::repositories_cache_dir, + "returns user repository cache path"); + _Filesystem.def_static("demos_dir", &H2Core::Filesystem::demos_dir, + "returns system demos path"); + _Filesystem.def_static("xsd_dir", &H2Core::Filesystem::xsd_dir, + "returns system xsd path"); + _Filesystem.def_static("tmp_dir", &H2Core::Filesystem::tmp_dir, + "returns temp path"); + _Filesystem.def_static("tmp_file_path", &H2Core::Filesystem::tmp_file_path, + "touch a temporary file under tmp_dir() and return it's path. if base has a suffix it will be preserved, spaces will be replaced by underscores.", + py::arg("base")); + _Filesystem.def_static("prepare_sample_path", &H2Core::Filesystem::prepare_sample_path, + "Returns the basename if the given path is under an existing user or system drumkit path, otherwise the given fname", + py::arg("fname")); + _Filesystem.def_static("file_is_under_drumkit", &H2Core::Filesystem::file_is_under_drumkit, + "Checks if the given filepath is under an existing user or system drumkit path, not the existence of the file", + py::arg("fname")); + _Filesystem.def_static("get_basename_idx_under_drumkit", &H2Core::Filesystem::get_basename_idx_under_drumkit, + "Returns the index of the basename if the given path is under an existing user or system drumkit path, otherwise -1", + py::arg("fname")); + // [] _Filesystem.def_static("sys_drumkit_list", &H2Core::Filesystem::sys_drumkit_list, + // [] "returns list of usable system drumkits ( see Filesystem::drumkit_list )"); + // [] _Filesystem.def_static("usr_drumkit_list", &H2Core::Filesystem::usr_drumkit_list, + // [] "returns list of usable user drumkits ( see Filesystem::drumkit_list )"); + _Filesystem.def_static("drumkit_exists", &H2Core::Filesystem::drumkit_exists, + "returns true if the drumkit exists within usable system or user drumkits", + py::arg("dk_name")); + _Filesystem.def_static("drumkit_usr_path", &H2Core::Filesystem::drumkit_usr_path, + "returns path for a drumkit within user drumkit path", + py::arg("dk_name")); + _Filesystem.def_static("drumkit_path_search", &H2Core::Filesystem::drumkit_path_search, + "Returns the path to a H2Core::Drumkit folder.", + py::arg("dk_name"), + py::arg("lookup"), + py::arg("bSilent")); + _Filesystem.def_static("drumkit_dir_search", &H2Core::Filesystem::drumkit_dir_search, + "returns the directory holding the named drumkit searching within user then system drumkits", + py::arg("dk_name"), + py::arg("lookup")); + _Filesystem.def_static("drumkit_valid", &H2Core::Filesystem::drumkit_valid, + "returns true if the path contains a usable drumkit", + py::arg("dk_path")); + _Filesystem.def_static("drumkit_file", &H2Core::Filesystem::drumkit_file, + "returns the path to the xml file within a supposed drumkit path", + py::arg("dk_path")); + // [] _Filesystem.def_static("pattern_drumkits", &H2Core::Filesystem::pattern_drumkits, + // [] "returns a list of existing drumkit sub dir into the patterns directory"); + // [] _Filesystem.def_static("pattern_list_static", py::overload_cast<>(&H2Core::Filesystem::pattern_list), + // [] "returns a list of existing patterns"); + // [] _Filesystem.def_static("pattern_list_static", py::overload_cast(&H2Core::Filesystem::pattern_list), + // [] "returns a list of existing patterns", + // [] py::arg("path")); + // [] _Filesystem.def_static("song_list", &H2Core::Filesystem::song_list, + // [] "returns a list of existing songs"); + // [] _Filesystem.def_static("song_list_cleared", &H2Core::Filesystem::song_list_cleared, + // [] "returns a list of existing songs, excluding the autosaved one"); + _Filesystem.def_static("song_exists", &H2Core::Filesystem::song_exists, + "returns true if the song file exists", + py::arg("sg_name")); + _Filesystem.def_static("info", &H2Core::Filesystem::info, + "send current settings information to logger with INFO severity"); + // [] _Filesystem.def_static("playlist_list", &H2Core::Filesystem::playlist_list, + // [] "returns a list of existing playlists"); + _Filesystem.def_static("file_exists", &H2Core::Filesystem::file_exists, + "returns true if the given path is an existing regular file", + py::arg("path"), + py::arg("silent")); + _Filesystem.def_static("file_readable", &H2Core::Filesystem::file_readable, + "returns true if the given path is an existing readable regular file", + py::arg("path"), + py::arg("silent")); + _Filesystem.def_static("file_writable", &H2Core::Filesystem::file_writable, + "returns true if the given path is a possibly writable file (may exist or not)", + py::arg("path"), + py::arg("silent")); + _Filesystem.def_static("file_executable", &H2Core::Filesystem::file_executable, + "returns true if the given path is an existing executable regular file", + py::arg("path"), + py::arg("silent")); + _Filesystem.def_static("dir_readable", &H2Core::Filesystem::dir_readable, + "returns true if the given path is a readable regular directory", + py::arg("path"), + py::arg("silent")); + _Filesystem.def_static("dir_writable", &H2Core::Filesystem::dir_writable, + "returns true if the given path is a writable regular directory", + py::arg("path"), + py::arg("silent")); + _Filesystem.def_static("path_usable", &H2Core::Filesystem::path_usable, + "returns true if the path is a readable and writable regular directory, create if it not exists", + py::arg("path"), + py::arg("create"), + py::arg("silent")); + _Filesystem.def_static("write_to_file", &H2Core::Filesystem::write_to_file, + "writes to a file", + py::arg("dst"), + py::arg("content")); + _Filesystem.def_static("file_copy", &H2Core::Filesystem::file_copy, + "copy a source file to a destination", + py::arg("src"), + py::arg("dst"), + py::arg("overwrite")); + _Filesystem.def_static("rm", &H2Core::Filesystem::rm, + "remove a path", + py::arg("path"), + py::arg("recursive")); + _Filesystem.def_static("mkdir", &H2Core::Filesystem::mkdir, + "create a path", + py::arg("path")); + _Filesystem.def_static("getPreferencesOverwritePath", &H2Core::Filesystem::getPreferencesOverwritePath, + "Returns m_sPreferencesOverwritePath"); + _Filesystem.def_static("setPreferencesOverwritePath", &H2Core::Filesystem::setPreferencesOverwritePath, + py::arg("sPath")); + + py::class_> _Song(m, "Song"); + _Song.def(py::init()); + _Song.def_static("class_name", &H2Core::Song::class_name); + _Song.def_static("getEmptySong", &H2Core::Song::getEmptySong); + _Song.def_static("getDefaultSong", &H2Core::Song::getDefaultSong); + _Song.def("getIsMuted", &H2Core::Song::getIsMuted); + _Song.def("setIsMuted", &H2Core::Song::setIsMuted, + py::arg("bIsMuted")); + _Song.def("getResolution", &H2Core::Song::getResolution); + _Song.def("setResolution", &H2Core::Song::setResolution, + py::arg("resolution")); + _Song.def("getBpm", &H2Core::Song::getBpm); + _Song.def("setBpm", &H2Core::Song::setBpm, + py::arg("fBpm")); + _Song.def("getName", &H2Core::Song::getName); + _Song.def("setName", &H2Core::Song::setName, + py::arg("sName")); + _Song.def("setVolume", &H2Core::Song::setVolume, + py::arg("fValue")); + _Song.def("getVolume", &H2Core::Song::getVolume); + _Song.def("setMetronomeVolume", &H2Core::Song::setMetronomeVolume, + py::arg("fValue")); + _Song.def("getMetronomeVolume", &H2Core::Song::getMetronomeVolume); + _Song.def("getPatternList", &H2Core::Song::getPatternList); + _Song.def("setPatternList", &H2Core::Song::setPatternList, + py::arg("pList")); + _Song.def("getPatternGroupVector", py::overload_cast<>(&H2Core::Song::getPatternGroupVector), + "Return a pointer to a vector storing all Pattern present in the Song."); + _Song.def("getPatternGroupVector", py::overload_cast<>(&H2Core::Song::getPatternGroupVector), + "Return a pointer to a vector storing all Pattern present in the Song."); + _Song.def("setPatternGroupVector", &H2Core::Song::setPatternGroupVector, + "Sets the vector storing all Pattern present in the Song #m_pPatternGroupSequence.", + py::arg("pGroupVector")); + _Song.def("lengthInTicks", &H2Core::Song::lengthInTicks, + "get the length of the song, in tick units"); + _Song.def_static("load", &H2Core::Song::load, + py::arg("sFilename")); + _Song.def("save", &H2Core::Song::save, + py::arg("sFilename")); + _Song.def("purgeInstrument", &H2Core::Song::purgeInstrument, + "Remove all the notes in the song that play on instrument I. The function is real-time safe (it locks the audio data while deleting notes)", + py::arg("pInstr")); + _Song.def("getInstrumentList", &H2Core::Song::getInstrumentList); + _Song.def("setInstrumentList", &H2Core::Song::setInstrumentList, + py::arg("pList")); + _Song.def("setNotes", &H2Core::Song::setNotes, + py::arg("sNotes")); + _Song.def("getNotes", &H2Core::Song::getNotes); + _Song.def("setLicense", &H2Core::Song::setLicense, + py::arg("sLicense")); + _Song.def("getLicense", &H2Core::Song::getLicense); + _Song.def("setAuthor", &H2Core::Song::setAuthor, + py::arg("sAuthor")); + _Song.def("getAuthor", &H2Core::Song::getAuthor); + _Song.def("getFilename", &H2Core::Song::getFilename); + _Song.def("setFilename", &H2Core::Song::setFilename, + py::arg("sFilename")); + _Song.def("getIsLoopEnabled", &H2Core::Song::getIsLoopEnabled); + _Song.def("setIsLoopEnabled", &H2Core::Song::setIsLoopEnabled, + py::arg("bEnabled")); + _Song.def("getHumanizeTimeValue", &H2Core::Song::getHumanizeTimeValue); + _Song.def("setHumanizeTimeValue", &H2Core::Song::setHumanizeTimeValue, + py::arg("fValue")); + _Song.def("getHumanizeVelocityValue", &H2Core::Song::getHumanizeVelocityValue); + _Song.def("setHumanizeVelocityValue", &H2Core::Song::setHumanizeVelocityValue, + py::arg("fValue")); + _Song.def("getSwingFactor", &H2Core::Song::getSwingFactor); + _Song.def("setSwingFactor", &H2Core::Song::setSwingFactor, + py::arg("fFactor")); + _Song.def("getMode", &H2Core::Song::getMode); + _Song.def("setMode", &H2Core::Song::setMode, + py::arg("mode")); + _Song.def("setIsModified", &H2Core::Song::setIsModified, + py::arg("bIsModified")); + _Song.def("getIsModified", &H2Core::Song::getIsModified); + _Song.def("getComponents", &H2Core::Song::getComponents); + _Song.def("getVelocityAutomationPath", &H2Core::Song::getVelocityAutomationPath); + _Song.def("getComponent", &H2Core::Song::getComponent, + py::arg("nID")); + _Song.def("readTempPatternList", &H2Core::Song::readTempPatternList, + py::arg("sFilename")); + _Song.def("writeTempPatternList", &H2Core::Song::writeTempPatternList, + py::arg("sFilename")); + _Song.def("copyInstrumentLineToString", &H2Core::Song::copyInstrumentLineToString, + py::arg("nSelectedPattern"), + py::arg("selectedInstrument")); + _Song.def("pasteInstrumentLineFromString", &H2Core::Song::pasteInstrumentLineFromString, + py::arg("sSerialized"), + py::arg("nSelectedPattern"), + py::arg("nSelectedInstrument"), + py::arg("pPatterns")); + _Song.def("getLatestRoundRobin", &H2Core::Song::getLatestRoundRobin, + py::arg("fStartVelocity")); + _Song.def("setLatestRoundRobin", &H2Core::Song::setLatestRoundRobin, + py::arg("fStartVelocity"), + py::arg("nLatestRoundRobin")); + _Song.def("getPlaybackTrackFilename", &H2Core::Song::getPlaybackTrackFilename, + "Returns #m_sPlaybackTrackFilename"); + _Song.def("setPlaybackTrackFilename", &H2Core::Song::setPlaybackTrackFilename, + py::arg("sFilename")); + _Song.def("getPlaybackTrackEnabled", &H2Core::Song::getPlaybackTrackEnabled, + "Returns #m_bPlaybackTrackEnabled"); + _Song.def("setPlaybackTrackEnabled", &H2Core::Song::setPlaybackTrackEnabled, + "Specifies whether a playback track should be used.", + py::arg("bEnabled")); + _Song.def("getPlaybackTrackVolume", &H2Core::Song::getPlaybackTrackVolume, + "Returns #m_fPlaybackTrackVolume"); + _Song.def("setPlaybackTrackVolume", &H2Core::Song::setPlaybackTrackVolume, + py::arg("fVolume")); + _Song.def("getActionMode", &H2Core::Song::getActionMode); + _Song.def("setActionMode", &H2Core::Song::setActionMode, + py::arg("actionMode")); + _Song.def("hasMissingSamples", &H2Core::Song::hasMissingSamples, + "Song was incompletely loaded from file (missing samples)"); + _Song.def("clearMissingSamples", &H2Core::Song::clearMissingSamples); + _Song.def("setPanLawType", &H2Core::Song::setPanLawType, + py::arg("nPanLawType")); + _Song.def("getPanLawType", &H2Core::Song::getPanLawType); + _Song.def("setPanLawKNorm", &H2Core::Song::setPanLawKNorm, + py::arg("fKNorm")); + _Song.def("getPanLawKNorm", &H2Core::Song::getPanLawKNorm); + _Song.def("toQString", &H2Core::Song::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + _Song.def("__repr__", + [](const H2Core::Song & song) { + return ""; +} +); + + py::class_> _AutomationPath(m, "AutomationPath"); + _AutomationPath.def(py::init()); + _AutomationPath.def_static("class_name", &H2Core::AutomationPath::class_name); + _AutomationPath.def("empty", &H2Core::AutomationPath::empty); + _AutomationPath.def("get_min", &H2Core::AutomationPath::get_min); + _AutomationPath.def("get_max", &H2Core::AutomationPath::get_max); + _AutomationPath.def("get_default", &H2Core::AutomationPath::get_default); + _AutomationPath.def("get_value", &H2Core::AutomationPath::get_value, + py::arg("x")); + _AutomationPath.def("add_point", &H2Core::AutomationPath::add_point, + py::arg("x"), + py::arg("y")); + _AutomationPath.def("remove_point", &H2Core::AutomationPath::remove_point, + py::arg("x")); + // [] _AutomationPath.def("begin", py::overload_cast<>(&H2Core::AutomationPath::begin)); + // [] _AutomationPath.def("begin", py::overload_cast<>(&H2Core::AutomationPath::begin)); + // [] _AutomationPath.def("end", py::overload_cast<>(&H2Core::AutomationPath::end)); + // [] _AutomationPath.def("end", py::overload_cast<>(&H2Core::AutomationPath::end)); + // [] _AutomationPath.def("find", &H2Core::AutomationPath::find, + // [] py::arg("x")); + // [] _AutomationPath.def("move", &H2Core::AutomationPath::move, + // [] py::arg("in"), + // [] py::arg("x"), + // [] py::arg("y")); + _AutomationPath.def("toQString", &H2Core::AutomationPath::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _Pattern(m, "Pattern"); + _Pattern.def(py::init()); + _Pattern.def(py::init()); + _Pattern.def_static("class_name", &H2Core::Pattern::class_name); + _Pattern.def_static("load_file", &H2Core::Pattern::load_file, + "load a pattern from a file", + py::arg("pattern_path"), + py::arg("instruments")); + _Pattern.def("save_file", &H2Core::Pattern::save_file, + "save a pattern into an xml file", + py::arg("drumkit_name"), + py::arg("author"), + py::arg("license"), + py::arg("pattern_path"), + py::arg("overwrite")); + _Pattern.def("set_name", &H2Core::Pattern::set_name, + py::arg("name")); + _Pattern.def("get_name", &H2Core::Pattern::get_name); + _Pattern.def("set_category", &H2Core::Pattern::set_category, + py::arg("category")); + _Pattern.def("set_info", &H2Core::Pattern::set_info, + py::arg("info")); + _Pattern.def("get_info", &H2Core::Pattern::get_info); + _Pattern.def("get_category", &H2Core::Pattern::get_category); + _Pattern.def("set_length", &H2Core::Pattern::set_length, + py::arg("length")); + _Pattern.def("get_length", &H2Core::Pattern::get_length); + _Pattern.def("set_denominator", &H2Core::Pattern::set_denominator, + py::arg("denominator")); + _Pattern.def("get_denominator", &H2Core::Pattern::get_denominator); + // [] _Pattern.def("get_notes", &H2Core::Pattern::get_notes); + // [] _Pattern.def("get_virtual_patterns", &H2Core::Pattern::get_virtual_patterns); + // [] _Pattern.def("get_flattened_virtual_patterns", &H2Core::Pattern::get_flattened_virtual_patterns); + _Pattern.def("insert_note", &H2Core::Pattern::insert_note, + "insert a new note within __notes", + py::arg("note")); + // [banned] _Pattern.def("find_note", py::overload_cast, bool>(&H2Core::Pattern::find_note), + // [banned] "search for a note at a given index within __notes which correspond to the given arguments", + // [banned] py::arg("idx_a"), + // [banned] py::arg("idx_b"), + // [banned] py::arg("instrument"), + // [banned] py::arg("strict")); + // [banned] _Pattern.def("find_note", py::overload_cast, Note::Key, Note::Octave, bool>(&H2Core::Pattern::find_note), + // [banned] "search for a note at a given index within __notes which correspond to the given arguments", + // [banned] py::arg("idx_a"), + // [banned] py::arg("idx_b"), + // [banned] py::arg("instrument"), + // [banned] py::arg("key"), + // [banned] py::arg("octave"), + // [banned] py::arg("strict")); + _Pattern.def("remove_note", &H2Core::Pattern::remove_note, + "removes a given note from __notes, it's not deleted", + py::arg("note")); + _Pattern.def("references", &H2Core::Pattern::references, + "check if this pattern contains a note referencing the given instrument", + py::arg("instr")); + _Pattern.def("purge_instrument", &H2Core::Pattern::purge_instrument, + "delete the notes referencing the given instrument The function is thread safe (it locks the audio data while deleting notes)", + py::arg("instr")); + _Pattern.def("set_to_old", &H2Core::Pattern::set_to_old, + "mark all notes as old"); + _Pattern.def("virtual_patterns_empty", &H2Core::Pattern::virtual_patterns_empty); + _Pattern.def("virtual_patterns_clear", &H2Core::Pattern::virtual_patterns_clear); + _Pattern.def("virtual_patterns_add", &H2Core::Pattern::virtual_patterns_add, + "add a pattern to __virtual_patterns", + py::arg("pattern")); + _Pattern.def("virtual_patterns_del", &H2Core::Pattern::virtual_patterns_del, + "remove a pattern from virtual_pattern set, flattened virtual patterns have to be rebuilt", + py::arg("pattern")); + _Pattern.def("flattened_virtual_patterns_clear", &H2Core::Pattern::flattened_virtual_patterns_clear); + _Pattern.def("flattened_virtual_patterns_compute", &H2Core::Pattern::flattened_virtual_patterns_compute, + "compute virtual_pattern_transitive_closure_set based on virtual_pattern_transitive_closure_set virtual_pattern_transitive_closure_set must have been cleared before which is the case is called from PatternList::compute_flattened_virtual_patterns"); + _Pattern.def("extand_with_flattened_virtual_patterns", &H2Core::Pattern::extand_with_flattened_virtual_patterns, + "add content of __flatteened_virtual_patterns into patterns", + py::arg("patterns")); + _Pattern.def("save_to", &H2Core::Pattern::save_to, + "save the pattern within the given XMLNode", + py::arg("node"), + py::arg("instrumentOnly")); + _Pattern.def("toQString", &H2Core::Pattern::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _Playlist(m, "Playlist"); + _Playlist.def_static("class_name", &H2Core::Playlist::class_name); + _Playlist.def_static("create_instance", &H2Core::Playlist::create_instance, + "If #__instance equals 0, a new Playlist singleton will be created and stored in it."); + _Playlist.def_static("get_instance", &H2Core::Playlist::get_instance, + "Returns a pointer to the current Playlist singleton stored in #__instance."); + _Playlist.def("activateSong", &H2Core::Playlist::activateSong, + py::arg("SongNumber")); + _Playlist.def("size", &H2Core::Playlist::size); + _Playlist.def("get", &H2Core::Playlist::get, + py::arg("idx")); + _Playlist.def("clear", &H2Core::Playlist::clear); + _Playlist.def("add", &H2Core::Playlist::add, + py::arg("entry")); + _Playlist.def("setNextSongByNumber", &H2Core::Playlist::setNextSongByNumber, + py::arg("SongNumber")); + _Playlist.def("getSelectedSongNr", &H2Core::Playlist::getSelectedSongNr); + _Playlist.def("setSelectedSongNr", &H2Core::Playlist::setSelectedSongNr, + py::arg("songNumber")); + _Playlist.def("getActiveSongNumber", &H2Core::Playlist::getActiveSongNumber); + _Playlist.def("setActiveSongNumber", &H2Core::Playlist::setActiveSongNumber, + py::arg("ActiveSongNumber")); + _Playlist.def("getSongFilenameByNumber", &H2Core::Playlist::getSongFilenameByNumber, + py::arg("songNumber"), + py::arg("fileName")); + _Playlist.def("getFilename", &H2Core::Playlist::getFilename); + _Playlist.def("setFilename", &H2Core::Playlist::setFilename, + py::arg("filename")); + _Playlist.def("getIsModified", &H2Core::Playlist::getIsModified); + _Playlist.def("setIsModified", &H2Core::Playlist::setIsModified, + py::arg("IsModified")); + _Playlist.def_static("load", &H2Core::Playlist::load, + py::arg("filename"), + py::arg("useRelativePaths")); + _Playlist.def_static("load_file", &H2Core::Playlist::load_file, + py::arg("pl_path"), + py::arg("useRelativePaths")); + _Playlist.def("save_file", &H2Core::Playlist::save_file, + py::arg("pl_path"), + py::arg("name"), + py::arg("overwrite"), + py::arg("useRelativePaths")); + _Playlist.def("toQString", &H2Core::Playlist::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _Preferences(m, "Preferences"); + _Preferences.def_readwrite("__lastspatternDirectory", &H2Core::Preferences::__lastspatternDirectory); + _Preferences.def_readwrite("__lastsampleDirectory", &H2Core::Preferences::__lastsampleDirectory); + _Preferences.def_readwrite("__playsamplesonclicking", &H2Core::Preferences::__playsamplesonclicking); + _Preferences.def_readwrite("__playselectedinstrument", &H2Core::Preferences::__playselectedinstrument); + _Preferences.def_readwrite("m_bFollowPlayhead", &H2Core::Preferences::m_bFollowPlayhead); + _Preferences.def_readwrite("m_brestartLash", &H2Core::Preferences::m_brestartLash); + _Preferences.def_readwrite("m_bsetLash", &H2Core::Preferences::m_bsetLash); + _Preferences.def_readwrite("__expandSongItem", &H2Core::Preferences::__expandSongItem); + _Preferences.def_readwrite("__expandPatternItem", &H2Core::Preferences::__expandPatternItem); + _Preferences.def_readwrite("m_bbc", &H2Core::Preferences::m_bbc); + _Preferences.def_readwrite("m_mmcsetplay", &H2Core::Preferences::m_mmcsetplay); + _Preferences.def_readwrite("m_countOffset", &H2Core::Preferences::m_countOffset); + _Preferences.def_readwrite("m_startOffset", &H2Core::Preferences::m_startOffset); + _Preferences.def_readwrite("sServerList", &H2Core::Preferences::sServerList); + _Preferences.def_readwrite("m_patternCategories", &H2Core::Preferences::m_patternCategories); + _Preferences.def_readwrite("m_sAudioDriver", &H2Core::Preferences::m_sAudioDriver); + _Preferences.def_readwrite("m_bUseMetronome", &H2Core::Preferences::m_bUseMetronome); + _Preferences.def_readwrite("m_fMetronomeVolume", &H2Core::Preferences::m_fMetronomeVolume); + _Preferences.def_readwrite("m_nMaxNotes", &H2Core::Preferences::m_nMaxNotes); + _Preferences.def_readwrite("m_nBufferSize", &H2Core::Preferences::m_nBufferSize); + _Preferences.def_readwrite("m_nSampleRate", &H2Core::Preferences::m_nSampleRate); + _Preferences.def_readwrite("m_sOSSDevice", &H2Core::Preferences::m_sOSSDevice); + _Preferences.def_readwrite("m_sMidiDriver", &H2Core::Preferences::m_sMidiDriver); + _Preferences.def_readwrite("m_sMidiPortName", &H2Core::Preferences::m_sMidiPortName); + _Preferences.def_readwrite("m_sMidiOutputPortName", &H2Core::Preferences::m_sMidiOutputPortName); + _Preferences.def_readwrite("m_nMidiChannelFilter", &H2Core::Preferences::m_nMidiChannelFilter); + _Preferences.def_readwrite("m_bMidiNoteOffIgnore", &H2Core::Preferences::m_bMidiNoteOffIgnore); + _Preferences.def_readwrite("m_bMidiFixedMapping", &H2Core::Preferences::m_bMidiFixedMapping); + _Preferences.def_readwrite("m_bMidiDiscardNoteAfterAction", &H2Core::Preferences::m_bMidiDiscardNoteAfterAction); + _Preferences.def_readwrite("m_bEnableMidiFeedback", &H2Core::Preferences::m_bEnableMidiFeedback); + _Preferences.def_readwrite("m_bOscServerEnabled", &H2Core::Preferences::m_bOscServerEnabled); + _Preferences.def_readwrite("m_bOscFeedbackEnabled", &H2Core::Preferences::m_bOscFeedbackEnabled); + _Preferences.def_readwrite("m_nOscTemporaryPort", &H2Core::Preferences::m_nOscTemporaryPort); + _Preferences.def_readwrite("m_nOscServerPort", &H2Core::Preferences::m_nOscServerPort); + _Preferences.def_readwrite("m_sAlsaAudioDevice", &H2Core::Preferences::m_sAlsaAudioDevice); + _Preferences.def_readwrite("m_sJackPortName1", &H2Core::Preferences::m_sJackPortName1); + _Preferences.def_readwrite("m_sJackPortName2", &H2Core::Preferences::m_sJackPortName2); + _Preferences.def_readwrite("m_bJackTransportMode", &H2Core::Preferences::m_bJackTransportMode); + _Preferences.def_readwrite("m_bJackConnectDefaults", &H2Core::Preferences::m_bJackConnectDefaults); + _Preferences.def_readwrite("m_bJackTrackOuts", &H2Core::Preferences::m_bJackTrackOuts); + _Preferences.def_readwrite("m_JackTrackOutputMode", &H2Core::Preferences::m_JackTrackOutputMode); + _Preferences.def_readwrite("m_bJackTimebaseEnabled", &H2Core::Preferences::m_bJackTimebaseEnabled); + _Preferences.def_readwrite("m_JackBBTSync", &H2Core::Preferences::m_JackBBTSync); + _Preferences.def_readwrite("m_bJackMasterMode", &H2Core::Preferences::m_bJackMasterMode); + _Preferences.def_readwrite("m_sDefaultEditor", &H2Core::Preferences::m_sDefaultEditor); + _Preferences.def_readwrite("m_rubberBandCLIexecutable", &H2Core::Preferences::m_rubberBandCLIexecutable); + _Preferences.def_static("class_name", &H2Core::Preferences::class_name); + _Preferences.def_static("create_instance", &H2Core::Preferences::create_instance, + "If #__instance equals 0, a new Preferences singleton will be created and stored in it."); + _Preferences.def_static("get_instance", &H2Core::Preferences::get_instance, + "Returns a pointer to the current Preferences singleton stored in #__instance."); + _Preferences.def("loadPreferences", &H2Core::Preferences::loadPreferences, + "Load the preferences file", + py::arg("bGlobal")); + _Preferences.def("savePreferences", &H2Core::Preferences::savePreferences, + "Save the preferences file"); + // [banned] _Preferences.def("getDataDirectory", &H2Core::Preferences::getDataDirectory); + _Preferences.def("getDefaultEditor", &H2Core::Preferences::getDefaultEditor); + _Preferences.def("setDefaultEditor", &H2Core::Preferences::setDefaultEditor, + py::arg("editor")); + _Preferences.def("getDefaultUILayout", &H2Core::Preferences::getDefaultUILayout); + _Preferences.def("setDefaultUILayout", &H2Core::Preferences::setDefaultUILayout, + py::arg("layout")); + _Preferences.def("getUIScalingPolicy", &H2Core::Preferences::getUIScalingPolicy); + _Preferences.def("setUIScalingPolicy", &H2Core::Preferences::setUIScalingPolicy, + py::arg("nPolicy")); + _Preferences.def("getPreferredLanguage", &H2Core::Preferences::getPreferredLanguage); + _Preferences.def("setPreferredLanguage", &H2Core::Preferences::setPreferredLanguage, + py::arg("sLanguage")); + _Preferences.def("setRestoreLastSongEnabled", &H2Core::Preferences::setRestoreLastSongEnabled, + py::arg("restore")); + _Preferences.def("setRestoreLastPlaylistEnabled", &H2Core::Preferences::setRestoreLastPlaylistEnabled, + py::arg("restore")); + _Preferences.def("setUseRelativeFilenamesForPlaylists", &H2Core::Preferences::setUseRelativeFilenamesForPlaylists, + py::arg("value")); + _Preferences.def("setShowDevelWarning", &H2Core::Preferences::setShowDevelWarning, + py::arg("value")); + _Preferences.def("getShowDevelWarning", &H2Core::Preferences::getShowDevelWarning); + _Preferences.def("getShowNoteOverwriteWarning", &H2Core::Preferences::getShowNoteOverwriteWarning); + _Preferences.def("setShowNoteOverwriteWarning", &H2Core::Preferences::setShowNoteOverwriteWarning, + py::arg("bValue")); + _Preferences.def("isRestoreLastSongEnabled", &H2Core::Preferences::isRestoreLastSongEnabled); + _Preferences.def("isRestoreLastPlaylistEnabled", &H2Core::Preferences::isRestoreLastPlaylistEnabled); + _Preferences.def("isPlaylistUsingRelativeFilenames", &H2Core::Preferences::isPlaylistUsingRelativeFilenames); + _Preferences.def("setLastSongFilename", &H2Core::Preferences::setLastSongFilename, + py::arg("filename")); + _Preferences.def("getLastSongFilename", &H2Core::Preferences::getLastSongFilename); + _Preferences.def("setLastPlaylistFilename", &H2Core::Preferences::setLastPlaylistFilename, + py::arg("filename")); + _Preferences.def("getLastPlaylistFilename", &H2Core::Preferences::getLastPlaylistFilename); + _Preferences.def("setHearNewNotes", &H2Core::Preferences::setHearNewNotes, + py::arg("value")); + _Preferences.def("getHearNewNotes", &H2Core::Preferences::getHearNewNotes); + _Preferences.def("setRecordEvents", &H2Core::Preferences::setRecordEvents, + py::arg("value")); + _Preferences.def("getRecordEvents", &H2Core::Preferences::getRecordEvents); + _Preferences.def("setPunchInPos", &H2Core::Preferences::setPunchInPos, + py::arg("pos")); + _Preferences.def("getPunchInPos", &H2Core::Preferences::getPunchInPos); + _Preferences.def("setPunchOutPos", &H2Core::Preferences::setPunchOutPos, + py::arg("pos")); + _Preferences.def("getPunchOutPos", &H2Core::Preferences::getPunchOutPos); + _Preferences.def("inPunchArea", &H2Core::Preferences::inPunchArea, + py::arg("pos")); + _Preferences.def("unsetPunchArea", &H2Core::Preferences::unsetPunchArea); + _Preferences.def("setQuantizeEvents", &H2Core::Preferences::setQuantizeEvents, + py::arg("value")); + _Preferences.def("getQuantizeEvents", &H2Core::Preferences::getQuantizeEvents); + _Preferences.def("getRecentFiles", &H2Core::Preferences::getRecentFiles); + _Preferences.def("setRecentFiles", &H2Core::Preferences::setRecentFiles, + py::arg("recentFiles")); + _Preferences.def("insertRecentFile", &H2Core::Preferences::insertRecentFile, + py::arg("sFilename")); + _Preferences.def("getRecentFX", &H2Core::Preferences::getRecentFX); + _Preferences.def("setMostRecentFX", &H2Core::Preferences::setMostRecentFX, + py::arg("")); + _Preferences.def("getQTStyle", &H2Core::Preferences::getQTStyle); + _Preferences.def("setQTStyle", &H2Core::Preferences::setQTStyle, + py::arg("sStyle")); + _Preferences.def("getApplicationFontFamily", &H2Core::Preferences::getApplicationFontFamily); + _Preferences.def("setApplicationFontFamily", &H2Core::Preferences::setApplicationFontFamily, + py::arg("family")); + _Preferences.def("getLevel2FontFamily", &H2Core::Preferences::getLevel2FontFamily); + _Preferences.def("setLevel2FontFamily", &H2Core::Preferences::setLevel2FontFamily, + py::arg("family")); + _Preferences.def("getLevel3FontFamily", &H2Core::Preferences::getLevel3FontFamily); + _Preferences.def("setLevel3FontFamily", &H2Core::Preferences::setLevel3FontFamily, + py::arg("family")); + _Preferences.def("getFontSize", &H2Core::Preferences::getFontSize); + _Preferences.def("setFontSize", &H2Core::Preferences::setFontSize, + py::arg("fontSize")); + _Preferences.def("getMixerFalloffSpeed", &H2Core::Preferences::getMixerFalloffSpeed); + _Preferences.def("setMixerFalloffSpeed", &H2Core::Preferences::setMixerFalloffSpeed, + py::arg("value")); + _Preferences.def("showInstrumentPeaks", &H2Core::Preferences::showInstrumentPeaks); + _Preferences.def("setInstrumentPeaks", &H2Core::Preferences::setInstrumentPeaks, + py::arg("value")); + _Preferences.def("getPatternEditorGridResolution", &H2Core::Preferences::getPatternEditorGridResolution); + _Preferences.def("setPatternEditorGridResolution", &H2Core::Preferences::setPatternEditorGridResolution, + py::arg("value")); + _Preferences.def("isPatternEditorUsingTriplets", &H2Core::Preferences::isPatternEditorUsingTriplets); + _Preferences.def("setPatternEditorUsingTriplets", &H2Core::Preferences::setPatternEditorUsingTriplets, + py::arg("value")); + _Preferences.def("isFXTabVisible", &H2Core::Preferences::isFXTabVisible); + _Preferences.def("setFXTabVisible", &H2Core::Preferences::setFXTabVisible, + py::arg("value")); + _Preferences.def("getShowAutomationArea", &H2Core::Preferences::getShowAutomationArea); + _Preferences.def("setShowAutomationArea", &H2Core::Preferences::setShowAutomationArea, + py::arg("value")); + _Preferences.def("getPatternEditorGridHeight", &H2Core::Preferences::getPatternEditorGridHeight); + _Preferences.def("setPatternEditorGridHeight", &H2Core::Preferences::setPatternEditorGridHeight, + py::arg("value")); + _Preferences.def("getPatternEditorGridWidth", &H2Core::Preferences::getPatternEditorGridWidth); + _Preferences.def("setPatternEditorGridWidth", &H2Core::Preferences::setPatternEditorGridWidth, + py::arg("value")); + _Preferences.def("getSongEditorGridHeight", &H2Core::Preferences::getSongEditorGridHeight); + _Preferences.def("setSongEditorGridHeight", &H2Core::Preferences::setSongEditorGridHeight, + py::arg("value")); + _Preferences.def("getSongEditorGridWidth", &H2Core::Preferences::getSongEditorGridWidth); + _Preferences.def("setSongEditorGridWidth", &H2Core::Preferences::setSongEditorGridWidth, + py::arg("value")); + _Preferences.def("setColoringMethod", &H2Core::Preferences::setColoringMethod, + py::arg("value")); + _Preferences.def("getColoringMethod", &H2Core::Preferences::getColoringMethod); + _Preferences.def("setPatternColors", &H2Core::Preferences::setPatternColors, + py::arg("patternColors")); + _Preferences.def("getPatternColors", &H2Core::Preferences::getPatternColors); + _Preferences.def("setMaxPatternColors", &H2Core::Preferences::setMaxPatternColors, + py::arg("nValue")); + _Preferences.def("getMaxPatternColors", &H2Core::Preferences::getMaxPatternColors); + _Preferences.def("setVisiblePatternColors", &H2Core::Preferences::setVisiblePatternColors, + py::arg("nValue")); + _Preferences.def("getVisiblePatternColors", &H2Core::Preferences::getVisiblePatternColors); + _Preferences.def("getMainFormProperties", &H2Core::Preferences::getMainFormProperties); + _Preferences.def("setMainFormProperties", &H2Core::Preferences::setMainFormProperties, + py::arg("prop")); + _Preferences.def("getMixerProperties", &H2Core::Preferences::getMixerProperties); + _Preferences.def("setMixerProperties", &H2Core::Preferences::setMixerProperties, + py::arg("prop")); + _Preferences.def("getPatternEditorProperties", &H2Core::Preferences::getPatternEditorProperties); + _Preferences.def("setPatternEditorProperties", &H2Core::Preferences::setPatternEditorProperties, + py::arg("prop")); + _Preferences.def("getSongEditorProperties", &H2Core::Preferences::getSongEditorProperties); + _Preferences.def("setSongEditorProperties", &H2Core::Preferences::setSongEditorProperties, + py::arg("prop")); + _Preferences.def("getInstrumentRackProperties", &H2Core::Preferences::getInstrumentRackProperties); + _Preferences.def("setInstrumentRackProperties", &H2Core::Preferences::setInstrumentRackProperties, + py::arg("prop")); + _Preferences.def("getAudioEngineInfoProperties", &H2Core::Preferences::getAudioEngineInfoProperties); + _Preferences.def("setAudioEngineInfoProperties", &H2Core::Preferences::setAudioEngineInfoProperties, + py::arg("prop")); + _Preferences.def("getLadspaProperties", &H2Core::Preferences::getLadspaProperties, + py::arg("nFX")); + _Preferences.def("setLadspaProperties", &H2Core::Preferences::setLadspaProperties, + py::arg("nFX"), + py::arg("prop")); + _Preferences.def("getDefaultUIStyle", &H2Core::Preferences::getDefaultUIStyle); + _Preferences.def("patternModePlaysSelected", &H2Core::Preferences::patternModePlaysSelected, + "Returns #m_bPatternModePlaysSelected"); + _Preferences.def("setPatternModePlaysSelected", &H2Core::Preferences::setPatternModePlaysSelected, + py::arg("b")); + _Preferences.def("useLash", &H2Core::Preferences::useLash); + _Preferences.def("setUseLash", &H2Core::Preferences::setUseLash, + py::arg("b")); + _Preferences.def("hideKeyboardCursor", &H2Core::Preferences::hideKeyboardCursor); + _Preferences.def("setHideKeyboardCursor", &H2Core::Preferences::setHideKeyboardCursor, + py::arg("value")); + _Preferences.def("setMaxBars", &H2Core::Preferences::setMaxBars, + py::arg("bars")); + _Preferences.def("getMaxBars", &H2Core::Preferences::getMaxBars, + "Returns #m_nMaxBars."); + _Preferences.def("setMaxLayers", &H2Core::Preferences::setMaxLayers, + py::arg("layers")); + _Preferences.def("getMaxLayers", &H2Core::Preferences::getMaxLayers, + "Returns #m_nMaxLayers."); + _Preferences.def("setWaitForSessionHandler", &H2Core::Preferences::setWaitForSessionHandler, + py::arg("value")); + _Preferences.def("getWaitForSessionHandler", &H2Core::Preferences::getWaitForSessionHandler); + _Preferences.def("setNsmClientId", &H2Core::Preferences::setNsmClientId, + py::arg("nsmClientId")); + _Preferences.def("getNsmClientId", &H2Core::Preferences::getNsmClientId); + _Preferences.def("setNsmSongName", &H2Core::Preferences::setNsmSongName, + py::arg("nsmSongName")); + _Preferences.def("getNsmSongName", &H2Core::Preferences::getNsmSongName); + _Preferences.def("getOscServerEnabled", &H2Core::Preferences::getOscServerEnabled, + "Returns #m_bOscServerEnabled"); + _Preferences.def("setOscServerEnabled", &H2Core::Preferences::setOscServerEnabled, + py::arg("val")); + _Preferences.def("getOscFeedbackEnabled", &H2Core::Preferences::getOscFeedbackEnabled, + "Returns #m_bOscFeedbackEnabled"); + _Preferences.def("setOscFeedbackEnabled", &H2Core::Preferences::setOscFeedbackEnabled, + py::arg("val")); + _Preferences.def("getOscServerPort", &H2Core::Preferences::getOscServerPort, + "Returns #m_nOscServerPort"); + _Preferences.def("setOscServerPort", &H2Core::Preferences::setOscServerPort, + py::arg("oscPort")); + _Preferences.def("getUseTimelineBpm", &H2Core::Preferences::getUseTimelineBpm, + "Whether to use the bpm of the timeline."); + _Preferences.def("setUseTimelineBpm", &H2Core::Preferences::setUseTimelineBpm, + "Setting #__useTimelineBpm.", + py::arg("val")); + _Preferences.def("setShowPlaybackTrack", &H2Core::Preferences::setShowPlaybackTrack, + py::arg("val")); + _Preferences.def("getShowPlaybackTrack", &H2Core::Preferences::getShowPlaybackTrack); + _Preferences.def("getRubberBandCalcTime", &H2Core::Preferences::getRubberBandCalcTime); + _Preferences.def("setRubberBandCalcTime", &H2Core::Preferences::setRubberBandCalcTime, + py::arg("val")); + _Preferences.def("getRubberBandBatchMode", &H2Core::Preferences::getRubberBandBatchMode); + _Preferences.def("setRubberBandBatchMode", &H2Core::Preferences::setRubberBandBatchMode, + py::arg("val")); + _Preferences.def("getLastOpenTab", &H2Core::Preferences::getLastOpenTab); + _Preferences.def("setLastOpenTab", &H2Core::Preferences::setLastOpenTab, + py::arg("n")); + _Preferences.def("setH2ProcessName", &H2Core::Preferences::setH2ProcessName, + py::arg("processName")); + _Preferences.def("getH2ProcessName", &H2Core::Preferences::getH2ProcessName); + _Preferences.def("getExportSampleDepthIdx", &H2Core::Preferences::getExportSampleDepthIdx); + _Preferences.def("setExportSampleDepthIdx", &H2Core::Preferences::setExportSampleDepthIdx, + py::arg("ExportSampleDepth")); + _Preferences.def("getExportSampleRateIdx", &H2Core::Preferences::getExportSampleRateIdx); + _Preferences.def("setExportSampleRateIdx", &H2Core::Preferences::setExportSampleRateIdx, + py::arg("ExportSampleRate")); + _Preferences.def("getExportModeIdx", &H2Core::Preferences::getExportModeIdx); + _Preferences.def("setExportModeIdx", &H2Core::Preferences::setExportModeIdx, + py::arg("ExportModeIdx")); + _Preferences.def("getExportDirectory", &H2Core::Preferences::getExportDirectory); + _Preferences.def("setExportDirectory", &H2Core::Preferences::setExportDirectory, + py::arg("ExportDirectory")); + _Preferences.def("getExportTemplateIdx", &H2Core::Preferences::getExportTemplateIdx); + _Preferences.def("setExportTemplateIdx", &H2Core::Preferences::setExportTemplateIdx, + py::arg("ExportTemplateIdx")); + _Preferences.def("getMidiExportMode", &H2Core::Preferences::getMidiExportMode); + _Preferences.def("setMidiExportMode", &H2Core::Preferences::setMidiExportMode, + py::arg("ExportMode")); + _Preferences.def("getMidiExportDirectory", &H2Core::Preferences::getMidiExportDirectory); + _Preferences.def("setMidiExportDirectory", &H2Core::Preferences::setMidiExportDirectory, + py::arg("ExportDirectory")); + // [banned] _Preferences.def("getPreferencesOverwritePath", &H2Core::Preferences::getPreferencesOverwritePath, + // [banned] "Returns #m_sPreferencesOverwritePath"); + // [banned] _Preferences.def("setPreferencesOverwritePath", &H2Core::Preferences::setPreferencesOverwritePath, + // [banned] "Setting #m_sPreferencesOverwritePath.", + // [banned] py::arg("newPath")); + + py::class_> _WindowProperties(m, "WindowProperties"); + _WindowProperties.def(py::init<>()); + _WindowProperties.def_readwrite("x", &H2Core::WindowProperties::x); + _WindowProperties.def_readwrite("y", &H2Core::WindowProperties::y); + _WindowProperties.def_readwrite("width", &H2Core::WindowProperties::width); + _WindowProperties.def_readwrite("height", &H2Core::WindowProperties::height); + _WindowProperties.def_readwrite("visible", &H2Core::WindowProperties::visible); + _WindowProperties.def_static("class_name", &H2Core::WindowProperties::class_name); + _WindowProperties.def("set", &H2Core::WindowProperties::set, + py::arg("_x"), + py::arg("_y"), + py::arg("_width"), + py::arg("_height"), + py::arg("_visible")); + + py::class_> _Sample(m, "Sample"); + _Sample.def(py::init()); + _Sample.def(py::init>()); + _Sample.def_static("class_name", &H2Core::Sample::class_name); + _Sample.def("write", &H2Core::Sample::write, + "write sample to a file", + py::arg("path"), + py::arg("format")); + _Sample.def_static("load_static", py::overload_cast(&H2Core::Sample::load), + "Load a sample from a file.", + py::arg("filepath")); + // [] _Sample.def_static("load_static", py::overload_cast(&H2Core::Sample::load), + // [] "Load a sample from a file and apply the transformations to the sample data.", + // [] py::arg("filepath"), + // [] py::arg("loops"), + // [] py::arg("rubber"), + // [] py::arg("velocity"), + // [] py::arg("pan")); + _Sample.def("load", py::overload_cast<>(&H2Core::Sample::load), + "Load the sample stored in #__filepath into #__data_l and #__data_r."); + _Sample.def("unload", &H2Core::Sample::unload, + "Flush the current content of the left and right channel and the current metadata."); + // [] _Sample.def("apply", &H2Core::Sample::apply, + // [] "Apply transformations to the sample data.", + // [] py::arg("loops"), + // [] py::arg("rubber"), + // [] py::arg("velocity"), + // [] py::arg("pan")); + _Sample.def("apply_loops", &H2Core::Sample::apply_loops, + "apply loop transformation to the sample", + py::arg("lo")); + // [] _Sample.def("apply_velocity", &H2Core::Sample::apply_velocity, + // [] "apply velocity transformation to the sample", + // [] py::arg("v")); + // [] _Sample.def("apply_pan", &H2Core::Sample::apply_pan, + // [] "apply velocity transformation to the sample", + // [] py::arg("p")); + _Sample.def("apply_rubberband", &H2Core::Sample::apply_rubberband, + "apply rubberband transformation to the sample", + py::arg("rb")); + _Sample.def("exec_rubberband_cli", &H2Core::Sample::exec_rubberband_cli, + "call rubberband cli to modify the sample", + py::arg("rb")); + _Sample.def("is_empty", &H2Core::Sample::is_empty, + "Returns true if both data channels are null pointers"); + _Sample.def("get_filepath", &H2Core::Sample::get_filepath, + "Returns #__filepath"); + _Sample.def("get_filename", &H2Core::Sample::get_filename, + "Returns Filename part of #__filepath"); + _Sample.def("set_filename", &H2Core::Sample::set_filename, + py::arg("filename")); + _Sample.def("set_frames", &H2Core::Sample::set_frames, + "#__frames setter", + py::arg("frames")); + _Sample.def("get_frames", &H2Core::Sample::get_frames, + "Returns #__frames accessor"); + _Sample.def("set_sample_rate", &H2Core::Sample::set_sample_rate, + py::arg("sampleRate")); + _Sample.def("get_sample_rate", &H2Core::Sample::get_sample_rate, + "Returns #__sample_rate"); + _Sample.def("get_sample_duration", &H2Core::Sample::get_sample_duration, + "Returns sample duration in seconds"); + _Sample.def("get_size", &H2Core::Sample::get_size, + "Returns data size, which is calculated by #__frames time sizeof( float ) * 2"); + _Sample.def("get_data_l", + [](const H2Core::Sample & sample) { + + size_t nframes = sample.get_frames(); + auto result = py::array_t(nframes); + py::buffer_info buf = result.request(); + float *ptr = static_cast(buf.ptr); + float *src = sample.get_data_l(); + for (size_t idx = 0; idx < nframes; idx++) { + ptr[idx] = src[idx]; + } + return result; +} +, + "Returns #__data_l"); + _Sample.def("get_data_r", + [](const H2Core::Sample & sample) { + + size_t nframes = sample.get_frames(); + auto result = py::array_t(nframes); + py::buffer_info buf = result.request(); + float *ptr = static_cast(buf.ptr); + float *src = sample.get_data_r(); + for (size_t idx = 0; idx < nframes; idx++) { + ptr[idx] = src[idx]; + } + return result; +} +, + "Returns #__data_r"); + _Sample.def("set_is_modified", &H2Core::Sample::set_is_modified, + "#__is_modified setter", + py::arg("is_modified")); + _Sample.def("get_is_modified", &H2Core::Sample::get_is_modified, + "Returns #__is_modified"); + // [] _Sample.def("get_pan_envelope", &H2Core::Sample::get_pan_envelope, + // [] "Returns #__pan_envelope"); + // [] _Sample.def("get_velocity_envelope", &H2Core::Sample::get_velocity_envelope, + // [] "Returns #__velocity_envelope"); + _Sample.def("get_loops", &H2Core::Sample::get_loops, + "Returns #__loops parameters"); + _Sample.def("get_rubberband", &H2Core::Sample::get_rubberband, + "Returns #__rubberband parameters"); + _Sample.def_static("parse_loop_mode", &H2Core::Sample::parse_loop_mode, + "parse the given string and rturn the corresponding loop_mode", + py::arg("string")); + _Sample.def("get_loop_mode_string", &H2Core::Sample::get_loop_mode_string, + "Returns mode member of #__loops as a string"); + _Sample.def("toQString", &H2Core::Sample::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + _Sample.def("__repr__", + [](const H2Core::Sample & sample) { + return ""; +} +); + + py::class_> _InstrumentList(m, "InstrumentList"); + _InstrumentList.def(py::init<>()); + _InstrumentList.def(py::init()); + _InstrumentList.def_static("class_name", &H2Core::InstrumentList::class_name); + _InstrumentList.def("size", &H2Core::InstrumentList::size, + "returns the numbers of instruments"); + _InstrumentList.def("operator<<", &H2Core::InstrumentList::operator<<, + "add an instrument to the list", + py::arg("instrument")); + _InstrumentList.def("operator[]", &H2Core::InstrumentList::operator[], + "get an instrument from the list", + py::arg("idx")); + _InstrumentList.def("add", &H2Core::InstrumentList::add, + "add an instrument to the list", + py::arg("instrument")); + _InstrumentList.def("insert", &H2Core::InstrumentList::insert, + "insert an instrument into the list", + py::arg("idx"), + py::arg("instrument")); + _InstrumentList.def("is_valid_index", &H2Core::InstrumentList::is_valid_index, + "check if there is a idx is a valid index for this list without throwing an error messaage", + py::arg("idx")); + _InstrumentList.def("get", &H2Core::InstrumentList::get, + "get an instrument from the list", + py::arg("idx")); + _InstrumentList.def("del", py::overload_cast(&H2Core::InstrumentList::del), + "remove the instrument at a given index, does not delete it", + py::arg("idx")); + _InstrumentList.def("del", py::overload_cast>(&H2Core::InstrumentList::del), + "remove an instrument from the list, does not delete it", + py::arg("instrument")); + _InstrumentList.def("index", &H2Core::InstrumentList::index, + "get the index of an instrument within the instruments", + py::arg("instrument")); + _InstrumentList.def("find", py::overload_cast(&H2Core::InstrumentList::find), + "find an instrument within the instruments", + py::arg("i")); + _InstrumentList.def("find", py::overload_cast(&H2Core::InstrumentList::find), + "find an instrument within the instruments", + py::arg("name")); + _InstrumentList.def("findMidiNote", &H2Core::InstrumentList::findMidiNote, + "find an instrument which play the given midi note", + py::arg("note")); + _InstrumentList.def("swap", &H2Core::InstrumentList::swap, + "swap the instruments of two different indexes", + py::arg("idx_a"), + py::arg("idx_b")); + _InstrumentList.def("move", &H2Core::InstrumentList::move, + "move an instrument from a position to another", + py::arg("idx_a"), + py::arg("idx_b")); + _InstrumentList.def("load_samples", &H2Core::InstrumentList::load_samples, + "Calls the Instrument::load_samples() member function of all Instruments in #__instruments."); + _InstrumentList.def("unload_samples", &H2Core::InstrumentList::unload_samples, + "Calls the Instrument::unload_samples() member function of all Instruments in #__instruments."); + _InstrumentList.def("save_to", &H2Core::InstrumentList::save_to, + "save the instrument list within the given XMLNode", + py::arg("node"), + py::arg("component_id")); + _InstrumentList.def_static("load_from", &H2Core::InstrumentList::load_from, + "load an instrument list from an XMLNode", + py::arg("node"), + py::arg("dk_path"), + py::arg("dk_name")); + _InstrumentList.def("fix_issue_307", &H2Core::InstrumentList::fix_issue_307, + "Fix GitHub issue #307, so called \"Hi Bongo fiasco\"."); + _InstrumentList.def("has_all_midi_notes_same", &H2Core::InstrumentList::has_all_midi_notes_same, + "Check if all instruments have assigned the same MIDI out note"); + _InstrumentList.def("set_default_midi_out_notes", &H2Core::InstrumentList::set_default_midi_out_notes, + "Set each instrument consecuteve MIDI out notes, starting from 36"); + _InstrumentList.def("toQString", &H2Core::InstrumentList::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _InstrumentLayer(m, "InstrumentLayer"); + _InstrumentLayer.def(py::init>()); + _InstrumentLayer.def(py::init>()); + _InstrumentLayer.def(py::init, std::shared_ptr>()); + _InstrumentLayer.def_static("class_name", &H2Core::InstrumentLayer::class_name); + _InstrumentLayer.def("set_gain", &H2Core::InstrumentLayer::set_gain, + "set the gain of the layer", + py::arg("gain")); + _InstrumentLayer.def("get_gain", &H2Core::InstrumentLayer::get_gain, + "get the gain of the layer"); + _InstrumentLayer.def("set_pitch", &H2Core::InstrumentLayer::set_pitch, + "set the pitch of the layer", + py::arg("pitch")); + _InstrumentLayer.def("get_pitch", &H2Core::InstrumentLayer::get_pitch, + "get the pitch of the layer"); + _InstrumentLayer.def("set_start_velocity", &H2Core::InstrumentLayer::set_start_velocity, + "set the start ivelocity of the layer", + py::arg("start")); + _InstrumentLayer.def("get_start_velocity", &H2Core::InstrumentLayer::get_start_velocity, + "get the start velocity of the layer"); + _InstrumentLayer.def("set_end_velocity", &H2Core::InstrumentLayer::set_end_velocity, + "set the end velocity of the layer", + py::arg("end")); + _InstrumentLayer.def("get_end_velocity", &H2Core::InstrumentLayer::get_end_velocity, + "get the end velocity of the layer"); + _InstrumentLayer.def("set_sample", &H2Core::InstrumentLayer::set_sample, + "set the sample of the layer", + py::arg("sample")); + _InstrumentLayer.def("get_sample", &H2Core::InstrumentLayer::get_sample, + "get the sample of the layer"); + _InstrumentLayer.def("load_sample", &H2Core::InstrumentLayer::load_sample, + "Calls the #H2Core::Sample::load() member function of #__sample."); + _InstrumentLayer.def("unload_sample", &H2Core::InstrumentLayer::unload_sample); + _InstrumentLayer.def("save_to", &H2Core::InstrumentLayer::save_to, + "save the instrument layer within the given XMLNode", + py::arg("node")); + _InstrumentLayer.def_static("load_from", &H2Core::InstrumentLayer::load_from, + "load an instrument layer from an XMLNode", + py::arg("node"), + py::arg("dk_path")); + _InstrumentLayer.def("toQString", &H2Core::InstrumentLayer::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _InstrumentComponent(m, "InstrumentComponent"); + _InstrumentComponent.def(py::init()); + _InstrumentComponent.def(py::init>()); + _InstrumentComponent.def_static("class_name", &H2Core::InstrumentComponent::class_name); + _InstrumentComponent.def("save_to", &H2Core::InstrumentComponent::save_to, + py::arg("node"), + py::arg("component_id")); + _InstrumentComponent.def_static("load_from", &H2Core::InstrumentComponent::load_from, + py::arg("node"), + py::arg("dk_path")); + _InstrumentComponent.def("operator[]", &H2Core::InstrumentComponent::operator[], + py::arg("idx")); + _InstrumentComponent.def("get_layer", &H2Core::InstrumentComponent::get_layer, + py::arg("idx")); + _InstrumentComponent.def("set_layer", &H2Core::InstrumentComponent::set_layer, + py::arg("layer"), + py::arg("idx")); + _InstrumentComponent.def("set_drumkit_componentID", &H2Core::InstrumentComponent::set_drumkit_componentID, + "Sets the component ID #__related_drumkit_componentID", + py::arg("related_drumkit_componentID")); + _InstrumentComponent.def("get_drumkit_componentID", &H2Core::InstrumentComponent::get_drumkit_componentID, + "Returns the component ID of the drumkit."); + _InstrumentComponent.def("set_gain", &H2Core::InstrumentComponent::set_gain, + py::arg("gain")); + _InstrumentComponent.def("get_gain", &H2Core::InstrumentComponent::get_gain); + _InstrumentComponent.def_static("getMaxLayers", &H2Core::InstrumentComponent::getMaxLayers, + "Returns #m_nMaxLayers."); + _InstrumentComponent.def_static("setMaxLayers", &H2Core::InstrumentComponent::setMaxLayers, + py::arg("layers")); + _InstrumentComponent.def("toQString", &H2Core::InstrumentComponent::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _Instrument(m, "Instrument"); + _Instrument.def(py::init>()); + _Instrument.def(py::init>()); + _Instrument.def_static("class_name", &H2Core::Instrument::class_name); + _Instrument.def_static("load_instrument", &H2Core::Instrument::load_instrument, + "creates a new Instrument, loads samples from a given instrument within a given drumkit", + py::arg("drumkit_name"), + py::arg("instrument_name"), + py::arg("lookup")); + _Instrument.def("load_from", py::overload_cast(&H2Core::Instrument::load_from), + "loads instrument from a given instrument within a given drumkit into a `live` Instrument object.", + py::arg("drumkit_name"), + py::arg("instrument_name"), + py::arg("is_live"), + py::arg("lookup")); + _Instrument.def("load_from", py::overload_cast, bool>(&H2Core::Instrument::load_from), + "loads instrument from a given instrument into a `live` Instrument object.", + py::arg("drumkit"), + py::arg("instrument"), + py::arg("is_live")); + _Instrument.def_static("load_from_static", py::overload_cast(&H2Core::Instrument::load_from), + "load an instrument from an XMLNode", + py::arg("node"), + py::arg("dk_path"), + py::arg("dk_name")); + _Instrument.def("load_samples", &H2Core::Instrument::load_samples, + "Calls the InstrumentLayer::load_sample() member function of all layers of each component of the Instrument."); + _Instrument.def("unload_samples", &H2Core::Instrument::unload_samples, + "Calls the InstrumentLayer::unload_sample() member function of all layers of each component of the Instrument."); + _Instrument.def("save_to", &H2Core::Instrument::save_to, + "save the instrument within the given XMLNode", + py::arg("node"), + py::arg("component_id")); + _Instrument.def("set_name", &H2Core::Instrument::set_name, + "Sets the name of the Instrument #__name.", + py::arg("name")); + _Instrument.def("get_name", &H2Core::Instrument::get_name, + "Access the name of the Instrument."); + _Instrument.def("set_id", &H2Core::Instrument::set_id, + "Sets #__id to id.", + py::arg("id")); + _Instrument.def("get_id", &H2Core::Instrument::get_id, + "Returns #__id."); + _Instrument.def("set_adsr", &H2Core::Instrument::set_adsr, + "set the ADSR of the instrument", + py::arg("adsr")); + _Instrument.def("get_adsr", &H2Core::Instrument::get_adsr, + "get the ADSR of the instrument"); + _Instrument.def("copy_adsr", &H2Core::Instrument::copy_adsr, + "get a copy of the ADSR of the instrument"); + _Instrument.def("set_mute_group", &H2Core::Instrument::set_mute_group, + "set the mute group of the instrument", + py::arg("group")); + _Instrument.def("get_mute_group", &H2Core::Instrument::get_mute_group, + "get the mute group of the instrument"); + _Instrument.def("set_midi_out_channel", &H2Core::Instrument::set_midi_out_channel, + "set the midi out channel of the instrument", + py::arg("channel")); + _Instrument.def("get_midi_out_channel", &H2Core::Instrument::get_midi_out_channel, + "get the midi out channel of the instrument"); + _Instrument.def("set_midi_out_note", &H2Core::Instrument::set_midi_out_note, + "set the midi out note of the instrument", + py::arg("note")); + _Instrument.def("get_midi_out_note", &H2Core::Instrument::get_midi_out_note, + "get the midi out note of the instrument"); + _Instrument.def("set_muted", &H2Core::Instrument::set_muted, + "set muted status of the instrument", + py::arg("muted")); + _Instrument.def("is_muted", &H2Core::Instrument::is_muted, + "get muted status of the instrument"); + _Instrument.def("setPan", &H2Core::Instrument::setPan, + "set pan of the instrument", + py::arg("val")); + _Instrument.def("setPanWithRangeFrom0To1", &H2Core::Instrument::setPanWithRangeFrom0To1, + "set pan of the instrument, assuming the input range in [0;1]", + py::arg("fVal")); + _Instrument.def("getPan", &H2Core::Instrument::getPan, + "get pan of the instrument"); + _Instrument.def("getPanWithRangeFrom0To1", &H2Core::Instrument::getPanWithRangeFrom0To1, + "get pan of the instrument scaling and translating the range from [-1;1] to [0;1]"); + _Instrument.def("set_gain", &H2Core::Instrument::set_gain, + "set gain of the instrument", + py::arg("gain")); + _Instrument.def("get_gain", &H2Core::Instrument::get_gain, + "get gain of the instrument"); + _Instrument.def("set_volume", &H2Core::Instrument::set_volume, + "set the volume of the instrument", + py::arg("volume")); + _Instrument.def("get_volume", &H2Core::Instrument::get_volume, + "get the volume of the instrument"); + _Instrument.def("set_filter_active", &H2Core::Instrument::set_filter_active, + "activate the filter of the instrument", + py::arg("active")); + _Instrument.def("is_filter_active", &H2Core::Instrument::is_filter_active, + "get the status of the filter of the instrument"); + _Instrument.def("set_filter_resonance", &H2Core::Instrument::set_filter_resonance, + "set the filter resonance of the instrument", + py::arg("val")); + _Instrument.def("get_filter_resonance", &H2Core::Instrument::get_filter_resonance, + "get the filter resonance of the instrument"); + _Instrument.def("set_filter_cutoff", &H2Core::Instrument::set_filter_cutoff, + "set the filter cutoff of the instrument", + py::arg("val")); + _Instrument.def("get_filter_cutoff", &H2Core::Instrument::get_filter_cutoff, + "get the filter cutoff of the instrument"); + _Instrument.def("set_peak_l", &H2Core::Instrument::set_peak_l, + "set the left peak of the instrument", + py::arg("val")); + _Instrument.def("get_peak_l", &H2Core::Instrument::get_peak_l, + "get the left peak of the instrument"); + _Instrument.def("set_peak_r", &H2Core::Instrument::set_peak_r, + "set the right peak of the instrument", + py::arg("val")); + _Instrument.def("get_peak_r", &H2Core::Instrument::get_peak_r, + "get the right peak of the instrument"); + _Instrument.def("set_fx_level", &H2Core::Instrument::set_fx_level, + "set the fx level of the instrument", + py::arg("level"), + py::arg("index")); + _Instrument.def("get_fx_level", &H2Core::Instrument::get_fx_level, + "get the fx level of the instrument", + py::arg("index")); + _Instrument.def("set_random_pitch_factor", &H2Core::Instrument::set_random_pitch_factor, + "set the random pitch factor of the instrument", + py::arg("val")); + _Instrument.def("get_random_pitch_factor", &H2Core::Instrument::get_random_pitch_factor, + "get the random pitch factor of the instrument"); + _Instrument.def("set_pitch_offset", &H2Core::Instrument::set_pitch_offset, + "set the pitch offset of the instrument", + py::arg("val")); + _Instrument.def("get_pitch_offset", &H2Core::Instrument::get_pitch_offset, + "get the pitch offset of the instrument"); + _Instrument.def("set_active", &H2Core::Instrument::set_active, + "set the active status of the instrument", + py::arg("active")); + _Instrument.def("is_active", &H2Core::Instrument::is_active, + "get the active status of the instrument"); + _Instrument.def("set_soloed", &H2Core::Instrument::set_soloed, + "set the soloed status of the instrument", + py::arg("soloed")); + _Instrument.def("is_soloed", &H2Core::Instrument::is_soloed, + "get the soloed status of the instrument"); + _Instrument.def("enqueue", &H2Core::Instrument::enqueue, + "enqueue the instrument"); + _Instrument.def("dequeue", &H2Core::Instrument::dequeue, + "dequeue the instrument"); + _Instrument.def("is_queued", &H2Core::Instrument::is_queued, + "get the queued status of the instrument"); + _Instrument.def("set_stop_notes", &H2Core::Instrument::set_stop_notes, + "set the stop notes status of the instrument", + py::arg("stopnotes")); + _Instrument.def("is_stop_notes", &H2Core::Instrument::is_stop_notes, + "get the stop notes of the instrument"); + _Instrument.def("set_sample_selection_alg", &H2Core::Instrument::set_sample_selection_alg, + py::arg("selected_algo")); + _Instrument.def("sample_selection_alg", &H2Core::Instrument::sample_selection_alg); + _Instrument.def("set_hihat_grp", &H2Core::Instrument::set_hihat_grp, + py::arg("hihat_grp")); + _Instrument.def("get_hihat_grp", &H2Core::Instrument::get_hihat_grp); + _Instrument.def("set_lower_cc", &H2Core::Instrument::set_lower_cc, + py::arg("message")); + _Instrument.def("get_lower_cc", &H2Core::Instrument::get_lower_cc); + _Instrument.def("set_higher_cc", &H2Core::Instrument::set_higher_cc, + py::arg("message")); + _Instrument.def("get_higher_cc", &H2Core::Instrument::get_higher_cc); + _Instrument.def("set_drumkit_name", &H2Core::Instrument::set_drumkit_name, + py::arg("name")); + _Instrument.def("get_drumkit_name", &H2Core::Instrument::get_drumkit_name); + _Instrument.def("set_is_preview_instrument", &H2Core::Instrument::set_is_preview_instrument, + "Mark the instrument as hydrogen's preview instrument", + py::arg("isPreview")); + _Instrument.def("is_preview_instrument", &H2Core::Instrument::is_preview_instrument); + _Instrument.def("set_is_metronome_instrument", &H2Core::Instrument::set_is_metronome_instrument, + "Mark the instrument as metronome instrument", + py::arg("isMetronome")); + _Instrument.def("is_metronome_instrument", &H2Core::Instrument::is_metronome_instrument); + _Instrument.def("get_components", &H2Core::Instrument::get_components); + _Instrument.def("get_component", &H2Core::Instrument::get_component, + py::arg("DrumkitComponentID")); + _Instrument.def("set_apply_velocity", &H2Core::Instrument::set_apply_velocity, + py::arg("apply_velocity")); + _Instrument.def("get_apply_velocity", &H2Core::Instrument::get_apply_velocity); + _Instrument.def("is_currently_exported", &H2Core::Instrument::is_currently_exported); + _Instrument.def("set_currently_exported", &H2Core::Instrument::set_currently_exported, + py::arg("isCurrentlyExported")); + _Instrument.def("has_missing_samples", &H2Core::Instrument::has_missing_samples); + _Instrument.def("set_missing_samples", &H2Core::Instrument::set_missing_samples, + py::arg("bHasMissingSamples")); + _Instrument.def("toQString", &H2Core::Instrument::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + _Instrument.def("__repr__", + [](const H2Core::Instrument & instrument) { + return ""; +} +); + + py::class_> _ADSR(m, "ADSR"); + _ADSR.def(py::init()); + _ADSR.def(py::init>()); + _ADSR.def_static("class_name", &H2Core::ADSR::class_name); + _ADSR.def("set_attack", &H2Core::ADSR::set_attack, + "__attack setter", + py::arg("value")); + _ADSR.def("get_attack", &H2Core::ADSR::get_attack, + "__attack accessor"); + _ADSR.def("set_decay", &H2Core::ADSR::set_decay, + "__decay setter", + py::arg("value")); + _ADSR.def("get_decay", &H2Core::ADSR::get_decay, + "__decay accessor"); + _ADSR.def("set_sustain", &H2Core::ADSR::set_sustain, + "__sustain setter", + py::arg("value")); + _ADSR.def("get_sustain", &H2Core::ADSR::get_sustain, + "__sustain accessor"); + _ADSR.def("set_release", &H2Core::ADSR::set_release, + "__release setter", + py::arg("value")); + _ADSR.def("get_release", &H2Core::ADSR::get_release, + "__release accessor"); + _ADSR.def("attack", &H2Core::ADSR::attack, + "sets state to ATTACK"); + _ADSR.def("get_value", &H2Core::ADSR::get_value, + "compute the value and return it", + py::arg("step")); + _ADSR.def("release", &H2Core::ADSR::release, + "sets state to RELEASE, returns 0 if the state is IDLE, __value if the state is RELEASE, set state to RELEASE, save __release_value and return it."); + _ADSR.def("toQString", &H2Core::ADSR::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _DrumkitComponent(m, "DrumkitComponent"); + _DrumkitComponent.def(py::init()); + _DrumkitComponent.def(py::init()); + _DrumkitComponent.def_static("class_name", &H2Core::DrumkitComponent::class_name); + _DrumkitComponent.def("save_to", &H2Core::DrumkitComponent::save_to, + py::arg("node")); + _DrumkitComponent.def_static("load_from_static", py::overload_cast(&H2Core::DrumkitComponent::load_from), + py::arg("node"), + py::arg("dk_path")); + _DrumkitComponent.def("load_from", py::overload_cast(&H2Core::DrumkitComponent::load_from), + py::arg("component"), + py::arg("is_live")); + _DrumkitComponent.def("set_name", &H2Core::DrumkitComponent::set_name, + "Sets the name of the DrumkitComponent #__name.", + py::arg("name")); + _DrumkitComponent.def("get_name", &H2Core::DrumkitComponent::get_name, + "Access the name of the DrumkitComponent."); + _DrumkitComponent.def("set_id", &H2Core::DrumkitComponent::set_id, + py::arg("id")); + _DrumkitComponent.def("get_id", &H2Core::DrumkitComponent::get_id); + _DrumkitComponent.def("set_volume", &H2Core::DrumkitComponent::set_volume, + py::arg("volume")); + _DrumkitComponent.def("get_volume", &H2Core::DrumkitComponent::get_volume); + _DrumkitComponent.def("set_muted", &H2Core::DrumkitComponent::set_muted, + py::arg("muted")); + _DrumkitComponent.def("is_muted", &H2Core::DrumkitComponent::is_muted); + _DrumkitComponent.def("set_soloed", &H2Core::DrumkitComponent::set_soloed, + py::arg("soloed")); + _DrumkitComponent.def("is_soloed", &H2Core::DrumkitComponent::is_soloed); + _DrumkitComponent.def("set_peak_l", &H2Core::DrumkitComponent::set_peak_l, + py::arg("val")); + _DrumkitComponent.def("get_peak_l", &H2Core::DrumkitComponent::get_peak_l); + _DrumkitComponent.def("set_peak_r", &H2Core::DrumkitComponent::set_peak_r, + py::arg("val")); + _DrumkitComponent.def("get_peak_r", &H2Core::DrumkitComponent::get_peak_r); + _DrumkitComponent.def("reset_outs", &H2Core::DrumkitComponent::reset_outs, + py::arg("nFrames")); + _DrumkitComponent.def("set_outs", &H2Core::DrumkitComponent::set_outs, + py::arg("nBufferPos"), + py::arg("valL"), + py::arg("valR")); + _DrumkitComponent.def("get_out_L", &H2Core::DrumkitComponent::get_out_L, + py::arg("nBufferPos")); + _DrumkitComponent.def("get_out_R", &H2Core::DrumkitComponent::get_out_R, + py::arg("nBufferPos")); + _DrumkitComponent.def("toQString", &H2Core::DrumkitComponent::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + _DrumkitComponent.def("__repr__", + [](const H2Core::DrumkitComponent & dkc) { + return ""; +} +); + + py::class_> _Drumkit(m, "Drumkit"); + _Drumkit.def(py::init<>()); + _Drumkit.def(py::init()); + _Drumkit.def_static("class_name", &H2Core::Drumkit::class_name); + _Drumkit.def_static("load", &H2Core::Drumkit::load, + "Load drumkit information from a directory.", + py::arg("dk_dir"), + py::arg("load_samples")); + _Drumkit.def_static("load_by_name", &H2Core::Drumkit::load_by_name, + "Simple wrapper for load() used with the drumkit's name instead of its directory.", + py::arg("dk_name"), + py::arg("load_samples"), + py::arg("lookup")); + _Drumkit.def_static("load_file", &H2Core::Drumkit::load_file, + "Load a Drumkit from a file.", + py::arg("dk_path"), + py::arg("load_samples")); + _Drumkit.def("load_samples", &H2Core::Drumkit::load_samples, + "Calls the InstrumentList::load_samples() member function of #__instruments."); + _Drumkit.def("unload_samples", &H2Core::Drumkit::unload_samples, + "Calls the InstrumentList::unload_samples() member function of #__instruments."); + _Drumkit.def_static("upgrade_drumkit", &H2Core::Drumkit::upgrade_drumkit, + "Saves the current drumkit to dk_path, but makes a backup. This is used when the drumkit did not comply to our xml schema.", + py::arg("pDrumkit"), + py::arg("dk_path")); + _Drumkit.def_static("user_drumkit_exists", &H2Core::Drumkit::user_drumkit_exists, + "check if a user drumkit with the given name already exists", + py::arg("dk_path")); + _Drumkit.def("save", py::overload_cast(&H2Core::Drumkit::save), + "save a drumkit, xml file and samples", + py::arg("overwrite")); + _Drumkit.def("save", py::overload_cast(&H2Core::Drumkit::save), + "save a drumkit, xml file and samples neither #__path nor #__name are updated", + py::arg("dk_dir"), + py::arg("overwrite")); + _Drumkit.def_static("save_static", py::overload_cast *, bool>(&H2Core::Drumkit::save), + "save a drumkit using given parameters and an instrument list", + py::arg("sName"), + py::arg("sAuthor"), + py::arg("sInfo"), + py::arg("sLicense"), + py::arg("sImage"), + py::arg("sImageLicense"), + py::arg("pInstruments"), + py::arg("pComponents"), + py::arg("bOverwrite")); + _Drumkit.def("save_file", &H2Core::Drumkit::save_file, + "save a drumkit into an xml file", + py::arg("dk_path"), + py::arg("overwrite"), + py::arg("component_id")); + _Drumkit.def("save_samples", &H2Core::Drumkit::save_samples, + "save a drumkit instruments samples into a directory", + py::arg("dk_dir"), + py::arg("overwrite")); + _Drumkit.def("save_image", &H2Core::Drumkit::save_image, + "save the drumkit image into the new directory", + py::arg("dk_dir"), + py::arg("overwrite")); + _Drumkit.def_static("install", &H2Core::Drumkit::install, + "install a drumkit from a filename", + py::arg("path")); + _Drumkit.def_static("remove", &H2Core::Drumkit::remove, + "remove a drumkit from the disk", + py::arg("dk_name"), + py::arg("lookup")); + _Drumkit.def("set_instruments", &H2Core::Drumkit::set_instruments, + "set __instruments, delete existing one", + py::arg("instruments")); + _Drumkit.def("get_instruments", &H2Core::Drumkit::get_instruments, + "returns #__instruments", + py::return_value_policy::reference_internal); + _Drumkit.def("set_path", &H2Core::Drumkit::set_path, + "#__path setter", + py::arg("path")); + _Drumkit.def("get_path", &H2Core::Drumkit::get_path, + "#__path accessor"); + _Drumkit.def("set_name", &H2Core::Drumkit::set_name, + "#__name setter", + py::arg("name")); + _Drumkit.def("get_name", &H2Core::Drumkit::get_name, + "#__name accessor"); + _Drumkit.def("set_author", &H2Core::Drumkit::set_author, + "#__author setter", + py::arg("author")); + _Drumkit.def("get_author", &H2Core::Drumkit::get_author, + "#__author accessor"); + _Drumkit.def("set_info", &H2Core::Drumkit::set_info, + "#__info setter", + py::arg("info")); + _Drumkit.def("get_info", &H2Core::Drumkit::get_info, + "#__info accessor"); + _Drumkit.def("set_license", &H2Core::Drumkit::set_license, + "#__license setter", + py::arg("license")); + _Drumkit.def("get_license", &H2Core::Drumkit::get_license, + "#__license accessor"); + _Drumkit.def("set_image", &H2Core::Drumkit::set_image, + "#__image setter", + py::arg("image")); + _Drumkit.def("get_image", &H2Core::Drumkit::get_image, + "#__image accessor"); + _Drumkit.def("set_image_license", &H2Core::Drumkit::set_image_license, + "#__imageLicense setter", + py::arg("imageLicense")); + _Drumkit.def("get_image_license", &H2Core::Drumkit::get_image_license, + "#__imageLicense accessor"); + _Drumkit.def("samples_loaded", &H2Core::Drumkit::samples_loaded, + "return true if the samples are loaded"); + _Drumkit.def("dump", &H2Core::Drumkit::dump); + _Drumkit.def("isUserDrumkit", &H2Core::Drumkit::isUserDrumkit, + "Returns Whether the associated files are located in the user or the systems drumkit folder."); + _Drumkit.def("get_components", &H2Core::Drumkit::get_components); + _Drumkit.def("set_components", &H2Core::Drumkit::set_components, + py::arg("components")); + _Drumkit.def("toQString", &H2Core::Drumkit::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + _Drumkit.def("__repr__", + [](const H2Core::Drumkit & drumkit) { + return ""; +} +); + + py::class_> _XMLNode(m, "XMLNode"); + _XMLNode.def(py::init<>()); + _XMLNode.def(py::init()); + _XMLNode.def_static("class_name", &H2Core::XMLNode::class_name); + _XMLNode.def("createNode", &H2Core::XMLNode::createNode, + "create a new XMLNode that has to be appended into de XMLDoc", + py::arg("name")); + _XMLNode.def("read_int", &H2Core::XMLNode::read_int, + "reads an integer stored into a child node", + py::arg("node"), + py::arg("default_value"), + py::arg("inexistent_ok"), + py::arg("empty_ok")); + _XMLNode.def("read_bool", &H2Core::XMLNode::read_bool, + "reads a boolean stored into a child node", + py::arg("node"), + py::arg("default_value"), + py::arg("inexistent_ok"), + py::arg("empty_ok")); + _XMLNode.def("read_float", py::overload_cast(&H2Core::XMLNode::read_float), + "reads a float stored into a child node", + py::arg("node"), + py::arg("default_value"), + py::arg("inexistent_ok"), + py::arg("empty_ok")); + _XMLNode.def("read_float", py::overload_cast(&H2Core::XMLNode::read_float), + py::arg("node"), + py::arg("default_value"), + py::arg("pFound"), + py::arg("inexistent_ok"), + py::arg("empty_ok")); + _XMLNode.def("read_string", &H2Core::XMLNode::read_string, + "reads a string stored into a child node", + py::arg("node"), + py::arg("default_value"), + py::arg("inexistent_ok"), + py::arg("empty_ok")); + _XMLNode.def("read_attribute", &H2Core::XMLNode::read_attribute, + "reads an attribute from the node", + py::arg("attribute"), + py::arg("default_value"), + py::arg("inexistent_ok"), + py::arg("empty_ok")); + _XMLNode.def("read_text", &H2Core::XMLNode::read_text, + "reads the text (content) from the node", + py::arg("empty_ok")); + _XMLNode.def("write_int", &H2Core::XMLNode::write_int, + "write an integer into a child node", + py::arg("node"), + py::arg("value")); + _XMLNode.def("write_bool", &H2Core::XMLNode::write_bool, + "write a boolean into a child node", + py::arg("node"), + py::arg("value")); + _XMLNode.def("write_float", &H2Core::XMLNode::write_float, + "write a float into a child node", + py::arg("node"), + py::arg("value")); + _XMLNode.def("write_string", &H2Core::XMLNode::write_string, + "write a string into a child node", + py::arg("node"), + py::arg("value")); + _XMLNode.def("write_attribute", &H2Core::XMLNode::write_attribute, + "write a string as an attribute of the node", + py::arg("attribute"), + py::arg("value")); + + // enum log_levels + py::enum_(_Logger, "log_levels") + .value("None", H2Core::Logger::log_levels::None) + .value("Error", H2Core::Logger::log_levels::Error) + .value("Warning", H2Core::Logger::log_levels::Warning) + .value("Info", H2Core::Logger::log_levels::Info) + .value("Debug", H2Core::Logger::log_levels::Debug) + .value("Constructors", H2Core::Logger::log_levels::Constructors) + .value("AELockTracing", H2Core::Logger::log_levels::AELockTracing); + + // enum MidiMessageType + py::enum_(_MidiMessage, "MidiMessageType") + .value("UNKNOWN", H2Core::MidiMessage::MidiMessageType::UNKNOWN) + .value("SYSEX", H2Core::MidiMessage::MidiMessageType::SYSEX) + .value("NOTE_ON", H2Core::MidiMessage::MidiMessageType::NOTE_ON) + .value("NOTE_OFF", H2Core::MidiMessage::MidiMessageType::NOTE_OFF) + .value("POLYPHONIC_KEY_PRESSURE", H2Core::MidiMessage::MidiMessageType::POLYPHONIC_KEY_PRESSURE) + .value("CONTROL_CHANGE", H2Core::MidiMessage::MidiMessageType::CONTROL_CHANGE) + .value("PROGRAM_CHANGE", H2Core::MidiMessage::MidiMessageType::PROGRAM_CHANGE) + .value("CHANNEL_PRESSURE", H2Core::MidiMessage::MidiMessageType::CHANNEL_PRESSURE) + .value("PITCH_WHEEL", H2Core::MidiMessage::MidiMessageType::PITCH_WHEEL) + .value("SYSTEM_EXCLUSIVE", H2Core::MidiMessage::MidiMessageType::SYSTEM_EXCLUSIVE) + .value("START", H2Core::MidiMessage::MidiMessageType::START) + .value("CONTINUE", H2Core::MidiMessage::MidiMessageType::CONTINUE) + .value("STOP", H2Core::MidiMessage::MidiMessageType::STOP) + .value("SONG_POS", H2Core::MidiMessage::MidiMessageType::SONG_POS) + .value("QUARTER_FRAME", H2Core::MidiMessage::MidiMessageType::QUARTER_FRAME); + + py::class_> _H2Exception(m, "H2Exception"); + _H2Exception.def(py::init()); + + py::class_> _PatternList(m, "PatternList"); + _PatternList.def(py::init<>()); + _PatternList.def(py::init()); + _PatternList.def_static("class_name", &H2Core::PatternList::class_name); + _PatternList.def("size", &H2Core::PatternList::size, + "returns the numbers of patterns"); + _PatternList.def("operator<<", &H2Core::PatternList::operator<<, + "add a pattern to the list", + py::arg("pattern")); + _PatternList.def("operator[]", &H2Core::PatternList::operator[], + "get a pattern from the list", + py::arg("idx")); + _PatternList.def("add", &H2Core::PatternList::add, + "add a pattern to the list", + py::arg("pattern")); + _PatternList.def("insert", &H2Core::PatternList::insert, + "insert a pattern into the list", + py::arg("idx"), + py::arg("pattern")); + _PatternList.def("get", py::overload_cast(&H2Core::PatternList::get), + "get a pattern from the list", + py::arg("idx")); + _PatternList.def("get", py::overload_cast(&H2Core::PatternList::get), + py::arg("idx")); + _PatternList.def("del", py::overload_cast(&H2Core::PatternList::del), + "remove the pattern at a given index, does not delete it", + py::arg("idx")); + _PatternList.def("del", py::overload_cast(&H2Core::PatternList::del), + "remove a pattern from the list, does not delete it", + py::arg("pattern")); + _PatternList.def("index", &H2Core::PatternList::index, + "get the index of the pattern within the patterns", + py::arg("pattern")); + _PatternList.def("replace", &H2Core::PatternList::replace, + "replace the pattern at a given index with a new one", + py::arg("idx"), + py::arg("pattern")); + _PatternList.def("clear", &H2Core::PatternList::clear, + "empty the pattern list"); + _PatternList.def("set_to_old", &H2Core::PatternList::set_to_old, + "mark all patterns as old"); + _PatternList.def("find", &H2Core::PatternList::find, + "find a pattern within the patterns", + py::arg("name")); + _PatternList.def("swap", &H2Core::PatternList::swap, + "swap the patterns of two different indexes", + py::arg("idx_a"), + py::arg("idx_b")); + _PatternList.def("move", &H2Core::PatternList::move, + "move a pattern from a position to another", + py::arg("idx_a"), + py::arg("idx_b")); + _PatternList.def("flattened_virtual_patterns_compute", &H2Core::PatternList::flattened_virtual_patterns_compute, + "call compute_flattened_virtual_patterns on each pattern"); + _PatternList.def("virtual_pattern_del", &H2Core::PatternList::virtual_pattern_del, + "call del_virtual_pattern on each pattern", + py::arg("pattern")); + _PatternList.def("check_name", &H2Core::PatternList::check_name, + "check if a pattern with name patternName already exists in this list", + py::arg("patternName"), + py::arg("ignore")); + _PatternList.def("find_unused_pattern_name", &H2Core::PatternList::find_unused_pattern_name, + "find unused patternName", + py::arg("sourceName"), + py::arg("ignore")); + _PatternList.def("longest_pattern_length", &H2Core::PatternList::longest_pattern_length, + "Get the length of the longest pattern in the list"); + _PatternList.def("toQString", &H2Core::PatternList::toQString, + "Formatted string version for debugging purposes.", + py::arg("sPrefix"), + py::arg("bShort")); + + // enum NameFormat + py::enum_(_QColor, "NameFormat") + .value("HexRgb", QColor::NameFormat::HexRgb) + .value("HexArgb", QColor::NameFormat::HexArgb); + + // enum Spec + py::enum_(_QColor, "Spec") + .value("Invalid", QColor::Spec::Invalid) + .value("Rgb", QColor::Spec::Rgb) + .value("Hsv", QColor::Spec::Hsv) + .value("Cmyk", QColor::Spec::Cmyk) + .value("Hsl", QColor::Spec::Hsl) + .value("ExtendedRgb", QColor::Spec::ExtendedRgb); + + // enum Octave + py::enum_(_Note, "Octave") + .value("P8Z", H2Core::Note::Octave::P8Z) + .value("P8Y", H2Core::Note::Octave::P8Y) + .value("P8X", H2Core::Note::Octave::P8X) + .value("P8", H2Core::Note::Octave::P8) + .value("P8A", H2Core::Note::Octave::P8A) + .value("P8B", H2Core::Note::Octave::P8B) + .value("P8C", H2Core::Note::Octave::P8C); + + // enum Key + py::enum_(_Note, "Key") + .value("C", H2Core::Note::Key::C) + .value("Cs", H2Core::Note::Key::Cs) + .value("D", H2Core::Note::Key::D) + .value("Ef", H2Core::Note::Key::Ef) + .value("E", H2Core::Note::Key::E) + .value("F", H2Core::Note::Key::F) + .value("Fs", H2Core::Note::Key::Fs) + .value("G", H2Core::Note::Key::G) + .value("Af", H2Core::Note::Key::Af) + .value("A", H2Core::Note::Key::A) + .value("Bf", H2Core::Note::Key::Bf) + .value("B", H2Core::Note::Key::B); + + // enum PAN_LAW_TYPES + py::enum_(_Sampler, "PAN_LAW_TYPES") + .value("RATIO_STRAIGHT_POLYGONAL", H2Core::Sampler::PAN_LAW_TYPES::RATIO_STRAIGHT_POLYGONAL) + .value("RATIO_CONST_POWER", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_POWER) + .value("RATIO_CONST_SUM", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_SUM) + .value("LINEAR_STRAIGHT_POLYGONAL", H2Core::Sampler::PAN_LAW_TYPES::LINEAR_STRAIGHT_POLYGONAL) + .value("LINEAR_CONST_POWER", H2Core::Sampler::PAN_LAW_TYPES::LINEAR_CONST_POWER) + .value("LINEAR_CONST_SUM", H2Core::Sampler::PAN_LAW_TYPES::LINEAR_CONST_SUM) + .value("POLAR_STRAIGHT_POLYGONAL", H2Core::Sampler::PAN_LAW_TYPES::POLAR_STRAIGHT_POLYGONAL) + .value("POLAR_CONST_POWER", H2Core::Sampler::PAN_LAW_TYPES::POLAR_CONST_POWER) + .value("POLAR_CONST_SUM", H2Core::Sampler::PAN_LAW_TYPES::POLAR_CONST_SUM) + .value("QUADRATIC_STRAIGHT_POLYGONAL", H2Core::Sampler::PAN_LAW_TYPES::QUADRATIC_STRAIGHT_POLYGONAL) + .value("QUADRATIC_CONST_POWER", H2Core::Sampler::PAN_LAW_TYPES::QUADRATIC_CONST_POWER) + .value("QUADRATIC_CONST_SUM", H2Core::Sampler::PAN_LAW_TYPES::QUADRATIC_CONST_SUM) + .value("LINEAR_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::LINEAR_CONST_K_NORM) + .value("RATIO_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_K_NORM) + .value("POLAR_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::POLAR_CONST_K_NORM) + .value("QUADRATIC_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::QUADRATIC_CONST_K_NORM); + + py::class_> _PortMidiDriver(m, "PortMidiDriver"); + _PortMidiDriver.def(py::init<>()); + _PortMidiDriver.def_readwrite("m_pMidiIn", &H2Core::PortMidiDriver::m_pMidiIn); + _PortMidiDriver.def_readwrite("m_pMidiOut", &H2Core::PortMidiDriver::m_pMidiOut); + _PortMidiDriver.def_readwrite("m_bRunning", &H2Core::PortMidiDriver::m_bRunning); + _PortMidiDriver.def_static("class_name", &H2Core::PortMidiDriver::class_name); + _PortMidiDriver.def("open", &H2Core::PortMidiDriver::open); + _PortMidiDriver.def("close", &H2Core::PortMidiDriver::close); + _PortMidiDriver.def("getInputPortList", &H2Core::PortMidiDriver::getInputPortList); + _PortMidiDriver.def("getOutputPortList", &H2Core::PortMidiDriver::getOutputPortList); + _PortMidiDriver.def("handleQueueNote", &H2Core::PortMidiDriver::handleQueueNote, + py::arg("pNote")); + _PortMidiDriver.def("handleQueueNoteOff", &H2Core::PortMidiDriver::handleQueueNoteOff, + py::arg("channel"), + py::arg("key"), + py::arg("velocity")); + _PortMidiDriver.def("handleQueueAllNoteOff", &H2Core::PortMidiDriver::handleQueueAllNoteOff); + _PortMidiDriver.def("handleOutgoingControlChange", &H2Core::PortMidiDriver::handleOutgoingControlChange, + py::arg("param"), + py::arg("value"), + py::arg("channel")); + + py::class_> _JackMidiDriver(m, "JackMidiDriver"); + _JackMidiDriver.def(py::init<>()); + _JackMidiDriver.def_static("class_name", &H2Core::JackMidiDriver::class_name); + _JackMidiDriver.def("open", &H2Core::JackMidiDriver::open); + _JackMidiDriver.def("close", &H2Core::JackMidiDriver::close); + _JackMidiDriver.def("getInputPortList", &H2Core::JackMidiDriver::getInputPortList); + _JackMidiDriver.def("getOutputPortList", &H2Core::JackMidiDriver::getOutputPortList); + _JackMidiDriver.def("getPortInfo", &H2Core::JackMidiDriver::getPortInfo, + py::arg("sPortName"), + py::arg("nClient"), + py::arg("nPort")); + _JackMidiDriver.def("JackMidiWrite", &H2Core::JackMidiDriver::JackMidiWrite, + py::arg("nframes")); + _JackMidiDriver.def("JackMidiRead", &H2Core::JackMidiDriver::JackMidiRead, + py::arg("nframes")); + _JackMidiDriver.def("handleQueueNote", &H2Core::JackMidiDriver::handleQueueNote, + py::arg("pNote")); + _JackMidiDriver.def("handleQueueNoteOff", &H2Core::JackMidiDriver::handleQueueNoteOff, + py::arg("channel"), + py::arg("key"), + py::arg("velocity")); + _JackMidiDriver.def("handleQueueAllNoteOff", &H2Core::JackMidiDriver::handleQueueAllNoteOff); + _JackMidiDriver.def("handleOutgoingControlChange", &H2Core::JackMidiDriver::handleOutgoingControlChange, + py::arg("param"), + py::arg("value"), + py::arg("channel")); + + py::class_> _AlsaMidiDriver(m, "AlsaMidiDriver"); + _AlsaMidiDriver.def(py::init<>()); + _AlsaMidiDriver.def_static("class_name", &H2Core::AlsaMidiDriver::class_name); + _AlsaMidiDriver.def("open", &H2Core::AlsaMidiDriver::open); + _AlsaMidiDriver.def("close", &H2Core::AlsaMidiDriver::close); + _AlsaMidiDriver.def("getInputPortList", &H2Core::AlsaMidiDriver::getInputPortList); + _AlsaMidiDriver.def("getOutputPortList", &H2Core::AlsaMidiDriver::getOutputPortList); + // [banned] _AlsaMidiDriver.def("midi_action", &H2Core::AlsaMidiDriver::midi_action, + // [banned] py::arg("seq_handle")); + _AlsaMidiDriver.def("getPortInfo", &H2Core::AlsaMidiDriver::getPortInfo, + py::arg("sPortName"), + py::arg("nClient"), + py::arg("nPort")); + _AlsaMidiDriver.def("handleQueueNote", &H2Core::AlsaMidiDriver::handleQueueNote, + py::arg("pNote")); + _AlsaMidiDriver.def("handleQueueNoteOff", &H2Core::AlsaMidiDriver::handleQueueNoteOff, + py::arg("channel"), + py::arg("key"), + py::arg("velocity")); + _AlsaMidiDriver.def("handleQueueAllNoteOff", &H2Core::AlsaMidiDriver::handleQueueAllNoteOff); + _AlsaMidiDriver.def("handleOutgoingControlChange", &H2Core::AlsaMidiDriver::handleOutgoingControlChange, + py::arg("param"), + py::arg("value"), + py::arg("channel")); + + py::class_> _PortAudioDriver(m, "PortAudioDriver"); + _PortAudioDriver.def(py::init()); + _PortAudioDriver.def_readwrite("m_pOut_L", &H2Core::PortAudioDriver::m_pOut_L); + _PortAudioDriver.def_readwrite("m_pOut_R", &H2Core::PortAudioDriver::m_pOut_R); + _PortAudioDriver.def_readwrite("m_nBufferSize", &H2Core::PortAudioDriver::m_nBufferSize); + _PortAudioDriver.def_static("class_name", &H2Core::PortAudioDriver::class_name); + _PortAudioDriver.def("init", &H2Core::PortAudioDriver::init, + py::arg("nBufferSize")); + _PortAudioDriver.def("connect", &H2Core::PortAudioDriver::connect); + _PortAudioDriver.def("disconnect", &H2Core::PortAudioDriver::disconnect); + _PortAudioDriver.def("getBufferSize", &H2Core::PortAudioDriver::getBufferSize); + _PortAudioDriver.def("getSampleRate", &H2Core::PortAudioDriver::getSampleRate); + _PortAudioDriver.def("getOut_L", &H2Core::PortAudioDriver::getOut_L); + _PortAudioDriver.def("getOut_R", &H2Core::PortAudioDriver::getOut_R); + _PortAudioDriver.def("updateTransportInfo", &H2Core::PortAudioDriver::updateTransportInfo); + _PortAudioDriver.def("play", &H2Core::PortAudioDriver::play); + _PortAudioDriver.def("stop", &H2Core::PortAudioDriver::stop); + _PortAudioDriver.def("locate", &H2Core::PortAudioDriver::locate, + py::arg("nFrame")); + _PortAudioDriver.def("setBpm", &H2Core::PortAudioDriver::setBpm, + py::arg("fBPM")); + + py::class_> _NullDriver(m, "NullDriver"); + _NullDriver.def(py::init()); + _NullDriver.def_static("class_name", &H2Core::NullDriver::class_name); + _NullDriver.def("init", &H2Core::NullDriver::init, + py::arg("nBufferSize")); + _NullDriver.def("connect", &H2Core::NullDriver::connect); + _NullDriver.def("disconnect", &H2Core::NullDriver::disconnect); + _NullDriver.def("getBufferSize", &H2Core::NullDriver::getBufferSize); + _NullDriver.def("getSampleRate", &H2Core::NullDriver::getSampleRate); + _NullDriver.def("getOut_L", &H2Core::NullDriver::getOut_L); + _NullDriver.def("getOut_R", &H2Core::NullDriver::getOut_R); + _NullDriver.def("play", &H2Core::NullDriver::play); + _NullDriver.def("stop", &H2Core::NullDriver::stop); + _NullDriver.def("locate", &H2Core::NullDriver::locate, + py::arg("nFrame")); + _NullDriver.def("updateTransportInfo", &H2Core::NullDriver::updateTransportInfo); + _NullDriver.def("setBpm", &H2Core::NullDriver::setBpm, + py::arg("fBPM")); + + py::class_> _JackAudioDriver(m, "JackAudioDriver"); + _JackAudioDriver.def(py::init()); + _JackAudioDriver.def_readwrite("m_currentPos", &H2Core::JackAudioDriver::m_currentPos); + _JackAudioDriver.def_static("class_name", &H2Core::JackAudioDriver::class_name); + _JackAudioDriver.def("connect", &H2Core::JackAudioDriver::connect, + "Connects to output ports via the JACK server."); + _JackAudioDriver.def("disconnect", &H2Core::JackAudioDriver::disconnect, + "Disconnects the JACK client of the Hydrogen from the JACK server."); + _JackAudioDriver.def("deactivate", &H2Core::JackAudioDriver::deactivate, + "Deactivates the JACK client of Hydrogen and disconnects all ports belonging to it."); + _JackAudioDriver.def("getBufferSize", &H2Core::JackAudioDriver::getBufferSize, + "Returns Global variable #jackServerBufferSize."); + _JackAudioDriver.def("getSampleRate", &H2Core::JackAudioDriver::getSampleRate, + "Returns Global variable #jackServerSampleRate."); + _JackAudioDriver.def("clearPerTrackAudioBuffers", &H2Core::JackAudioDriver::clearPerTrackAudioBuffers, + "Resets the buffers contained in #m_pTrackOutputPortsL and #m_pTrackOutputPortsR.", + py::arg("nFrames")); + _JackAudioDriver.def("makeTrackOutputs", &H2Core::JackAudioDriver::makeTrackOutputs, + "Creates per component output ports for each instrument.", + py::arg("pSong")); + _JackAudioDriver.def("setConnectDefaults", &H2Core::JackAudioDriver::setConnectDefaults, + py::arg("flag")); + _JackAudioDriver.def("getConnectDefaults", &H2Core::JackAudioDriver::getConnectDefaults, + "Returns #m_bConnectDefaults"); + _JackAudioDriver.def("getOut_L", &H2Core::JackAudioDriver::getOut_L, + "Get content in the left stereo output port."); + _JackAudioDriver.def("getOut_R", &H2Core::JackAudioDriver::getOut_R, + "Get content in the right stereo output port."); + _JackAudioDriver.def("getTrackOut_L", py::overload_cast(&H2Core::JackAudioDriver::getTrackOut_L), + "Get content of left output port of a specific track.", + py::arg("nTrack")); + _JackAudioDriver.def("getTrackOut_L", py::overload_cast, std::shared_ptr>(&H2Core::JackAudioDriver::getTrackOut_L), + "Convenience function looking up the track number of a component of an instrument using in #m_trackMap using their IDs Instrument::__id and InstrumentComponent::__related_drumkit_componentID. Using the track number it then calls getTrackOut_L( unsigned ) and returns its result.", + py::arg("instr"), + py::arg("pCompo")); + _JackAudioDriver.def("getTrackOut_R", py::overload_cast(&H2Core::JackAudioDriver::getTrackOut_R), + "Get content of right output port of a specific track.", + py::arg("nTrack")); + _JackAudioDriver.def("getTrackOut_R", py::overload_cast, std::shared_ptr>(&H2Core::JackAudioDriver::getTrackOut_R), + "Convenience function looking up the track number of a component of an instrument using in #m_trackMap using their IDs Instrument::__id and InstrumentComponent::__related_drumkit_componentID. Using the track number it then calls getTrackOut_R( unsigned ) and returns its result.", + py::arg("instr"), + py::arg("pCompo")); + _JackAudioDriver.def("init", &H2Core::JackAudioDriver::init, + "Initializes the JACK audio driver.", + py::arg("bufferSize")); + _JackAudioDriver.def("play", &H2Core::JackAudioDriver::play, + "Starts the JACK transport."); + _JackAudioDriver.def("stop", &H2Core::JackAudioDriver::stop, + "Stops the JACK transport."); + _JackAudioDriver.def("locate", &H2Core::JackAudioDriver::locate, + "Re-positions the transport position to nFrame.", + py::arg("nFrame")); + _JackAudioDriver.def("updateTransportInfo", &H2Core::JackAudioDriver::updateTransportInfo, + "Updating the local instance of the TransportInfo AudioOutput::m_transport."); + _JackAudioDriver.def("setBpm", &H2Core::JackAudioDriver::setBpm, + "Set the tempo stored TransportInfo::m_fBPM of the local instance of the TransportInfo AudioOutput::m_transport.", + py::arg("fBPM")); + _JackAudioDriver.def("calculateFrameOffset", &H2Core::JackAudioDriver::calculateFrameOffset, + "Calculates the difference between the true transport position and the internal one.", + py::arg("oldFrame")); + _JackAudioDriver.def("initTimebaseMaster", &H2Core::JackAudioDriver::initTimebaseMaster, + "Registers Hydrogen as JACK timebase master."); + _JackAudioDriver.def("releaseTimebaseMaster", &H2Core::JackAudioDriver::releaseTimebaseMaster, + "Calls _jack_release_timebase()_ (jack/transport.h) to release Hydrogen from the JACK timebase master responsibilities. This causes the JackTimebaseCallback() callback function to not be called by the JACK server anymore."); + _JackAudioDriver.def("getTimebaseState", &H2Core::JackAudioDriver::getTimebaseState, + "Returns #m_timebaseState"); + _JackAudioDriver.def_static("jackDriverSampleRate", &H2Core::JackAudioDriver::jackDriverSampleRate, + "Callback function for the JACK audio server to set the sample rate #jackServerSampleRate and prints a message to the #__INFOLOG, which has to be included via a Logger instance in the provided param.", + py::arg("nframes"), + py::arg("param")); + _JackAudioDriver.def_static("jackDriverBufferSize", &H2Core::JackAudioDriver::jackDriverBufferSize, + "Callback function for the JACK audio server to set the buffer size #jackServerBufferSize.", + py::arg("nframes"), + py::arg("arg")); + + py::class_> _FakeDriver(m, "FakeDriver"); + _FakeDriver.def(py::init()); + _FakeDriver.def_static("class_name", &H2Core::FakeDriver::class_name); + _FakeDriver.def("init", &H2Core::FakeDriver::init, + py::arg("nBufferSize")); + _FakeDriver.def("connect", &H2Core::FakeDriver::connect); + _FakeDriver.def("disconnect", &H2Core::FakeDriver::disconnect); + _FakeDriver.def("getBufferSize", &H2Core::FakeDriver::getBufferSize); + _FakeDriver.def("getSampleRate", &H2Core::FakeDriver::getSampleRate); + _FakeDriver.def("getOut_L", &H2Core::FakeDriver::getOut_L); + _FakeDriver.def("getOut_R", &H2Core::FakeDriver::getOut_R); + _FakeDriver.def("play", &H2Core::FakeDriver::play); + _FakeDriver.def("stop", &H2Core::FakeDriver::stop); + _FakeDriver.def("locate", &H2Core::FakeDriver::locate, + py::arg("nFrame")); + _FakeDriver.def("updateTransportInfo", &H2Core::FakeDriver::updateTransportInfo); + _FakeDriver.def("setBpm", &H2Core::FakeDriver::setBpm, + py::arg("fBPM")); + + py::class_> _DiskWriterDriver(m, "DiskWriterDriver"); + _DiskWriterDriver.def(py::init()); + _DiskWriterDriver.def_readwrite("m_nSampleRate", &H2Core::DiskWriterDriver::m_nSampleRate); + _DiskWriterDriver.def_readwrite("m_sFilename", &H2Core::DiskWriterDriver::m_sFilename); + _DiskWriterDriver.def_readwrite("m_nBufferSize", &H2Core::DiskWriterDriver::m_nBufferSize); + _DiskWriterDriver.def_readwrite("m_nSampleDepth", &H2Core::DiskWriterDriver::m_nSampleDepth); + _DiskWriterDriver.def_readwrite("m_pOut_L", &H2Core::DiskWriterDriver::m_pOut_L); + _DiskWriterDriver.def_readwrite("m_pOut_R", &H2Core::DiskWriterDriver::m_pOut_R); + _DiskWriterDriver.def_static("class_name", &H2Core::DiskWriterDriver::class_name); + _DiskWriterDriver.def("init", &H2Core::DiskWriterDriver::init, + py::arg("nBufferSize")); + _DiskWriterDriver.def("connect", &H2Core::DiskWriterDriver::connect); + _DiskWriterDriver.def("disconnect", &H2Core::DiskWriterDriver::disconnect); + // [banned] _DiskWriterDriver.def("write", &H2Core::DiskWriterDriver::write, + // [banned] py::arg("buffer_L"), + // [banned] py::arg("buffer_R"), + // [banned] py::arg("bufferSize")); + _DiskWriterDriver.def("audioEngine_process_checkBPMChanged", &H2Core::DiskWriterDriver::audioEngine_process_checkBPMChanged); + _DiskWriterDriver.def("getBufferSize", &H2Core::DiskWriterDriver::getBufferSize); + _DiskWriterDriver.def("getSampleRate", &H2Core::DiskWriterDriver::getSampleRate); + _DiskWriterDriver.def("getOut_L", &H2Core::DiskWriterDriver::getOut_L); + _DiskWriterDriver.def("getOut_R", &H2Core::DiskWriterDriver::getOut_R); + _DiskWriterDriver.def("setFileName", &H2Core::DiskWriterDriver::setFileName, + py::arg("sFilename")); + _DiskWriterDriver.def("play", &H2Core::DiskWriterDriver::play); + _DiskWriterDriver.def("stop", &H2Core::DiskWriterDriver::stop); + _DiskWriterDriver.def("locate", &H2Core::DiskWriterDriver::locate, + py::arg("nFrame")); + _DiskWriterDriver.def("updateTransportInfo", &H2Core::DiskWriterDriver::updateTransportInfo); + _DiskWriterDriver.def("setBpm", &H2Core::DiskWriterDriver::setBpm, + py::arg("fBPM")); + + py::class_> _AlsaAudioDriver(m, "AlsaAudioDriver"); + _AlsaAudioDriver.def(py::init()); + _AlsaAudioDriver.def_readwrite("m_bIsRunning", &H2Core::AlsaAudioDriver::m_bIsRunning); + _AlsaAudioDriver.def_readwrite("m_nBufferSize", &H2Core::AlsaAudioDriver::m_nBufferSize); + _AlsaAudioDriver.def_readwrite("m_pOut_L", &H2Core::AlsaAudioDriver::m_pOut_L); + _AlsaAudioDriver.def_readwrite("m_pOut_R", &H2Core::AlsaAudioDriver::m_pOut_R); + _AlsaAudioDriver.def_readwrite("m_nXRuns", &H2Core::AlsaAudioDriver::m_nXRuns); + _AlsaAudioDriver.def_readwrite("m_sAlsaAudioDevice", &H2Core::AlsaAudioDriver::m_sAlsaAudioDevice); + _AlsaAudioDriver.def_static("class_name", &H2Core::AlsaAudioDriver::class_name); + _AlsaAudioDriver.def("init", &H2Core::AlsaAudioDriver::init, + py::arg("nBufferSize")); + _AlsaAudioDriver.def("connect", &H2Core::AlsaAudioDriver::connect); + _AlsaAudioDriver.def("disconnect", &H2Core::AlsaAudioDriver::disconnect); + _AlsaAudioDriver.def("getBufferSize", &H2Core::AlsaAudioDriver::getBufferSize); + _AlsaAudioDriver.def("getSampleRate", &H2Core::AlsaAudioDriver::getSampleRate); + _AlsaAudioDriver.def("getOut_L", &H2Core::AlsaAudioDriver::getOut_L); + _AlsaAudioDriver.def("getOut_R", &H2Core::AlsaAudioDriver::getOut_R); + _AlsaAudioDriver.def("updateTransportInfo", &H2Core::AlsaAudioDriver::updateTransportInfo); + _AlsaAudioDriver.def("play", &H2Core::AlsaAudioDriver::play); + _AlsaAudioDriver.def("stop", &H2Core::AlsaAudioDriver::stop); + _AlsaAudioDriver.def("locate", &H2Core::AlsaAudioDriver::locate, + py::arg("nFrame")); + _AlsaAudioDriver.def("setBpm", &H2Core::AlsaAudioDriver::setBpm, + py::arg("fBPM")); + + py::class_> _Tag(m, "Tag"); + _Tag.def_readwrite("nBar", &H2Core::Timeline::Tag::nBar); + _Tag.def_readwrite("sTag", &H2Core::Timeline::Tag::sTag); + + py::class_> _TempoMarker(m, "TempoMarker"); + _TempoMarker.def_readwrite("nBar", &H2Core::Timeline::TempoMarker::nBar); + _TempoMarker.def_readwrite("fBpm", &H2Core::Timeline::TempoMarker::fBpm); + + py::class_> _AddMidiNoteVector(m, "AddMidiNoteVector"); + _AddMidiNoteVector.def_readwrite("m_column", &H2Core::EventQueue::AddMidiNoteVector::m_column); + _AddMidiNoteVector.def_readwrite("m_row", &H2Core::EventQueue::AddMidiNoteVector::m_row); + _AddMidiNoteVector.def_readwrite("m_pattern", &H2Core::EventQueue::AddMidiNoteVector::m_pattern); + _AddMidiNoteVector.def_readwrite("m_length", &H2Core::EventQueue::AddMidiNoteVector::m_length); + _AddMidiNoteVector.def_readwrite("f_velocity", &H2Core::EventQueue::AddMidiNoteVector::f_velocity); + _AddMidiNoteVector.def_readwrite("f_pan", &H2Core::EventQueue::AddMidiNoteVector::f_pan); + _AddMidiNoteVector.def_readwrite("nk_noteKeyVal", &H2Core::EventQueue::AddMidiNoteVector::nk_noteKeyVal); + _AddMidiNoteVector.def_readwrite("no_octaveKeyVal", &H2Core::EventQueue::AddMidiNoteVector::no_octaveKeyVal); + _AddMidiNoteVector.def_readwrite("b_isMidi", &H2Core::EventQueue::AddMidiNoteVector::b_isMidi); + _AddMidiNoteVector.def_readwrite("b_isInstrumentMode", &H2Core::EventQueue::AddMidiNoteVector::b_isInstrumentMode); + _AddMidiNoteVector.def_readwrite("b_noteExist", &H2Core::EventQueue::AddMidiNoteVector::b_noteExist); + + // enum ErrorMessages + py::enum_(_Hydrogen, "ErrorMessages") + .value("UNKNOWN_DRIVER", H2Core::Hydrogen::ErrorMessages::UNKNOWN_DRIVER) + .value("ERROR_STARTING_DRIVER", H2Core::Hydrogen::ErrorMessages::ERROR_STARTING_DRIVER) + .value("JACK_SERVER_SHUTDOWN", H2Core::Hydrogen::ErrorMessages::JACK_SERVER_SHUTDOWN) + .value("JACK_CANNOT_ACTIVATE_CLIENT", H2Core::Hydrogen::ErrorMessages::JACK_CANNOT_ACTIVATE_CLIENT) + .value("JACK_CANNOT_CONNECT_OUTPUT_PORT", H2Core::Hydrogen::ErrorMessages::JACK_CANNOT_CONNECT_OUTPUT_PORT) + .value("JACK_CANNOT_CLOSE_CLIENT", H2Core::Hydrogen::ErrorMessages::JACK_CANNOT_CLOSE_CLIENT) + .value("JACK_ERROR_IN_PORT_REGISTER", H2Core::Hydrogen::ErrorMessages::JACK_ERROR_IN_PORT_REGISTER) + .value("OSC_CANNOT_CONNECT_TO_PORT", H2Core::Hydrogen::ErrorMessages::OSC_CANNOT_CONNECT_TO_PORT); + + // enum GUIState + py::enum_(_Hydrogen, "GUIState") + .value("notReady", H2Core::Hydrogen::GUIState::notReady) + .value("unavailable", H2Core::Hydrogen::GUIState::unavailable) + .value("ready", H2Core::Hydrogen::GUIState::ready); + + // enum Lookup + py::enum_(_Filesystem, "Lookup") + .value("stacked", H2Core::Filesystem::Lookup::stacked) + .value("user", H2Core::Filesystem::Lookup::user) + .value("system", H2Core::Filesystem::Lookup::system); + + // enum file_perms + py::enum_(_Filesystem, "file_perms") + .value("is_dir", H2Core::Filesystem::file_perms::is_dir) + .value("is_file", H2Core::Filesystem::file_perms::is_file) + .value("is_readable", H2Core::Filesystem::file_perms::is_readable) + .value("is_writable", H2Core::Filesystem::file_perms::is_writable) + .value("is_executable", H2Core::Filesystem::file_perms::is_executable); + + // enum ActionMode + py::enum_(_Song, "ActionMode") + .value("selectMode", H2Core::Song::ActionMode::selectMode) + .value("drawMode", H2Core::Song::ActionMode::drawMode); + + // enum SongMode + py::enum_(_Song, "SongMode") + .value("PATTERN_MODE", H2Core::Song::SongMode::PATTERN_MODE) + .value("SONG_MODE", H2Core::Song::SongMode::SONG_MODE); + + py::class_> _Entry(m, "Entry"); + _Entry.def_readwrite("filePath", &H2Core::Playlist::Entry::filePath); + _Entry.def_readwrite("fileExists", &H2Core::Playlist::Entry::fileExists); + _Entry.def_readwrite("scriptPath", &H2Core::Playlist::Entry::scriptPath); + _Entry.def_readwrite("scriptEnabled", &H2Core::Playlist::Entry::scriptEnabled); + + // enum UI_SCALING_POLICY + py::enum_(_Preferences, "UI_SCALING_POLICY") + .value("UI_SCALING_SMALLER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SMALLER) + .value("UI_SCALING_SYSTEM", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SYSTEM) + .value("UI_SCALING_LARGER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_LARGER); + + // enum UI_LAYOUT_TYPES + py::enum_(_Preferences, "UI_LAYOUT_TYPES") + .value("UI_LAYOUT_SINGLE_PANE", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_SINGLE_PANE) + .value("UI_LAYOUT_TABBED", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_TABBED); + + // enum FontSize + py::enum_(_Preferences, "FontSize") + .value("Normal", H2Core::Preferences::FontSize::Normal) + .value("Small", H2Core::Preferences::FontSize::Small) + .value("Large", H2Core::Preferences::FontSize::Large); + + // enum JackBBTSyncMethod + py::enum_(_Preferences, "JackBBTSyncMethod") + .value("constMeasure", H2Core::Preferences::JackBBTSyncMethod::constMeasure) + .value("identicalBars", H2Core::Preferences::JackBBTSyncMethod::identicalBars); + + // enum JackTrackOutputMode + py::enum_(_Preferences, "JackTrackOutputMode") + .value("postFader", H2Core::Preferences::JackTrackOutputMode::postFader) + .value("preFader", H2Core::Preferences::JackTrackOutputMode::preFader); + + py::class_> _Rubberband(m, "Rubberband"); + _Rubberband.def(py::init<>()); + _Rubberband.def(py::init()); + _Rubberband.def_readwrite("use", &H2Core::Sample::Rubberband::use); + _Rubberband.def_readwrite("divider", &H2Core::Sample::Rubberband::divider); + _Rubberband.def_readwrite("pitch", &H2Core::Sample::Rubberband::pitch); + _Rubberband.def_readwrite("c_settings", &H2Core::Sample::Rubberband::c_settings); + _Rubberband.def("operator==", &H2Core::Sample::Rubberband::operator==, + "equal to operator", + py::arg("b")); + _Rubberband.def("toQString", &H2Core::Sample::Rubberband::toQString, + py::arg("sPrefix"), + py::arg("bShort")); + + py::class_> _Loops(m, "Loops"); + _Loops.def(py::init<>()); + _Loops.def(py::init()); + _Loops.def_readwrite("start_frame", &H2Core::Sample::Loops::start_frame); + _Loops.def_readwrite("loop_frame", &H2Core::Sample::Loops::loop_frame); + _Loops.def_readwrite("end_frame", &H2Core::Sample::Loops::end_frame); + _Loops.def_readwrite("count", &H2Core::Sample::Loops::count); + _Loops.def_readwrite("mode", &H2Core::Sample::Loops::mode); + _Loops.def("operator==", &H2Core::Sample::Loops::operator==, + "equal to operator", + py::arg("b")); + _Loops.def("toQString", &H2Core::Sample::Loops::toQString, + py::arg("sPrefix"), + py::arg("bShort")); + + // enum SampleSelectionAlgo + py::enum_(_Instrument, "SampleSelectionAlgo") + .value("VELOCITY", H2Core::Instrument::SampleSelectionAlgo::VELOCITY) + .value("ROUND_ROBIN", H2Core::Instrument::SampleSelectionAlgo::ROUND_ROBIN) + .value("RANDOM", H2Core::Instrument::SampleSelectionAlgo::RANDOM); + + // enum Timebase + py::enum_(_JackAudioDriver, "Timebase") + .value("Master", H2Core::JackAudioDriver::Timebase::Master) + .value("Slave", H2Core::JackAudioDriver::Timebase::Slave) + .value("None", H2Core::JackAudioDriver::Timebase::None); + + // enum LoopMode + py::enum_(_Loops, "LoopMode") + .value("FORWARD", H2Core::Sample::Loops::LoopMode::FORWARD) + .value("REVERSE", H2Core::Sample::Loops::LoopMode::REVERSE) + .value("PINGPONG", H2Core::Sample::Loops::LoopMode::PINGPONG); + +} \ No newline at end of file diff --git a/src/bindings/h2core_module.hpp b/src/bindings/h2core_module.hpp new file mode 100644 index 000000000..e09a9051c --- /dev/null +++ b/src/bindings/h2core_module.hpp @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include From 0b68f860ef497bc88c6cbb87cf5cb1ea61e1de4b Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Sat, 3 Jul 2021 23:43:52 +0200 Subject: [PATCH 04/24] typos --- src/bindings/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/README.md b/src/bindings/README.md index e4094543e..2b80309ab 100644 --- a/src/bindings/README.md +++ b/src/bindings/README.md @@ -1,13 +1,13 @@ # Python Bindings To generate bindings after a change in hydrogen headers/API, -to install [HydraGen](https://github.com/charbeljc/HydraGen) +install [HydraGen](https://github.com/charbeljc/HydraGen) ```bash pip3 install git+https://github.com/charbeljc/HydraGen.git ``` -Edit include_paths in `h2core.yaml` (sorry, this is work in progress), then +Then, edit include_paths in `h2core.yaml` (sorry, this is work in progress), and finally ```bash cd src/bindings hydragen h2core.yaml . From 3f4116ed066db35898bf6c4f5193dc319c73420b Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Sun, 4 Jul 2021 01:21:11 +0200 Subject: [PATCH 05/24] missing includes for bindings --- src/bindings/include/qtcasters.h | 53 ++++++++++++++++++++++++++++++++ src/bindings/include/qtreset.h | 1 + 2 files changed, 54 insertions(+) create mode 100644 src/bindings/include/qtcasters.h create mode 100644 src/bindings/include/qtreset.h diff --git a/src/bindings/include/qtcasters.h b/src/bindings/include/qtcasters.h new file mode 100644 index 000000000..b089d7ae1 --- /dev/null +++ b/src/bindings/include/qtcasters.h @@ -0,0 +1,53 @@ +#include +#undef slots +#include +#include +#include +#include +#include +#include +#include + + +namespace pybind11 { namespace detail { + template <> struct type_caster : public type_caster_base { + using base = type_caster_base; + public: + /** + * This macro establishes the name 'inty' in + * function signatures and declares a local variable + * 'value' of type inty + */ + PYBIND11_TYPE_CASTER(QString, _("QString")); + + /** + * Conversion part 1 (Python->C++): convert a PyObject into a inty + * instance or return false upon failure. The second argument + * indicates whether implicit conversions should be applied. + */ + bool load(handle src, bool) { + /* Extract PyObject from handle */ + PyObject *source = src.ptr(); + if ( !PyUnicode_Check(source) ) + return false; + ssize_t sz; + const char *s = PyUnicode_AsUTF8AndSize(source, &sz); + value = QString::fromUtf8(s, sz); + /* Try converting into a Python integer value */ + /* Ensure return code was OK (to avoid out-of-range errors etc) */ + return true; //!(value.long_value == -1 && !PyErr_Occurred()); + } + + /** + * Conversion part 2 (C++ -> Python): convert an inty instance into + * a Python object. The second and third arguments are used to + * indicate the return value policy and parent object (for + * ``return_value_policy::reference_internal``) and are generally + * ignored by implicit casters. + */ + static handle cast(QString src, return_value_policy /* policy */, handle /* parent */) { + QByteArray utf8 = src.toUtf8(); + return PyUnicode_FromStringAndSize(utf8.data(), utf8.size()); + } + }; +}} // namespace pybind11::detail \ No newline at end of file diff --git a/src/bindings/include/qtreset.h b/src/bindings/include/qtreset.h new file mode 100644 index 000000000..8f1dd7036 --- /dev/null +++ b/src/bindings/include/qtreset.h @@ -0,0 +1 @@ +#undef slots From 626747f8adccf09e5246713f6515bd63b4b6fc79 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Sun, 4 Jul 2021 01:21:28 +0200 Subject: [PATCH 06/24] integrate with build system --- CMakeLists.txt | 4 ++++ build.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b9a397f..f6a700592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,7 @@ ENDIF() OPTION(WANT_CPPUNIT "Include CppUnit test suite" ON) OPTION(FIXME_DISABLE_OPTIMIZATIONS "Fix broken builds by turning off optimizations" OFF) +OPTION(WANT_PYBINDINGS "Build python extension module" OFF) include(Sanitizers) INCLUDE(StatusSupportOptions) @@ -400,6 +401,9 @@ ADD_SUBDIRECTORY(src/gui) IF(EXISTS ${CMAKE_SOURCE_DIR}/data/doc/CMakeLists.txt) ADD_SUBDIRECTORY(data/doc) ENDIF() +IF(WANT_PYBINDINGS) + ADD_SUBDIRECTORY(src/bindings) +ENDIF() INSTALL(DIRECTORY data DESTINATION ${H2_DATA_PATH} PATTERN ".git" EXCLUDE PATTERN "i18n" EXCLUDE PATTERN doc EXCLUDE) IF(NOT MINGW AND NOT APPLE) INSTALL(FILES ${CMAKE_SOURCE_DIR}/linux/org.hydrogenmusic.Hydrogen.appdata.xml DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/appdata") diff --git a/build.sh b/build.sh index 208601b1b..3b340ee90 100755 --- a/build.sh +++ b/build.sh @@ -22,6 +22,7 @@ QTDIR=${QTDIR:-/usr/lib/qt} VERBOSE=${VERBOSE:-0} +WANT_PYBINDINGS=${WANT_PYBINDINGS:-0} CMAKE_OPTIONS=" -DCMAKE_COLOR_MAKEFILE=1 \ -DWANT_DEBUG=1 \ @@ -37,6 +38,9 @@ CMAKE_OPTIONS=" -DWANT_COREAUDIO=1 \ -DWANT_COREMIDI=1 " +if [ ${WANT_PYBINDINGS} -ne 0 ]; then + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DWANT_PYBINDINGS=1" +fi MAKE_OPTS="-j 3" H2FLAGS="-V0xf" BUILD_DIR=./build From 9ccdd4fc9606f610d5c0184792068334aea4aa1e Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Sun, 4 Jul 2021 22:46:31 +0200 Subject: [PATCH 07/24] group banned symbols add more __repr__() methods --- src/bindings/h2core.yaml | 64 ++++++++++++++++++++++++---------- src/bindings/h2core_module.cpp | 62 ++++++++++++++++++++++++++++---- 2 files changed, 100 insertions(+), 26 deletions(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index fefb200a9..deb7c2057 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -70,11 +70,10 @@ module: H2Core::Sampler: core/Sampler/Sampler.h H2Core::Synth: core/Synth/Synth.h ban: + # Qt non namespace - QColor::QColor(QColor &&) # ban this constructor, pybind11 bark on this - QColor::name(QColor::NameFormat) - QColor::operator= - - H2Core::Note::match - - H2Core::Pattern::find_note - std::thread::thread(const std::thread &) - std::thread::operator=(const std::thread &) - std::thread::operator=(std::thread &&) @@ -88,8 +87,6 @@ module: - std::__cow_string::__cow_string(std::__cow_string &&) - std::runtime_error::operator=(std::runtime_error &&) - std::runtime_error::runtime_error(std::runtime_error &&) - - targeted_element - - MidiActionManager::targeted_element - _locker_struct - QDomNodePrivate - QStringList @@ -100,6 +97,21 @@ module: - QFileInfo::QFileInfo(QFileInfoPrivate *) - QFileInfo::operator=(QFileInfo &&) - QFileInfo::exists + - QRgba64::operator= + - QMetaType + - QStringRef + - QStringView + - QByteArray + - QChar + - QDomNode + - QFileInfo + - QLatin1String + - "*::metaObject()" + - "*::qt_metacall(QMetaObject::Call, int, void **)" + - "*::qt_static_metacall(QObject *, QMetaObject::Call, int, void **)" + ### Hydrogen names + - targeted_element + - MidiActionManager::targeted_element - H2Core::AlsaAudioDriver::AlsaAudioDriver() - H2Core::AlsaMidiDriver::midi_action - H2Core::JackAudioDriver::m_pClient @@ -111,24 +123,14 @@ module: - H2Core::DiskWriterDriver::m_processCallback - H2Core::AlsaAudioDriver::m_processCallback # Qt Reduction, phase 2 - - H2Core::LadspaFX::m_pLibrary - - H2Core::AudioEngine::m_EngineMutex + # - H2Core::LadspaFX::m_pLibrary # QLibrary + - H2Core::AudioEngine::m_EngineMutex # QMutex ? - H2Core::AudioEngine::m_MutexOutputPointer - H2Core::AudioEngine::m_LockingThread - H2Core::AudioEngine::m_currentTickTime - - QRgba64::operator= - - QMetaType - - QStringRef - - QStringView - - QByteArray - - QChar - - QDomNode - - QFileInfo - - QLatin1String - - "*::metaObject()" - - "*::qt_metacall(QMetaObject::Call, int, void **)" - - "*::qt_static_metacall(QObject *, QMetaObject::Call, int, void **)" - - "H2Core::DiskWriterDriver::write" # inlined ? + - H2Core::Note::match + - H2Core::Pattern::find_note + - H2Core::DiskWriterDriver::write # inlined ? - H2Core::CoreAudioDriver - H2Core::PulseAudioDriver - H2Core::Hydrogen::previewSample # defined in headers but no implementation @@ -138,6 +140,8 @@ module: - H2Core::Preferences::setPreferencesOverwritePath - H2Core::Preferences::getPreferencesOverwritePath - H2Core::Preferences::getDataDirectory + - H2Core::LadspaControlPort::__class_name + - H2Core::LadspaControlPort::class_name cleaners: - qtreset.h plugins: @@ -209,11 +213,33 @@ module: [](const H2Core::Sample & sample) { return ""; } + - name: H2Core::LadspaFX::__repr__ + code: | + [](H2Core::LadspaFX & fx) { + return ""; + } + - name: H2Core::LadspaFXInfo::__repr__ + code: | + [](H2Core::LadspaFXInfo & fxi) { + return ""; + } policies: - name: H2Core::Drumkit::get_instruments policy: py::return_value_policy::reference_internal - name: H2Core::Hydrogen::get_instance policy: py::return_value_policy::reference + - name: H2Core::Logger::bootstrap + policy: py::return_value_policy::reference + - name: H2Core::Logger::get_instance + policy: py::return_value_policy::reference + - name: H2Core::Effects::get_instance + policy: py::return_value_policy::reference + - name: H2Core::EventQueue::get_instance + policy: py::return_value_policy::reference + - name: H2Core::Playlist::get_instance + policy: py::return_value_policy::reference + - name: H2Core::Preferences::get_instance + policy: py::return_value_policy::reference prolog: | using namespace H2Core; diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index 5e1e0c678..a7b0e20a4 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -41,11 +41,13 @@ PYBIND11_MODULE(h2core, m) { py::class_> _Logger(m, "Logger"); _Logger.def_static("bootstrap", &H2Core::Logger::bootstrap, "create the logger instance if not exists, set the log level and return the instance", - py::arg("msk")); + py::arg("msk"), + py::return_value_policy::reference); _Logger.def_static("create_instance", &H2Core::Logger::create_instance, "If #__instance equals 0, a new H2Core::Logger singleton will be created and stored in it."); _Logger.def_static("get_instance", &H2Core::Logger::get_instance, - "Returns a pointer to the current H2Core::Logger singleton stored in #__instance."); + "Returns a pointer to the current H2Core::Logger singleton stored in #__instance.", + py::return_value_policy::reference); _Logger.def("should_log", &H2Core::Logger::should_log, "return true if the level is set in the bitmask", py::arg("lvl")); @@ -87,7 +89,7 @@ PYBIND11_MODULE(h2core, m) { _MidiMessage.def_readwrite("m_nData1", &H2Core::MidiMessage::m_nData1); _MidiMessage.def_readwrite("m_nData2", &H2Core::MidiMessage::m_nData2); _MidiMessage.def_readwrite("m_nChannel", &H2Core::MidiMessage::m_nChannel); - _MidiMessage.def_readwrite("m_sysexData", &H2Core::MidiMessage::m_sysexData); + // ['>] _MidiMessage.def_readwrite("m_sysexData", &H2Core::MidiMessage::m_sysexData); py::class_> _runtime_error(m, "runtime_error"); _runtime_error.def(py::init()); @@ -712,13 +714,30 @@ PYBIND11_MODULE(h2core, m) { _LadspaFX.def("setVolume", &H2Core::LadspaFX::setVolume, py::arg("fValue")); _LadspaFX.def("getVolume", &H2Core::LadspaFX::getVolume); + _LadspaFX.def("__repr__", + [](H2Core::LadspaFX & fx) { + return ""; +} +); + + py::class_> _LadspaControlPort(m, "LadspaControlPort"); + _LadspaControlPort.def(py::init<>()); + _LadspaControlPort.def_readwrite("sName", &H2Core::LadspaControlPort::sName); + _LadspaControlPort.def_readwrite("isToggle", &H2Core::LadspaControlPort::isToggle); + _LadspaControlPort.def_readwrite("m_bIsInteger", &H2Core::LadspaControlPort::m_bIsInteger); + _LadspaControlPort.def_readwrite("fDefaultValue", &H2Core::LadspaControlPort::fDefaultValue); + _LadspaControlPort.def_readwrite("fControlValue", &H2Core::LadspaControlPort::fControlValue); + _LadspaControlPort.def_readwrite("fLowerBound", &H2Core::LadspaControlPort::fLowerBound); + _LadspaControlPort.def_readwrite("fUpperBound", &H2Core::LadspaControlPort::fUpperBound); + // [banned] _LadspaControlPort.def_static("class_name", &H2Core::LadspaControlPort::class_name); py::class_> _Effects(m, "Effects"); _Effects.def_static("class_name", &H2Core::Effects::class_name); _Effects.def_static("create_instance", &H2Core::Effects::create_instance, "If #__instance equals 0, a new Effects singleton will be created and stored in it."); _Effects.def_static("get_instance", &H2Core::Effects::get_instance, - "Returns a pointer to the current Effects singleton stored in #__instance."); + "Returns a pointer to the current Effects singleton stored in #__instance.", + py::return_value_policy::reference); _Effects.def("getLadspaFX", &H2Core::Effects::getLadspaFX, py::arg("nFX")); _Effects.def("setLadspaFX", &H2Core::Effects::setLadspaFX, @@ -759,6 +778,11 @@ PYBIND11_MODULE(h2core, m) { _LadspaFXInfo.def_static("alphabeticOrder", &H2Core::LadspaFXInfo::alphabeticOrder, py::arg("a"), py::arg("b")); + _LadspaFXInfo.def("__repr__", + [](H2Core::LadspaFXInfo & fxi) { + return ""; +} +); py::class_> _Timeline(m, "Timeline"); _Timeline.def(py::init<>()); @@ -822,7 +846,8 @@ PYBIND11_MODULE(h2core, m) { _EventQueue.def_static("create_instance", &H2Core::EventQueue::create_instance, "If #__instance equals 0, a new EventQueue singleton will be created and stored in it."); _EventQueue.def_static("get_instance", &H2Core::EventQueue::get_instance, - "Returns a pointer to the current EventQueue singleton stored in #__instance."); + "Returns a pointer to the current EventQueue singleton stored in #__instance.", + py::return_value_policy::reference); _EventQueue.def("push_event", &H2Core::EventQueue::push_event, "Queues the next event into the EventQueue.", py::arg("type"), @@ -1687,7 +1712,8 @@ PYBIND11_MODULE(h2core, m) { _Playlist.def_static("create_instance", &H2Core::Playlist::create_instance, "If #__instance equals 0, a new Playlist singleton will be created and stored in it."); _Playlist.def_static("get_instance", &H2Core::Playlist::get_instance, - "Returns a pointer to the current Playlist singleton stored in #__instance."); + "Returns a pointer to the current Playlist singleton stored in #__instance.", + py::return_value_policy::reference); _Playlist.def("activateSong", &H2Core::Playlist::activateSong, py::arg("SongNumber")); _Playlist.def("size", &H2Core::Playlist::size); @@ -1780,7 +1806,8 @@ PYBIND11_MODULE(h2core, m) { _Preferences.def_static("create_instance", &H2Core::Preferences::create_instance, "If #__instance equals 0, a new Preferences singleton will be created and stored in it."); _Preferences.def_static("get_instance", &H2Core::Preferences::get_instance, - "Returns a pointer to the current Preferences singleton stored in #__instance."); + "Returns a pointer to the current Preferences singleton stored in #__instance.", + py::return_value_policy::reference); _Preferences.def("loadPreferences", &H2Core::Preferences::loadPreferences, "Load the preferences file", py::arg("bGlobal")); @@ -2786,6 +2813,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("value")); // enum log_levels + // py::enum_(_Logger, "log_levels") .value("None", H2Core::Logger::log_levels::None) .value("Error", H2Core::Logger::log_levels::Error) @@ -2796,6 +2824,7 @@ PYBIND11_MODULE(h2core, m) { .value("AELockTracing", H2Core::Logger::log_levels::AELockTracing); // enum MidiMessageType + // py::enum_(_MidiMessage, "MidiMessageType") .value("UNKNOWN", H2Core::MidiMessage::MidiMessageType::UNKNOWN) .value("SYSEX", H2Core::MidiMessage::MidiMessageType::SYSEX) @@ -2889,11 +2918,13 @@ PYBIND11_MODULE(h2core, m) { py::arg("bShort")); // enum NameFormat + // py::enum_(_QColor, "NameFormat") .value("HexRgb", QColor::NameFormat::HexRgb) .value("HexArgb", QColor::NameFormat::HexArgb); // enum Spec + // py::enum_(_QColor, "Spec") .value("Invalid", QColor::Spec::Invalid) .value("Rgb", QColor::Spec::Rgb) @@ -2903,6 +2934,7 @@ PYBIND11_MODULE(h2core, m) { .value("ExtendedRgb", QColor::Spec::ExtendedRgb); // enum Octave + // py::enum_(_Note, "Octave") .value("P8Z", H2Core::Note::Octave::P8Z) .value("P8Y", H2Core::Note::Octave::P8Y) @@ -2913,6 +2945,7 @@ PYBIND11_MODULE(h2core, m) { .value("P8C", H2Core::Note::Octave::P8C); // enum Key + // py::enum_(_Note, "Key") .value("C", H2Core::Note::Key::C) .value("Cs", H2Core::Note::Key::Cs) @@ -2928,6 +2961,7 @@ PYBIND11_MODULE(h2core, m) { .value("B", H2Core::Note::Key::B); // enum PAN_LAW_TYPES + // py::enum_(_Sampler, "PAN_LAW_TYPES") .value("RATIO_STRAIGHT_POLYGONAL", H2Core::Sampler::PAN_LAW_TYPES::RATIO_STRAIGHT_POLYGONAL) .value("RATIO_CONST_POWER", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_POWER) @@ -3234,6 +3268,7 @@ PYBIND11_MODULE(h2core, m) { _AddMidiNoteVector.def_readwrite("b_noteExist", &H2Core::EventQueue::AddMidiNoteVector::b_noteExist); // enum ErrorMessages + // py::enum_(_Hydrogen, "ErrorMessages") .value("UNKNOWN_DRIVER", H2Core::Hydrogen::ErrorMessages::UNKNOWN_DRIVER) .value("ERROR_STARTING_DRIVER", H2Core::Hydrogen::ErrorMessages::ERROR_STARTING_DRIVER) @@ -3245,18 +3280,21 @@ PYBIND11_MODULE(h2core, m) { .value("OSC_CANNOT_CONNECT_TO_PORT", H2Core::Hydrogen::ErrorMessages::OSC_CANNOT_CONNECT_TO_PORT); // enum GUIState + // py::enum_(_Hydrogen, "GUIState") .value("notReady", H2Core::Hydrogen::GUIState::notReady) .value("unavailable", H2Core::Hydrogen::GUIState::unavailable) .value("ready", H2Core::Hydrogen::GUIState::ready); // enum Lookup + // py::enum_(_Filesystem, "Lookup") .value("stacked", H2Core::Filesystem::Lookup::stacked) .value("user", H2Core::Filesystem::Lookup::user) .value("system", H2Core::Filesystem::Lookup::system); // enum file_perms + // py::enum_(_Filesystem, "file_perms") .value("is_dir", H2Core::Filesystem::file_perms::is_dir) .value("is_file", H2Core::Filesystem::file_perms::is_file) @@ -3265,11 +3303,13 @@ PYBIND11_MODULE(h2core, m) { .value("is_executable", H2Core::Filesystem::file_perms::is_executable); // enum ActionMode + // py::enum_(_Song, "ActionMode") .value("selectMode", H2Core::Song::ActionMode::selectMode) .value("drawMode", H2Core::Song::ActionMode::drawMode); // enum SongMode + // py::enum_(_Song, "SongMode") .value("PATTERN_MODE", H2Core::Song::SongMode::PATTERN_MODE) .value("SONG_MODE", H2Core::Song::SongMode::SONG_MODE); @@ -3281,28 +3321,33 @@ PYBIND11_MODULE(h2core, m) { _Entry.def_readwrite("scriptEnabled", &H2Core::Playlist::Entry::scriptEnabled); // enum UI_SCALING_POLICY + // py::enum_(_Preferences, "UI_SCALING_POLICY") .value("UI_SCALING_SMALLER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SMALLER) .value("UI_SCALING_SYSTEM", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SYSTEM) .value("UI_SCALING_LARGER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_LARGER); // enum UI_LAYOUT_TYPES + // py::enum_(_Preferences, "UI_LAYOUT_TYPES") .value("UI_LAYOUT_SINGLE_PANE", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_SINGLE_PANE) .value("UI_LAYOUT_TABBED", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_TABBED); // enum FontSize + // py::enum_(_Preferences, "FontSize") .value("Normal", H2Core::Preferences::FontSize::Normal) .value("Small", H2Core::Preferences::FontSize::Small) .value("Large", H2Core::Preferences::FontSize::Large); // enum JackBBTSyncMethod + // py::enum_(_Preferences, "JackBBTSyncMethod") .value("constMeasure", H2Core::Preferences::JackBBTSyncMethod::constMeasure) .value("identicalBars", H2Core::Preferences::JackBBTSyncMethod::identicalBars); // enum JackTrackOutputMode + // py::enum_(_Preferences, "JackTrackOutputMode") .value("postFader", H2Core::Preferences::JackTrackOutputMode::postFader) .value("preFader", H2Core::Preferences::JackTrackOutputMode::preFader); @@ -3337,18 +3382,21 @@ PYBIND11_MODULE(h2core, m) { py::arg("bShort")); // enum SampleSelectionAlgo + // py::enum_(_Instrument, "SampleSelectionAlgo") .value("VELOCITY", H2Core::Instrument::SampleSelectionAlgo::VELOCITY) .value("ROUND_ROBIN", H2Core::Instrument::SampleSelectionAlgo::ROUND_ROBIN) .value("RANDOM", H2Core::Instrument::SampleSelectionAlgo::RANDOM); // enum Timebase + // py::enum_(_JackAudioDriver, "Timebase") .value("Master", H2Core::JackAudioDriver::Timebase::Master) .value("Slave", H2Core::JackAudioDriver::Timebase::Slave) .value("None", H2Core::JackAudioDriver::Timebase::None); // enum LoopMode + // py::enum_(_Loops, "LoopMode") .value("FORWARD", H2Core::Sample::Loops::LoopMode::FORWARD) .value("REVERSE", H2Core::Sample::Loops::LoopMode::REVERSE) From 761b73e656e096b447001a5659fe09197761f0a5 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Tue, 6 Jul 2021 15:03:58 +0200 Subject: [PATCH 08/24] add missing CMakeLists.txt --- src/bindings/CMakeLists.txt | 46 ++++++++++++++++++++++++++ src/bindings/examples/test_SongPlay.py | 29 ++++++++++++++++ src/bindings/h2core.yaml | 6 ++-- 3 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/bindings/CMakeLists.txt create mode 100644 src/bindings/examples/test_SongPlay.py diff --git a/src/bindings/CMakeLists.txt b/src/bindings/CMakeLists.txt new file mode 100644 index 000000000..8b34fb5c1 --- /dev/null +++ b/src/bindings/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.4...3.18) + +find_package(Python COMPONENTS Interpreter Development REQUIRED) +find_package(pybind11 CONFIG REQUIRED) + +set(core_bindings_library "h2core") +set(CMAKE_AUTOMOC OFF) +set(CMAKE_AUTOUIC OFF) + +set(core_wrapped_header ${CMAKE_CURRENT_SOURCE_DIR}/h2core_module.hpp) +# Add custom target to run binder to generate the binding cpp files. +set(core_generated_sources +${CMAKE_CURRENT_SOURCE_DIR}/h2core_module.cpp +) + +add_library(${core_bindings_library} MODULE ${core_generated_sources}) +target_link_libraries(${core_bindings_library} PRIVATE + pybind11::module pybind11::lto pybind11::windows_extras + hydrogen-core-${VERSION} + Qt5::Core + Qt5::Xml + Qt5::XmlPatterns +) + +target_include_directories(${core_bindings_library} PRIVATE + ${QT_INCLUDES} +# Apply relevant include and link flags. +${python_include_dir} +${CMAKE_SOURCE_DIR}/src +${CMAKE_BINARY_DIR}/src +${CMAKE_SOURCE_DIR}/src/core +${CMAKE_SOURCE_DIR}/src/bindings/include +) + +execute_process(COMMAND + "${_Python_EXECUTABLE}" + "-c" + "from distutils import sysconfig as s;print(s.get_python_lib(plat_specific=True), end='');" + RESULT_VARIABLE _PYTHON_SUCCESS + OUTPUT_VARIABLE PYTHON_SITE_PACKAGES) +message("python site packages: [${PYTHON_SITE_PACKAGES}]") + +pybind11_extension(${core_bindings_library}) +install(TARGETS ${core_bindings_library} + LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}" +) \ No newline at end of file diff --git a/src/bindings/examples/test_SongPlay.py b/src/bindings/examples/test_SongPlay.py new file mode 100644 index 000000000..6f79eb803 --- /dev/null +++ b/src/bindings/examples/test_SongPlay.py @@ -0,0 +1,29 @@ +import h2core +from h2core import Logger, Object, Filesystem, Preferences, Hydrogen, Song +import time +print(h2core) +# log_levels = Logger.log_levels +LogLevel = Logger.log_levels +logger = Logger.bootstrap(LogLevel.Debug | LogLevel.Info | LogLevel.Warning | LogLevel.Error) +Object.bootstrap(logger, True) +Filesystem.bootstrap(logger, "/usr/local/share/hydrogen/data/") +Preferences.create_instance() +prefs = Preferences.instance +Hydrogen.create_instance() +hydrogen = Hydrogen.instance +# dk = Drumkit.load_file( +# "/home/rebelcat/.hydrogen/data/drumkits/RoRBateria/drumkit.xml", False +# ) +song = Song.load("/home/rebelcat/envelope_test.h2song") +hydrogen.song = song +hydrogen.sequencer_play() +time.sleep(3) +hydrogen.sequencer_stop() +# hydrogen.setSong(None) +print(song) +del song +del hydrogen +del prefs +del logger +print("alive:", Object.alive_object_count) + diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index deb7c2057..6697e7c55 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -157,8 +157,7 @@ module: - name: H2Core::Sample::get_data_l() code: | [](const H2Core::Sample & sample) { - - size_t nframes = sample.get_frames(); + size_t nframes = sample.is_empty() ? 0 : sample.get_frames(); auto result = py::array_t(nframes); py::buffer_info buf = result.request(); float *ptr = static_cast(buf.ptr); @@ -171,8 +170,7 @@ module: - name: H2Core::Sample::get_data_r() code: | [](const H2Core::Sample & sample) { - - size_t nframes = sample.get_frames(); + size_t nframes = sample.is_empty() ? 0 : sample.get_frames(); auto result = py::array_t(nframes); py::buffer_info buf = result.request(); float *ptr = static_cast(buf.ptr); From 767ba805e31480fbe1cd093c2cb29c1261b4e2a3 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Tue, 6 Jul 2021 15:24:53 +0200 Subject: [PATCH 09/24] bind get/set method pairs as properties, ban Sample::get_{pan,velocity}_envelope() --- src/bindings/err | 1414 ++++++++++++++++++++++++++++++++ src/bindings/h2core.yaml | 3 + src/bindings/h2core_module.cpp | 1318 ++++++++--------------------- 3 files changed, 1742 insertions(+), 993 deletions(-) create mode 100644 src/bindings/err diff --git a/src/bindings/err b/src/bindings/err new file mode 100644 index 000000000..4cf2fa464 --- /dev/null +++ b/src/bindings/err @@ -0,0 +1,1414 @@ +banned + QColor::QColor(QColor &&) + QColor::name(QColor::NameFormat) + QColor::operator= + std::thread::thread(const std::thread &) + std::thread::operator=(const std::thread &) + std::thread::operator=(std::thread &&) + std::thread::thread(std::thread &&) + std::timed_mutex::timed_mutex(const std::timed_mutex &) + std::timed_mutex::operator= + std::exception::operator=(std::exception &&) + std::exception::exception(std::exception &&) + std::__cow_string + std::__cow_string::operator=(std::__cow_string &&) + std::__cow_string::__cow_string(std::__cow_string &&) + std::runtime_error::operator=(std::runtime_error &&) + std::runtime_error::runtime_error(std::runtime_error &&) + _locker_struct + QDomNodePrivate + QStringList + QFileInfoPrivate + QLibraryPrivate + Entry + QObject + QFileInfo::QFileInfo(QFileInfoPrivate *) + QFileInfo::operator=(QFileInfo &&) + QFileInfo::exists + QRgba64::operator= + QMetaType + QStringRef + QStringView + QByteArray + QChar + QDomNode + QFileInfo + QLatin1String + targeted_element + MidiActionManager::targeted_element + H2Core::AlsaAudioDriver::AlsaAudioDriver() + H2Core::AlsaMidiDriver::midi_action + H2Core::JackAudioDriver::m_pClient + H2Core::Synth::m_playingNotesQueue + H2Core::Hydrogen::m_nInstrumentLookupTable + H2Core::AlsaAudioDriver::m_pPlayback_handle + H2Core::PortAudioDriver::m_processCallback + H2Core::DiskWriterDriver::m_processCallback + H2Core::AlsaAudioDriver::m_processCallback + H2Core::AudioEngine::m_EngineMutex + H2Core::AudioEngine::m_MutexOutputPointer + H2Core::AudioEngine::m_LockingThread + H2Core::AudioEngine::m_currentTickTime + H2Core::Note::match + H2Core::Pattern::find_note + H2Core::DiskWriterDriver::write + H2Core::CoreAudioDriver + H2Core::PulseAudioDriver + H2Core::Hydrogen::previewSample + H2Core::Hydrogen::previewInstrument + H2Core::AudioEngine::prepNoteQueue + H2Core::AudioEngine::renderNote + H2Core::Preferences::setPreferencesOverwritePath + H2Core::Preferences::getPreferencesOverwritePath + H2Core::Preferences::getDataDirectory + H2Core::LadspaControlPort::__class_name + H2Core::LadspaControlPort::class_name +banned pattern + metaObject() + qt_metacall(QMetaObject::Call, int, void **) + qt_static_metacall(QObject *, QMetaObject::Call, int, void **) +include path + /usr/include/c++/10 + /usr/include/x86_64-linux-gnu/c++/10 + /usr/include/x86_64-linux-gnu/qt5 + /usr/include/x86_64-linux-gnu/qt5/QtCore + /usr/include/x86_64-linux-gnu/qt5/QtGui + /usr/include/x86_64-linux-gnu/qt5/QtXml + /home/rebelcat/Hack/hydrogen/src + /home/rebelcat/Hack/hydrogen/build/src + /usr/include/python3.9 + /home/rebelcat/Hack/hydragen/include + /usr/include +clags + -x c++ -fPIC -std=c++14 -fexceptions +cleaners + qtreset.h +plugins + pybind11/stl.h + pybind11/numpy.h + qtcasters.h +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL integral_constant: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL integral_constant: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL integral_constant: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL integral_constant: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL integral_constant: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL integral_constant: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL integral_constant: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:46 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_base: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_ptr: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_ptr: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL _Sp_counted_ptr: + +[W 210704 18:18:47 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL collate: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL collate: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL collate: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL collate: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL numpunct: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL numpunct: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL numpunct: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL numpunct: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:47 dom:221] XXX rpnf: >::char_type *, std::streamsize, std::basic_istream>::char_type)'>, CursorKind.CLASS_DECL basic_istream: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL basic_istream: + +[W 210704 18:18:47 dom:221] XXX rpnf: >::int_type)'>, CursorKind.CLASS_DECL basic_istream: + +[W 210704 18:18:47 dom:221] XXX rpnf: >::char_type *, std::streamsize, std::basic_istream>::char_type)'>, CursorKind.CLASS_DECL basic_istream: + +[W 210704 18:18:47 dom:221] XXX rpnf: , CursorKind.CLASS_DECL basic_istream: + +[W 210704 18:18:47 dom:221] XXX rpnf: >::int_type)'>, CursorKind.CLASS_DECL basic_istream: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL QAtomicTraits: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL QAtomicTraits: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL QAtomicTraits: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL QAtomicTraits: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:48 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:49 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.STRUCT_DECL ratio: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:50 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:50 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.CLASS_DECL mersenne_twister_engine: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:242] TypeDef/Field Enum/Struct: , , '>: +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:51 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:52 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:242] TypeDef/Field Enum/Struct: , , : +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 dom:221] XXX rpnf: , CursorKind.TRANSLATION_UNIT /home/rebelcat/Hack/hydrogen/src/bindings/h2core_module.hpp: + +[W 210704 18:18:53 gen:352] H2Core::CoreMidiDriver not found +[W 210704 18:18:53 gen:352] LashClient not found +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:356] caster for: +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:383] queue for H2Core::Synth +[I 210704 18:18:53 gen:400] queue for member H2Core::Synth::noteOn(H2Core::Note *) +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Note::get_key() +[I 210704 18:18:53 gen:400] queue for member H2Core::Note::get_octave() +[I 210704 18:18:53 gen:393] queue member: H2Core::Note:Key +[I 210704 18:18:53 gen:393] queue member: H2Core::Note:Octave +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Object::bootstrap(H2Core::Logger *, bool) +[I 210704 18:18:53 gen:393] queue member: H2Core::Object: +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:393] queue member: H2Core::Logger:log_levels +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Sampler::setInterpolateMode(Interpolation::InterpolateMode) +[I 210704 18:18:53 gen:393] queue member: H2Core::Sampler:PAN_LAW_TYPES +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:393] queue member: H2Core::TransportInfo: +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL PortMidiStream +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL PortMidiStream +[W 210704 18:18:53 dom:672] No Type for +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::MidiMessage::m_type +[W 210704 18:18:53 dom:707] BaseSpec: '> +[I 210704 18:18:53 gen:393] queue member: H2Core::MidiMessage:MidiMessageType +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::JackAudioDriver::getTimebaseState() +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL JackProcessCallback +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[I 210704 18:18:53 gen:393] queue member: H2Core::JackAudioDriver:Timebase +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::LadspaFX::inputControlPorts +[I 210704 18:18:53 gen:393] queue member: H2Core::LadspaFX: +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Effects::getPluginList() +[I 210704 18:18:53 gen:400] queue for member H2Core::Effects::getLadspaFXGroup() +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Timeline::getAllTempoMarkers() +[I 210704 18:18:53 gen:400] queue for member H2Core::Timeline::getAllTags() +[I 210704 18:18:53 gen:393] queue member: H2Core::Timeline:TempoMarker +[I 210704 18:18:53 gen:393] queue member: H2Core::Timeline:Tag +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:383] queue for H2Core::H2Exception +[I 210704 18:18:53 gen:377] add +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.CLASS_DECL exception +[W 210704 18:18:53 dom:764] base-spec, missing type: +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::EventQueue::m_addMidiNoteVector +[I 210704 18:18:53 gen:400] queue for member H2Core::EventQueue::push_event(const H2Core::EventType, const int) +[I 210704 18:18:53 gen:400] queue for member H2Core::EventQueue::pop_event() +[I 210704 18:18:53 gen:393] queue member: H2Core::EventQueue:AddMidiNoteVector +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Hydrogen::setCurrentDrumkitLookup(Filesystem::Lookup) +[I 210704 18:18:53 gen:400] queue for member H2Core::Hydrogen::getGUIState() +[I 210704 18:18:53 gen:393] queue member: H2Core::Hydrogen:ErrorMessages +[I 210704 18:18:53 gen:393] queue member: H2Core::Hydrogen:GUIState +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:383] queue for H2Core::Filesystem::Lookup +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:393] queue member: H2Core::Filesystem:file_perms +[I 210704 18:18:53 gen:393] queue member: H2Core::Filesystem:Lookup +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Song::getMode() +[I 210704 18:18:53 gen:400] queue for member H2Core::Song::getActionMode() +[I 210704 18:18:53 gen:393] queue member: H2Core::Song:SongMode +[I 210704 18:18:53 gen:393] queue member: H2Core::Song:ActionMode +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL const_iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL const_iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:383] queue for H2Core::PatternList +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Playlist::get(int) +[I 210704 18:18:53 gen:393] queue member: H2Core::Playlist:Entry +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Preferences::m_JackTrackOutputMode +[I 210704 18:18:53 gen:400] queue for member H2Core::Preferences::m_JackBBTSync +[I 210704 18:18:53 gen:400] queue for member H2Core::Preferences::getFontSize() +[I 210704 18:18:53 gen:400] queue for member H2Core::Preferences::setPatternColors(std::vector) +[I 210704 18:18:53 gen:400] queue for member H2Core::Preferences::setMainFormProperties(const H2Core::WindowProperties &) +[I 210704 18:18:53 gen:393] queue member: H2Core::Preferences: +[I 210704 18:18:53 gen:393] queue member: H2Core::Preferences:FontSize +[I 210704 18:18:53 gen:393] queue member: H2Core::Preferences:UI_LAYOUT_TYPES +[I 210704 18:18:53 gen:393] queue member: H2Core::Preferences:UI_SCALING_POLICY +[I 210704 18:18:53 gen:393] queue member: H2Core::Preferences:JackTrackOutputMode +[I 210704 18:18:53 gen:393] queue member: H2Core::Preferences:JackBBTSyncMethod +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member QColor::spec() +[I 210704 18:18:53 gen:400] queue for member QColor::rgba64() +[I 210704 18:18:53 gen:400] queue for member QColor::QColor(Qt::GlobalColor) +[I 210704 18:18:53 gen:393] queue member: QColor:Spec +[I 210704 18:18:53 gen:393] queue member: QColor:NameFormat +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Sample::load(const QString &, const H2Core::Sample::Loops &, const H2Core::Sample::Rubberband &, const H2Core::Sample::VelocityEnvelope &, const H2Core::Sample::PanEnvelope &) +[I 210704 18:18:53 gen:400] queue for member H2Core::Sample::load(const QString &, const H2Core::Sample::Loops &, const H2Core::Sample::Rubberband &, const H2Core::Sample::VelocityEnvelope &, const H2Core::Sample::PanEnvelope &) +[I 210704 18:18:53 gen:400] queue for member H2Core::Sample::parse_loop_mode(const QString &) +[I 210704 18:18:53 gen:393] queue member: H2Core::Sample:Loops +[I 210704 18:18:53 gen:393] queue member: H2Core::Sample:Rubberband +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:393] queue member: H2Core::Sample::Loops:LoopMode +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:400] queue for member H2Core::Instrument::set_adsr(std::shared_ptr) +[I 210704 18:18:53 gen:400] queue for member H2Core::Instrument::set_sample_selection_alg(H2Core::Instrument::SampleSelectionAlgo) +[I 210704 18:18:53 gen:393] queue member: H2Core::Instrument:SampleSelectionAlgo +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:377] add +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[I 210704 18:18:53 gen:426] binding +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL LADSPA_Data +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL const_iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL const_iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL const_iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL const_iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL iterator +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL PortMidiStream +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL PortMidiStream +[W 210704 18:18:53 dom:672] No Type for +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL snd_seq_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_transport_state_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_nframes_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_position_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 dom:469] lookup failed: decl: CursorKind.TYPEDEF_DECL jack_position_t +[W 210704 18:18:53 dom:650] hu... +[W 210704 18:18:53 dom:518] no type for +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: +[W 210704 18:18:53 gen:95] base class not in bindings or abstract: diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index 6697e7c55..1a65c1178 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -69,6 +69,7 @@ module: H2Core::LilyPond: core/Lilipond/Lilypond.h H2Core::Sampler: core/Sampler/Sampler.h H2Core::Synth: core/Synth/Synth.h + ban: # Qt non namespace - QColor::QColor(QColor &&) # ban this constructor, pybind11 bark on this @@ -142,6 +143,8 @@ module: - H2Core::Preferences::getDataDirectory - H2Core::LadspaControlPort::__class_name - H2Core::LadspaControlPort::class_name + - H2Core::Sample::get_pan_envelope # unique pointers in stl containers, pybind11 can't cope with this. + - H2Core::Sample::get_velocity_envelope cleaners: - qtreset.h plugins: diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index a7b0e20a4..04a7912bf 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -7,10 +7,9 @@ PYBIND11_MODULE(h2core, m) { py::class_> _Object(m, "Object"); _Object.def(py::init()); _Object.def(py::init()); + _Object.def_property_readonly_static("alive_object_count", [](py::object) { return H2Core::Object::getAliveObjectCount(); }); + _Object.def_property_readonly_static("object_map", [](py::object) { return H2Core::Object::getObjectMap(); }); _Object.def("class_name", &H2Core::Object::class_name); - _Object.def_static("set_count", &H2Core::Object::set_count, - "enable/disable class instances counting", - py::arg("flag")); _Object.def_static("count_active", &H2Core::Object::count_active); _Object.def_static("objects_count", &H2Core::Object::objects_count); // [] _Object.def_static("write_objects_map_to", &H2Core::Object::write_objects_map_to, @@ -23,10 +22,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("logger"), py::arg("count")); _Object.def_static("logger", &H2Core::Object::logger); - _Object.def_static("getAliveObjectCount", &H2Core::Object::getAliveObjectCount, - "Returns Total numbers of objects being alive."); - // [] _Object.def_static("getObjectMap", &H2Core::Object::getObjectMap, - // [] "Returns Copy of the object map."); // [] _Object.def_static("printObjectMapDiff", &H2Core::Object::printObjectMapDiff, // [] "Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.", // [] py::arg("map")); @@ -39,26 +34,18 @@ PYBIND11_MODULE(h2core, m) { py::arg("bShort")); py::class_> _Logger(m, "Logger"); + _Logger.def_property_readonly_static("instance", [](py::object) { return H2Core::Logger::get_instance(); }, py::return_value_policy::reference); _Logger.def_static("bootstrap", &H2Core::Logger::bootstrap, "create the logger instance if not exists, set the log level and return the instance", py::arg("msk"), py::return_value_policy::reference); _Logger.def_static("create_instance", &H2Core::Logger::create_instance, "If #__instance equals 0, a new H2Core::Logger singleton will be created and stored in it."); - _Logger.def_static("get_instance", &H2Core::Logger::get_instance, - "Returns a pointer to the current H2Core::Logger singleton stored in #__instance.", - py::return_value_policy::reference); _Logger.def("should_log", &H2Core::Logger::should_log, "return true if the level is set in the bitmask", py::arg("lvl")); - _Logger.def_static("set_bit_mask", &H2Core::Logger::set_bit_mask, - "set the bitmask", - py::arg("msk")); _Logger.def_static("bit_mask", &H2Core::Logger::bit_mask, "return the current log level bit mask"); - _Logger.def("set_use_file", &H2Core::Logger::set_use_file, - "set use file flag", - py::arg("use")); _Logger.def("use_file", &H2Core::Logger::use_file, "return __use_file"); _Logger.def_static("parse_log_level", &H2Core::Logger::parse_log_level, @@ -107,9 +94,6 @@ PYBIND11_MODULE(h2core, m) { py::class_> _AudioEngineLocking(m, "AudioEngineLocking"); _AudioEngineLocking.def(py::init<>()); - _AudioEngineLocking.def("setNeedsLock", &H2Core::AudioEngineLocking::setNeedsLock, - "The audio processing thread can modify some PatternLists. For these structures, the audio engine lock must be held for any thread to access them.", - py::arg("bNeedsLock")); py::class_> _QColor(m, "QColor"); _QColor.def(py::init<>()); @@ -147,29 +131,13 @@ PYBIND11_MODULE(h2core, m) { // [] _QColor.def_static("colorNames", &QColor::colorNames); _QColor.def("spec", &QColor::spec); _QColor.def("alpha", &QColor::alpha); - _QColor.def("setAlpha", &QColor::setAlpha, - py::arg("alpha")); _QColor.def("alphaF", &QColor::alphaF); - _QColor.def("setAlphaF", &QColor::setAlphaF, - py::arg("alpha")); _QColor.def("red", &QColor::red); _QColor.def("green", &QColor::green); _QColor.def("blue", &QColor::blue); - _QColor.def("setRed", &QColor::setRed, - py::arg("red")); - _QColor.def("setGreen", &QColor::setGreen, - py::arg("green")); - _QColor.def("setBlue", &QColor::setBlue, - py::arg("blue")); _QColor.def("redF", &QColor::redF); _QColor.def("greenF", &QColor::greenF); _QColor.def("blueF", &QColor::blueF); - _QColor.def("setRedF", &QColor::setRedF, - py::arg("red")); - _QColor.def("setGreenF", &QColor::setGreenF, - py::arg("green")); - _QColor.def("setBlueF", &QColor::setBlueF, - py::arg("blue")); _QColor.def("getRgb", &QColor::getRgb, py::arg("r"), py::arg("g"), @@ -193,11 +161,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("b"), py::arg("a")); _QColor.def("rgba64", &QColor::rgba64); - _QColor.def("setRgba64", &QColor::setRgba64, - py::arg("rgba")); _QColor.def("rgba", &QColor::rgba); - _QColor.def("setRgba", &QColor::setRgba, - py::arg("rgba")); _QColor.def("rgb", &QColor::rgb); _QColor.def("hue", &QColor::hue); _QColor.def("saturation", &QColor::saturation); @@ -405,14 +369,6 @@ PYBIND11_MODULE(h2core, m) { _QRgba64.def("green", &QRgba64::green); _QRgba64.def("blue", &QRgba64::blue); _QRgba64.def("alpha", &QRgba64::alpha); - _QRgba64.def("setRed", &QRgba64::setRed, - py::arg("_red")); - _QRgba64.def("setGreen", &QRgba64::setGreen, - py::arg("_green")); - _QRgba64.def("setBlue", &QRgba64::setBlue, - py::arg("_blue")); - _QRgba64.def("setAlpha", &QRgba64::setAlpha, - py::arg("_alpha")); _QRgba64.def("red8", &QRgba64::red8); _QRgba64.def("green8", &QRgba64::green8); _QRgba64.def("blue8", &QRgba64::blue8); @@ -428,6 +384,7 @@ PYBIND11_MODULE(h2core, m) { _Synth.def(py::init<>()); _Synth.def_readwrite("m_pOut_L", &H2Core::Synth::m_pOut_L); _Synth.def_readwrite("m_pOut_R", &H2Core::Synth::m_pOut_R); + _Synth.def_property_readonly("playing_notes_number", &H2Core::Synth::getPlayingNotesNumber); _Synth.def_static("class_name", &H2Core::Synth::class_name); _Synth.def("noteOn", &H2Core::Synth::noteOn, "Start playing a note", @@ -437,13 +394,39 @@ PYBIND11_MODULE(h2core, m) { py::arg("pNote")); _Synth.def("process", &H2Core::Synth::process, py::arg("nFrames")); - _Synth.def("setAudioOutput", &H2Core::Synth::setAudioOutput, - py::arg("pAudioOutput")); - _Synth.def("getPlayingNotesNumber", &H2Core::Synth::getPlayingNotesNumber); py::class_> _Note(m, "Note"); _Note.def(py::init, int, float, float, int, float>()); _Note.def(py::init>()); + _Note.def_property_readonly("instrument", &H2Core::Note::get_instrument); + _Note.def_property("instrument_id", &H2Core::Note::get_instrument_id, &H2Core::Note::set_instrument_id); + _Note.def_property("specific_compo_id", &H2Core::Note::get_specific_compo_id, &H2Core::Note::set_specific_compo_id); + _Note.def_property("position", &H2Core::Note::get_position, &H2Core::Note::set_position); + _Note.def_property("velocity", &H2Core::Note::get_velocity, &H2Core::Note::set_velocity); + _Note.def_property("pan", &H2Core::Note::getPan, &H2Core::Note::setPan); + _Note.def_property("pan_with_range_from_0_to_1", &H2Core::Note::getPanWithRangeFrom0To1, &H2Core::Note::setPanWithRangeFrom0To1); + _Note.def_property("lead_lag", &H2Core::Note::get_lead_lag, &H2Core::Note::set_lead_lag); + _Note.def_property("length", &H2Core::Note::get_length, &H2Core::Note::set_length); + _Note.def_property("pitch", &H2Core::Note::get_pitch, &H2Core::Note::set_pitch); + _Note.def_property("note_off", &H2Core::Note::get_note_off, &H2Core::Note::set_note_off); + _Note.def_property_readonly("midi_msg", &H2Core::Note::get_midi_msg); + _Note.def_property("pattern_idx", &H2Core::Note::get_pattern_idx, &H2Core::Note::set_pattern_idx); + _Note.def_property("just_recorded", &H2Core::Note::get_just_recorded, &H2Core::Note::set_just_recorded); + _Note.def_property("probability", &H2Core::Note::get_probability, &H2Core::Note::set_probability); + _Note.def_property("humanize_delay", &H2Core::Note::get_humanize_delay, &H2Core::Note::set_humanize_delay); + _Note.def_property_readonly("cut_off", &H2Core::Note::get_cut_off); + _Note.def_property_readonly("resonance", &H2Core::Note::get_resonance); + _Note.def_property_readonly("bpfb_l", &H2Core::Note::get_bpfb_l); + _Note.def_property_readonly("bpfb_r", &H2Core::Note::get_bpfb_r); + _Note.def_property_readonly("lpfb_l", &H2Core::Note::get_lpfb_l); + _Note.def_property_readonly("lpfb_r", &H2Core::Note::get_lpfb_r); + _Note.def_property_readonly("key", &H2Core::Note::get_key); + _Note.def_property_readonly("octave", &H2Core::Note::get_octave); + _Note.def_property_readonly("midi_key", &H2Core::Note::get_midi_key); + _Note.def_property_readonly("midi_velocity", &H2Core::Note::get_midi_velocity); + _Note.def_property_readonly("notekey_pitch", &H2Core::Note::get_notekey_pitch); + _Note.def_property_readonly("total_pitch", &H2Core::Note::get_total_pitch); + _Note.def_property_readonly("adsr", &H2Core::Note::get_adsr); _Note.def_static("class_name", &H2Core::Note::class_name); _Note.def("save_to", &H2Core::Note::save_to, py::arg("node")); @@ -456,106 +439,10 @@ PYBIND11_MODULE(h2core, m) { _Note.def("map_instrument", &H2Core::Note::map_instrument, "find the corresponding instrument and point to it, or an empty instrument", py::arg("instruments")); - _Note.def("get_instrument", &H2Core::Note::get_instrument, - "#__instrument accessor"); _Note.def("has_instrument", &H2Core::Note::has_instrument, "return true if #__instrument is set"); - _Note.def("set_instrument_id", &H2Core::Note::set_instrument_id, - "#__instrument_id setter", - py::arg("value")); - _Note.def("get_instrument_id", &H2Core::Note::get_instrument_id, - "#__instrument_id accessor"); - _Note.def("set_specific_compo_id", &H2Core::Note::set_specific_compo_id, - "#__specific_compo_id setter", - py::arg("value")); - _Note.def("get_specific_compo_id", &H2Core::Note::get_specific_compo_id, - "#__specific_compo_id accessor"); - _Note.def("set_position", &H2Core::Note::set_position, - "#__position setter", - py::arg("value")); - _Note.def("get_position", &H2Core::Note::get_position, - "#__position accessor"); - _Note.def("set_velocity", &H2Core::Note::set_velocity, - "#__velocity setter", - py::arg("value")); - _Note.def("get_velocity", &H2Core::Note::get_velocity, - "#__velocity accessor"); - _Note.def("setPan", &H2Core::Note::setPan, - "set pan of the note. assumes the input range in [-1;1]", - py::arg("val")); - _Note.def("setPanWithRangeFrom0To1", &H2Core::Note::setPanWithRangeFrom0To1, - "set pan of the note, assuming the input range in [0;1]", - py::arg("fVal")); - _Note.def("getPan", &H2Core::Note::getPan, - "get pan of the note. Output pan range: [-1;1]"); - _Note.def("getPanWithRangeFrom0To1", &H2Core::Note::getPanWithRangeFrom0To1, - "get pan of the note, scaling and translating the range from [-1;1] to [0;1]"); - _Note.def("set_lead_lag", &H2Core::Note::set_lead_lag, - "#__lead_lag setter", - py::arg("value")); - _Note.def("get_lead_lag", &H2Core::Note::get_lead_lag, - "#__lead_lag accessor"); - _Note.def("set_length", &H2Core::Note::set_length, - "#__length setter", - py::arg("value")); - _Note.def("get_length", &H2Core::Note::get_length, - "#__length accessor"); - _Note.def("set_pitch", &H2Core::Note::set_pitch, - "#__pitch setter", - py::arg("value")); - _Note.def("get_pitch", &H2Core::Note::get_pitch, - "#__pitch accessor"); - _Note.def("set_note_off", &H2Core::Note::set_note_off, - "#__note_off setter", - py::arg("value")); - _Note.def("get_note_off", &H2Core::Note::get_note_off, - "#__note_off accessor"); - _Note.def("get_midi_msg", &H2Core::Note::get_midi_msg, - "#__midi_msg accessor"); - _Note.def("set_pattern_idx", &H2Core::Note::set_pattern_idx, - "#__pattern_idx setter", - py::arg("value")); - _Note.def("get_pattern_idx", &H2Core::Note::get_pattern_idx, - "#__pattern_idx accessor"); - _Note.def("set_just_recorded", &H2Core::Note::set_just_recorded, - "#__just_recorded setter", - py::arg("value")); - _Note.def("get_just_recorded", &H2Core::Note::get_just_recorded, - "#__just_recorded accessor"); _Note.def("get_layer_selected", &H2Core::Note::get_layer_selected, py::arg("CompoID")); - _Note.def("set_probability", &H2Core::Note::set_probability, - py::arg("value")); - _Note.def("get_probability", &H2Core::Note::get_probability); - _Note.def("set_humanize_delay", &H2Core::Note::set_humanize_delay, - "#__humanize_delay setter", - py::arg("value")); - _Note.def("get_humanize_delay", &H2Core::Note::get_humanize_delay, - "#__humanize_delay accessor"); - _Note.def("get_cut_off", &H2Core::Note::get_cut_off, - "#__cut_off accessor"); - _Note.def("get_resonance", &H2Core::Note::get_resonance, - "#__resonance accessor"); - _Note.def("get_bpfb_l", &H2Core::Note::get_bpfb_l, - "#__bpfb_l accessor"); - _Note.def("get_bpfb_r", &H2Core::Note::get_bpfb_r, - "#__bpfb_r accessor"); - _Note.def("get_lpfb_l", &H2Core::Note::get_lpfb_l, - "#__lpfb_l accessor"); - _Note.def("get_lpfb_r", &H2Core::Note::get_lpfb_r, - "#__lpfb_r accessor"); - _Note.def("get_key", &H2Core::Note::get_key, - "#__key accessor"); - _Note.def("get_octave", &H2Core::Note::get_octave, - "#__octave accessor"); - _Note.def("get_midi_key", &H2Core::Note::get_midi_key, - "return scaled key for midi output, !!! DO NOT CHECK IF INSTRUMENT IS SET !!!"); - _Note.def("get_midi_velocity", &H2Core::Note::get_midi_velocity, - "midi velocity accessor"); - _Note.def("get_notekey_pitch", &H2Core::Note::get_notekey_pitch, - "note key pitch accessor"); - _Note.def("get_total_pitch", &H2Core::Note::get_total_pitch, - "returns"); _Note.def("key_to_string", &H2Core::Note::key_to_string, "return a string representation of key-octave"); _Note.def("set_key_octave", py::overload_cast(&H2Core::Note::set_key_octave), @@ -570,8 +457,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("key"), py::arg("octave"), py::arg("msg")); - _Note.def("get_adsr", &H2Core::Note::get_adsr, - "get the ADSR of the note"); // [banned] _Note.def("match", py::overload_cast, H2Core::Note::Key, H2Core::Note::Octave>(&H2Core::Note::match), // [banned] "return true if instrument, key and octave matches with internal", // [banned] py::arg("instrument"), @@ -593,6 +478,10 @@ PYBIND11_MODULE(h2core, m) { _Sampler.def(py::init<>()); _Sampler.def_readwrite("m_pMainOut_L", &H2Core::Sampler::m_pMainOut_L); _Sampler.def_readwrite("m_pMainOut_R", &H2Core::Sampler::m_pMainOut_R); + _Sampler.def_property_readonly("playing_notes_number", &H2Core::Sampler::getPlayingNotesNumber); + _Sampler.def_property("interpolate_mode", &H2Core::Sampler::getInterpolateMode, &H2Core::Sampler::setInterpolateMode); + _Sampler.def_property_readonly("preview_instrument", &H2Core::Sampler::getPreviewInstrument); + _Sampler.def_property_readonly("playback_track_instrument", &H2Core::Sampler::getPlaybackTrackInstrument); _Sampler.def_static("class_name", &H2Core::Sampler::class_name); _Sampler.def_static("ratioStraightPolygonalPanLaw", &H2Core::Sampler::ratioStraightPolygonalPanLaw, py::arg("fPan")); @@ -647,23 +536,15 @@ PYBIND11_MODULE(h2core, m) { py::arg("key")); _Sampler.def("stopPlayingNotes", &H2Core::Sampler::stopPlayingNotes, py::arg("pInstr")); - _Sampler.def("getPlayingNotesNumber", &H2Core::Sampler::getPlayingNotesNumber); _Sampler.def("preview_sample", &H2Core::Sampler::preview_sample, py::arg("pSample"), py::arg("length")); - _Sampler.def("preview_instrument", &H2Core::Sampler::preview_instrument, - py::arg("pInstr")); _Sampler.def("setPlayingNotelength", &H2Core::Sampler::setPlayingNotelength, py::arg("pInstrument"), py::arg("ticks"), py::arg("noteOnTick")); _Sampler.def("isInstrumentPlaying", &H2Core::Sampler::isInstrumentPlaying, py::arg("pInstr")); - _Sampler.def("setInterpolateMode", &H2Core::Sampler::setInterpolateMode, - py::arg("mode")); - _Sampler.def("getPreviewInstrument", &H2Core::Sampler::getPreviewInstrument); - _Sampler.def("getPlaybackTrackInstrument", &H2Core::Sampler::getPlaybackTrackInstrument); - _Sampler.def("getInterpolateMode", &H2Core::Sampler::getInterpolateMode); _Sampler.def("reinitializePlaybackTrack", &H2Core::Sampler::reinitializePlaybackTrack, "Loading of the playback track."); @@ -688,6 +569,11 @@ PYBIND11_MODULE(h2core, m) { _LadspaFX.def_readwrite("m_pBuffer_R", &H2Core::LadspaFX::m_pBuffer_R); _LadspaFX.def_readwrite("inputControlPorts", &H2Core::LadspaFX::inputControlPorts); _LadspaFX.def_readwrite("outputControlPorts", &H2Core::LadspaFX::outputControlPorts); + _LadspaFX.def_property_readonly("plugin_label", &H2Core::LadspaFX::getPluginLabel); + _LadspaFX.def_property("plugin_name", &H2Core::LadspaFX::getPluginName, &H2Core::LadspaFX::setPluginName); + _LadspaFX.def_property_readonly("library_path", &H2Core::LadspaFX::getLibraryPath); + _LadspaFX.def_property_readonly("plugin_type", &H2Core::LadspaFX::getPluginType); + _LadspaFX.def_property("volume", &H2Core::LadspaFX::getVolume, &H2Core::LadspaFX::setVolume); _LadspaFX.def_static("class_name", &H2Core::LadspaFX::class_name); _LadspaFX.def("connectAudioPorts", &H2Core::LadspaFX::connectAudioPorts, py::arg("pIn_L"), @@ -698,22 +584,11 @@ PYBIND11_MODULE(h2core, m) { _LadspaFX.def("deactivate", &H2Core::LadspaFX::deactivate); _LadspaFX.def("processFX", &H2Core::LadspaFX::processFX, py::arg("nFrames")); - _LadspaFX.def("getPluginLabel", &H2Core::LadspaFX::getPluginLabel); - _LadspaFX.def("getPluginName", &H2Core::LadspaFX::getPluginName); - _LadspaFX.def("setPluginName", &H2Core::LadspaFX::setPluginName, - py::arg("sName")); - _LadspaFX.def("getLibraryPath", &H2Core::LadspaFX::getLibraryPath); _LadspaFX.def("isEnabled", &H2Core::LadspaFX::isEnabled); - _LadspaFX.def("setEnabled", &H2Core::LadspaFX::setEnabled, - py::arg("value")); _LadspaFX.def_static("load", &H2Core::LadspaFX::load, py::arg("sLibraryPath"), py::arg("sPluginLabel"), py::arg("nSampleRate")); - _LadspaFX.def("getPluginType", &H2Core::LadspaFX::getPluginType); - _LadspaFX.def("setVolume", &H2Core::LadspaFX::setVolume, - py::arg("fValue")); - _LadspaFX.def("getVolume", &H2Core::LadspaFX::getVolume); _LadspaFX.def("__repr__", [](H2Core::LadspaFX & fx) { return ""; @@ -732,30 +607,28 @@ PYBIND11_MODULE(h2core, m) { // [banned] _LadspaControlPort.def_static("class_name", &H2Core::LadspaControlPort::class_name); py::class_> _Effects(m, "Effects"); + _Effects.def_property_readonly_static("instance", [](py::object) { return H2Core::Effects::get_instance(); }, py::return_value_policy::reference); + _Effects.def_property_readonly("plugin_list", &H2Core::Effects::getPluginList); _Effects.def_static("class_name", &H2Core::Effects::class_name); _Effects.def_static("create_instance", &H2Core::Effects::create_instance, "If #__instance equals 0, a new Effects singleton will be created and stored in it."); - _Effects.def_static("get_instance", &H2Core::Effects::get_instance, - "Returns a pointer to the current Effects singleton stored in #__instance.", - py::return_value_policy::reference); _Effects.def("getLadspaFX", &H2Core::Effects::getLadspaFX, py::arg("nFX")); _Effects.def("setLadspaFX", &H2Core::Effects::setLadspaFX, py::arg("pFX"), py::arg("nFX")); - _Effects.def("getPluginList", &H2Core::Effects::getPluginList); _Effects.def("getLadspaFXGroup", &H2Core::Effects::getLadspaFXGroup); py::class_> _LadspaFXGroup(m, "LadspaFXGroup"); _LadspaFXGroup.def(py::init()); + _LadspaFXGroup.def_property_readonly("name", &H2Core::LadspaFXGroup::getName); + _LadspaFXGroup.def_property_readonly("ladspa_info", &H2Core::LadspaFXGroup::getLadspaInfo); + _LadspaFXGroup.def_property_readonly("child_list", &H2Core::LadspaFXGroup::getChildList); _LadspaFXGroup.def_static("class_name", &H2Core::LadspaFXGroup::class_name); - _LadspaFXGroup.def("getName", &H2Core::LadspaFXGroup::getName); _LadspaFXGroup.def("addLadspaInfo", &H2Core::LadspaFXGroup::addLadspaInfo, py::arg("pInfo")); - _LadspaFXGroup.def("getLadspaInfo", &H2Core::LadspaFXGroup::getLadspaInfo); _LadspaFXGroup.def("addChild", &H2Core::LadspaFXGroup::addChild, py::arg("pChild")); - _LadspaFXGroup.def("getChildList", &H2Core::LadspaFXGroup::getChildList); _LadspaFXGroup.def("clear", &H2Core::LadspaFXGroup::clear); _LadspaFXGroup.def_static("alphabeticOrder", &H2Core::LadspaFXGroup::alphabeticOrder, py::arg(""), @@ -786,6 +659,8 @@ PYBIND11_MODULE(h2core, m) { py::class_> _Timeline(m, "Timeline"); _Timeline.def(py::init<>()); + _Timeline.def_property_readonly("all_tempo_markers", &H2Core::Timeline::getAllTempoMarkers); + _Timeline.def_property_readonly("all_tags", &H2Core::Timeline::getAllTags); _Timeline.def_static("class_name", &H2Core::Timeline::class_name); _Timeline.def("addTempoMarker", &H2Core::Timeline::addTempoMarker, py::arg("nBar"), @@ -797,8 +672,6 @@ PYBIND11_MODULE(h2core, m) { "Returns the tempo of the Song at a given bar.", py::arg("nBar"), py::arg("bSticky")); - _Timeline.def("getAllTempoMarkers", &H2Core::Timeline::getAllTempoMarkers, - "Returns std::vector> Provides read-only access to m_tempoMarker."); _Timeline.def("addTag", &H2Core::Timeline::addTag, py::arg("nBar"), py::arg("sTag")); @@ -809,8 +682,6 @@ PYBIND11_MODULE(h2core, m) { "Returns the tag of the Song at a given bar.", py::arg("nBar"), py::arg("bSticky")); - _Timeline.def("getAllTags", &H2Core::Timeline::getAllTags, - "Returns std::vector> Provides read-only access to m_tags."); _Timeline.def("toQString", &H2Core::Timeline::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -818,36 +689,29 @@ PYBIND11_MODULE(h2core, m) { py::class_> _MidiActionManager(m, "MidiActionManager"); _MidiActionManager.def(py::init<>()); + _MidiActionManager.def_property_readonly_static("instance", [](py::object) { return MidiActionManager::get_instance(); }); + _MidiActionManager.def_property_readonly("action_list", &MidiActionManager::getActionList); + _MidiActionManager.def_property_readonly("event_list", &MidiActionManager::getEventList); _MidiActionManager.def_static("class_name", &MidiActionManager::class_name); _MidiActionManager.def("handleAction", &MidiActionManager::handleAction, "The handleAction method is the heart of the MidiActionManager class. It executes the operations that are needed to carry the desired action.", py::arg("")); _MidiActionManager.def_static("create_instance", &MidiActionManager::create_instance, "If #__instance equals 0, a new MidiActionManager singleton will be created and stored in it."); - _MidiActionManager.def_static("get_instance", &MidiActionManager::get_instance, - "Returns a pointer to the current MidiActionManager singleton stored in #__instance."); - // [] _MidiActionManager.def("getActionList", &MidiActionManager::getActionList); - // [] _MidiActionManager.def("getEventList", &MidiActionManager::getEventList); py::class_> _Action(m, "Action"); _Action.def(py::init()); + _Action.def_property("parameter_1", &Action::getParameter1, &Action::setParameter1); + _Action.def_property("parameter_2", &Action::getParameter2, &Action::setParameter2); + _Action.def_property_readonly("type", &Action::getType); _Action.def_static("class_name", &Action::class_name); - _Action.def("setParameter1", &Action::setParameter1, - py::arg("text")); - _Action.def("setParameter2", &Action::setParameter2, - py::arg("text")); - _Action.def("getParameter1", &Action::getParameter1); - _Action.def("getParameter2", &Action::getParameter2); - _Action.def("getType", &Action::getType); py::class_> _EventQueue(m, "EventQueue"); _EventQueue.def_readwrite("m_addMidiNoteVector", &H2Core::EventQueue::m_addMidiNoteVector); + _EventQueue.def_property_readonly_static("instance", [](py::object) { return H2Core::EventQueue::get_instance(); }, py::return_value_policy::reference); _EventQueue.def_static("class_name", &H2Core::EventQueue::class_name); _EventQueue.def_static("create_instance", &H2Core::EventQueue::create_instance, "If #__instance equals 0, a new EventQueue singleton will be created and stored in it."); - _EventQueue.def_static("get_instance", &H2Core::EventQueue::get_instance, - "Returns a pointer to the current EventQueue singleton stored in #__instance.", - py::return_value_policy::reference); _EventQueue.def("push_event", &H2Core::EventQueue::push_event, "Queues the next event into the EventQueue.", py::arg("type"), @@ -858,8 +722,6 @@ PYBIND11_MODULE(h2core, m) { py::class_> _CoreActionController(m, "CoreActionController"); _CoreActionController.def(py::init<>()); _CoreActionController.def_static("class_name", &H2Core::CoreActionController::class_name); - _CoreActionController.def("setMasterVolume", &H2Core::CoreActionController::setMasterVolume, - py::arg("masterVolumeValue")); _CoreActionController.def("setStripVolume", &H2Core::CoreActionController::setStripVolume, py::arg("nStrip"), py::arg("fVolumeValue"), @@ -872,10 +734,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("nStrip"), py::arg("fValue"), py::arg("bSelectStrip")); - _CoreActionController.def("setMetronomeIsActive", &H2Core::CoreActionController::setMetronomeIsActive, - py::arg("isActive")); - _CoreActionController.def("setMasterIsMuted", &H2Core::CoreActionController::setMasterIsMuted, - py::arg("isMuted")); _CoreActionController.def("setStripIsMuted", &H2Core::CoreActionController::setStripIsMuted, py::arg("nStrip"), py::arg("isMuted")); @@ -941,6 +799,23 @@ PYBIND11_MODULE(h2core, m) { py::class_> _AudioEngine(m, "AudioEngine"); _AudioEngine.def(py::init<>()); + _AudioEngine.def_property_readonly("sampler", &H2Core::AudioEngine::getSampler); + _AudioEngine.def_property_readonly("synth", &H2Core::AudioEngine::getSynth); + _AudioEngine.def_property_readonly("elapsed_time", &H2Core::AudioEngine::getElapsedTime); + _AudioEngine.def_property("audio_driver", &H2Core::AudioEngine::getAudioDriver, &H2Core::AudioEngine::setAudioDriver); + _AudioEngine.def_property_readonly("midi_driver", &H2Core::AudioEngine::getMidiDriver); + _AudioEngine.def_property_readonly("midi_out_driver", &H2Core::AudioEngine::getMidiOutDriver); + _AudioEngine.def_property("state", &H2Core::AudioEngine::getState, &H2Core::AudioEngine::setState); + _AudioEngine.def_property_readonly("process_time", &H2Core::AudioEngine::getProcessTime); + _AudioEngine.def_property_readonly("max_process_time", &H2Core::AudioEngine::getMaxProcessTime); + _AudioEngine.def_property("selected_pattern_number", &H2Core::AudioEngine::getSelectedPatternNumber, &H2Core::AudioEngine::setSelectedPatternNumber); + _AudioEngine.def_property("pattern_tick_position", &H2Core::AudioEngine::getPatternTickPosition, &H2Core::AudioEngine::setPatternTickPosition); + _AudioEngine.def_property("song_pos", &H2Core::AudioEngine::getSongPos, &H2Core::AudioEngine::setSongPos); + _AudioEngine.def_property_readonly("next_patterns", &H2Core::AudioEngine::getNextPatterns); + _AudioEngine.def_property_readonly("playing_patterns", &H2Core::AudioEngine::getPlayingPatterns); + _AudioEngine.def_property("realtime_frames", &H2Core::AudioEngine::getRealtimeFrames, &H2Core::AudioEngine::setRealtimeFrames); + _AudioEngine.def_property("add_realtime_note_tick_position", &H2Core::AudioEngine::getAddRealtimeNoteTickPosition, &H2Core::AudioEngine::setAddRealtimeNoteTickPosition); + _AudioEngine.def_property_readonly("current_tick_time", &H2Core::AudioEngine::getCurrentTickTime); _AudioEngine.def_static("class_name", &H2Core::AudioEngine::class_name); _AudioEngine.def("lock", &H2Core::AudioEngine::lock, "Mutex locking of the AudioEngine.", @@ -970,9 +845,6 @@ PYBIND11_MODULE(h2core, m) { _AudioEngine.def("stop", &H2Core::AudioEngine::stop, "If the audio engine is in state #m_audioEngineState #STATE_PLAYING, this function will - sets #m_fMasterPeak_L and #m_fMasterPeak_R to 0.0f - sets #m_audioEngineState to #STATE_READY - sets #m_nPatternStartTick to -1 - deletes all copied Note in song notes queue #m_songNoteQueue and MIDI notes queue #m_midiNoteQueue - calls the _clear()_ member of #m_midiNoteQueue", py::arg("bLockEngine")); - _AudioEngine.def("setSong", &H2Core::AudioEngine::setSong, - "Updates the global objects of the audioEngine according to new Song.", - py::arg("pNewSong")); _AudioEngine.def("removeSong", &H2Core::AudioEngine::removeSong, "Does the necessary cleanup of the global objects in the audioEngine."); _AudioEngine.def("noteOn", &H2Core::AudioEngine::noteOn, @@ -1006,12 +878,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("nSampleRate"), py::arg("fBpm"), py::arg("nResolution")); - _AudioEngine.def("getSampler", &H2Core::AudioEngine::getSampler, - "Returns #m_pSampler"); - _AudioEngine.def("getSynth", &H2Core::AudioEngine::getSynth, - "Returns #m_pSynth"); - _AudioEngine.def("getElapsedTime", &H2Core::AudioEngine::getElapsedTime, - "Returns #m_fElapsedTime"); _AudioEngine.def("calculateElapsedTime", &H2Core::AudioEngine::calculateElapsedTime, "Calculates the elapsed time for an arbitrary position.", py::arg("sampleRate"), @@ -1042,56 +908,47 @@ PYBIND11_MODULE(h2core, m) { _AudioEngine.def("renameJackPorts", &H2Core::AudioEngine::renameJackPorts, "Hands the provided Song to JackAudioDriver::makeTrackOutputs() if pSong is not a null pointer and the audio driver #m_pAudioDriver is an instance of the JackAudioDriver.", py::arg("pSong")); - _AudioEngine.def("setAudioDriver", &H2Core::AudioEngine::setAudioDriver, - py::arg("pAudioDriver")); - _AudioEngine.def("getAudioDriver", &H2Core::AudioEngine::getAudioDriver); - _AudioEngine.def("getMidiDriver", &H2Core::AudioEngine::getMidiDriver); - _AudioEngine.def("getMidiOutDriver", &H2Core::AudioEngine::getMidiOutDriver); _AudioEngine.def("raiseError", &H2Core::AudioEngine::raiseError, py::arg("nErrorCode")); - _AudioEngine.def("getState", &H2Core::AudioEngine::getState); - _AudioEngine.def("setState", &H2Core::AudioEngine::setState, - py::arg("state")); _AudioEngine.def("setMasterPeak_L", &H2Core::AudioEngine::setMasterPeak_L, py::arg("value")); _AudioEngine.def("getMasterPeak_L", &H2Core::AudioEngine::getMasterPeak_L); _AudioEngine.def("setMasterPeak_R", &H2Core::AudioEngine::setMasterPeak_R, py::arg("value")); _AudioEngine.def("getMasterPeak_R", &H2Core::AudioEngine::getMasterPeak_R); - _AudioEngine.def("getProcessTime", &H2Core::AudioEngine::getProcessTime); - _AudioEngine.def("getMaxProcessTime", &H2Core::AudioEngine::getMaxProcessTime); - _AudioEngine.def("getSelectedPatternNumber", &H2Core::AudioEngine::getSelectedPatternNumber); - _AudioEngine.def("setSelectedPatternNumber", &H2Core::AudioEngine::setSelectedPatternNumber, - py::arg("number")); - _AudioEngine.def("setPatternStartTick", &H2Core::AudioEngine::setPatternStartTick, - py::arg("tick")); - _AudioEngine.def("setPatternTickPosition", &H2Core::AudioEngine::setPatternTickPosition, - py::arg("tick")); - _AudioEngine.def("getPatternTickPosition", &H2Core::AudioEngine::getPatternTickPosition); - _AudioEngine.def("setSongPos", &H2Core::AudioEngine::setSongPos, - py::arg("songPos")); - _AudioEngine.def("getSongPos", &H2Core::AudioEngine::getSongPos); - _AudioEngine.def("getNextPatterns", &H2Core::AudioEngine::getNextPatterns); - _AudioEngine.def("getPlayingPatterns", &H2Core::AudioEngine::getPlayingPatterns); - _AudioEngine.def("getRealtimeFrames", &H2Core::AudioEngine::getRealtimeFrames); - _AudioEngine.def("setRealtimeFrames", &H2Core::AudioEngine::setRealtimeFrames, - py::arg("nFrames")); - _AudioEngine.def("getAddRealtimeNoteTickPosition", &H2Core::AudioEngine::getAddRealtimeNoteTickPosition); - _AudioEngine.def("setAddRealtimeNoteTickPosition", &H2Core::AudioEngine::setAddRealtimeNoteTickPosition, - py::arg("tickPosition")); - _AudioEngine.def("getCurrentTickTime", &H2Core::AudioEngine::getCurrentTickTime); py::class_> _Hydrogen(m, "Hydrogen"); _Hydrogen.def_readwrite("lastMidiEvent", &H2Core::Hydrogen::lastMidiEvent); _Hydrogen.def_readwrite("lastMidiEventParameter", &H2Core::Hydrogen::lastMidiEventParameter); _Hydrogen.def_readwrite("m_nMaxTimeHumanize", &H2Core::Hydrogen::m_nMaxTimeHumanize); + _Hydrogen.def_property_readonly_static("instance", [](py::object) { return H2Core::Hydrogen::get_instance(); }, py::return_value_policy::reference); + _Hydrogen.def_property_readonly("audio_engine", &H2Core::Hydrogen::getAudioEngine); + _Hydrogen.def_property("song", &H2Core::Hydrogen::getSong, &H2Core::Hydrogen::setSong); + _Hydrogen.def_property_readonly("tick_position", &H2Core::Hydrogen::getTickPosition); + _Hydrogen.def_property_readonly("realtime_tick_position", &H2Core::Hydrogen::getRealtimeTickPosition); + _Hydrogen.def_property_readonly("total_frames", &H2Core::Hydrogen::getTotalFrames); + _Hydrogen.def_property("realtime_frames", &H2Core::Hydrogen::getRealtimeFrames, &H2Core::Hydrogen::setRealtimeFrames); + _Hydrogen.def_property("current_pattern_list", &H2Core::Hydrogen::getCurrentPatternList, &H2Core::Hydrogen::setCurrentPatternList); + _Hydrogen.def_property_readonly("next_patterns", &H2Core::Hydrogen::getNextPatterns); + _Hydrogen.def_property("pattern_pos", &H2Core::Hydrogen::getPatternPos, &H2Core::Hydrogen::setPatternPos); + _Hydrogen.def_property_readonly("audio_output", &H2Core::Hydrogen::getAudioOutput); + _Hydrogen.def_property_readonly("midi_input", &H2Core::Hydrogen::getMidiInput); + _Hydrogen.def_property_readonly("midi_output", &H2Core::Hydrogen::getMidiOutput); + _Hydrogen.def_property_readonly("state", &H2Core::Hydrogen::getState); + _Hydrogen.def_property("current_drumkit_name", &H2Core::Hydrogen::getCurrentDrumkitName, &H2Core::Hydrogen::setCurrentDrumkitName); + _Hydrogen.def_property("current_drumkit_lookup", &H2Core::Hydrogen::getCurrentDrumkitLookup, &H2Core::Hydrogen::setCurrentDrumkitLookup); + _Hydrogen.def_property("selected_pattern_number", &H2Core::Hydrogen::getSelectedPatternNumber, &H2Core::Hydrogen::setSelectedPatternNumber); + _Hydrogen.def_property("selected_instrument_number", &H2Core::Hydrogen::getSelectedInstrumentNumber, &H2Core::Hydrogen::setSelectedInstrumentNumber); + _Hydrogen.def_property("note_length", &H2Core::Hydrogen::getNoteLength, &H2Core::Hydrogen::setNoteLength); + _Hydrogen.def_property_readonly("bc_status", &H2Core::Hydrogen::getBcStatus); + _Hydrogen.def_property_readonly("timeline", &H2Core::Hydrogen::getTimeline); + _Hydrogen.def_property_readonly("is_export_session_active", &H2Core::Hydrogen::getIsExportSessionActive); + _Hydrogen.def_property_readonly("core_action_controller", &H2Core::Hydrogen::getCoreActionController); + _Hydrogen.def_property("playback_track_state", &H2Core::Hydrogen::getPlaybackTrackState, &H2Core::Hydrogen::setPlaybackTrackState); + _Hydrogen.def_property_readonly("jack_timebase_state", &H2Core::Hydrogen::getJackTimebaseState); _Hydrogen.def_static("class_name", &H2Core::Hydrogen::class_name); _Hydrogen.def_static("create_instance", &H2Core::Hydrogen::create_instance, "Creates all the instances used within Hydrogen in the right order."); - _Hydrogen.def_static("get_instance", &H2Core::Hydrogen::get_instance, - "Returns the current Hydrogen instance #__instance.", - py::return_value_policy::reference); - _Hydrogen.def("getAudioEngine", &H2Core::Hydrogen::getAudioEngine); _Hydrogen.def("sequencer_play", &H2Core::Hydrogen::sequencer_play, "Start the internal sequencer"); _Hydrogen.def("sequencer_stop", &H2Core::Hydrogen::sequencer_stop, @@ -1106,11 +963,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("pos")); _Hydrogen.def("togglePlaysSelected", &H2Core::Hydrogen::togglePlaysSelected, "Switches playback to focused pattern."); - _Hydrogen.def("getSong", &H2Core::Hydrogen::getSong, - "Get the current song."); - _Hydrogen.def("setSong", &H2Core::Hydrogen::setSong, - "Sets the current song #__song to newSong.", - py::arg("newSong")); _Hydrogen.def("removeSong", &H2Core::Hydrogen::removeSong); _Hydrogen.def("addRealtimeNote", &H2Core::Hydrogen::addRealtimeNote, py::arg("instrument"), @@ -1120,28 +972,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("noteoff"), py::arg("forcePlay"), py::arg("msg1")); - _Hydrogen.def("getTickPosition", &H2Core::Hydrogen::getTickPosition, - "Returns #m_nPatternTickPosition"); - _Hydrogen.def("getRealtimeTickPosition", &H2Core::Hydrogen::getRealtimeTickPosition, - "Keep track of the tick position in realtime."); - _Hydrogen.def("getTotalFrames", &H2Core::Hydrogen::getTotalFrames); - _Hydrogen.def("setRealtimeFrames", &H2Core::Hydrogen::setRealtimeFrames, - "Sets #m_nRealtimeFrames", - py::arg("frames")); - _Hydrogen.def("getRealtimeFrames", &H2Core::Hydrogen::getRealtimeFrames, - "Returns the current realtime transport position TransportInfo::m_nFrames."); - _Hydrogen.def("getCurrentPatternList", &H2Core::Hydrogen::getCurrentPatternList, - "Returns #m_pPlayingPatterns"); - _Hydrogen.def("setCurrentPatternList", &H2Core::Hydrogen::setCurrentPatternList, - "Sets #m_pPlayingPatterns.", - py::arg("pPatternList")); - _Hydrogen.def("getNextPatterns", &H2Core::Hydrogen::getNextPatterns, - "Returns #m_pNextPatterns"); - _Hydrogen.def("getPatternPos", &H2Core::Hydrogen::getPatternPos, - "Get the position of the current Pattern in the Song."); - _Hydrogen.def("setPatternPos", &H2Core::Hydrogen::setPatternPos, - "Relocate the position to another Pattern in the Song.", - py::arg("pos")); _Hydrogen.def("getPosForTick", &H2Core::Hydrogen::getPosForTick, "Returns the pattern number corresponding to the tick position TickPos.", py::arg("TickPos"), @@ -1152,11 +982,6 @@ PYBIND11_MODULE(h2core, m) { "Get the total number of ticks passed up to a Pattern at position pos.", py::arg("pos")); _Hydrogen.def("restartDrivers", &H2Core::Hydrogen::restartDrivers); - _Hydrogen.def("getAudioOutput", &H2Core::Hydrogen::getAudioOutput); - _Hydrogen.def("getMidiInput", &H2Core::Hydrogen::getMidiInput); - _Hydrogen.def("getMidiOutput", &H2Core::Hydrogen::getMidiOutput); - _Hydrogen.def("getState", &H2Core::Hydrogen::getState, - "Returns the current state of the audio engine."); _Hydrogen.def("loadDrumkit", py::overload_cast(&H2Core::Hydrogen::loadDrumkit), "Wrapper around loadDrumkit( Drumkit, bool ) with the conditional argument set to true.", py::arg("pDrumkitInfo")); @@ -1171,14 +996,6 @@ PYBIND11_MODULE(h2core, m) { "Delete an Instrument. If conditional is true, and there are some Pattern that are using this Instrument, it's not deleted anyway.", py::arg("instrumentnumber"), py::arg("conditional")); - _Hydrogen.def("getCurrentDrumkitName", &H2Core::Hydrogen::getCurrentDrumkitName, - "Returns m_sCurrentDrumkitName"); - _Hydrogen.def("setCurrentDrumkitName", &H2Core::Hydrogen::setCurrentDrumkitName, - py::arg("sName")); - _Hydrogen.def("getCurrentDrumkitLookup", &H2Core::Hydrogen::getCurrentDrumkitLookup, - "Returns m_currentDrumkitLookup"); - _Hydrogen.def("setCurrentDrumkitLookup", &H2Core::Hydrogen::setCurrentDrumkitLookup, - py::arg("lookup")); _Hydrogen.def("raiseError", &H2Core::Hydrogen::raiseError, py::arg("nErrorCode")); // [banned] _Hydrogen.def("previewSample", &H2Core::Hydrogen::previewSample, @@ -1186,20 +1003,10 @@ PYBIND11_MODULE(h2core, m) { // [banned] _Hydrogen.def("previewInstrument", &H2Core::Hydrogen::previewInstrument, // [banned] py::arg("pInstr")); _Hydrogen.def("onTapTempoAccelEvent", &H2Core::Hydrogen::onTapTempoAccelEvent); - _Hydrogen.def("setTapTempo", &H2Core::Hydrogen::setTapTempo, - py::arg("fInterval")); _Hydrogen.def("setBPM", &H2Core::Hydrogen::setBPM, "Updates the speed.", py::arg("fBPM")); _Hydrogen.def("restartLadspaFX", &H2Core::Hydrogen::restartLadspaFX); - _Hydrogen.def("getSelectedPatternNumber", &H2Core::Hydrogen::getSelectedPatternNumber, - "Returns #m_nSelectedPatternNumber"); - _Hydrogen.def("setSelectedPatternNumber", &H2Core::Hydrogen::setSelectedPatternNumber, - "Sets #m_nSelectedPatternNumber.", - py::arg("nPat")); - _Hydrogen.def("getSelectedInstrumentNumber", &H2Core::Hydrogen::getSelectedInstrumentNumber); - _Hydrogen.def("setSelectedInstrumentNumber", &H2Core::Hydrogen::setSelectedInstrumentNumber, - py::arg("nInstrument")); _Hydrogen.def("refreshInstrumentParameters", &H2Core::Hydrogen::refreshInstrumentParameters, py::arg("nInstrument")); _Hydrogen.def("renameJackPorts", &H2Core::Hydrogen::renameJackPorts, @@ -1214,10 +1021,6 @@ PYBIND11_MODULE(h2core, m) { _Hydrogen.def("setbeatsToCount", &H2Core::Hydrogen::setbeatsToCount, py::arg("beatstocount")); _Hydrogen.def("getbeatsToCount", &H2Core::Hydrogen::getbeatsToCount); - _Hydrogen.def("setNoteLength", &H2Core::Hydrogen::setNoteLength, - py::arg("notelength")); - _Hydrogen.def("getNoteLength", &H2Core::Hydrogen::getNoteLength); - _Hydrogen.def("getBcStatus", &H2Core::Hydrogen::getBcStatus); _Hydrogen.def("handleBeatCounter", &H2Core::Hydrogen::handleBeatCounter); _Hydrogen.def("setBcOffsetAdjust", &H2Core::Hydrogen::setBcOffsetAdjust); _Hydrogen.def("offJackMaster", &H2Core::Hydrogen::offJackMaster, @@ -1238,8 +1041,6 @@ PYBIND11_MODULE(h2core, m) { _Hydrogen.def("getTimelineBpm", &H2Core::Hydrogen::getTimelineBpm, "Returns the local speed at a specific nBar in the Timeline.", py::arg("nBar")); - _Hydrogen.def("getTimeline", &H2Core::Hydrogen::getTimeline); - _Hydrogen.def("getIsExportSessionActive", &H2Core::Hydrogen::getIsExportSessionActive); _Hydrogen.def("startExportSession", &H2Core::Hydrogen::startExportSession, py::arg("rate"), py::arg("depth")); @@ -1247,12 +1048,6 @@ PYBIND11_MODULE(h2core, m) { _Hydrogen.def("startExportSong", &H2Core::Hydrogen::startExportSong, py::arg("filename")); _Hydrogen.def("stopExportSong", &H2Core::Hydrogen::stopExportSong); - _Hydrogen.def("getCoreActionController", &H2Core::Hydrogen::getCoreActionController); - _Hydrogen.def("setPlaybackTrackState", &H2Core::Hydrogen::setPlaybackTrackState, - "*********************************************************", - py::arg("state")); - _Hydrogen.def("getPlaybackTrackState", &H2Core::Hydrogen::getPlaybackTrackState, - "Wrapper around Song::getPlaybackTrackEnabled()."); _Hydrogen.def("loadPlaybackTrack", &H2Core::Hydrogen::loadPlaybackTrack, "Wrapper function for loading the playback track.", py::arg("filename")); @@ -1270,8 +1065,6 @@ PYBIND11_MODULE(h2core, m) { "Returns Whether JackAudioDriver is used as current audio driver."); _Hydrogen.def("haveJackTransport", &H2Core::Hydrogen::haveJackTransport, "Returns Whether JackAudioDriver is used as current audio driver and JACK transport was activated via the GUI (#Preferences::m_bJackTransportMode)."); - _Hydrogen.def("getJackTimebaseState", &H2Core::Hydrogen::getJackTimebaseState, - "Returns Whether we haveJackTransport() and there is an external JACK timebase master broadcasting us tempo information and making use disregard Hydrogen's Timeline information (see #JackAudioDriver::m_timebaseState)."); _Hydrogen.def("isUnderSessionManagement", &H2Core::Hydrogen::isUnderSessionManagement, "Returns NsmClient::m_bUnderSessionManagement if NSM is supported."); _Hydrogen.def("toQString", &H2Core::Hydrogen::toQString, @@ -1280,6 +1073,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("bShort")); py::class_> _Filesystem(m, "Filesystem"); + _Filesystem.def_property("preferences_overwrite_path", &H2Core::Filesystem::getPreferencesOverwritePath, &H2Core::Filesystem::setPreferencesOverwritePath); _Filesystem.def_static("class_name", &H2Core::Filesystem::class_name); _Filesystem.def_static("bootstrap", &H2Core::Filesystem::bootstrap, "check user and system filesystem usability", @@ -1458,44 +1252,42 @@ PYBIND11_MODULE(h2core, m) { _Filesystem.def_static("mkdir", &H2Core::Filesystem::mkdir, "create a path", py::arg("path")); - _Filesystem.def_static("getPreferencesOverwritePath", &H2Core::Filesystem::getPreferencesOverwritePath, - "Returns m_sPreferencesOverwritePath"); - _Filesystem.def_static("setPreferencesOverwritePath", &H2Core::Filesystem::setPreferencesOverwritePath, - py::arg("sPath")); py::class_> _Song(m, "Song"); _Song.def(py::init()); + _Song.def_property_readonly_static("empty_song", [](py::object) { return H2Core::Song::getEmptySong(); }); + _Song.def_property_readonly_static("default_song", [](py::object) { return H2Core::Song::getDefaultSong(); }); + _Song.def_property("is_muted", &H2Core::Song::getIsMuted, &H2Core::Song::setIsMuted); + _Song.def_property("resolution", &H2Core::Song::getResolution, &H2Core::Song::setResolution); + _Song.def_property("bpm", &H2Core::Song::getBpm, &H2Core::Song::setBpm); + _Song.def_property("name", &H2Core::Song::getName, &H2Core::Song::setName); + _Song.def_property("volume", &H2Core::Song::getVolume, &H2Core::Song::setVolume); + _Song.def_property("metronome_volume", &H2Core::Song::getMetronomeVolume, &H2Core::Song::setMetronomeVolume); + _Song.def_property("pattern_list", &H2Core::Song::getPatternList, &H2Core::Song::setPatternList); + _Song.def_property("instrument_list", &H2Core::Song::getInstrumentList, &H2Core::Song::setInstrumentList); + _Song.def_property("notes", &H2Core::Song::getNotes, &H2Core::Song::setNotes); + _Song.def_property("license", &H2Core::Song::getLicense, &H2Core::Song::setLicense); + _Song.def_property("author", &H2Core::Song::getAuthor, &H2Core::Song::setAuthor); + _Song.def_property("filename", &H2Core::Song::getFilename, &H2Core::Song::setFilename); + _Song.def_property("is_loop_enabled", &H2Core::Song::getIsLoopEnabled, &H2Core::Song::setIsLoopEnabled); + _Song.def_property("humanize_time_value", &H2Core::Song::getHumanizeTimeValue, &H2Core::Song::setHumanizeTimeValue); + _Song.def_property("humanize_velocity_value", &H2Core::Song::getHumanizeVelocityValue, &H2Core::Song::setHumanizeVelocityValue); + _Song.def_property("swing_factor", &H2Core::Song::getSwingFactor, &H2Core::Song::setSwingFactor); + _Song.def_property("mode", &H2Core::Song::getMode, &H2Core::Song::setMode); + _Song.def_property("is_modified", &H2Core::Song::getIsModified, &H2Core::Song::setIsModified); + _Song.def_property_readonly("components", &H2Core::Song::getComponents); + _Song.def_property_readonly("velocity_automation_path", &H2Core::Song::getVelocityAutomationPath); + _Song.def_property("playback_track_filename", &H2Core::Song::getPlaybackTrackFilename, &H2Core::Song::setPlaybackTrackFilename); + _Song.def_property("playback_track_enabled", &H2Core::Song::getPlaybackTrackEnabled, &H2Core::Song::setPlaybackTrackEnabled); + _Song.def_property("playback_track_volume", &H2Core::Song::getPlaybackTrackVolume, &H2Core::Song::setPlaybackTrackVolume); + _Song.def_property("action_mode", &H2Core::Song::getActionMode, &H2Core::Song::setActionMode); + _Song.def_property("pan_law_type", &H2Core::Song::getPanLawType, &H2Core::Song::setPanLawType); + _Song.def_property("pan_law_k_norm", &H2Core::Song::getPanLawKNorm, &H2Core::Song::setPanLawKNorm); _Song.def_static("class_name", &H2Core::Song::class_name); - _Song.def_static("getEmptySong", &H2Core::Song::getEmptySong); - _Song.def_static("getDefaultSong", &H2Core::Song::getDefaultSong); - _Song.def("getIsMuted", &H2Core::Song::getIsMuted); - _Song.def("setIsMuted", &H2Core::Song::setIsMuted, - py::arg("bIsMuted")); - _Song.def("getResolution", &H2Core::Song::getResolution); - _Song.def("setResolution", &H2Core::Song::setResolution, - py::arg("resolution")); - _Song.def("getBpm", &H2Core::Song::getBpm); - _Song.def("setBpm", &H2Core::Song::setBpm, - py::arg("fBpm")); - _Song.def("getName", &H2Core::Song::getName); - _Song.def("setName", &H2Core::Song::setName, - py::arg("sName")); - _Song.def("setVolume", &H2Core::Song::setVolume, - py::arg("fValue")); - _Song.def("getVolume", &H2Core::Song::getVolume); - _Song.def("setMetronomeVolume", &H2Core::Song::setMetronomeVolume, - py::arg("fValue")); - _Song.def("getMetronomeVolume", &H2Core::Song::getMetronomeVolume); - _Song.def("getPatternList", &H2Core::Song::getPatternList); - _Song.def("setPatternList", &H2Core::Song::setPatternList, - py::arg("pList")); _Song.def("getPatternGroupVector", py::overload_cast<>(&H2Core::Song::getPatternGroupVector), "Return a pointer to a vector storing all Pattern present in the Song."); _Song.def("getPatternGroupVector", py::overload_cast<>(&H2Core::Song::getPatternGroupVector), "Return a pointer to a vector storing all Pattern present in the Song."); - _Song.def("setPatternGroupVector", &H2Core::Song::setPatternGroupVector, - "Sets the vector storing all Pattern present in the Song #m_pPatternGroupSequence.", - py::arg("pGroupVector")); _Song.def("lengthInTicks", &H2Core::Song::lengthInTicks, "get the length of the song, in tick units"); _Song.def_static("load", &H2Core::Song::load, @@ -1505,41 +1297,6 @@ PYBIND11_MODULE(h2core, m) { _Song.def("purgeInstrument", &H2Core::Song::purgeInstrument, "Remove all the notes in the song that play on instrument I. The function is real-time safe (it locks the audio data while deleting notes)", py::arg("pInstr")); - _Song.def("getInstrumentList", &H2Core::Song::getInstrumentList); - _Song.def("setInstrumentList", &H2Core::Song::setInstrumentList, - py::arg("pList")); - _Song.def("setNotes", &H2Core::Song::setNotes, - py::arg("sNotes")); - _Song.def("getNotes", &H2Core::Song::getNotes); - _Song.def("setLicense", &H2Core::Song::setLicense, - py::arg("sLicense")); - _Song.def("getLicense", &H2Core::Song::getLicense); - _Song.def("setAuthor", &H2Core::Song::setAuthor, - py::arg("sAuthor")); - _Song.def("getAuthor", &H2Core::Song::getAuthor); - _Song.def("getFilename", &H2Core::Song::getFilename); - _Song.def("setFilename", &H2Core::Song::setFilename, - py::arg("sFilename")); - _Song.def("getIsLoopEnabled", &H2Core::Song::getIsLoopEnabled); - _Song.def("setIsLoopEnabled", &H2Core::Song::setIsLoopEnabled, - py::arg("bEnabled")); - _Song.def("getHumanizeTimeValue", &H2Core::Song::getHumanizeTimeValue); - _Song.def("setHumanizeTimeValue", &H2Core::Song::setHumanizeTimeValue, - py::arg("fValue")); - _Song.def("getHumanizeVelocityValue", &H2Core::Song::getHumanizeVelocityValue); - _Song.def("setHumanizeVelocityValue", &H2Core::Song::setHumanizeVelocityValue, - py::arg("fValue")); - _Song.def("getSwingFactor", &H2Core::Song::getSwingFactor); - _Song.def("setSwingFactor", &H2Core::Song::setSwingFactor, - py::arg("fFactor")); - _Song.def("getMode", &H2Core::Song::getMode); - _Song.def("setMode", &H2Core::Song::setMode, - py::arg("mode")); - _Song.def("setIsModified", &H2Core::Song::setIsModified, - py::arg("bIsModified")); - _Song.def("getIsModified", &H2Core::Song::getIsModified); - _Song.def("getComponents", &H2Core::Song::getComponents); - _Song.def("getVelocityAutomationPath", &H2Core::Song::getVelocityAutomationPath); _Song.def("getComponent", &H2Core::Song::getComponent, py::arg("nID")); _Song.def("readTempPatternList", &H2Core::Song::readTempPatternList, @@ -1559,31 +1316,9 @@ PYBIND11_MODULE(h2core, m) { _Song.def("setLatestRoundRobin", &H2Core::Song::setLatestRoundRobin, py::arg("fStartVelocity"), py::arg("nLatestRoundRobin")); - _Song.def("getPlaybackTrackFilename", &H2Core::Song::getPlaybackTrackFilename, - "Returns #m_sPlaybackTrackFilename"); - _Song.def("setPlaybackTrackFilename", &H2Core::Song::setPlaybackTrackFilename, - py::arg("sFilename")); - _Song.def("getPlaybackTrackEnabled", &H2Core::Song::getPlaybackTrackEnabled, - "Returns #m_bPlaybackTrackEnabled"); - _Song.def("setPlaybackTrackEnabled", &H2Core::Song::setPlaybackTrackEnabled, - "Specifies whether a playback track should be used.", - py::arg("bEnabled")); - _Song.def("getPlaybackTrackVolume", &H2Core::Song::getPlaybackTrackVolume, - "Returns #m_fPlaybackTrackVolume"); - _Song.def("setPlaybackTrackVolume", &H2Core::Song::setPlaybackTrackVolume, - py::arg("fVolume")); - _Song.def("getActionMode", &H2Core::Song::getActionMode); - _Song.def("setActionMode", &H2Core::Song::setActionMode, - py::arg("actionMode")); _Song.def("hasMissingSamples", &H2Core::Song::hasMissingSamples, "Song was incompletely loaded from file (missing samples)"); _Song.def("clearMissingSamples", &H2Core::Song::clearMissingSamples); - _Song.def("setPanLawType", &H2Core::Song::setPanLawType, - py::arg("nPanLawType")); - _Song.def("getPanLawType", &H2Core::Song::getPanLawType); - _Song.def("setPanLawKNorm", &H2Core::Song::setPanLawKNorm, - py::arg("fKNorm")); - _Song.def("getPanLawKNorm", &H2Core::Song::getPanLawKNorm); _Song.def("toQString", &H2Core::Song::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -1596,11 +1331,11 @@ PYBIND11_MODULE(h2core, m) { py::class_> _AutomationPath(m, "AutomationPath"); _AutomationPath.def(py::init()); + _AutomationPath.def_property_readonly("min", &H2Core::AutomationPath::get_min); + _AutomationPath.def_property_readonly("max", &H2Core::AutomationPath::get_max); + _AutomationPath.def_property_readonly("default", &H2Core::AutomationPath::get_default); _AutomationPath.def_static("class_name", &H2Core::AutomationPath::class_name); _AutomationPath.def("empty", &H2Core::AutomationPath::empty); - _AutomationPath.def("get_min", &H2Core::AutomationPath::get_min); - _AutomationPath.def("get_max", &H2Core::AutomationPath::get_max); - _AutomationPath.def("get_default", &H2Core::AutomationPath::get_default); _AutomationPath.def("get_value", &H2Core::AutomationPath::get_value, py::arg("x")); _AutomationPath.def("add_point", &H2Core::AutomationPath::add_point, @@ -1626,6 +1361,14 @@ PYBIND11_MODULE(h2core, m) { py::class_> _Pattern(m, "Pattern"); _Pattern.def(py::init()); _Pattern.def(py::init()); + _Pattern.def_property("name", &H2Core::Pattern::get_name, &H2Core::Pattern::set_name); + _Pattern.def_property("category", &H2Core::Pattern::get_category, &H2Core::Pattern::set_category); + _Pattern.def_property("info", &H2Core::Pattern::get_info, &H2Core::Pattern::set_info); + _Pattern.def_property("length", &H2Core::Pattern::get_length, &H2Core::Pattern::set_length); + _Pattern.def_property("denominator", &H2Core::Pattern::get_denominator, &H2Core::Pattern::set_denominator); + _Pattern.def_property_readonly("notes", &H2Core::Pattern::get_notes); + _Pattern.def_property_readonly("virtual_patterns", &H2Core::Pattern::get_virtual_patterns); + _Pattern.def_property_readonly("flattened_virtual_patterns", &H2Core::Pattern::get_flattened_virtual_patterns); _Pattern.def_static("class_name", &H2Core::Pattern::class_name); _Pattern.def_static("load_file", &H2Core::Pattern::load_file, "load a pattern from a file", @@ -1638,24 +1381,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("license"), py::arg("pattern_path"), py::arg("overwrite")); - _Pattern.def("set_name", &H2Core::Pattern::set_name, - py::arg("name")); - _Pattern.def("get_name", &H2Core::Pattern::get_name); - _Pattern.def("set_category", &H2Core::Pattern::set_category, - py::arg("category")); - _Pattern.def("set_info", &H2Core::Pattern::set_info, - py::arg("info")); - _Pattern.def("get_info", &H2Core::Pattern::get_info); - _Pattern.def("get_category", &H2Core::Pattern::get_category); - _Pattern.def("set_length", &H2Core::Pattern::set_length, - py::arg("length")); - _Pattern.def("get_length", &H2Core::Pattern::get_length); - _Pattern.def("set_denominator", &H2Core::Pattern::set_denominator, - py::arg("denominator")); - _Pattern.def("get_denominator", &H2Core::Pattern::get_denominator); - // [] _Pattern.def("get_notes", &H2Core::Pattern::get_notes); - // [] _Pattern.def("get_virtual_patterns", &H2Core::Pattern::get_virtual_patterns); - // [] _Pattern.def("get_flattened_virtual_patterns", &H2Core::Pattern::get_flattened_virtual_patterns); _Pattern.def("insert_note", &H2Core::Pattern::insert_note, "insert a new note within __notes", py::arg("note")); @@ -1708,12 +1433,14 @@ PYBIND11_MODULE(h2core, m) { py::arg("bShort")); py::class_> _Playlist(m, "Playlist"); + _Playlist.def_property_readonly_static("instance", [](py::object) { return H2Core::Playlist::get_instance(); }, py::return_value_policy::reference); + _Playlist.def_property("selected_song_nr", &H2Core::Playlist::getSelectedSongNr, &H2Core::Playlist::setSelectedSongNr); + _Playlist.def_property("active_song_number", &H2Core::Playlist::getActiveSongNumber, &H2Core::Playlist::setActiveSongNumber); + _Playlist.def_property("filename", &H2Core::Playlist::getFilename, &H2Core::Playlist::setFilename); + _Playlist.def_property("is_modified", &H2Core::Playlist::getIsModified, &H2Core::Playlist::setIsModified); _Playlist.def_static("class_name", &H2Core::Playlist::class_name); _Playlist.def_static("create_instance", &H2Core::Playlist::create_instance, "If #__instance equals 0, a new Playlist singleton will be created and stored in it."); - _Playlist.def_static("get_instance", &H2Core::Playlist::get_instance, - "Returns a pointer to the current Playlist singleton stored in #__instance.", - py::return_value_policy::reference); _Playlist.def("activateSong", &H2Core::Playlist::activateSong, py::arg("SongNumber")); _Playlist.def("size", &H2Core::Playlist::size); @@ -1722,23 +1449,9 @@ PYBIND11_MODULE(h2core, m) { _Playlist.def("clear", &H2Core::Playlist::clear); _Playlist.def("add", &H2Core::Playlist::add, py::arg("entry")); - _Playlist.def("setNextSongByNumber", &H2Core::Playlist::setNextSongByNumber, - py::arg("SongNumber")); - _Playlist.def("getSelectedSongNr", &H2Core::Playlist::getSelectedSongNr); - _Playlist.def("setSelectedSongNr", &H2Core::Playlist::setSelectedSongNr, - py::arg("songNumber")); - _Playlist.def("getActiveSongNumber", &H2Core::Playlist::getActiveSongNumber); - _Playlist.def("setActiveSongNumber", &H2Core::Playlist::setActiveSongNumber, - py::arg("ActiveSongNumber")); _Playlist.def("getSongFilenameByNumber", &H2Core::Playlist::getSongFilenameByNumber, py::arg("songNumber"), py::arg("fileName")); - _Playlist.def("getFilename", &H2Core::Playlist::getFilename); - _Playlist.def("setFilename", &H2Core::Playlist::setFilename, - py::arg("filename")); - _Playlist.def("getIsModified", &H2Core::Playlist::getIsModified); - _Playlist.def("setIsModified", &H2Core::Playlist::setIsModified, - py::arg("IsModified")); _Playlist.def_static("load", &H2Core::Playlist::load, py::arg("filename"), py::arg("useRelativePaths")); @@ -1802,72 +1515,82 @@ PYBIND11_MODULE(h2core, m) { _Preferences.def_readwrite("m_bJackMasterMode", &H2Core::Preferences::m_bJackMasterMode); _Preferences.def_readwrite("m_sDefaultEditor", &H2Core::Preferences::m_sDefaultEditor); _Preferences.def_readwrite("m_rubberBandCLIexecutable", &H2Core::Preferences::m_rubberBandCLIexecutable); + _Preferences.def_property_readonly_static("instance", [](py::object) { return H2Core::Preferences::get_instance(); }, py::return_value_policy::reference); + _Preferences.def_property("default_editor", &H2Core::Preferences::getDefaultEditor, &H2Core::Preferences::setDefaultEditor); + _Preferences.def_property("preferred_language", &H2Core::Preferences::getPreferredLanguage, &H2Core::Preferences::setPreferredLanguage); + _Preferences.def_property("show_devel_warning", &H2Core::Preferences::getShowDevelWarning, &H2Core::Preferences::setShowDevelWarning); + _Preferences.def_property("show_note_overwrite_warning", &H2Core::Preferences::getShowNoteOverwriteWarning, &H2Core::Preferences::setShowNoteOverwriteWarning); + _Preferences.def_property("last_song_filename", &H2Core::Preferences::getLastSongFilename, &H2Core::Preferences::setLastSongFilename); + _Preferences.def_property("last_playlist_filename", &H2Core::Preferences::getLastPlaylistFilename, &H2Core::Preferences::setLastPlaylistFilename); + _Preferences.def_property("hear_new_notes", &H2Core::Preferences::getHearNewNotes, &H2Core::Preferences::setHearNewNotes); + _Preferences.def_property("record_events", &H2Core::Preferences::getRecordEvents, &H2Core::Preferences::setRecordEvents); + _Preferences.def_property("punch_in_pos", &H2Core::Preferences::getPunchInPos, &H2Core::Preferences::setPunchInPos); + _Preferences.def_property("punch_out_pos", &H2Core::Preferences::getPunchOutPos, &H2Core::Preferences::setPunchOutPos); + _Preferences.def_property("quantize_events", &H2Core::Preferences::getQuantizeEvents, &H2Core::Preferences::setQuantizeEvents); + _Preferences.def_property("recent_files", &H2Core::Preferences::getRecentFiles, &H2Core::Preferences::setRecentFiles); + _Preferences.def_property("application_font_family", &H2Core::Preferences::getApplicationFontFamily, &H2Core::Preferences::setApplicationFontFamily); + _Preferences.def_property("level_2_font_family", &H2Core::Preferences::getLevel2FontFamily, &H2Core::Preferences::setLevel2FontFamily); + _Preferences.def_property("level_3_font_family", &H2Core::Preferences::getLevel3FontFamily, &H2Core::Preferences::setLevel3FontFamily); + _Preferences.def_property("font_size", &H2Core::Preferences::getFontSize, &H2Core::Preferences::setFontSize); + _Preferences.def_property("mixer_falloff_speed", &H2Core::Preferences::getMixerFalloffSpeed, &H2Core::Preferences::setMixerFalloffSpeed); + _Preferences.def_property("pattern_editor_grid_resolution", &H2Core::Preferences::getPatternEditorGridResolution, &H2Core::Preferences::setPatternEditorGridResolution); + _Preferences.def_property("show_automation_area", &H2Core::Preferences::getShowAutomationArea, &H2Core::Preferences::setShowAutomationArea); + _Preferences.def_property("pattern_editor_grid_height", &H2Core::Preferences::getPatternEditorGridHeight, &H2Core::Preferences::setPatternEditorGridHeight); + _Preferences.def_property("pattern_editor_grid_width", &H2Core::Preferences::getPatternEditorGridWidth, &H2Core::Preferences::setPatternEditorGridWidth); + _Preferences.def_property("song_editor_grid_height", &H2Core::Preferences::getSongEditorGridHeight, &H2Core::Preferences::setSongEditorGridHeight); + _Preferences.def_property("song_editor_grid_width", &H2Core::Preferences::getSongEditorGridWidth, &H2Core::Preferences::setSongEditorGridWidth); + _Preferences.def_property("coloring_method", &H2Core::Preferences::getColoringMethod, &H2Core::Preferences::setColoringMethod); + _Preferences.def_property("pattern_colors", &H2Core::Preferences::getPatternColors, &H2Core::Preferences::setPatternColors); + _Preferences.def_property("max_pattern_colors", &H2Core::Preferences::getMaxPatternColors, &H2Core::Preferences::setMaxPatternColors); + _Preferences.def_property("visible_pattern_colors", &H2Core::Preferences::getVisiblePatternColors, &H2Core::Preferences::setVisiblePatternColors); + _Preferences.def_property("main_form_properties", &H2Core::Preferences::getMainFormProperties, &H2Core::Preferences::setMainFormProperties); + _Preferences.def_property("mixer_properties", &H2Core::Preferences::getMixerProperties, &H2Core::Preferences::setMixerProperties); + _Preferences.def_property("pattern_editor_properties", &H2Core::Preferences::getPatternEditorProperties, &H2Core::Preferences::setPatternEditorProperties); + _Preferences.def_property("song_editor_properties", &H2Core::Preferences::getSongEditorProperties, &H2Core::Preferences::setSongEditorProperties); + _Preferences.def_property("instrument_rack_properties", &H2Core::Preferences::getInstrumentRackProperties, &H2Core::Preferences::setInstrumentRackProperties); + _Preferences.def_property("audio_engine_info_properties", &H2Core::Preferences::getAudioEngineInfoProperties, &H2Core::Preferences::setAudioEngineInfoProperties); + _Preferences.def_property("max_bars", &H2Core::Preferences::getMaxBars, &H2Core::Preferences::setMaxBars); + _Preferences.def_property("max_layers", &H2Core::Preferences::getMaxLayers, &H2Core::Preferences::setMaxLayers); + _Preferences.def_property("wait_for_session_handler", &H2Core::Preferences::getWaitForSessionHandler, &H2Core::Preferences::setWaitForSessionHandler); + _Preferences.def_property("nsm_client_id", &H2Core::Preferences::getNsmClientId, &H2Core::Preferences::setNsmClientId); + _Preferences.def_property("nsm_song_name", &H2Core::Preferences::getNsmSongName, &H2Core::Preferences::setNsmSongName); + _Preferences.def_property("osc_server_enabled", &H2Core::Preferences::getOscServerEnabled, &H2Core::Preferences::setOscServerEnabled); + _Preferences.def_property("osc_feedback_enabled", &H2Core::Preferences::getOscFeedbackEnabled, &H2Core::Preferences::setOscFeedbackEnabled); + _Preferences.def_property("osc_server_port", &H2Core::Preferences::getOscServerPort, &H2Core::Preferences::setOscServerPort); + _Preferences.def_property("use_timeline_bpm", &H2Core::Preferences::getUseTimelineBpm, &H2Core::Preferences::setUseTimelineBpm); + _Preferences.def_property("show_playback_track", &H2Core::Preferences::getShowPlaybackTrack, &H2Core::Preferences::setShowPlaybackTrack); + _Preferences.def_property("rubber_band_calc_time", &H2Core::Preferences::getRubberBandCalcTime, &H2Core::Preferences::setRubberBandCalcTime); + _Preferences.def_property("rubber_band_batch_mode", &H2Core::Preferences::getRubberBandBatchMode, &H2Core::Preferences::setRubberBandBatchMode); + _Preferences.def_property("last_open_tab", &H2Core::Preferences::getLastOpenTab, &H2Core::Preferences::setLastOpenTab); + _Preferences.def_property("h_2_process_name", &H2Core::Preferences::getH2ProcessName, &H2Core::Preferences::setH2ProcessName); + _Preferences.def_property("export_sample_depth_idx", &H2Core::Preferences::getExportSampleDepthIdx, &H2Core::Preferences::setExportSampleDepthIdx); + _Preferences.def_property("export_sample_rate_idx", &H2Core::Preferences::getExportSampleRateIdx, &H2Core::Preferences::setExportSampleRateIdx); + _Preferences.def_property("export_mode_idx", &H2Core::Preferences::getExportModeIdx, &H2Core::Preferences::setExportModeIdx); + _Preferences.def_property("export_directory", &H2Core::Preferences::getExportDirectory, &H2Core::Preferences::setExportDirectory); + _Preferences.def_property("export_template_idx", &H2Core::Preferences::getExportTemplateIdx, &H2Core::Preferences::setExportTemplateIdx); + _Preferences.def_property("midi_export_mode", &H2Core::Preferences::getMidiExportMode, &H2Core::Preferences::setMidiExportMode); + _Preferences.def_property("midi_export_directory", &H2Core::Preferences::getMidiExportDirectory, &H2Core::Preferences::setMidiExportDirectory); _Preferences.def_static("class_name", &H2Core::Preferences::class_name); _Preferences.def_static("create_instance", &H2Core::Preferences::create_instance, "If #__instance equals 0, a new Preferences singleton will be created and stored in it."); - _Preferences.def_static("get_instance", &H2Core::Preferences::get_instance, - "Returns a pointer to the current Preferences singleton stored in #__instance.", - py::return_value_policy::reference); _Preferences.def("loadPreferences", &H2Core::Preferences::loadPreferences, "Load the preferences file", py::arg("bGlobal")); _Preferences.def("savePreferences", &H2Core::Preferences::savePreferences, "Save the preferences file"); // [banned] _Preferences.def("getDataDirectory", &H2Core::Preferences::getDataDirectory); - _Preferences.def("getDefaultEditor", &H2Core::Preferences::getDefaultEditor); - _Preferences.def("setDefaultEditor", &H2Core::Preferences::setDefaultEditor, - py::arg("editor")); _Preferences.def("getDefaultUILayout", &H2Core::Preferences::getDefaultUILayout); _Preferences.def("setDefaultUILayout", &H2Core::Preferences::setDefaultUILayout, py::arg("layout")); _Preferences.def("getUIScalingPolicy", &H2Core::Preferences::getUIScalingPolicy); _Preferences.def("setUIScalingPolicy", &H2Core::Preferences::setUIScalingPolicy, py::arg("nPolicy")); - _Preferences.def("getPreferredLanguage", &H2Core::Preferences::getPreferredLanguage); - _Preferences.def("setPreferredLanguage", &H2Core::Preferences::setPreferredLanguage, - py::arg("sLanguage")); - _Preferences.def("setRestoreLastSongEnabled", &H2Core::Preferences::setRestoreLastSongEnabled, - py::arg("restore")); - _Preferences.def("setRestoreLastPlaylistEnabled", &H2Core::Preferences::setRestoreLastPlaylistEnabled, - py::arg("restore")); - _Preferences.def("setUseRelativeFilenamesForPlaylists", &H2Core::Preferences::setUseRelativeFilenamesForPlaylists, - py::arg("value")); - _Preferences.def("setShowDevelWarning", &H2Core::Preferences::setShowDevelWarning, - py::arg("value")); - _Preferences.def("getShowDevelWarning", &H2Core::Preferences::getShowDevelWarning); - _Preferences.def("getShowNoteOverwriteWarning", &H2Core::Preferences::getShowNoteOverwriteWarning); - _Preferences.def("setShowNoteOverwriteWarning", &H2Core::Preferences::setShowNoteOverwriteWarning, - py::arg("bValue")); _Preferences.def("isRestoreLastSongEnabled", &H2Core::Preferences::isRestoreLastSongEnabled); _Preferences.def("isRestoreLastPlaylistEnabled", &H2Core::Preferences::isRestoreLastPlaylistEnabled); _Preferences.def("isPlaylistUsingRelativeFilenames", &H2Core::Preferences::isPlaylistUsingRelativeFilenames); - _Preferences.def("setLastSongFilename", &H2Core::Preferences::setLastSongFilename, - py::arg("filename")); - _Preferences.def("getLastSongFilename", &H2Core::Preferences::getLastSongFilename); - _Preferences.def("setLastPlaylistFilename", &H2Core::Preferences::setLastPlaylistFilename, - py::arg("filename")); - _Preferences.def("getLastPlaylistFilename", &H2Core::Preferences::getLastPlaylistFilename); - _Preferences.def("setHearNewNotes", &H2Core::Preferences::setHearNewNotes, - py::arg("value")); - _Preferences.def("getHearNewNotes", &H2Core::Preferences::getHearNewNotes); - _Preferences.def("setRecordEvents", &H2Core::Preferences::setRecordEvents, - py::arg("value")); - _Preferences.def("getRecordEvents", &H2Core::Preferences::getRecordEvents); - _Preferences.def("setPunchInPos", &H2Core::Preferences::setPunchInPos, - py::arg("pos")); - _Preferences.def("getPunchInPos", &H2Core::Preferences::getPunchInPos); - _Preferences.def("setPunchOutPos", &H2Core::Preferences::setPunchOutPos, - py::arg("pos")); - _Preferences.def("getPunchOutPos", &H2Core::Preferences::getPunchOutPos); _Preferences.def("inPunchArea", &H2Core::Preferences::inPunchArea, py::arg("pos")); _Preferences.def("unsetPunchArea", &H2Core::Preferences::unsetPunchArea); - _Preferences.def("setQuantizeEvents", &H2Core::Preferences::setQuantizeEvents, - py::arg("value")); - _Preferences.def("getQuantizeEvents", &H2Core::Preferences::getQuantizeEvents); - _Preferences.def("getRecentFiles", &H2Core::Preferences::getRecentFiles); - _Preferences.def("setRecentFiles", &H2Core::Preferences::setRecentFiles, - py::arg("recentFiles")); _Preferences.def("insertRecentFile", &H2Core::Preferences::insertRecentFile, py::arg("sFilename")); _Preferences.def("getRecentFX", &H2Core::Preferences::getRecentFX); @@ -1876,78 +1599,11 @@ PYBIND11_MODULE(h2core, m) { _Preferences.def("getQTStyle", &H2Core::Preferences::getQTStyle); _Preferences.def("setQTStyle", &H2Core::Preferences::setQTStyle, py::arg("sStyle")); - _Preferences.def("getApplicationFontFamily", &H2Core::Preferences::getApplicationFontFamily); - _Preferences.def("setApplicationFontFamily", &H2Core::Preferences::setApplicationFontFamily, - py::arg("family")); - _Preferences.def("getLevel2FontFamily", &H2Core::Preferences::getLevel2FontFamily); - _Preferences.def("setLevel2FontFamily", &H2Core::Preferences::setLevel2FontFamily, - py::arg("family")); - _Preferences.def("getLevel3FontFamily", &H2Core::Preferences::getLevel3FontFamily); - _Preferences.def("setLevel3FontFamily", &H2Core::Preferences::setLevel3FontFamily, - py::arg("family")); - _Preferences.def("getFontSize", &H2Core::Preferences::getFontSize); - _Preferences.def("setFontSize", &H2Core::Preferences::setFontSize, - py::arg("fontSize")); - _Preferences.def("getMixerFalloffSpeed", &H2Core::Preferences::getMixerFalloffSpeed); - _Preferences.def("setMixerFalloffSpeed", &H2Core::Preferences::setMixerFalloffSpeed, - py::arg("value")); _Preferences.def("showInstrumentPeaks", &H2Core::Preferences::showInstrumentPeaks); - _Preferences.def("setInstrumentPeaks", &H2Core::Preferences::setInstrumentPeaks, - py::arg("value")); - _Preferences.def("getPatternEditorGridResolution", &H2Core::Preferences::getPatternEditorGridResolution); - _Preferences.def("setPatternEditorGridResolution", &H2Core::Preferences::setPatternEditorGridResolution, - py::arg("value")); _Preferences.def("isPatternEditorUsingTriplets", &H2Core::Preferences::isPatternEditorUsingTriplets); - _Preferences.def("setPatternEditorUsingTriplets", &H2Core::Preferences::setPatternEditorUsingTriplets, - py::arg("value")); _Preferences.def("isFXTabVisible", &H2Core::Preferences::isFXTabVisible); _Preferences.def("setFXTabVisible", &H2Core::Preferences::setFXTabVisible, py::arg("value")); - _Preferences.def("getShowAutomationArea", &H2Core::Preferences::getShowAutomationArea); - _Preferences.def("setShowAutomationArea", &H2Core::Preferences::setShowAutomationArea, - py::arg("value")); - _Preferences.def("getPatternEditorGridHeight", &H2Core::Preferences::getPatternEditorGridHeight); - _Preferences.def("setPatternEditorGridHeight", &H2Core::Preferences::setPatternEditorGridHeight, - py::arg("value")); - _Preferences.def("getPatternEditorGridWidth", &H2Core::Preferences::getPatternEditorGridWidth); - _Preferences.def("setPatternEditorGridWidth", &H2Core::Preferences::setPatternEditorGridWidth, - py::arg("value")); - _Preferences.def("getSongEditorGridHeight", &H2Core::Preferences::getSongEditorGridHeight); - _Preferences.def("setSongEditorGridHeight", &H2Core::Preferences::setSongEditorGridHeight, - py::arg("value")); - _Preferences.def("getSongEditorGridWidth", &H2Core::Preferences::getSongEditorGridWidth); - _Preferences.def("setSongEditorGridWidth", &H2Core::Preferences::setSongEditorGridWidth, - py::arg("value")); - _Preferences.def("setColoringMethod", &H2Core::Preferences::setColoringMethod, - py::arg("value")); - _Preferences.def("getColoringMethod", &H2Core::Preferences::getColoringMethod); - _Preferences.def("setPatternColors", &H2Core::Preferences::setPatternColors, - py::arg("patternColors")); - _Preferences.def("getPatternColors", &H2Core::Preferences::getPatternColors); - _Preferences.def("setMaxPatternColors", &H2Core::Preferences::setMaxPatternColors, - py::arg("nValue")); - _Preferences.def("getMaxPatternColors", &H2Core::Preferences::getMaxPatternColors); - _Preferences.def("setVisiblePatternColors", &H2Core::Preferences::setVisiblePatternColors, - py::arg("nValue")); - _Preferences.def("getVisiblePatternColors", &H2Core::Preferences::getVisiblePatternColors); - _Preferences.def("getMainFormProperties", &H2Core::Preferences::getMainFormProperties); - _Preferences.def("setMainFormProperties", &H2Core::Preferences::setMainFormProperties, - py::arg("prop")); - _Preferences.def("getMixerProperties", &H2Core::Preferences::getMixerProperties); - _Preferences.def("setMixerProperties", &H2Core::Preferences::setMixerProperties, - py::arg("prop")); - _Preferences.def("getPatternEditorProperties", &H2Core::Preferences::getPatternEditorProperties); - _Preferences.def("setPatternEditorProperties", &H2Core::Preferences::setPatternEditorProperties, - py::arg("prop")); - _Preferences.def("getSongEditorProperties", &H2Core::Preferences::getSongEditorProperties); - _Preferences.def("setSongEditorProperties", &H2Core::Preferences::setSongEditorProperties, - py::arg("prop")); - _Preferences.def("getInstrumentRackProperties", &H2Core::Preferences::getInstrumentRackProperties); - _Preferences.def("setInstrumentRackProperties", &H2Core::Preferences::setInstrumentRackProperties, - py::arg("prop")); - _Preferences.def("getAudioEngineInfoProperties", &H2Core::Preferences::getAudioEngineInfoProperties); - _Preferences.def("setAudioEngineInfoProperties", &H2Core::Preferences::setAudioEngineInfoProperties, - py::arg("prop")); _Preferences.def("getLadspaProperties", &H2Core::Preferences::getLadspaProperties, py::arg("nFX")); _Preferences.def("setLadspaProperties", &H2Core::Preferences::setLadspaProperties, @@ -1956,84 +1612,8 @@ PYBIND11_MODULE(h2core, m) { _Preferences.def("getDefaultUIStyle", &H2Core::Preferences::getDefaultUIStyle); _Preferences.def("patternModePlaysSelected", &H2Core::Preferences::patternModePlaysSelected, "Returns #m_bPatternModePlaysSelected"); - _Preferences.def("setPatternModePlaysSelected", &H2Core::Preferences::setPatternModePlaysSelected, - py::arg("b")); _Preferences.def("useLash", &H2Core::Preferences::useLash); - _Preferences.def("setUseLash", &H2Core::Preferences::setUseLash, - py::arg("b")); _Preferences.def("hideKeyboardCursor", &H2Core::Preferences::hideKeyboardCursor); - _Preferences.def("setHideKeyboardCursor", &H2Core::Preferences::setHideKeyboardCursor, - py::arg("value")); - _Preferences.def("setMaxBars", &H2Core::Preferences::setMaxBars, - py::arg("bars")); - _Preferences.def("getMaxBars", &H2Core::Preferences::getMaxBars, - "Returns #m_nMaxBars."); - _Preferences.def("setMaxLayers", &H2Core::Preferences::setMaxLayers, - py::arg("layers")); - _Preferences.def("getMaxLayers", &H2Core::Preferences::getMaxLayers, - "Returns #m_nMaxLayers."); - _Preferences.def("setWaitForSessionHandler", &H2Core::Preferences::setWaitForSessionHandler, - py::arg("value")); - _Preferences.def("getWaitForSessionHandler", &H2Core::Preferences::getWaitForSessionHandler); - _Preferences.def("setNsmClientId", &H2Core::Preferences::setNsmClientId, - py::arg("nsmClientId")); - _Preferences.def("getNsmClientId", &H2Core::Preferences::getNsmClientId); - _Preferences.def("setNsmSongName", &H2Core::Preferences::setNsmSongName, - py::arg("nsmSongName")); - _Preferences.def("getNsmSongName", &H2Core::Preferences::getNsmSongName); - _Preferences.def("getOscServerEnabled", &H2Core::Preferences::getOscServerEnabled, - "Returns #m_bOscServerEnabled"); - _Preferences.def("setOscServerEnabled", &H2Core::Preferences::setOscServerEnabled, - py::arg("val")); - _Preferences.def("getOscFeedbackEnabled", &H2Core::Preferences::getOscFeedbackEnabled, - "Returns #m_bOscFeedbackEnabled"); - _Preferences.def("setOscFeedbackEnabled", &H2Core::Preferences::setOscFeedbackEnabled, - py::arg("val")); - _Preferences.def("getOscServerPort", &H2Core::Preferences::getOscServerPort, - "Returns #m_nOscServerPort"); - _Preferences.def("setOscServerPort", &H2Core::Preferences::setOscServerPort, - py::arg("oscPort")); - _Preferences.def("getUseTimelineBpm", &H2Core::Preferences::getUseTimelineBpm, - "Whether to use the bpm of the timeline."); - _Preferences.def("setUseTimelineBpm", &H2Core::Preferences::setUseTimelineBpm, - "Setting #__useTimelineBpm.", - py::arg("val")); - _Preferences.def("setShowPlaybackTrack", &H2Core::Preferences::setShowPlaybackTrack, - py::arg("val")); - _Preferences.def("getShowPlaybackTrack", &H2Core::Preferences::getShowPlaybackTrack); - _Preferences.def("getRubberBandCalcTime", &H2Core::Preferences::getRubberBandCalcTime); - _Preferences.def("setRubberBandCalcTime", &H2Core::Preferences::setRubberBandCalcTime, - py::arg("val")); - _Preferences.def("getRubberBandBatchMode", &H2Core::Preferences::getRubberBandBatchMode); - _Preferences.def("setRubberBandBatchMode", &H2Core::Preferences::setRubberBandBatchMode, - py::arg("val")); - _Preferences.def("getLastOpenTab", &H2Core::Preferences::getLastOpenTab); - _Preferences.def("setLastOpenTab", &H2Core::Preferences::setLastOpenTab, - py::arg("n")); - _Preferences.def("setH2ProcessName", &H2Core::Preferences::setH2ProcessName, - py::arg("processName")); - _Preferences.def("getH2ProcessName", &H2Core::Preferences::getH2ProcessName); - _Preferences.def("getExportSampleDepthIdx", &H2Core::Preferences::getExportSampleDepthIdx); - _Preferences.def("setExportSampleDepthIdx", &H2Core::Preferences::setExportSampleDepthIdx, - py::arg("ExportSampleDepth")); - _Preferences.def("getExportSampleRateIdx", &H2Core::Preferences::getExportSampleRateIdx); - _Preferences.def("setExportSampleRateIdx", &H2Core::Preferences::setExportSampleRateIdx, - py::arg("ExportSampleRate")); - _Preferences.def("getExportModeIdx", &H2Core::Preferences::getExportModeIdx); - _Preferences.def("setExportModeIdx", &H2Core::Preferences::setExportModeIdx, - py::arg("ExportModeIdx")); - _Preferences.def("getExportDirectory", &H2Core::Preferences::getExportDirectory); - _Preferences.def("setExportDirectory", &H2Core::Preferences::setExportDirectory, - py::arg("ExportDirectory")); - _Preferences.def("getExportTemplateIdx", &H2Core::Preferences::getExportTemplateIdx); - _Preferences.def("setExportTemplateIdx", &H2Core::Preferences::setExportTemplateIdx, - py::arg("ExportTemplateIdx")); - _Preferences.def("getMidiExportMode", &H2Core::Preferences::getMidiExportMode); - _Preferences.def("setMidiExportMode", &H2Core::Preferences::setMidiExportMode, - py::arg("ExportMode")); - _Preferences.def("getMidiExportDirectory", &H2Core::Preferences::getMidiExportDirectory); - _Preferences.def("setMidiExportDirectory", &H2Core::Preferences::setMidiExportDirectory, - py::arg("ExportDirectory")); // [banned] _Preferences.def("getPreferencesOverwritePath", &H2Core::Preferences::getPreferencesOverwritePath, // [banned] "Returns #m_sPreferencesOverwritePath"); // [banned] _Preferences.def("setPreferencesOverwritePath", &H2Core::Preferences::setPreferencesOverwritePath, @@ -2058,6 +1638,40 @@ PYBIND11_MODULE(h2core, m) { py::class_> _Sample(m, "Sample"); _Sample.def(py::init()); _Sample.def(py::init>()); + _Sample.def_property_readonly("filepath", &H2Core::Sample::get_filepath); + _Sample.def_property("filename", &H2Core::Sample::get_filename, &H2Core::Sample::set_filename); + _Sample.def_property("frames", &H2Core::Sample::get_frames, &H2Core::Sample::set_frames); + _Sample.def_property("sample_rate", &H2Core::Sample::get_sample_rate, &H2Core::Sample::set_sample_rate); + _Sample.def_property_readonly("sample_duration", &H2Core::Sample::get_sample_duration); + _Sample.def_property_readonly("size", &H2Core::Sample::get_size); + _Sample.def_property_readonly("data_l", [](const H2Core::Sample & sample) { + size_t nframes = sample.is_empty() ? 0 : sample.get_frames(); + auto result = py::array_t(nframes); + py::buffer_info buf = result.request(); + float *ptr = static_cast(buf.ptr); + float *src = sample.get_data_l(); + for (size_t idx = 0; idx < nframes; idx++) { + ptr[idx] = src[idx]; + } + return result; +} +); + _Sample.def_property_readonly("data_r", [](const H2Core::Sample & sample) { + size_t nframes = sample.is_empty() ? 0 : sample.get_frames(); + auto result = py::array_t(nframes); + py::buffer_info buf = result.request(); + float *ptr = static_cast(buf.ptr); + float *src = sample.get_data_r(); + for (size_t idx = 0; idx < nframes; idx++) { + ptr[idx] = src[idx]; + } + return result; +} +); + _Sample.def_property("is_modified", &H2Core::Sample::get_is_modified, &H2Core::Sample::set_is_modified); + _Sample.def_property_readonly("loops", &H2Core::Sample::get_loops); + _Sample.def_property_readonly("rubberband", &H2Core::Sample::get_rubberband); + _Sample.def_property_readonly("loop_mode_string", &H2Core::Sample::get_loop_mode_string); _Sample.def_static("class_name", &H2Core::Sample::class_name); _Sample.def("write", &H2Core::Sample::write, "write sample to a file", @@ -2100,73 +1714,13 @@ PYBIND11_MODULE(h2core, m) { py::arg("rb")); _Sample.def("is_empty", &H2Core::Sample::is_empty, "Returns true if both data channels are null pointers"); - _Sample.def("get_filepath", &H2Core::Sample::get_filepath, - "Returns #__filepath"); - _Sample.def("get_filename", &H2Core::Sample::get_filename, - "Returns Filename part of #__filepath"); - _Sample.def("set_filename", &H2Core::Sample::set_filename, - py::arg("filename")); - _Sample.def("set_frames", &H2Core::Sample::set_frames, - "#__frames setter", - py::arg("frames")); - _Sample.def("get_frames", &H2Core::Sample::get_frames, - "Returns #__frames accessor"); - _Sample.def("set_sample_rate", &H2Core::Sample::set_sample_rate, - py::arg("sampleRate")); - _Sample.def("get_sample_rate", &H2Core::Sample::get_sample_rate, - "Returns #__sample_rate"); - _Sample.def("get_sample_duration", &H2Core::Sample::get_sample_duration, - "Returns sample duration in seconds"); - _Sample.def("get_size", &H2Core::Sample::get_size, - "Returns data size, which is calculated by #__frames time sizeof( float ) * 2"); - _Sample.def("get_data_l", - [](const H2Core::Sample & sample) { - - size_t nframes = sample.get_frames(); - auto result = py::array_t(nframes); - py::buffer_info buf = result.request(); - float *ptr = static_cast(buf.ptr); - float *src = sample.get_data_l(); - for (size_t idx = 0; idx < nframes; idx++) { - ptr[idx] = src[idx]; - } - return result; -} -, - "Returns #__data_l"); - _Sample.def("get_data_r", - [](const H2Core::Sample & sample) { - - size_t nframes = sample.get_frames(); - auto result = py::array_t(nframes); - py::buffer_info buf = result.request(); - float *ptr = static_cast(buf.ptr); - float *src = sample.get_data_r(); - for (size_t idx = 0; idx < nframes; idx++) { - ptr[idx] = src[idx]; - } - return result; -} -, - "Returns #__data_r"); - _Sample.def("set_is_modified", &H2Core::Sample::set_is_modified, - "#__is_modified setter", - py::arg("is_modified")); - _Sample.def("get_is_modified", &H2Core::Sample::get_is_modified, - "Returns #__is_modified"); - // [] _Sample.def("get_pan_envelope", &H2Core::Sample::get_pan_envelope, - // [] "Returns #__pan_envelope"); - // [] _Sample.def("get_velocity_envelope", &H2Core::Sample::get_velocity_envelope, - // [] "Returns #__velocity_envelope"); - _Sample.def("get_loops", &H2Core::Sample::get_loops, - "Returns #__loops parameters"); - _Sample.def("get_rubberband", &H2Core::Sample::get_rubberband, - "Returns #__rubberband parameters"); + // [banned] _Sample.def("get_pan_envelope", &H2Core::Sample::get_pan_envelope, + // [banned] "Returns #__pan_envelope"); + // [banned] _Sample.def("get_velocity_envelope", &H2Core::Sample::get_velocity_envelope, + // [banned] "Returns #__velocity_envelope"); _Sample.def_static("parse_loop_mode", &H2Core::Sample::parse_loop_mode, "parse the given string and rturn the corresponding loop_mode", py::arg("string")); - _Sample.def("get_loop_mode_string", &H2Core::Sample::get_loop_mode_string, - "Returns mode member of #__loops as a string"); _Sample.def("toQString", &H2Core::Sample::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -2256,32 +1810,12 @@ PYBIND11_MODULE(h2core, m) { _InstrumentLayer.def(py::init>()); _InstrumentLayer.def(py::init>()); _InstrumentLayer.def(py::init, std::shared_ptr>()); + _InstrumentLayer.def_property("gain", &H2Core::InstrumentLayer::get_gain, &H2Core::InstrumentLayer::set_gain); + _InstrumentLayer.def_property("pitch", &H2Core::InstrumentLayer::get_pitch, &H2Core::InstrumentLayer::set_pitch); + _InstrumentLayer.def_property("start_velocity", &H2Core::InstrumentLayer::get_start_velocity, &H2Core::InstrumentLayer::set_start_velocity); + _InstrumentLayer.def_property("end_velocity", &H2Core::InstrumentLayer::get_end_velocity, &H2Core::InstrumentLayer::set_end_velocity); + _InstrumentLayer.def_property("sample", &H2Core::InstrumentLayer::get_sample, &H2Core::InstrumentLayer::set_sample); _InstrumentLayer.def_static("class_name", &H2Core::InstrumentLayer::class_name); - _InstrumentLayer.def("set_gain", &H2Core::InstrumentLayer::set_gain, - "set the gain of the layer", - py::arg("gain")); - _InstrumentLayer.def("get_gain", &H2Core::InstrumentLayer::get_gain, - "get the gain of the layer"); - _InstrumentLayer.def("set_pitch", &H2Core::InstrumentLayer::set_pitch, - "set the pitch of the layer", - py::arg("pitch")); - _InstrumentLayer.def("get_pitch", &H2Core::InstrumentLayer::get_pitch, - "get the pitch of the layer"); - _InstrumentLayer.def("set_start_velocity", &H2Core::InstrumentLayer::set_start_velocity, - "set the start ivelocity of the layer", - py::arg("start")); - _InstrumentLayer.def("get_start_velocity", &H2Core::InstrumentLayer::get_start_velocity, - "get the start velocity of the layer"); - _InstrumentLayer.def("set_end_velocity", &H2Core::InstrumentLayer::set_end_velocity, - "set the end velocity of the layer", - py::arg("end")); - _InstrumentLayer.def("get_end_velocity", &H2Core::InstrumentLayer::get_end_velocity, - "get the end velocity of the layer"); - _InstrumentLayer.def("set_sample", &H2Core::InstrumentLayer::set_sample, - "set the sample of the layer", - py::arg("sample")); - _InstrumentLayer.def("get_sample", &H2Core::InstrumentLayer::get_sample, - "get the sample of the layer"); _InstrumentLayer.def("load_sample", &H2Core::InstrumentLayer::load_sample, "Calls the #H2Core::Sample::load() member function of #__sample."); _InstrumentLayer.def("unload_sample", &H2Core::InstrumentLayer::unload_sample); @@ -2300,6 +1834,9 @@ PYBIND11_MODULE(h2core, m) { py::class_> _InstrumentComponent(m, "InstrumentComponent"); _InstrumentComponent.def(py::init()); _InstrumentComponent.def(py::init>()); + _InstrumentComponent.def_property("drumkit_componentID", &H2Core::InstrumentComponent::get_drumkit_componentID, &H2Core::InstrumentComponent::set_drumkit_componentID); + _InstrumentComponent.def_property("gain", &H2Core::InstrumentComponent::get_gain, &H2Core::InstrumentComponent::set_gain); + _InstrumentComponent.def_property("max_layers", &H2Core::InstrumentComponent::getMaxLayers, &H2Core::InstrumentComponent::setMaxLayers); _InstrumentComponent.def_static("class_name", &H2Core::InstrumentComponent::class_name); _InstrumentComponent.def("save_to", &H2Core::InstrumentComponent::save_to, py::arg("node"), @@ -2314,18 +1851,6 @@ PYBIND11_MODULE(h2core, m) { _InstrumentComponent.def("set_layer", &H2Core::InstrumentComponent::set_layer, py::arg("layer"), py::arg("idx")); - _InstrumentComponent.def("set_drumkit_componentID", &H2Core::InstrumentComponent::set_drumkit_componentID, - "Sets the component ID #__related_drumkit_componentID", - py::arg("related_drumkit_componentID")); - _InstrumentComponent.def("get_drumkit_componentID", &H2Core::InstrumentComponent::get_drumkit_componentID, - "Returns the component ID of the drumkit."); - _InstrumentComponent.def("set_gain", &H2Core::InstrumentComponent::set_gain, - py::arg("gain")); - _InstrumentComponent.def("get_gain", &H2Core::InstrumentComponent::get_gain); - _InstrumentComponent.def_static("getMaxLayers", &H2Core::InstrumentComponent::getMaxLayers, - "Returns #m_nMaxLayers."); - _InstrumentComponent.def_static("setMaxLayers", &H2Core::InstrumentComponent::setMaxLayers, - py::arg("layers")); _InstrumentComponent.def("toQString", &H2Core::InstrumentComponent::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -2334,6 +1859,28 @@ PYBIND11_MODULE(h2core, m) { py::class_> _Instrument(m, "Instrument"); _Instrument.def(py::init>()); _Instrument.def(py::init>()); + _Instrument.def_property("name", &H2Core::Instrument::get_name, &H2Core::Instrument::set_name); + _Instrument.def_property("id", &H2Core::Instrument::get_id, &H2Core::Instrument::set_id); + _Instrument.def_property("adsr", &H2Core::Instrument::get_adsr, &H2Core::Instrument::set_adsr); + _Instrument.def_property("mute_group", &H2Core::Instrument::get_mute_group, &H2Core::Instrument::set_mute_group); + _Instrument.def_property("midi_out_channel", &H2Core::Instrument::get_midi_out_channel, &H2Core::Instrument::set_midi_out_channel); + _Instrument.def_property("midi_out_note", &H2Core::Instrument::get_midi_out_note, &H2Core::Instrument::set_midi_out_note); + _Instrument.def_property("pan", &H2Core::Instrument::getPan, &H2Core::Instrument::setPan); + _Instrument.def_property("pan_with_range_from_0_to_1", &H2Core::Instrument::getPanWithRangeFrom0To1, &H2Core::Instrument::setPanWithRangeFrom0To1); + _Instrument.def_property("gain", &H2Core::Instrument::get_gain, &H2Core::Instrument::set_gain); + _Instrument.def_property("volume", &H2Core::Instrument::get_volume, &H2Core::Instrument::set_volume); + _Instrument.def_property("filter_resonance", &H2Core::Instrument::get_filter_resonance, &H2Core::Instrument::set_filter_resonance); + _Instrument.def_property("filter_cutoff", &H2Core::Instrument::get_filter_cutoff, &H2Core::Instrument::set_filter_cutoff); + _Instrument.def_property("peak_l", &H2Core::Instrument::get_peak_l, &H2Core::Instrument::set_peak_l); + _Instrument.def_property("peak_r", &H2Core::Instrument::get_peak_r, &H2Core::Instrument::set_peak_r); + _Instrument.def_property("random_pitch_factor", &H2Core::Instrument::get_random_pitch_factor, &H2Core::Instrument::set_random_pitch_factor); + _Instrument.def_property("pitch_offset", &H2Core::Instrument::get_pitch_offset, &H2Core::Instrument::set_pitch_offset); + _Instrument.def_property("hihat_grp", &H2Core::Instrument::get_hihat_grp, &H2Core::Instrument::set_hihat_grp); + _Instrument.def_property("lower_cc", &H2Core::Instrument::get_lower_cc, &H2Core::Instrument::set_lower_cc); + _Instrument.def_property("higher_cc", &H2Core::Instrument::get_higher_cc, &H2Core::Instrument::set_higher_cc); + _Instrument.def_property("drumkit_name", &H2Core::Instrument::get_drumkit_name, &H2Core::Instrument::set_drumkit_name); + _Instrument.def_property_readonly("components", &H2Core::Instrument::get_components); + _Instrument.def_property("apply_velocity", &H2Core::Instrument::get_apply_velocity, &H2Core::Instrument::set_apply_velocity); _Instrument.def_static("class_name", &H2Core::Instrument::class_name); _Instrument.def_static("load_instrument", &H2Core::Instrument::load_instrument, "creates a new Instrument, loads samples from a given instrument within a given drumkit", @@ -2364,88 +1911,12 @@ PYBIND11_MODULE(h2core, m) { "save the instrument within the given XMLNode", py::arg("node"), py::arg("component_id")); - _Instrument.def("set_name", &H2Core::Instrument::set_name, - "Sets the name of the Instrument #__name.", - py::arg("name")); - _Instrument.def("get_name", &H2Core::Instrument::get_name, - "Access the name of the Instrument."); - _Instrument.def("set_id", &H2Core::Instrument::set_id, - "Sets #__id to id.", - py::arg("id")); - _Instrument.def("get_id", &H2Core::Instrument::get_id, - "Returns #__id."); - _Instrument.def("set_adsr", &H2Core::Instrument::set_adsr, - "set the ADSR of the instrument", - py::arg("adsr")); - _Instrument.def("get_adsr", &H2Core::Instrument::get_adsr, - "get the ADSR of the instrument"); _Instrument.def("copy_adsr", &H2Core::Instrument::copy_adsr, "get a copy of the ADSR of the instrument"); - _Instrument.def("set_mute_group", &H2Core::Instrument::set_mute_group, - "set the mute group of the instrument", - py::arg("group")); - _Instrument.def("get_mute_group", &H2Core::Instrument::get_mute_group, - "get the mute group of the instrument"); - _Instrument.def("set_midi_out_channel", &H2Core::Instrument::set_midi_out_channel, - "set the midi out channel of the instrument", - py::arg("channel")); - _Instrument.def("get_midi_out_channel", &H2Core::Instrument::get_midi_out_channel, - "get the midi out channel of the instrument"); - _Instrument.def("set_midi_out_note", &H2Core::Instrument::set_midi_out_note, - "set the midi out note of the instrument", - py::arg("note")); - _Instrument.def("get_midi_out_note", &H2Core::Instrument::get_midi_out_note, - "get the midi out note of the instrument"); - _Instrument.def("set_muted", &H2Core::Instrument::set_muted, - "set muted status of the instrument", - py::arg("muted")); _Instrument.def("is_muted", &H2Core::Instrument::is_muted, "get muted status of the instrument"); - _Instrument.def("setPan", &H2Core::Instrument::setPan, - "set pan of the instrument", - py::arg("val")); - _Instrument.def("setPanWithRangeFrom0To1", &H2Core::Instrument::setPanWithRangeFrom0To1, - "set pan of the instrument, assuming the input range in [0;1]", - py::arg("fVal")); - _Instrument.def("getPan", &H2Core::Instrument::getPan, - "get pan of the instrument"); - _Instrument.def("getPanWithRangeFrom0To1", &H2Core::Instrument::getPanWithRangeFrom0To1, - "get pan of the instrument scaling and translating the range from [-1;1] to [0;1]"); - _Instrument.def("set_gain", &H2Core::Instrument::set_gain, - "set gain of the instrument", - py::arg("gain")); - _Instrument.def("get_gain", &H2Core::Instrument::get_gain, - "get gain of the instrument"); - _Instrument.def("set_volume", &H2Core::Instrument::set_volume, - "set the volume of the instrument", - py::arg("volume")); - _Instrument.def("get_volume", &H2Core::Instrument::get_volume, - "get the volume of the instrument"); - _Instrument.def("set_filter_active", &H2Core::Instrument::set_filter_active, - "activate the filter of the instrument", - py::arg("active")); _Instrument.def("is_filter_active", &H2Core::Instrument::is_filter_active, "get the status of the filter of the instrument"); - _Instrument.def("set_filter_resonance", &H2Core::Instrument::set_filter_resonance, - "set the filter resonance of the instrument", - py::arg("val")); - _Instrument.def("get_filter_resonance", &H2Core::Instrument::get_filter_resonance, - "get the filter resonance of the instrument"); - _Instrument.def("set_filter_cutoff", &H2Core::Instrument::set_filter_cutoff, - "set the filter cutoff of the instrument", - py::arg("val")); - _Instrument.def("get_filter_cutoff", &H2Core::Instrument::get_filter_cutoff, - "get the filter cutoff of the instrument"); - _Instrument.def("set_peak_l", &H2Core::Instrument::set_peak_l, - "set the left peak of the instrument", - py::arg("val")); - _Instrument.def("get_peak_l", &H2Core::Instrument::get_peak_l, - "get the left peak of the instrument"); - _Instrument.def("set_peak_r", &H2Core::Instrument::set_peak_r, - "set the right peak of the instrument", - py::arg("val")); - _Instrument.def("get_peak_r", &H2Core::Instrument::get_peak_r, - "get the right peak of the instrument"); _Instrument.def("set_fx_level", &H2Core::Instrument::set_fx_level, "set the fx level of the instrument", py::arg("level"), @@ -2453,24 +1924,8 @@ PYBIND11_MODULE(h2core, m) { _Instrument.def("get_fx_level", &H2Core::Instrument::get_fx_level, "get the fx level of the instrument", py::arg("index")); - _Instrument.def("set_random_pitch_factor", &H2Core::Instrument::set_random_pitch_factor, - "set the random pitch factor of the instrument", - py::arg("val")); - _Instrument.def("get_random_pitch_factor", &H2Core::Instrument::get_random_pitch_factor, - "get the random pitch factor of the instrument"); - _Instrument.def("set_pitch_offset", &H2Core::Instrument::set_pitch_offset, - "set the pitch offset of the instrument", - py::arg("val")); - _Instrument.def("get_pitch_offset", &H2Core::Instrument::get_pitch_offset, - "get the pitch offset of the instrument"); - _Instrument.def("set_active", &H2Core::Instrument::set_active, - "set the active status of the instrument", - py::arg("active")); _Instrument.def("is_active", &H2Core::Instrument::is_active, "get the active status of the instrument"); - _Instrument.def("set_soloed", &H2Core::Instrument::set_soloed, - "set the soloed status of the instrument", - py::arg("soloed")); _Instrument.def("is_soloed", &H2Core::Instrument::is_soloed, "get the soloed status of the instrument"); _Instrument.def("enqueue", &H2Core::Instrument::enqueue, @@ -2479,46 +1934,15 @@ PYBIND11_MODULE(h2core, m) { "dequeue the instrument"); _Instrument.def("is_queued", &H2Core::Instrument::is_queued, "get the queued status of the instrument"); - _Instrument.def("set_stop_notes", &H2Core::Instrument::set_stop_notes, - "set the stop notes status of the instrument", - py::arg("stopnotes")); _Instrument.def("is_stop_notes", &H2Core::Instrument::is_stop_notes, "get the stop notes of the instrument"); - _Instrument.def("set_sample_selection_alg", &H2Core::Instrument::set_sample_selection_alg, - py::arg("selected_algo")); _Instrument.def("sample_selection_alg", &H2Core::Instrument::sample_selection_alg); - _Instrument.def("set_hihat_grp", &H2Core::Instrument::set_hihat_grp, - py::arg("hihat_grp")); - _Instrument.def("get_hihat_grp", &H2Core::Instrument::get_hihat_grp); - _Instrument.def("set_lower_cc", &H2Core::Instrument::set_lower_cc, - py::arg("message")); - _Instrument.def("get_lower_cc", &H2Core::Instrument::get_lower_cc); - _Instrument.def("set_higher_cc", &H2Core::Instrument::set_higher_cc, - py::arg("message")); - _Instrument.def("get_higher_cc", &H2Core::Instrument::get_higher_cc); - _Instrument.def("set_drumkit_name", &H2Core::Instrument::set_drumkit_name, - py::arg("name")); - _Instrument.def("get_drumkit_name", &H2Core::Instrument::get_drumkit_name); - _Instrument.def("set_is_preview_instrument", &H2Core::Instrument::set_is_preview_instrument, - "Mark the instrument as hydrogen's preview instrument", - py::arg("isPreview")); _Instrument.def("is_preview_instrument", &H2Core::Instrument::is_preview_instrument); - _Instrument.def("set_is_metronome_instrument", &H2Core::Instrument::set_is_metronome_instrument, - "Mark the instrument as metronome instrument", - py::arg("isMetronome")); _Instrument.def("is_metronome_instrument", &H2Core::Instrument::is_metronome_instrument); - _Instrument.def("get_components", &H2Core::Instrument::get_components); _Instrument.def("get_component", &H2Core::Instrument::get_component, py::arg("DrumkitComponentID")); - _Instrument.def("set_apply_velocity", &H2Core::Instrument::set_apply_velocity, - py::arg("apply_velocity")); - _Instrument.def("get_apply_velocity", &H2Core::Instrument::get_apply_velocity); _Instrument.def("is_currently_exported", &H2Core::Instrument::is_currently_exported); - _Instrument.def("set_currently_exported", &H2Core::Instrument::set_currently_exported, - py::arg("isCurrentlyExported")); _Instrument.def("has_missing_samples", &H2Core::Instrument::has_missing_samples); - _Instrument.def("set_missing_samples", &H2Core::Instrument::set_missing_samples, - py::arg("bHasMissingSamples")); _Instrument.def("toQString", &H2Core::Instrument::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -2532,34 +1956,14 @@ PYBIND11_MODULE(h2core, m) { py::class_> _ADSR(m, "ADSR"); _ADSR.def(py::init()); _ADSR.def(py::init>()); + _ADSR.def_property("attack", &H2Core::ADSR::get_attack, &H2Core::ADSR::set_attack); + _ADSR.def_property("decay", &H2Core::ADSR::get_decay, &H2Core::ADSR::set_decay); + _ADSR.def_property("sustain", &H2Core::ADSR::get_sustain, &H2Core::ADSR::set_sustain); + _ADSR.def_property("release", &H2Core::ADSR::get_release, &H2Core::ADSR::set_release); _ADSR.def_static("class_name", &H2Core::ADSR::class_name); - _ADSR.def("set_attack", &H2Core::ADSR::set_attack, - "__attack setter", - py::arg("value")); - _ADSR.def("get_attack", &H2Core::ADSR::get_attack, - "__attack accessor"); - _ADSR.def("set_decay", &H2Core::ADSR::set_decay, - "__decay setter", - py::arg("value")); - _ADSR.def("get_decay", &H2Core::ADSR::get_decay, - "__decay accessor"); - _ADSR.def("set_sustain", &H2Core::ADSR::set_sustain, - "__sustain setter", - py::arg("value")); - _ADSR.def("get_sustain", &H2Core::ADSR::get_sustain, - "__sustain accessor"); - _ADSR.def("set_release", &H2Core::ADSR::set_release, - "__release setter", - py::arg("value")); - _ADSR.def("get_release", &H2Core::ADSR::get_release, - "__release accessor"); - _ADSR.def("attack", &H2Core::ADSR::attack, - "sets state to ATTACK"); _ADSR.def("get_value", &H2Core::ADSR::get_value, "compute the value and return it", py::arg("step")); - _ADSR.def("release", &H2Core::ADSR::release, - "sets state to RELEASE, returns 0 if the state is IDLE, __value if the state is RELEASE, set state to RELEASE, save __release_value and return it."); _ADSR.def("toQString", &H2Core::ADSR::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -2568,6 +1972,11 @@ PYBIND11_MODULE(h2core, m) { py::class_> _DrumkitComponent(m, "DrumkitComponent"); _DrumkitComponent.def(py::init()); _DrumkitComponent.def(py::init()); + _DrumkitComponent.def_property("name", &H2Core::DrumkitComponent::get_name, &H2Core::DrumkitComponent::set_name); + _DrumkitComponent.def_property("id", &H2Core::DrumkitComponent::get_id, &H2Core::DrumkitComponent::set_id); + _DrumkitComponent.def_property("volume", &H2Core::DrumkitComponent::get_volume, &H2Core::DrumkitComponent::set_volume); + _DrumkitComponent.def_property("peak_l", &H2Core::DrumkitComponent::get_peak_l, &H2Core::DrumkitComponent::set_peak_l); + _DrumkitComponent.def_property("peak_r", &H2Core::DrumkitComponent::get_peak_r, &H2Core::DrumkitComponent::set_peak_r); _DrumkitComponent.def_static("class_name", &H2Core::DrumkitComponent::class_name); _DrumkitComponent.def("save_to", &H2Core::DrumkitComponent::save_to, py::arg("node")); @@ -2577,29 +1986,8 @@ PYBIND11_MODULE(h2core, m) { _DrumkitComponent.def("load_from", py::overload_cast(&H2Core::DrumkitComponent::load_from), py::arg("component"), py::arg("is_live")); - _DrumkitComponent.def("set_name", &H2Core::DrumkitComponent::set_name, - "Sets the name of the DrumkitComponent #__name.", - py::arg("name")); - _DrumkitComponent.def("get_name", &H2Core::DrumkitComponent::get_name, - "Access the name of the DrumkitComponent."); - _DrumkitComponent.def("set_id", &H2Core::DrumkitComponent::set_id, - py::arg("id")); - _DrumkitComponent.def("get_id", &H2Core::DrumkitComponent::get_id); - _DrumkitComponent.def("set_volume", &H2Core::DrumkitComponent::set_volume, - py::arg("volume")); - _DrumkitComponent.def("get_volume", &H2Core::DrumkitComponent::get_volume); - _DrumkitComponent.def("set_muted", &H2Core::DrumkitComponent::set_muted, - py::arg("muted")); _DrumkitComponent.def("is_muted", &H2Core::DrumkitComponent::is_muted); - _DrumkitComponent.def("set_soloed", &H2Core::DrumkitComponent::set_soloed, - py::arg("soloed")); _DrumkitComponent.def("is_soloed", &H2Core::DrumkitComponent::is_soloed); - _DrumkitComponent.def("set_peak_l", &H2Core::DrumkitComponent::set_peak_l, - py::arg("val")); - _DrumkitComponent.def("get_peak_l", &H2Core::DrumkitComponent::get_peak_l); - _DrumkitComponent.def("set_peak_r", &H2Core::DrumkitComponent::set_peak_r, - py::arg("val")); - _DrumkitComponent.def("get_peak_r", &H2Core::DrumkitComponent::get_peak_r); _DrumkitComponent.def("reset_outs", &H2Core::DrumkitComponent::reset_outs, py::arg("nFrames")); _DrumkitComponent.def("set_outs", &H2Core::DrumkitComponent::set_outs, @@ -2623,6 +2011,15 @@ PYBIND11_MODULE(h2core, m) { py::class_> _Drumkit(m, "Drumkit"); _Drumkit.def(py::init<>()); _Drumkit.def(py::init()); + _Drumkit.def_property("instruments", &H2Core::Drumkit::get_instruments, &H2Core::Drumkit::set_instruments, py::return_value_policy::reference_internal); + _Drumkit.def_property("path", &H2Core::Drumkit::get_path, &H2Core::Drumkit::set_path); + _Drumkit.def_property("name", &H2Core::Drumkit::get_name, &H2Core::Drumkit::set_name); + _Drumkit.def_property("author", &H2Core::Drumkit::get_author, &H2Core::Drumkit::set_author); + _Drumkit.def_property("info", &H2Core::Drumkit::get_info, &H2Core::Drumkit::set_info); + _Drumkit.def_property("license", &H2Core::Drumkit::get_license, &H2Core::Drumkit::set_license); + _Drumkit.def_property("image", &H2Core::Drumkit::get_image, &H2Core::Drumkit::set_image); + _Drumkit.def_property("image_license", &H2Core::Drumkit::get_image_license, &H2Core::Drumkit::set_image_license); + _Drumkit.def_property("components", &H2Core::Drumkit::get_components, &H2Core::Drumkit::set_components); _Drumkit.def_static("class_name", &H2Core::Drumkit::class_name); _Drumkit.def_static("load", &H2Core::Drumkit::load, "Load drumkit information from a directory.", @@ -2686,55 +2083,11 @@ PYBIND11_MODULE(h2core, m) { "remove a drumkit from the disk", py::arg("dk_name"), py::arg("lookup")); - _Drumkit.def("set_instruments", &H2Core::Drumkit::set_instruments, - "set __instruments, delete existing one", - py::arg("instruments")); - _Drumkit.def("get_instruments", &H2Core::Drumkit::get_instruments, - "returns #__instruments", - py::return_value_policy::reference_internal); - _Drumkit.def("set_path", &H2Core::Drumkit::set_path, - "#__path setter", - py::arg("path")); - _Drumkit.def("get_path", &H2Core::Drumkit::get_path, - "#__path accessor"); - _Drumkit.def("set_name", &H2Core::Drumkit::set_name, - "#__name setter", - py::arg("name")); - _Drumkit.def("get_name", &H2Core::Drumkit::get_name, - "#__name accessor"); - _Drumkit.def("set_author", &H2Core::Drumkit::set_author, - "#__author setter", - py::arg("author")); - _Drumkit.def("get_author", &H2Core::Drumkit::get_author, - "#__author accessor"); - _Drumkit.def("set_info", &H2Core::Drumkit::set_info, - "#__info setter", - py::arg("info")); - _Drumkit.def("get_info", &H2Core::Drumkit::get_info, - "#__info accessor"); - _Drumkit.def("set_license", &H2Core::Drumkit::set_license, - "#__license setter", - py::arg("license")); - _Drumkit.def("get_license", &H2Core::Drumkit::get_license, - "#__license accessor"); - _Drumkit.def("set_image", &H2Core::Drumkit::set_image, - "#__image setter", - py::arg("image")); - _Drumkit.def("get_image", &H2Core::Drumkit::get_image, - "#__image accessor"); - _Drumkit.def("set_image_license", &H2Core::Drumkit::set_image_license, - "#__imageLicense setter", - py::arg("imageLicense")); - _Drumkit.def("get_image_license", &H2Core::Drumkit::get_image_license, - "#__imageLicense accessor"); _Drumkit.def("samples_loaded", &H2Core::Drumkit::samples_loaded, "return true if the samples are loaded"); _Drumkit.def("dump", &H2Core::Drumkit::dump); _Drumkit.def("isUserDrumkit", &H2Core::Drumkit::isUserDrumkit, "Returns Whether the associated files are located in the user or the systems drumkit folder."); - _Drumkit.def("get_components", &H2Core::Drumkit::get_components); - _Drumkit.def("set_components", &H2Core::Drumkit::set_components, - py::arg("components")); _Drumkit.def("toQString", &H2Core::Drumkit::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -2814,7 +2167,7 @@ PYBIND11_MODULE(h2core, m) { // enum log_levels // - py::enum_(_Logger, "log_levels") + py::enum_(_Logger, "log_levels", py::arithmetic()) .value("None", H2Core::Logger::log_levels::None) .value("Error", H2Core::Logger::log_levels::Error) .value("Warning", H2Core::Logger::log_levels::Warning) @@ -2825,7 +2178,7 @@ PYBIND11_MODULE(h2core, m) { // enum MidiMessageType // - py::enum_(_MidiMessage, "MidiMessageType") + py::enum_(_MidiMessage, "MidiMessageType", py::arithmetic()) .value("UNKNOWN", H2Core::MidiMessage::MidiMessageType::UNKNOWN) .value("SYSEX", H2Core::MidiMessage::MidiMessageType::SYSEX) .value("NOTE_ON", H2Core::MidiMessage::MidiMessageType::NOTE_ON) @@ -2919,13 +2272,13 @@ PYBIND11_MODULE(h2core, m) { // enum NameFormat // - py::enum_(_QColor, "NameFormat") + py::enum_(_QColor, "NameFormat", py::arithmetic()) .value("HexRgb", QColor::NameFormat::HexRgb) .value("HexArgb", QColor::NameFormat::HexArgb); // enum Spec // - py::enum_(_QColor, "Spec") + py::enum_(_QColor, "Spec", py::arithmetic()) .value("Invalid", QColor::Spec::Invalid) .value("Rgb", QColor::Spec::Rgb) .value("Hsv", QColor::Spec::Hsv) @@ -2935,7 +2288,7 @@ PYBIND11_MODULE(h2core, m) { // enum Octave // - py::enum_(_Note, "Octave") + py::enum_(_Note, "Octave", py::arithmetic()) .value("P8Z", H2Core::Note::Octave::P8Z) .value("P8Y", H2Core::Note::Octave::P8Y) .value("P8X", H2Core::Note::Octave::P8X) @@ -2946,7 +2299,7 @@ PYBIND11_MODULE(h2core, m) { // enum Key // - py::enum_(_Note, "Key") + py::enum_(_Note, "Key", py::arithmetic()) .value("C", H2Core::Note::Key::C) .value("Cs", H2Core::Note::Key::Cs) .value("D", H2Core::Note::Key::D) @@ -2962,7 +2315,7 @@ PYBIND11_MODULE(h2core, m) { // enum PAN_LAW_TYPES // - py::enum_(_Sampler, "PAN_LAW_TYPES") + py::enum_(_Sampler, "PAN_LAW_TYPES", py::arithmetic()) .value("RATIO_STRAIGHT_POLYGONAL", H2Core::Sampler::PAN_LAW_TYPES::RATIO_STRAIGHT_POLYGONAL) .value("RATIO_CONST_POWER", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_POWER) .value("RATIO_CONST_SUM", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_SUM) @@ -2985,11 +2338,11 @@ PYBIND11_MODULE(h2core, m) { _PortMidiDriver.def_readwrite("m_pMidiIn", &H2Core::PortMidiDriver::m_pMidiIn); _PortMidiDriver.def_readwrite("m_pMidiOut", &H2Core::PortMidiDriver::m_pMidiOut); _PortMidiDriver.def_readwrite("m_bRunning", &H2Core::PortMidiDriver::m_bRunning); + _PortMidiDriver.def_property_readonly("input_port_list", &H2Core::PortMidiDriver::getInputPortList); + _PortMidiDriver.def_property_readonly("output_port_list", &H2Core::PortMidiDriver::getOutputPortList); _PortMidiDriver.def_static("class_name", &H2Core::PortMidiDriver::class_name); _PortMidiDriver.def("open", &H2Core::PortMidiDriver::open); _PortMidiDriver.def("close", &H2Core::PortMidiDriver::close); - _PortMidiDriver.def("getInputPortList", &H2Core::PortMidiDriver::getInputPortList); - _PortMidiDriver.def("getOutputPortList", &H2Core::PortMidiDriver::getOutputPortList); _PortMidiDriver.def("handleQueueNote", &H2Core::PortMidiDriver::handleQueueNote, py::arg("pNote")); _PortMidiDriver.def("handleQueueNoteOff", &H2Core::PortMidiDriver::handleQueueNoteOff, @@ -3004,11 +2357,11 @@ PYBIND11_MODULE(h2core, m) { py::class_> _JackMidiDriver(m, "JackMidiDriver"); _JackMidiDriver.def(py::init<>()); + _JackMidiDriver.def_property_readonly("input_port_list", &H2Core::JackMidiDriver::getInputPortList); + _JackMidiDriver.def_property_readonly("output_port_list", &H2Core::JackMidiDriver::getOutputPortList); _JackMidiDriver.def_static("class_name", &H2Core::JackMidiDriver::class_name); _JackMidiDriver.def("open", &H2Core::JackMidiDriver::open); _JackMidiDriver.def("close", &H2Core::JackMidiDriver::close); - _JackMidiDriver.def("getInputPortList", &H2Core::JackMidiDriver::getInputPortList); - _JackMidiDriver.def("getOutputPortList", &H2Core::JackMidiDriver::getOutputPortList); _JackMidiDriver.def("getPortInfo", &H2Core::JackMidiDriver::getPortInfo, py::arg("sPortName"), py::arg("nClient"), @@ -3031,11 +2384,11 @@ PYBIND11_MODULE(h2core, m) { py::class_> _AlsaMidiDriver(m, "AlsaMidiDriver"); _AlsaMidiDriver.def(py::init<>()); + _AlsaMidiDriver.def_property_readonly("input_port_list", &H2Core::AlsaMidiDriver::getInputPortList); + _AlsaMidiDriver.def_property_readonly("output_port_list", &H2Core::AlsaMidiDriver::getOutputPortList); _AlsaMidiDriver.def_static("class_name", &H2Core::AlsaMidiDriver::class_name); _AlsaMidiDriver.def("open", &H2Core::AlsaMidiDriver::open); _AlsaMidiDriver.def("close", &H2Core::AlsaMidiDriver::close); - _AlsaMidiDriver.def("getInputPortList", &H2Core::AlsaMidiDriver::getInputPortList); - _AlsaMidiDriver.def("getOutputPortList", &H2Core::AlsaMidiDriver::getOutputPortList); // [banned] _AlsaMidiDriver.def("midi_action", &H2Core::AlsaMidiDriver::midi_action, // [banned] py::arg("seq_handle")); _AlsaMidiDriver.def("getPortInfo", &H2Core::AlsaMidiDriver::getPortInfo, @@ -3059,13 +2412,13 @@ PYBIND11_MODULE(h2core, m) { _PortAudioDriver.def_readwrite("m_pOut_L", &H2Core::PortAudioDriver::m_pOut_L); _PortAudioDriver.def_readwrite("m_pOut_R", &H2Core::PortAudioDriver::m_pOut_R); _PortAudioDriver.def_readwrite("m_nBufferSize", &H2Core::PortAudioDriver::m_nBufferSize); + _PortAudioDriver.def_property_readonly("buffer_size", &H2Core::PortAudioDriver::getBufferSize); + _PortAudioDriver.def_property_readonly("sample_rate", &H2Core::PortAudioDriver::getSampleRate); _PortAudioDriver.def_static("class_name", &H2Core::PortAudioDriver::class_name); _PortAudioDriver.def("init", &H2Core::PortAudioDriver::init, py::arg("nBufferSize")); _PortAudioDriver.def("connect", &H2Core::PortAudioDriver::connect); _PortAudioDriver.def("disconnect", &H2Core::PortAudioDriver::disconnect); - _PortAudioDriver.def("getBufferSize", &H2Core::PortAudioDriver::getBufferSize); - _PortAudioDriver.def("getSampleRate", &H2Core::PortAudioDriver::getSampleRate); _PortAudioDriver.def("getOut_L", &H2Core::PortAudioDriver::getOut_L); _PortAudioDriver.def("getOut_R", &H2Core::PortAudioDriver::getOut_R); _PortAudioDriver.def("updateTransportInfo", &H2Core::PortAudioDriver::updateTransportInfo); @@ -3073,18 +2426,16 @@ PYBIND11_MODULE(h2core, m) { _PortAudioDriver.def("stop", &H2Core::PortAudioDriver::stop); _PortAudioDriver.def("locate", &H2Core::PortAudioDriver::locate, py::arg("nFrame")); - _PortAudioDriver.def("setBpm", &H2Core::PortAudioDriver::setBpm, - py::arg("fBPM")); py::class_> _NullDriver(m, "NullDriver"); _NullDriver.def(py::init()); + _NullDriver.def_property_readonly("buffer_size", &H2Core::NullDriver::getBufferSize); + _NullDriver.def_property_readonly("sample_rate", &H2Core::NullDriver::getSampleRate); _NullDriver.def_static("class_name", &H2Core::NullDriver::class_name); _NullDriver.def("init", &H2Core::NullDriver::init, py::arg("nBufferSize")); _NullDriver.def("connect", &H2Core::NullDriver::connect); _NullDriver.def("disconnect", &H2Core::NullDriver::disconnect); - _NullDriver.def("getBufferSize", &H2Core::NullDriver::getBufferSize); - _NullDriver.def("getSampleRate", &H2Core::NullDriver::getSampleRate); _NullDriver.def("getOut_L", &H2Core::NullDriver::getOut_L); _NullDriver.def("getOut_R", &H2Core::NullDriver::getOut_R); _NullDriver.def("play", &H2Core::NullDriver::play); @@ -3092,12 +2443,14 @@ PYBIND11_MODULE(h2core, m) { _NullDriver.def("locate", &H2Core::NullDriver::locate, py::arg("nFrame")); _NullDriver.def("updateTransportInfo", &H2Core::NullDriver::updateTransportInfo); - _NullDriver.def("setBpm", &H2Core::NullDriver::setBpm, - py::arg("fBPM")); py::class_> _JackAudioDriver(m, "JackAudioDriver"); _JackAudioDriver.def(py::init()); _JackAudioDriver.def_readwrite("m_currentPos", &H2Core::JackAudioDriver::m_currentPos); + _JackAudioDriver.def_property_readonly("buffer_size", &H2Core::JackAudioDriver::getBufferSize); + _JackAudioDriver.def_property_readonly("sample_rate", &H2Core::JackAudioDriver::getSampleRate); + _JackAudioDriver.def_property("connect_defaults", &H2Core::JackAudioDriver::getConnectDefaults, &H2Core::JackAudioDriver::setConnectDefaults); + _JackAudioDriver.def_property_readonly("timebase_state", &H2Core::JackAudioDriver::getTimebaseState); _JackAudioDriver.def_static("class_name", &H2Core::JackAudioDriver::class_name); _JackAudioDriver.def("connect", &H2Core::JackAudioDriver::connect, "Connects to output ports via the JACK server."); @@ -3105,20 +2458,12 @@ PYBIND11_MODULE(h2core, m) { "Disconnects the JACK client of the Hydrogen from the JACK server."); _JackAudioDriver.def("deactivate", &H2Core::JackAudioDriver::deactivate, "Deactivates the JACK client of Hydrogen and disconnects all ports belonging to it."); - _JackAudioDriver.def("getBufferSize", &H2Core::JackAudioDriver::getBufferSize, - "Returns Global variable #jackServerBufferSize."); - _JackAudioDriver.def("getSampleRate", &H2Core::JackAudioDriver::getSampleRate, - "Returns Global variable #jackServerSampleRate."); _JackAudioDriver.def("clearPerTrackAudioBuffers", &H2Core::JackAudioDriver::clearPerTrackAudioBuffers, "Resets the buffers contained in #m_pTrackOutputPortsL and #m_pTrackOutputPortsR.", py::arg("nFrames")); _JackAudioDriver.def("makeTrackOutputs", &H2Core::JackAudioDriver::makeTrackOutputs, "Creates per component output ports for each instrument.", py::arg("pSong")); - _JackAudioDriver.def("setConnectDefaults", &H2Core::JackAudioDriver::setConnectDefaults, - py::arg("flag")); - _JackAudioDriver.def("getConnectDefaults", &H2Core::JackAudioDriver::getConnectDefaults, - "Returns #m_bConnectDefaults"); _JackAudioDriver.def("getOut_L", &H2Core::JackAudioDriver::getOut_L, "Get content in the left stereo output port."); _JackAudioDriver.def("getOut_R", &H2Core::JackAudioDriver::getOut_R, @@ -3149,9 +2494,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("nFrame")); _JackAudioDriver.def("updateTransportInfo", &H2Core::JackAudioDriver::updateTransportInfo, "Updating the local instance of the TransportInfo AudioOutput::m_transport."); - _JackAudioDriver.def("setBpm", &H2Core::JackAudioDriver::setBpm, - "Set the tempo stored TransportInfo::m_fBPM of the local instance of the TransportInfo AudioOutput::m_transport.", - py::arg("fBPM")); _JackAudioDriver.def("calculateFrameOffset", &H2Core::JackAudioDriver::calculateFrameOffset, "Calculates the difference between the true transport position and the internal one.", py::arg("oldFrame")); @@ -3159,8 +2501,6 @@ PYBIND11_MODULE(h2core, m) { "Registers Hydrogen as JACK timebase master."); _JackAudioDriver.def("releaseTimebaseMaster", &H2Core::JackAudioDriver::releaseTimebaseMaster, "Calls _jack_release_timebase()_ (jack/transport.h) to release Hydrogen from the JACK timebase master responsibilities. This causes the JackTimebaseCallback() callback function to not be called by the JACK server anymore."); - _JackAudioDriver.def("getTimebaseState", &H2Core::JackAudioDriver::getTimebaseState, - "Returns #m_timebaseState"); _JackAudioDriver.def_static("jackDriverSampleRate", &H2Core::JackAudioDriver::jackDriverSampleRate, "Callback function for the JACK audio server to set the sample rate #jackServerSampleRate and prints a message to the #__INFOLOG, which has to be included via a Logger instance in the provided param.", py::arg("nframes"), @@ -3172,13 +2512,13 @@ PYBIND11_MODULE(h2core, m) { py::class_> _FakeDriver(m, "FakeDriver"); _FakeDriver.def(py::init()); + _FakeDriver.def_property_readonly("buffer_size", &H2Core::FakeDriver::getBufferSize); + _FakeDriver.def_property_readonly("sample_rate", &H2Core::FakeDriver::getSampleRate); _FakeDriver.def_static("class_name", &H2Core::FakeDriver::class_name); _FakeDriver.def("init", &H2Core::FakeDriver::init, py::arg("nBufferSize")); _FakeDriver.def("connect", &H2Core::FakeDriver::connect); _FakeDriver.def("disconnect", &H2Core::FakeDriver::disconnect); - _FakeDriver.def("getBufferSize", &H2Core::FakeDriver::getBufferSize); - _FakeDriver.def("getSampleRate", &H2Core::FakeDriver::getSampleRate); _FakeDriver.def("getOut_L", &H2Core::FakeDriver::getOut_L); _FakeDriver.def("getOut_R", &H2Core::FakeDriver::getOut_R); _FakeDriver.def("play", &H2Core::FakeDriver::play); @@ -3186,8 +2526,6 @@ PYBIND11_MODULE(h2core, m) { _FakeDriver.def("locate", &H2Core::FakeDriver::locate, py::arg("nFrame")); _FakeDriver.def("updateTransportInfo", &H2Core::FakeDriver::updateTransportInfo); - _FakeDriver.def("setBpm", &H2Core::FakeDriver::setBpm, - py::arg("fBPM")); py::class_> _DiskWriterDriver(m, "DiskWriterDriver"); _DiskWriterDriver.def(py::init()); @@ -3197,6 +2535,8 @@ PYBIND11_MODULE(h2core, m) { _DiskWriterDriver.def_readwrite("m_nSampleDepth", &H2Core::DiskWriterDriver::m_nSampleDepth); _DiskWriterDriver.def_readwrite("m_pOut_L", &H2Core::DiskWriterDriver::m_pOut_L); _DiskWriterDriver.def_readwrite("m_pOut_R", &H2Core::DiskWriterDriver::m_pOut_R); + _DiskWriterDriver.def_property_readonly("buffer_size", &H2Core::DiskWriterDriver::getBufferSize); + _DiskWriterDriver.def_property_readonly("sample_rate", &H2Core::DiskWriterDriver::getSampleRate); _DiskWriterDriver.def_static("class_name", &H2Core::DiskWriterDriver::class_name); _DiskWriterDriver.def("init", &H2Core::DiskWriterDriver::init, py::arg("nBufferSize")); @@ -3207,19 +2547,13 @@ PYBIND11_MODULE(h2core, m) { // [banned] py::arg("buffer_R"), // [banned] py::arg("bufferSize")); _DiskWriterDriver.def("audioEngine_process_checkBPMChanged", &H2Core::DiskWriterDriver::audioEngine_process_checkBPMChanged); - _DiskWriterDriver.def("getBufferSize", &H2Core::DiskWriterDriver::getBufferSize); - _DiskWriterDriver.def("getSampleRate", &H2Core::DiskWriterDriver::getSampleRate); _DiskWriterDriver.def("getOut_L", &H2Core::DiskWriterDriver::getOut_L); _DiskWriterDriver.def("getOut_R", &H2Core::DiskWriterDriver::getOut_R); - _DiskWriterDriver.def("setFileName", &H2Core::DiskWriterDriver::setFileName, - py::arg("sFilename")); _DiskWriterDriver.def("play", &H2Core::DiskWriterDriver::play); _DiskWriterDriver.def("stop", &H2Core::DiskWriterDriver::stop); _DiskWriterDriver.def("locate", &H2Core::DiskWriterDriver::locate, py::arg("nFrame")); _DiskWriterDriver.def("updateTransportInfo", &H2Core::DiskWriterDriver::updateTransportInfo); - _DiskWriterDriver.def("setBpm", &H2Core::DiskWriterDriver::setBpm, - py::arg("fBPM")); py::class_> _AlsaAudioDriver(m, "AlsaAudioDriver"); _AlsaAudioDriver.def(py::init()); @@ -3229,13 +2563,13 @@ PYBIND11_MODULE(h2core, m) { _AlsaAudioDriver.def_readwrite("m_pOut_R", &H2Core::AlsaAudioDriver::m_pOut_R); _AlsaAudioDriver.def_readwrite("m_nXRuns", &H2Core::AlsaAudioDriver::m_nXRuns); _AlsaAudioDriver.def_readwrite("m_sAlsaAudioDevice", &H2Core::AlsaAudioDriver::m_sAlsaAudioDevice); + _AlsaAudioDriver.def_property_readonly("buffer_size", &H2Core::AlsaAudioDriver::getBufferSize); + _AlsaAudioDriver.def_property_readonly("sample_rate", &H2Core::AlsaAudioDriver::getSampleRate); _AlsaAudioDriver.def_static("class_name", &H2Core::AlsaAudioDriver::class_name); _AlsaAudioDriver.def("init", &H2Core::AlsaAudioDriver::init, py::arg("nBufferSize")); _AlsaAudioDriver.def("connect", &H2Core::AlsaAudioDriver::connect); _AlsaAudioDriver.def("disconnect", &H2Core::AlsaAudioDriver::disconnect); - _AlsaAudioDriver.def("getBufferSize", &H2Core::AlsaAudioDriver::getBufferSize); - _AlsaAudioDriver.def("getSampleRate", &H2Core::AlsaAudioDriver::getSampleRate); _AlsaAudioDriver.def("getOut_L", &H2Core::AlsaAudioDriver::getOut_L); _AlsaAudioDriver.def("getOut_R", &H2Core::AlsaAudioDriver::getOut_R); _AlsaAudioDriver.def("updateTransportInfo", &H2Core::AlsaAudioDriver::updateTransportInfo); @@ -3243,8 +2577,6 @@ PYBIND11_MODULE(h2core, m) { _AlsaAudioDriver.def("stop", &H2Core::AlsaAudioDriver::stop); _AlsaAudioDriver.def("locate", &H2Core::AlsaAudioDriver::locate, py::arg("nFrame")); - _AlsaAudioDriver.def("setBpm", &H2Core::AlsaAudioDriver::setBpm, - py::arg("fBPM")); py::class_> _Tag(m, "Tag"); _Tag.def_readwrite("nBar", &H2Core::Timeline::Tag::nBar); @@ -3269,7 +2601,7 @@ PYBIND11_MODULE(h2core, m) { // enum ErrorMessages // - py::enum_(_Hydrogen, "ErrorMessages") + py::enum_(_Hydrogen, "ErrorMessages", py::arithmetic()) .value("UNKNOWN_DRIVER", H2Core::Hydrogen::ErrorMessages::UNKNOWN_DRIVER) .value("ERROR_STARTING_DRIVER", H2Core::Hydrogen::ErrorMessages::ERROR_STARTING_DRIVER) .value("JACK_SERVER_SHUTDOWN", H2Core::Hydrogen::ErrorMessages::JACK_SERVER_SHUTDOWN) @@ -3281,21 +2613,21 @@ PYBIND11_MODULE(h2core, m) { // enum GUIState // - py::enum_(_Hydrogen, "GUIState") + py::enum_(_Hydrogen, "GUIState", py::arithmetic()) .value("notReady", H2Core::Hydrogen::GUIState::notReady) .value("unavailable", H2Core::Hydrogen::GUIState::unavailable) .value("ready", H2Core::Hydrogen::GUIState::ready); // enum Lookup // - py::enum_(_Filesystem, "Lookup") + py::enum_(_Filesystem, "Lookup", py::arithmetic()) .value("stacked", H2Core::Filesystem::Lookup::stacked) .value("user", H2Core::Filesystem::Lookup::user) .value("system", H2Core::Filesystem::Lookup::system); // enum file_perms // - py::enum_(_Filesystem, "file_perms") + py::enum_(_Filesystem, "file_perms", py::arithmetic()) .value("is_dir", H2Core::Filesystem::file_perms::is_dir) .value("is_file", H2Core::Filesystem::file_perms::is_file) .value("is_readable", H2Core::Filesystem::file_perms::is_readable) @@ -3304,13 +2636,13 @@ PYBIND11_MODULE(h2core, m) { // enum ActionMode // - py::enum_(_Song, "ActionMode") + py::enum_(_Song, "ActionMode", py::arithmetic()) .value("selectMode", H2Core::Song::ActionMode::selectMode) .value("drawMode", H2Core::Song::ActionMode::drawMode); // enum SongMode // - py::enum_(_Song, "SongMode") + py::enum_(_Song, "SongMode", py::arithmetic()) .value("PATTERN_MODE", H2Core::Song::SongMode::PATTERN_MODE) .value("SONG_MODE", H2Core::Song::SongMode::SONG_MODE); @@ -3322,33 +2654,33 @@ PYBIND11_MODULE(h2core, m) { // enum UI_SCALING_POLICY // - py::enum_(_Preferences, "UI_SCALING_POLICY") + py::enum_(_Preferences, "UI_SCALING_POLICY", py::arithmetic()) .value("UI_SCALING_SMALLER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SMALLER) .value("UI_SCALING_SYSTEM", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SYSTEM) .value("UI_SCALING_LARGER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_LARGER); // enum UI_LAYOUT_TYPES // - py::enum_(_Preferences, "UI_LAYOUT_TYPES") + py::enum_(_Preferences, "UI_LAYOUT_TYPES", py::arithmetic()) .value("UI_LAYOUT_SINGLE_PANE", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_SINGLE_PANE) .value("UI_LAYOUT_TABBED", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_TABBED); // enum FontSize // - py::enum_(_Preferences, "FontSize") + py::enum_(_Preferences, "FontSize", py::arithmetic()) .value("Normal", H2Core::Preferences::FontSize::Normal) .value("Small", H2Core::Preferences::FontSize::Small) .value("Large", H2Core::Preferences::FontSize::Large); // enum JackBBTSyncMethod // - py::enum_(_Preferences, "JackBBTSyncMethod") + py::enum_(_Preferences, "JackBBTSyncMethod", py::arithmetic()) .value("constMeasure", H2Core::Preferences::JackBBTSyncMethod::constMeasure) .value("identicalBars", H2Core::Preferences::JackBBTSyncMethod::identicalBars); // enum JackTrackOutputMode // - py::enum_(_Preferences, "JackTrackOutputMode") + py::enum_(_Preferences, "JackTrackOutputMode", py::arithmetic()) .value("postFader", H2Core::Preferences::JackTrackOutputMode::postFader) .value("preFader", H2Core::Preferences::JackTrackOutputMode::preFader); @@ -3383,21 +2715,21 @@ PYBIND11_MODULE(h2core, m) { // enum SampleSelectionAlgo // - py::enum_(_Instrument, "SampleSelectionAlgo") + py::enum_(_Instrument, "SampleSelectionAlgo", py::arithmetic()) .value("VELOCITY", H2Core::Instrument::SampleSelectionAlgo::VELOCITY) .value("ROUND_ROBIN", H2Core::Instrument::SampleSelectionAlgo::ROUND_ROBIN) .value("RANDOM", H2Core::Instrument::SampleSelectionAlgo::RANDOM); // enum Timebase // - py::enum_(_JackAudioDriver, "Timebase") + py::enum_(_JackAudioDriver, "Timebase", py::arithmetic()) .value("Master", H2Core::JackAudioDriver::Timebase::Master) .value("Slave", H2Core::JackAudioDriver::Timebase::Slave) .value("None", H2Core::JackAudioDriver::Timebase::None); // enum LoopMode // - py::enum_(_Loops, "LoopMode") + py::enum_(_Loops, "LoopMode", py::arithmetic()) .value("FORWARD", H2Core::Sample::Loops::LoopMode::FORWARD) .value("REVERSE", H2Core::Sample::Loops::LoopMode::REVERSE) .value("PINGPONG", H2Core::Sample::Loops::LoopMode::PINGPONG); From ec1249c09de35a4a17187b239e81692e89411343 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Tue, 6 Jul 2021 15:36:45 +0200 Subject: [PATCH 10/24] build python bindings on linux --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 50c35201e..608cd6260 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,11 +33,12 @@ for: sudo apt-get update sudo apt-get install -y clang qt5-default qttools5-dev qttools5-dev-tools libqt5xmlpatterns5-dev libarchive-dev libsndfile1-dev libasound2-dev libjack-jackd2-dev sudo apt-get install -y liblo-dev libpulse-dev libportmidi-dev portaudio19-dev libcppunit-dev liblrdf-dev librubberband-dev ladspa-sdk + sudo apt-get install -y python3-dev python3-pybind11 sudo rm /usr/local/bin/doxygen build_script: |- git submodule init && git submodule update - mkdir build && cd build && cmake -DWANT_LASH=1 -DWANT_LRDF=1 -DWANT_RUBBERBAND=1 .. && make + mkdir build && cd build && cmake -DWANT_PYBINDINGS=1 -DWANT_LASH=1 -DWANT_LRDF=1 -DWANT_RUBBERBAND=1 .. && make test_script: |- TMPDIR=/tmp src/tests/tests --appveyor From eef2375624d7065ca58bfc8f057ca751a74e2375 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Tue, 6 Jul 2021 17:19:38 +0200 Subject: [PATCH 11/24] build python bindings on linux, second try with pip installed pybind11 --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 608cd6260..d277dbe39 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,7 +33,8 @@ for: sudo apt-get update sudo apt-get install -y clang qt5-default qttools5-dev qttools5-dev-tools libqt5xmlpatterns5-dev libarchive-dev libsndfile1-dev libasound2-dev libjack-jackd2-dev sudo apt-get install -y liblo-dev libpulse-dev libportmidi-dev portaudio19-dev libcppunit-dev liblrdf-dev librubberband-dev ladspa-sdk - sudo apt-get install -y python3-dev python3-pybind11 + sudo apt-get install -y python3-dev python3-pip + sudo pip3 install "pybind11[global]" sudo rm /usr/local/bin/doxygen build_script: |- From 397a14e0776b6942acaea1a374416daaef70e934 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Tue, 6 Jul 2021 21:48:49 +0200 Subject: [PATCH 12/24] [hydragen] option to export enum values --- src/bindings/h2core.yaml | 2 ++ src/bindings/h2core_module.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index 1a65c1178..0d23ca42d 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -241,6 +241,8 @@ module: policy: py::return_value_policy::reference - name: H2Core::Preferences::get_instance policy: py::return_value_policy::reference + export_enum_values: + - H2Core::Logger::log_levels prolog: | using namespace H2Core; diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index 04a7912bf..4e3bfb2b6 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -2174,7 +2174,8 @@ PYBIND11_MODULE(h2core, m) { .value("Info", H2Core::Logger::log_levels::Info) .value("Debug", H2Core::Logger::log_levels::Debug) .value("Constructors", H2Core::Logger::log_levels::Constructors) - .value("AELockTracing", H2Core::Logger::log_levels::AELockTracing); + .value("AELockTracing", H2Core::Logger::log_levels::AELockTracing) + .export_values(); // enum MidiMessageType // From 401fd2183ce48908194d17c202267fd656f1f2b9 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Tue, 6 Jul 2021 22:02:51 +0200 Subject: [PATCH 13/24] [hydragen] arithmetic on enum is opt-in --- src/bindings/h2core.yaml | 2 ++ src/bindings/h2core_module.cpp | 40 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index 0d23ca42d..b69e6527e 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -243,6 +243,8 @@ module: policy: py::return_value_policy::reference export_enum_values: - H2Core::Logger::log_levels + arith_enum: + - H2Core::Logger::log_levels prolog: | using namespace H2Core; diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index 4e3bfb2b6..efac9a23d 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -2179,7 +2179,7 @@ PYBIND11_MODULE(h2core, m) { // enum MidiMessageType // - py::enum_(_MidiMessage, "MidiMessageType", py::arithmetic()) + py::enum_(_MidiMessage, "MidiMessageType") .value("UNKNOWN", H2Core::MidiMessage::MidiMessageType::UNKNOWN) .value("SYSEX", H2Core::MidiMessage::MidiMessageType::SYSEX) .value("NOTE_ON", H2Core::MidiMessage::MidiMessageType::NOTE_ON) @@ -2273,13 +2273,13 @@ PYBIND11_MODULE(h2core, m) { // enum NameFormat // - py::enum_(_QColor, "NameFormat", py::arithmetic()) + py::enum_(_QColor, "NameFormat") .value("HexRgb", QColor::NameFormat::HexRgb) .value("HexArgb", QColor::NameFormat::HexArgb); // enum Spec // - py::enum_(_QColor, "Spec", py::arithmetic()) + py::enum_(_QColor, "Spec") .value("Invalid", QColor::Spec::Invalid) .value("Rgb", QColor::Spec::Rgb) .value("Hsv", QColor::Spec::Hsv) @@ -2289,7 +2289,7 @@ PYBIND11_MODULE(h2core, m) { // enum Octave // - py::enum_(_Note, "Octave", py::arithmetic()) + py::enum_(_Note, "Octave") .value("P8Z", H2Core::Note::Octave::P8Z) .value("P8Y", H2Core::Note::Octave::P8Y) .value("P8X", H2Core::Note::Octave::P8X) @@ -2300,7 +2300,7 @@ PYBIND11_MODULE(h2core, m) { // enum Key // - py::enum_(_Note, "Key", py::arithmetic()) + py::enum_(_Note, "Key") .value("C", H2Core::Note::Key::C) .value("Cs", H2Core::Note::Key::Cs) .value("D", H2Core::Note::Key::D) @@ -2316,7 +2316,7 @@ PYBIND11_MODULE(h2core, m) { // enum PAN_LAW_TYPES // - py::enum_(_Sampler, "PAN_LAW_TYPES", py::arithmetic()) + py::enum_(_Sampler, "PAN_LAW_TYPES") .value("RATIO_STRAIGHT_POLYGONAL", H2Core::Sampler::PAN_LAW_TYPES::RATIO_STRAIGHT_POLYGONAL) .value("RATIO_CONST_POWER", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_POWER) .value("RATIO_CONST_SUM", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_SUM) @@ -2602,7 +2602,7 @@ PYBIND11_MODULE(h2core, m) { // enum ErrorMessages // - py::enum_(_Hydrogen, "ErrorMessages", py::arithmetic()) + py::enum_(_Hydrogen, "ErrorMessages") .value("UNKNOWN_DRIVER", H2Core::Hydrogen::ErrorMessages::UNKNOWN_DRIVER) .value("ERROR_STARTING_DRIVER", H2Core::Hydrogen::ErrorMessages::ERROR_STARTING_DRIVER) .value("JACK_SERVER_SHUTDOWN", H2Core::Hydrogen::ErrorMessages::JACK_SERVER_SHUTDOWN) @@ -2614,21 +2614,21 @@ PYBIND11_MODULE(h2core, m) { // enum GUIState // - py::enum_(_Hydrogen, "GUIState", py::arithmetic()) + py::enum_(_Hydrogen, "GUIState") .value("notReady", H2Core::Hydrogen::GUIState::notReady) .value("unavailable", H2Core::Hydrogen::GUIState::unavailable) .value("ready", H2Core::Hydrogen::GUIState::ready); // enum Lookup // - py::enum_(_Filesystem, "Lookup", py::arithmetic()) + py::enum_(_Filesystem, "Lookup") .value("stacked", H2Core::Filesystem::Lookup::stacked) .value("user", H2Core::Filesystem::Lookup::user) .value("system", H2Core::Filesystem::Lookup::system); // enum file_perms // - py::enum_(_Filesystem, "file_perms", py::arithmetic()) + py::enum_(_Filesystem, "file_perms") .value("is_dir", H2Core::Filesystem::file_perms::is_dir) .value("is_file", H2Core::Filesystem::file_perms::is_file) .value("is_readable", H2Core::Filesystem::file_perms::is_readable) @@ -2637,13 +2637,13 @@ PYBIND11_MODULE(h2core, m) { // enum ActionMode // - py::enum_(_Song, "ActionMode", py::arithmetic()) + py::enum_(_Song, "ActionMode") .value("selectMode", H2Core::Song::ActionMode::selectMode) .value("drawMode", H2Core::Song::ActionMode::drawMode); // enum SongMode // - py::enum_(_Song, "SongMode", py::arithmetic()) + py::enum_(_Song, "SongMode") .value("PATTERN_MODE", H2Core::Song::SongMode::PATTERN_MODE) .value("SONG_MODE", H2Core::Song::SongMode::SONG_MODE); @@ -2655,33 +2655,33 @@ PYBIND11_MODULE(h2core, m) { // enum UI_SCALING_POLICY // - py::enum_(_Preferences, "UI_SCALING_POLICY", py::arithmetic()) + py::enum_(_Preferences, "UI_SCALING_POLICY") .value("UI_SCALING_SMALLER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SMALLER) .value("UI_SCALING_SYSTEM", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SYSTEM) .value("UI_SCALING_LARGER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_LARGER); // enum UI_LAYOUT_TYPES // - py::enum_(_Preferences, "UI_LAYOUT_TYPES", py::arithmetic()) + py::enum_(_Preferences, "UI_LAYOUT_TYPES") .value("UI_LAYOUT_SINGLE_PANE", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_SINGLE_PANE) .value("UI_LAYOUT_TABBED", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_TABBED); // enum FontSize // - py::enum_(_Preferences, "FontSize", py::arithmetic()) + py::enum_(_Preferences, "FontSize") .value("Normal", H2Core::Preferences::FontSize::Normal) .value("Small", H2Core::Preferences::FontSize::Small) .value("Large", H2Core::Preferences::FontSize::Large); // enum JackBBTSyncMethod // - py::enum_(_Preferences, "JackBBTSyncMethod", py::arithmetic()) + py::enum_(_Preferences, "JackBBTSyncMethod") .value("constMeasure", H2Core::Preferences::JackBBTSyncMethod::constMeasure) .value("identicalBars", H2Core::Preferences::JackBBTSyncMethod::identicalBars); // enum JackTrackOutputMode // - py::enum_(_Preferences, "JackTrackOutputMode", py::arithmetic()) + py::enum_(_Preferences, "JackTrackOutputMode") .value("postFader", H2Core::Preferences::JackTrackOutputMode::postFader) .value("preFader", H2Core::Preferences::JackTrackOutputMode::preFader); @@ -2716,21 +2716,21 @@ PYBIND11_MODULE(h2core, m) { // enum SampleSelectionAlgo // - py::enum_(_Instrument, "SampleSelectionAlgo", py::arithmetic()) + py::enum_(_Instrument, "SampleSelectionAlgo") .value("VELOCITY", H2Core::Instrument::SampleSelectionAlgo::VELOCITY) .value("ROUND_ROBIN", H2Core::Instrument::SampleSelectionAlgo::ROUND_ROBIN) .value("RANDOM", H2Core::Instrument::SampleSelectionAlgo::RANDOM); // enum Timebase // - py::enum_(_JackAudioDriver, "Timebase", py::arithmetic()) + py::enum_(_JackAudioDriver, "Timebase") .value("Master", H2Core::JackAudioDriver::Timebase::Master) .value("Slave", H2Core::JackAudioDriver::Timebase::Slave) .value("None", H2Core::JackAudioDriver::Timebase::None); // enum LoopMode // - py::enum_(_Loops, "LoopMode", py::arithmetic()) + py::enum_(_Loops, "LoopMode") .value("FORWARD", H2Core::Sample::Loops::LoopMode::FORWARD) .value("REVERSE", H2Core::Sample::Loops::LoopMode::REVERSE) .value("PINGPONG", H2Core::Sample::Loops::LoopMode::PINGPONG); From 09f67f8b3a1f7fcd8e2f05b8b68a3fd0bca7b6e0 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Wed, 7 Jul 2021 21:00:13 +0200 Subject: [PATCH 14/24] ban more symbols, wrap abstract classes --- src/bindings/h2core.yaml | 9 +- src/bindings/h2core_module.cpp | 1331 ++++++++++++++++++++++++++++++-- 2 files changed, 1261 insertions(+), 79 deletions(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index b69e6527e..e2c752944 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -75,6 +75,7 @@ module: - QColor::QColor(QColor &&) # ban this constructor, pybind11 bark on this - QColor::name(QColor::NameFormat) - QColor::operator= + - QColor::toExtendedRgb - std::thread::thread(const std::thread &) - std::thread::operator=(const std::thread &) - std::thread::operator=(std::thread &&) @@ -116,6 +117,8 @@ module: - H2Core::AlsaAudioDriver::AlsaAudioDriver() - H2Core::AlsaMidiDriver::midi_action - H2Core::JackAudioDriver::m_pClient + - H2Core::PortMidiDriver + - H2Core::PortAudioDriver # std::vector - H2Core::Synth::m_playingNotesQueue - H2Core::Hydrogen::m_nInstrumentLookupTable @@ -143,8 +146,10 @@ module: - H2Core::Preferences::getDataDirectory - H2Core::LadspaControlPort::__class_name - H2Core::LadspaControlPort::class_name - - H2Core::Sample::get_pan_envelope # unique pointers in stl containers, pybind11 can't cope with this. - - H2Core::Sample::get_velocity_envelope + # - H2Core::Sample::get_pan_envelope # unique pointers in stl containers, pybind11 can't cope with this. + # - H2Core::Sample::get_velocity_envelope + - H2Core::Object::Object(const H2Core::Object &) + - std::runtime_error::runtime_error(const std::runtime_error &) cleaners: - qtreset.h plugins: diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index efac9a23d..f0a79ec84 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -1,11 +1,1191 @@ #include namespace py = pybind11; + +class PyB11_Object: public H2Core::Object { + public: + // Inherit the constructors + using H2Core::Object::Object; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Object, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_runtime_error: public std::runtime_error { + public: + // Inherit the constructors + using std::runtime_error::runtime_error; + + const char * what() const noexcept override { + PYBIND11_OVERRIDE( + const char *, + std::runtime_error, + what + ); + } + + }; + +class PyB11_Note: public H2Core::Note { + public: + // Inherit the constructors + using H2Core::Note::Note; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Note, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_MidiOutput: public H2Core::MidiOutput { + public: + // Inherit the constructors + using H2Core::MidiOutput::MidiOutput; + + std::vector getInputPortList() override { + PYBIND11_OVERRIDE_PURE( + std::vector, + H2Core::MidiOutput, + getInputPortList + ); + } + + void handleQueueNote(H2Core::Note * pNote) override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::MidiOutput, + handleQueueNote, + pNote + ); + } + + void handleQueueNoteOff(int channel, int key, int velocity) override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::MidiOutput, + handleQueueNoteOff, + channel, + key, + velocity + ); + } + + void handleQueueAllNoteOff() override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::MidiOutput, + handleQueueAllNoteOff + ); + } + + void handleOutgoingControlChange(int param, int value, int channel) override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::MidiOutput, + handleOutgoingControlChange, + param, + value, + channel + ); + } + + }; + +class PyB11_MidiInput: public H2Core::MidiInput { + public: + // Inherit the constructors + using H2Core::MidiInput::MidiInput; + + void open() override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::MidiInput, + open + ); + } + + void close() override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::MidiInput, + close + ); + } + + std::vector getOutputPortList() override { + PYBIND11_OVERRIDE_PURE( + std::vector, + H2Core::MidiInput, + getOutputPortList + ); + } + + }; + +class PyB11_AudioOutput: public H2Core::AudioOutput { + public: + // Inherit the constructors + using H2Core::AudioOutput::AudioOutput; + + int init(unsigned int nBufferSize) override { + PYBIND11_OVERRIDE_PURE( + int, + H2Core::AudioOutput, + init, + nBufferSize + ); + } + + int connect() override { + PYBIND11_OVERRIDE_PURE( + int, + H2Core::AudioOutput, + connect + ); + } + + void disconnect() override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::AudioOutput, + disconnect + ); + } + + unsigned int getBufferSize() override { + PYBIND11_OVERRIDE_PURE( + unsigned int, + H2Core::AudioOutput, + getBufferSize + ); + } + + unsigned int getSampleRate() override { + PYBIND11_OVERRIDE_PURE( + unsigned int, + H2Core::AudioOutput, + getSampleRate + ); + } + + float * getOut_L() override { + PYBIND11_OVERRIDE_PURE( + float *, + H2Core::AudioOutput, + getOut_L + ); + } + + float * getOut_R() override { + PYBIND11_OVERRIDE_PURE( + float *, + H2Core::AudioOutput, + getOut_R + ); + } + + void updateTransportInfo() override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::AudioOutput, + updateTransportInfo + ); + } + + void play() override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::AudioOutput, + play + ); + } + + void stop() override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::AudioOutput, + stop + ); + } + + void locate(unsigned long nFrame) override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::AudioOutput, + locate, + nFrame + ); + } + + void setBpm(float fBPM) override { + PYBIND11_OVERRIDE_PURE( + void, + H2Core::AudioOutput, + setBpm, + fBPM + ); + } + + }; + +class PyB11_Timeline: public H2Core::Timeline { + public: + // Inherit the constructors + using H2Core::Timeline::Timeline; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Timeline, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_Hydrogen: public H2Core::Hydrogen { + public: + // Inherit the constructors + using H2Core::Hydrogen::Hydrogen; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Hydrogen, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_Song: public H2Core::Song { + public: + // Inherit the constructors + using H2Core::Song::Song; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Song, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_AutomationPath: public H2Core::AutomationPath { + public: + // Inherit the constructors + using H2Core::AutomationPath::AutomationPath; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::AutomationPath, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_Pattern: public H2Core::Pattern { + public: + // Inherit the constructors + using H2Core::Pattern::Pattern; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Pattern, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_Playlist: public H2Core::Playlist { + public: + // Inherit the constructors + using H2Core::Playlist::Playlist; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Playlist, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_Sample: public H2Core::Sample { + public: + // Inherit the constructors + using H2Core::Sample::Sample; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Sample, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_InstrumentList: public H2Core::InstrumentList { + public: + // Inherit the constructors + using H2Core::InstrumentList::InstrumentList; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::InstrumentList, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_InstrumentLayer: public H2Core::InstrumentLayer { + public: + // Inherit the constructors + using H2Core::InstrumentLayer::InstrumentLayer; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::InstrumentLayer, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_InstrumentComponent: public H2Core::InstrumentComponent { + public: + // Inherit the constructors + using H2Core::InstrumentComponent::InstrumentComponent; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::InstrumentComponent, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_Instrument: public H2Core::Instrument { + public: + // Inherit the constructors + using H2Core::Instrument::Instrument; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Instrument, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_ADSR: public H2Core::ADSR { + public: + // Inherit the constructors + using H2Core::ADSR::ADSR; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::ADSR, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_DrumkitComponent: public H2Core::DrumkitComponent { + public: + // Inherit the constructors + using H2Core::DrumkitComponent::DrumkitComponent; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::DrumkitComponent, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_Drumkit: public H2Core::Drumkit { + public: + // Inherit the constructors + using H2Core::Drumkit::Drumkit; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::Drumkit, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_PatternList: public H2Core::PatternList { + public: + // Inherit the constructors + using H2Core::PatternList::PatternList; + + QString toQString(const QString & sPrefix, bool bShort = true) const override { + PYBIND11_OVERRIDE( + QString, + H2Core::PatternList, + toQString, + sPrefix, + bShort + ); + } + + }; + +class PyB11_JackMidiDriver: public H2Core::JackMidiDriver { + public: + // Inherit the constructors + using H2Core::JackMidiDriver::JackMidiDriver; + + void open() override { + PYBIND11_OVERRIDE( + void, + H2Core::JackMidiDriver, + open + ); + } + + void close() override { + PYBIND11_OVERRIDE( + void, + H2Core::JackMidiDriver, + close + ); + } + + std::vector getInputPortList() override { + PYBIND11_OVERRIDE( + std::vector, + H2Core::JackMidiDriver, + getInputPortList + ); + } + + std::vector getOutputPortList() override { + PYBIND11_OVERRIDE( + std::vector, + H2Core::JackMidiDriver, + getOutputPortList + ); + } + + void handleQueueNote(H2Core::Note * pNote) override { + PYBIND11_OVERRIDE( + void, + H2Core::JackMidiDriver, + handleQueueNote, + pNote + ); + } + + void handleQueueNoteOff(int channel, int key, int velocity) override { + PYBIND11_OVERRIDE( + void, + H2Core::JackMidiDriver, + handleQueueNoteOff, + channel, + key, + velocity + ); + } + + void handleQueueAllNoteOff() override { + PYBIND11_OVERRIDE( + void, + H2Core::JackMidiDriver, + handleQueueAllNoteOff + ); + } + + void handleOutgoingControlChange(int param, int value, int channel) override { + PYBIND11_OVERRIDE( + void, + H2Core::JackMidiDriver, + handleOutgoingControlChange, + param, + value, + channel + ); + } + + }; + +class PyB11_AlsaMidiDriver: public H2Core::AlsaMidiDriver { + public: + // Inherit the constructors + using H2Core::AlsaMidiDriver::AlsaMidiDriver; + + void open() override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaMidiDriver, + open + ); + } + + void close() override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaMidiDriver, + close + ); + } + + std::vector getInputPortList() override { + PYBIND11_OVERRIDE( + std::vector, + H2Core::AlsaMidiDriver, + getInputPortList + ); + } + + std::vector getOutputPortList() override { + PYBIND11_OVERRIDE( + std::vector, + H2Core::AlsaMidiDriver, + getOutputPortList + ); + } + + void handleQueueNote(H2Core::Note * pNote) override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaMidiDriver, + handleQueueNote, + pNote + ); + } + + void handleQueueNoteOff(int channel, int key, int velocity) override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaMidiDriver, + handleQueueNoteOff, + channel, + key, + velocity + ); + } + + void handleQueueAllNoteOff() override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaMidiDriver, + handleQueueAllNoteOff + ); + } + + void handleOutgoingControlChange(int param, int value, int channel) override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaMidiDriver, + handleOutgoingControlChange, + param, + value, + channel + ); + } + + }; + +class PyB11_NullDriver: public H2Core::NullDriver { + public: + // Inherit the constructors + using H2Core::NullDriver::NullDriver; + + int init(unsigned int nBufferSize) override { + PYBIND11_OVERRIDE( + int, + H2Core::NullDriver, + init, + nBufferSize + ); + } + + int connect() override { + PYBIND11_OVERRIDE( + int, + H2Core::NullDriver, + connect + ); + } + + void disconnect() override { + PYBIND11_OVERRIDE( + void, + H2Core::NullDriver, + disconnect + ); + } + + unsigned int getBufferSize() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::NullDriver, + getBufferSize + ); + } + + unsigned int getSampleRate() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::NullDriver, + getSampleRate + ); + } + + float * getOut_L() override { + PYBIND11_OVERRIDE( + float *, + H2Core::NullDriver, + getOut_L + ); + } + + float * getOut_R() override { + PYBIND11_OVERRIDE( + float *, + H2Core::NullDriver, + getOut_R + ); + } + + void play() override { + PYBIND11_OVERRIDE( + void, + H2Core::NullDriver, + play + ); + } + + void stop() override { + PYBIND11_OVERRIDE( + void, + H2Core::NullDriver, + stop + ); + } + + void locate(unsigned long nFrame) override { + PYBIND11_OVERRIDE( + void, + H2Core::NullDriver, + locate, + nFrame + ); + } + + void updateTransportInfo() override { + PYBIND11_OVERRIDE( + void, + H2Core::NullDriver, + updateTransportInfo + ); + } + + void setBpm(float fBPM) override { + PYBIND11_OVERRIDE( + void, + H2Core::NullDriver, + setBpm, + fBPM + ); + } + + }; + +class PyB11_JackAudioDriver: public H2Core::JackAudioDriver { + public: + // Inherit the constructors + using H2Core::JackAudioDriver::JackAudioDriver; + + int connect() override { + PYBIND11_OVERRIDE( + int, + H2Core::JackAudioDriver, + connect + ); + } + + void disconnect() override { + PYBIND11_OVERRIDE( + void, + H2Core::JackAudioDriver, + disconnect + ); + } + + unsigned int getBufferSize() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::JackAudioDriver, + getBufferSize + ); + } + + unsigned int getSampleRate() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::JackAudioDriver, + getSampleRate + ); + } + + float * getOut_L() override { + PYBIND11_OVERRIDE( + float *, + H2Core::JackAudioDriver, + getOut_L + ); + } + + float * getOut_R() override { + PYBIND11_OVERRIDE( + float *, + H2Core::JackAudioDriver, + getOut_R + ); + } + + int init(unsigned int bufferSize) override { + PYBIND11_OVERRIDE( + int, + H2Core::JackAudioDriver, + init, + bufferSize + ); + } + + void play() override { + PYBIND11_OVERRIDE( + void, + H2Core::JackAudioDriver, + play + ); + } + + void stop() override { + PYBIND11_OVERRIDE( + void, + H2Core::JackAudioDriver, + stop + ); + } + + void locate(unsigned long nFrame) override { + PYBIND11_OVERRIDE( + void, + H2Core::JackAudioDriver, + locate, + nFrame + ); + } + + void updateTransportInfo() override { + PYBIND11_OVERRIDE( + void, + H2Core::JackAudioDriver, + updateTransportInfo + ); + } + + void setBpm(float fBPM) override { + PYBIND11_OVERRIDE( + void, + H2Core::JackAudioDriver, + setBpm, + fBPM + ); + } + + }; + +class PyB11_FakeDriver: public H2Core::FakeDriver { + public: + // Inherit the constructors + using H2Core::FakeDriver::FakeDriver; + + int init(unsigned int nBufferSize) override { + PYBIND11_OVERRIDE( + int, + H2Core::FakeDriver, + init, + nBufferSize + ); + } + + int connect() override { + PYBIND11_OVERRIDE( + int, + H2Core::FakeDriver, + connect + ); + } + + void disconnect() override { + PYBIND11_OVERRIDE( + void, + H2Core::FakeDriver, + disconnect + ); + } + + unsigned int getBufferSize() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::FakeDriver, + getBufferSize + ); + } + + unsigned int getSampleRate() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::FakeDriver, + getSampleRate + ); + } + + float * getOut_L() override { + PYBIND11_OVERRIDE( + float *, + H2Core::FakeDriver, + getOut_L + ); + } + + float * getOut_R() override { + PYBIND11_OVERRIDE( + float *, + H2Core::FakeDriver, + getOut_R + ); + } + + void play() override { + PYBIND11_OVERRIDE( + void, + H2Core::FakeDriver, + play + ); + } + + void stop() override { + PYBIND11_OVERRIDE( + void, + H2Core::FakeDriver, + stop + ); + } + + void locate(unsigned long nFrame) override { + PYBIND11_OVERRIDE( + void, + H2Core::FakeDriver, + locate, + nFrame + ); + } + + void updateTransportInfo() override { + PYBIND11_OVERRIDE( + void, + H2Core::FakeDriver, + updateTransportInfo + ); + } + + void setBpm(float fBPM) override { + PYBIND11_OVERRIDE( + void, + H2Core::FakeDriver, + setBpm, + fBPM + ); + } + + }; + +class PyB11_DiskWriterDriver: public H2Core::DiskWriterDriver { + public: + // Inherit the constructors + using H2Core::DiskWriterDriver::DiskWriterDriver; + + int init(unsigned int nBufferSize) override { + PYBIND11_OVERRIDE( + int, + H2Core::DiskWriterDriver, + init, + nBufferSize + ); + } + + int connect() override { + PYBIND11_OVERRIDE( + int, + H2Core::DiskWriterDriver, + connect + ); + } + + void disconnect() override { + PYBIND11_OVERRIDE( + void, + H2Core::DiskWriterDriver, + disconnect + ); + } + + unsigned int getBufferSize() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::DiskWriterDriver, + getBufferSize + ); + } + + unsigned int getSampleRate() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::DiskWriterDriver, + getSampleRate + ); + } + + float * getOut_L() override { + PYBIND11_OVERRIDE( + float *, + H2Core::DiskWriterDriver, + getOut_L + ); + } + + float * getOut_R() override { + PYBIND11_OVERRIDE( + float *, + H2Core::DiskWriterDriver, + getOut_R + ); + } + + void play() override { + PYBIND11_OVERRIDE( + void, + H2Core::DiskWriterDriver, + play + ); + } + + void stop() override { + PYBIND11_OVERRIDE( + void, + H2Core::DiskWriterDriver, + stop + ); + } + + void locate(unsigned long nFrame) override { + PYBIND11_OVERRIDE( + void, + H2Core::DiskWriterDriver, + locate, + nFrame + ); + } + + void updateTransportInfo() override { + PYBIND11_OVERRIDE( + void, + H2Core::DiskWriterDriver, + updateTransportInfo + ); + } + + void setBpm(float fBPM) override { + PYBIND11_OVERRIDE( + void, + H2Core::DiskWriterDriver, + setBpm, + fBPM + ); + } + + }; + +class PyB11_AlsaAudioDriver: public H2Core::AlsaAudioDriver { + public: + // Inherit the constructors + using H2Core::AlsaAudioDriver::AlsaAudioDriver; + + int init(unsigned int nBufferSize) override { + PYBIND11_OVERRIDE( + int, + H2Core::AlsaAudioDriver, + init, + nBufferSize + ); + } + + int connect() override { + PYBIND11_OVERRIDE( + int, + H2Core::AlsaAudioDriver, + connect + ); + } + + void disconnect() override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaAudioDriver, + disconnect + ); + } + + unsigned int getBufferSize() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::AlsaAudioDriver, + getBufferSize + ); + } + + unsigned int getSampleRate() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::AlsaAudioDriver, + getSampleRate + ); + } + + float * getOut_L() override { + PYBIND11_OVERRIDE( + float *, + H2Core::AlsaAudioDriver, + getOut_L + ); + } + + float * getOut_R() override { + PYBIND11_OVERRIDE( + float *, + H2Core::AlsaAudioDriver, + getOut_R + ); + } + + void updateTransportInfo() override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaAudioDriver, + updateTransportInfo + ); + } + + void play() override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaAudioDriver, + play + ); + } + + void stop() override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaAudioDriver, + stop + ); + } + + void locate(unsigned long nFrame) override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaAudioDriver, + locate, + nFrame + ); + } + + void setBpm(float fBPM) override { + PYBIND11_OVERRIDE( + void, + H2Core::AlsaAudioDriver, + setBpm, + fBPM + ); + } + + }; using namespace H2Core; PYBIND11_MODULE(h2core, m) { - py::class_> _Object(m, "Object"); - _Object.def(py::init()); + py::class_> _Object(m, "Object"); _Object.def(py::init()); _Object.def_property_readonly_static("alive_object_count", [](py::object) { return H2Core::Object::getAliveObjectCount(); }); _Object.def_property_readonly_static("object_map", [](py::object) { return H2Core::Object::getObjectMap(); }); @@ -78,10 +1258,9 @@ PYBIND11_MODULE(h2core, m) { _MidiMessage.def_readwrite("m_nChannel", &H2Core::MidiMessage::m_nChannel); // ['>] _MidiMessage.def_readwrite("m_sysexData", &H2Core::MidiMessage::m_sysexData); - py::class_> _runtime_error(m, "runtime_error"); + py::class_> _runtime_error(m, "runtime_error"); _runtime_error.def(py::init()); _runtime_error.def(py::init()); - _runtime_error.def(py::init()); // [banned] _runtime_error.def("operator=", py::overload_cast(&std::runtime_error::operator=), // [banned] py::arg("")); _runtime_error.def("operator=", py::overload_cast(&std::runtime_error::operator=), @@ -267,7 +1446,7 @@ PYBIND11_MODULE(h2core, m) { _QColor.def("toHsv", &QColor::toHsv); _QColor.def("toCmyk", &QColor::toCmyk); _QColor.def("toHsl", &QColor::toHsl); - _QColor.def("toExtendedRgb", &QColor::toExtendedRgb); + // [banned] _QColor.def("toExtendedRgb", &QColor::toExtendedRgb); _QColor.def("convertTo", &QColor::convertTo, py::arg("colorSpec")); _QColor.def_static("fromRgb_static", py::overload_cast(&QColor::fromRgb), @@ -395,7 +1574,7 @@ PYBIND11_MODULE(h2core, m) { _Synth.def("process", &H2Core::Synth::process, py::arg("nFrames")); - py::class_> _Note(m, "Note"); + py::class_> _Note(m, "Note"); _Note.def(py::init, int, float, float, int, float>()); _Note.def(py::init>()); _Note.def_property_readonly("instrument", &H2Core::Note::get_instrument); @@ -558,11 +1737,53 @@ PYBIND11_MODULE(h2core, m) { _TransportInfo.def("printInfo", &H2Core::TransportInfo::printInfo, "Displays general information about the transport state in the #INFOLOG"); -// abstract class MidiOutput + py::class_> _MidiOutput(m, "MidiOutput"); + _MidiOutput.def(py::init()); + _MidiOutput.def_property_readonly("input_port_list", &H2Core::MidiOutput::getInputPortList); + _MidiOutput.def("handleQueueNote", &H2Core::MidiOutput::handleQueueNote, + py::arg("pNote")); + _MidiOutput.def("handleQueueNoteOff", &H2Core::MidiOutput::handleQueueNoteOff, + py::arg("channel"), + py::arg("key"), + py::arg("velocity")); + _MidiOutput.def("handleQueueAllNoteOff", &H2Core::MidiOutput::handleQueueAllNoteOff); + _MidiOutput.def("handleOutgoingControlChange", &H2Core::MidiOutput::handleOutgoingControlChange, + py::arg("param"), + py::arg("value"), + py::arg("channel")); -// abstract class MidiInput + py::class_> _MidiInput(m, "MidiInput"); + _MidiInput.def(py::init()); + _MidiInput.def_property_readonly("output_port_list", &H2Core::MidiInput::getOutputPortList); + _MidiInput.def("open", &H2Core::MidiInput::open); + _MidiInput.def("close", &H2Core::MidiInput::close); + _MidiInput.def("handleMidiMessage", &H2Core::MidiInput::handleMidiMessage, + py::arg("msg")); + _MidiInput.def("handleSysexMessage", &H2Core::MidiInput::handleSysexMessage, + py::arg("msg")); + _MidiInput.def("handleControlChangeMessage", &H2Core::MidiInput::handleControlChangeMessage, + py::arg("msg")); + _MidiInput.def("handleProgramChangeMessage", &H2Core::MidiInput::handleProgramChangeMessage, + py::arg("msg")); + _MidiInput.def("handlePolyphonicKeyPressureMessage", &H2Core::MidiInput::handlePolyphonicKeyPressureMessage, + py::arg("msg")); -// abstract class AudioOutput + py::class_> _AudioOutput(m, "AudioOutput"); + _AudioOutput.def(py::init()); + _AudioOutput.def_readwrite("m_transport", &H2Core::AudioOutput::m_transport); + _AudioOutput.def_property_readonly("buffer_size", &H2Core::AudioOutput::getBufferSize); + _AudioOutput.def_property_readonly("sample_rate", &H2Core::AudioOutput::getSampleRate); + _AudioOutput.def("init", &H2Core::AudioOutput::init, + py::arg("nBufferSize")); + _AudioOutput.def("connect", &H2Core::AudioOutput::connect); + _AudioOutput.def("disconnect", &H2Core::AudioOutput::disconnect); + _AudioOutput.def("getOut_L", &H2Core::AudioOutput::getOut_L); + _AudioOutput.def("getOut_R", &H2Core::AudioOutput::getOut_R); + _AudioOutput.def("updateTransportInfo", &H2Core::AudioOutput::updateTransportInfo); + _AudioOutput.def("play", &H2Core::AudioOutput::play); + _AudioOutput.def("stop", &H2Core::AudioOutput::stop); + _AudioOutput.def("locate", &H2Core::AudioOutput::locate, + py::arg("nFrame")); py::class_> _LadspaFX(m, "LadspaFX"); _LadspaFX.def_readwrite("m_pBuffer_L", &H2Core::LadspaFX::m_pBuffer_L); @@ -657,7 +1878,7 @@ PYBIND11_MODULE(h2core, m) { } ); - py::class_> _Timeline(m, "Timeline"); + py::class_> _Timeline(m, "Timeline"); _Timeline.def(py::init<>()); _Timeline.def_property_readonly("all_tempo_markers", &H2Core::Timeline::getAllTempoMarkers); _Timeline.def_property_readonly("all_tags", &H2Core::Timeline::getAllTags); @@ -917,7 +2138,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("value")); _AudioEngine.def("getMasterPeak_R", &H2Core::AudioEngine::getMasterPeak_R); - py::class_> _Hydrogen(m, "Hydrogen"); + py::class_> _Hydrogen(m, "Hydrogen"); _Hydrogen.def_readwrite("lastMidiEvent", &H2Core::Hydrogen::lastMidiEvent); _Hydrogen.def_readwrite("lastMidiEventParameter", &H2Core::Hydrogen::lastMidiEventParameter); _Hydrogen.def_readwrite("m_nMaxTimeHumanize", &H2Core::Hydrogen::m_nMaxTimeHumanize); @@ -1253,7 +2474,7 @@ PYBIND11_MODULE(h2core, m) { "create a path", py::arg("path")); - py::class_> _Song(m, "Song"); + py::class_> _Song(m, "Song"); _Song.def(py::init()); _Song.def_property_readonly_static("empty_song", [](py::object) { return H2Core::Song::getEmptySong(); }); _Song.def_property_readonly_static("default_song", [](py::object) { return H2Core::Song::getDefaultSong(); }); @@ -1329,7 +2550,7 @@ PYBIND11_MODULE(h2core, m) { } ); - py::class_> _AutomationPath(m, "AutomationPath"); + py::class_> _AutomationPath(m, "AutomationPath"); _AutomationPath.def(py::init()); _AutomationPath.def_property_readonly("min", &H2Core::AutomationPath::get_min); _AutomationPath.def_property_readonly("max", &H2Core::AutomationPath::get_max); @@ -1358,7 +2579,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("sPrefix"), py::arg("bShort")); - py::class_> _Pattern(m, "Pattern"); + py::class_> _Pattern(m, "Pattern"); _Pattern.def(py::init()); _Pattern.def(py::init()); _Pattern.def_property("name", &H2Core::Pattern::get_name, &H2Core::Pattern::set_name); @@ -1432,7 +2653,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("sPrefix"), py::arg("bShort")); - py::class_> _Playlist(m, "Playlist"); + py::class_> _Playlist(m, "Playlist"); _Playlist.def_property_readonly_static("instance", [](py::object) { return H2Core::Playlist::get_instance(); }, py::return_value_policy::reference); _Playlist.def_property("selected_song_nr", &H2Core::Playlist::getSelectedSongNr, &H2Core::Playlist::setSelectedSongNr); _Playlist.def_property("active_song_number", &H2Core::Playlist::getActiveSongNumber, &H2Core::Playlist::setActiveSongNumber); @@ -1635,7 +2856,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("_height"), py::arg("_visible")); - py::class_> _Sample(m, "Sample"); + py::class_> _Sample(m, "Sample"); _Sample.def(py::init()); _Sample.def(py::init>()); _Sample.def_property_readonly("filepath", &H2Core::Sample::get_filepath); @@ -1669,6 +2890,8 @@ PYBIND11_MODULE(h2core, m) { } ); _Sample.def_property("is_modified", &H2Core::Sample::get_is_modified, &H2Core::Sample::set_is_modified); + _Sample.def_property_readonly("pan_envelope", &H2Core::Sample::get_pan_envelope); + _Sample.def_property_readonly("velocity_envelope", &H2Core::Sample::get_velocity_envelope); _Sample.def_property_readonly("loops", &H2Core::Sample::get_loops); _Sample.def_property_readonly("rubberband", &H2Core::Sample::get_rubberband); _Sample.def_property_readonly("loop_mode_string", &H2Core::Sample::get_loop_mode_string); @@ -1714,10 +2937,6 @@ PYBIND11_MODULE(h2core, m) { py::arg("rb")); _Sample.def("is_empty", &H2Core::Sample::is_empty, "Returns true if both data channels are null pointers"); - // [banned] _Sample.def("get_pan_envelope", &H2Core::Sample::get_pan_envelope, - // [banned] "Returns #__pan_envelope"); - // [banned] _Sample.def("get_velocity_envelope", &H2Core::Sample::get_velocity_envelope, - // [banned] "Returns #__velocity_envelope"); _Sample.def_static("parse_loop_mode", &H2Core::Sample::parse_loop_mode, "parse the given string and rturn the corresponding loop_mode", py::arg("string")); @@ -1731,7 +2950,7 @@ PYBIND11_MODULE(h2core, m) { } ); - py::class_> _InstrumentList(m, "InstrumentList"); + py::class_> _InstrumentList(m, "InstrumentList"); _InstrumentList.def(py::init<>()); _InstrumentList.def(py::init()); _InstrumentList.def_static("class_name", &H2Core::InstrumentList::class_name); @@ -1806,7 +3025,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("sPrefix"), py::arg("bShort")); - py::class_> _InstrumentLayer(m, "InstrumentLayer"); + py::class_> _InstrumentLayer(m, "InstrumentLayer"); _InstrumentLayer.def(py::init>()); _InstrumentLayer.def(py::init>()); _InstrumentLayer.def(py::init, std::shared_ptr>()); @@ -1831,7 +3050,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("sPrefix"), py::arg("bShort")); - py::class_> _InstrumentComponent(m, "InstrumentComponent"); + py::class_> _InstrumentComponent(m, "InstrumentComponent"); _InstrumentComponent.def(py::init()); _InstrumentComponent.def(py::init>()); _InstrumentComponent.def_property("drumkit_componentID", &H2Core::InstrumentComponent::get_drumkit_componentID, &H2Core::InstrumentComponent::set_drumkit_componentID); @@ -1856,7 +3075,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("sPrefix"), py::arg("bShort")); - py::class_> _Instrument(m, "Instrument"); + py::class_> _Instrument(m, "Instrument"); _Instrument.def(py::init>()); _Instrument.def(py::init>()); _Instrument.def_property("name", &H2Core::Instrument::get_name, &H2Core::Instrument::set_name); @@ -1953,7 +3172,7 @@ PYBIND11_MODULE(h2core, m) { } ); - py::class_> _ADSR(m, "ADSR"); + py::class_> _ADSR(m, "ADSR"); _ADSR.def(py::init()); _ADSR.def(py::init>()); _ADSR.def_property("attack", &H2Core::ADSR::get_attack, &H2Core::ADSR::set_attack); @@ -1969,7 +3188,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("sPrefix"), py::arg("bShort")); - py::class_> _DrumkitComponent(m, "DrumkitComponent"); + py::class_> _DrumkitComponent(m, "DrumkitComponent"); _DrumkitComponent.def(py::init()); _DrumkitComponent.def(py::init()); _DrumkitComponent.def_property("name", &H2Core::DrumkitComponent::get_name, &H2Core::DrumkitComponent::set_name); @@ -2008,7 +3227,7 @@ PYBIND11_MODULE(h2core, m) { } ); - py::class_> _Drumkit(m, "Drumkit"); + py::class_> _Drumkit(m, "Drumkit"); _Drumkit.def(py::init<>()); _Drumkit.def(py::init()); _Drumkit.def_property("instruments", &H2Core::Drumkit::get_instruments, &H2Core::Drumkit::set_instruments, py::return_value_policy::reference_internal); @@ -2199,7 +3418,7 @@ PYBIND11_MODULE(h2core, m) { py::class_> _H2Exception(m, "H2Exception"); _H2Exception.def(py::init()); - py::class_> _PatternList(m, "PatternList"); + py::class_> _PatternList(m, "PatternList"); _PatternList.def(py::init<>()); _PatternList.def(py::init()); _PatternList.def_static("class_name", &H2Core::PatternList::class_name); @@ -2334,29 +3553,7 @@ PYBIND11_MODULE(h2core, m) { .value("POLAR_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::POLAR_CONST_K_NORM) .value("QUADRATIC_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::QUADRATIC_CONST_K_NORM); - py::class_> _PortMidiDriver(m, "PortMidiDriver"); - _PortMidiDriver.def(py::init<>()); - _PortMidiDriver.def_readwrite("m_pMidiIn", &H2Core::PortMidiDriver::m_pMidiIn); - _PortMidiDriver.def_readwrite("m_pMidiOut", &H2Core::PortMidiDriver::m_pMidiOut); - _PortMidiDriver.def_readwrite("m_bRunning", &H2Core::PortMidiDriver::m_bRunning); - _PortMidiDriver.def_property_readonly("input_port_list", &H2Core::PortMidiDriver::getInputPortList); - _PortMidiDriver.def_property_readonly("output_port_list", &H2Core::PortMidiDriver::getOutputPortList); - _PortMidiDriver.def_static("class_name", &H2Core::PortMidiDriver::class_name); - _PortMidiDriver.def("open", &H2Core::PortMidiDriver::open); - _PortMidiDriver.def("close", &H2Core::PortMidiDriver::close); - _PortMidiDriver.def("handleQueueNote", &H2Core::PortMidiDriver::handleQueueNote, - py::arg("pNote")); - _PortMidiDriver.def("handleQueueNoteOff", &H2Core::PortMidiDriver::handleQueueNoteOff, - py::arg("channel"), - py::arg("key"), - py::arg("velocity")); - _PortMidiDriver.def("handleQueueAllNoteOff", &H2Core::PortMidiDriver::handleQueueAllNoteOff); - _PortMidiDriver.def("handleOutgoingControlChange", &H2Core::PortMidiDriver::handleOutgoingControlChange, - py::arg("param"), - py::arg("value"), - py::arg("channel")); - - py::class_> _JackMidiDriver(m, "JackMidiDriver"); + py::class_> _JackMidiDriver(m, "JackMidiDriver"); _JackMidiDriver.def(py::init<>()); _JackMidiDriver.def_property_readonly("input_port_list", &H2Core::JackMidiDriver::getInputPortList); _JackMidiDriver.def_property_readonly("output_port_list", &H2Core::JackMidiDriver::getOutputPortList); @@ -2383,7 +3580,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("value"), py::arg("channel")); - py::class_> _AlsaMidiDriver(m, "AlsaMidiDriver"); + py::class_> _AlsaMidiDriver(m, "AlsaMidiDriver"); _AlsaMidiDriver.def(py::init<>()); _AlsaMidiDriver.def_property_readonly("input_port_list", &H2Core::AlsaMidiDriver::getInputPortList); _AlsaMidiDriver.def_property_readonly("output_port_list", &H2Core::AlsaMidiDriver::getOutputPortList); @@ -2408,27 +3605,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("value"), py::arg("channel")); - py::class_> _PortAudioDriver(m, "PortAudioDriver"); - _PortAudioDriver.def(py::init()); - _PortAudioDriver.def_readwrite("m_pOut_L", &H2Core::PortAudioDriver::m_pOut_L); - _PortAudioDriver.def_readwrite("m_pOut_R", &H2Core::PortAudioDriver::m_pOut_R); - _PortAudioDriver.def_readwrite("m_nBufferSize", &H2Core::PortAudioDriver::m_nBufferSize); - _PortAudioDriver.def_property_readonly("buffer_size", &H2Core::PortAudioDriver::getBufferSize); - _PortAudioDriver.def_property_readonly("sample_rate", &H2Core::PortAudioDriver::getSampleRate); - _PortAudioDriver.def_static("class_name", &H2Core::PortAudioDriver::class_name); - _PortAudioDriver.def("init", &H2Core::PortAudioDriver::init, - py::arg("nBufferSize")); - _PortAudioDriver.def("connect", &H2Core::PortAudioDriver::connect); - _PortAudioDriver.def("disconnect", &H2Core::PortAudioDriver::disconnect); - _PortAudioDriver.def("getOut_L", &H2Core::PortAudioDriver::getOut_L); - _PortAudioDriver.def("getOut_R", &H2Core::PortAudioDriver::getOut_R); - _PortAudioDriver.def("updateTransportInfo", &H2Core::PortAudioDriver::updateTransportInfo); - _PortAudioDriver.def("play", &H2Core::PortAudioDriver::play); - _PortAudioDriver.def("stop", &H2Core::PortAudioDriver::stop); - _PortAudioDriver.def("locate", &H2Core::PortAudioDriver::locate, - py::arg("nFrame")); - - py::class_> _NullDriver(m, "NullDriver"); + py::class_> _NullDriver(m, "NullDriver"); _NullDriver.def(py::init()); _NullDriver.def_property_readonly("buffer_size", &H2Core::NullDriver::getBufferSize); _NullDriver.def_property_readonly("sample_rate", &H2Core::NullDriver::getSampleRate); @@ -2445,7 +3622,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("nFrame")); _NullDriver.def("updateTransportInfo", &H2Core::NullDriver::updateTransportInfo); - py::class_> _JackAudioDriver(m, "JackAudioDriver"); + py::class_> _JackAudioDriver(m, "JackAudioDriver"); _JackAudioDriver.def(py::init()); _JackAudioDriver.def_readwrite("m_currentPos", &H2Core::JackAudioDriver::m_currentPos); _JackAudioDriver.def_property_readonly("buffer_size", &H2Core::JackAudioDriver::getBufferSize); @@ -2511,7 +3688,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("nframes"), py::arg("arg")); - py::class_> _FakeDriver(m, "FakeDriver"); + py::class_> _FakeDriver(m, "FakeDriver"); _FakeDriver.def(py::init()); _FakeDriver.def_property_readonly("buffer_size", &H2Core::FakeDriver::getBufferSize); _FakeDriver.def_property_readonly("sample_rate", &H2Core::FakeDriver::getSampleRate); @@ -2528,7 +3705,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("nFrame")); _FakeDriver.def("updateTransportInfo", &H2Core::FakeDriver::updateTransportInfo); - py::class_> _DiskWriterDriver(m, "DiskWriterDriver"); + py::class_> _DiskWriterDriver(m, "DiskWriterDriver"); _DiskWriterDriver.def(py::init()); _DiskWriterDriver.def_readwrite("m_nSampleRate", &H2Core::DiskWriterDriver::m_nSampleRate); _DiskWriterDriver.def_readwrite("m_sFilename", &H2Core::DiskWriterDriver::m_sFilename); @@ -2556,7 +3733,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("nFrame")); _DiskWriterDriver.def("updateTransportInfo", &H2Core::DiskWriterDriver::updateTransportInfo); - py::class_> _AlsaAudioDriver(m, "AlsaAudioDriver"); + py::class_> _AlsaAudioDriver(m, "AlsaAudioDriver"); _AlsaAudioDriver.def(py::init()); _AlsaAudioDriver.def_readwrite("m_bIsRunning", &H2Core::AlsaAudioDriver::m_bIsRunning); _AlsaAudioDriver.def_readwrite("m_nBufferSize", &H2Core::AlsaAudioDriver::m_nBufferSize); From 21a8f746ea5decf40cb474bf9409f672c543ba04 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Wed, 7 Jul 2021 02:32:22 +0200 Subject: [PATCH 15/24] kill __class_name attribute --- src/core/AudioEngine.cpp | 4 +- src/core/AudioEngine.h | 2 +- src/core/AutomationPathSerializer.cpp | 4 +- src/core/AutomationPathSerializer.h | 2 +- src/core/Basics/Adsr.cpp | 5 +-- src/core/Basics/Adsr.h | 2 +- src/core/Basics/AutomationPath.cpp | 4 +- src/core/Basics/AutomationPath.h | 2 +- src/core/Basics/Drumkit.cpp | 6 +-- src/core/Basics/Drumkit.h | 2 +- src/core/Basics/DrumkitComponent.cpp | 5 +-- src/core/Basics/DrumkitComponent.h | 2 +- src/core/Basics/Instrument.cpp | 6 +-- src/core/Basics/Instrument.h | 2 +- src/core/Basics/InstrumentComponent.cpp | 6 +-- src/core/Basics/InstrumentComponent.h | 2 +- src/core/Basics/InstrumentLayer.cpp | 8 ++-- src/core/Basics/InstrumentLayer.h | 2 +- src/core/Basics/InstrumentList.cpp | 6 +-- src/core/Basics/InstrumentList.h | 2 +- src/core/Basics/Note.cpp | 5 +-- src/core/Basics/Note.h | 2 +- src/core/Basics/Pattern.cpp | 6 +-- src/core/Basics/Pattern.h | 2 +- src/core/Basics/PatternList.cpp | 5 +-- src/core/Basics/PatternList.h | 2 +- src/core/Basics/Playlist.cpp | 4 +- src/core/Basics/Playlist.h | 2 +- src/core/Basics/Sample.cpp | 13 +++---- src/core/Basics/Sample.h | 4 +- src/core/Basics/Song.cpp | 8 +--- src/core/Basics/Song.h | 4 +- src/core/CoreActionController.cpp | 4 +- src/core/CoreActionController.h | 2 +- src/core/EventQueue.cpp | 3 +- src/core/EventQueue.h | 2 +- src/core/FX/Effects.cpp | 3 +- src/core/FX/Effects.h | 2 +- src/core/FX/LadspaFX.h | 10 ++--- src/core/FX/LadspaFx.cpp | 11 ++---- src/core/Helpers/Files.cpp | 1 - src/core/Helpers/Files.h | 2 +- src/core/Helpers/Filesystem.cpp | 1 - src/core/Helpers/Filesystem.h | 2 +- src/core/Helpers/Legacy.cpp | 1 - src/core/Helpers/Legacy.h | 2 +- src/core/Helpers/Xml.cpp | 8 ++-- src/core/Helpers/Xml.h | 4 +- src/core/Hydrogen.cpp | 3 +- src/core/Hydrogen.h | 2 +- src/core/IO/AlsaAudioDriver.cpp | 4 +- src/core/IO/AlsaAudioDriver.h | 4 +- src/core/IO/AlsaMidiDriver.cpp | 4 +- src/core/IO/AlsaMidiDriver.h | 2 +- src/core/IO/AudioOutput.h | 5 ++- src/core/IO/CoreAudioDriver.cpp | 2 - src/core/IO/CoreAudioDriver.h | 4 +- src/core/IO/CoreMidiDriver.cpp | 4 +- src/core/IO/CoreMidiDriver.h | 2 +- src/core/IO/DiskWriterDriver.cpp | 4 +- src/core/IO/DiskWriterDriver.h | 2 +- src/core/IO/FakeDriver.cpp | 4 +- src/core/IO/FakeDriver.h | 2 +- src/core/IO/JackAudioDriver.cpp | 3 +- src/core/IO/JackAudioDriver.h | 4 +- src/core/IO/JackMidiDriver.cpp | 4 +- src/core/IO/JackMidiDriver.h | 2 +- src/core/IO/MidiInput.cpp | 4 +- src/core/IO/MidiInput.h | 2 +- src/core/IO/MidiOutput.cpp | 4 +- src/core/IO/MidiOutput.h | 3 +- src/core/IO/NullDriver.cpp | 4 +- src/core/IO/NullDriver.h | 2 +- src/core/IO/OssDriver.cpp | 3 -- src/core/IO/OssDriver.h | 4 +- src/core/IO/PortAudioDriver.h | 4 +- src/core/IO/PortMidiDriver.h | 2 +- src/core/IO/PortaudioDriver.cpp | 4 +- src/core/IO/PortmidiDriver.cpp | 4 +- src/core/IO/PulseAudioDriver.cpp | 2 +- src/core/IO/PulseAudioDriver.h | 4 +- src/core/IO/TransportInfo.cpp | 4 +- src/core/IO/TransportInfo.h | 2 +- src/core/LocalFileMgr.cpp | 7 +--- src/core/LocalFileMng.h | 4 +- src/core/MidiAction.cpp | 7 +--- src/core/MidiAction.h | 4 +- src/core/MidiMap.cpp | 3 +- src/core/MidiMap.h | 2 +- src/core/NsmClient.cpp | 3 +- src/core/NsmClient.h | 2 +- src/core/Object.cpp | 4 +- src/core/Object.h | 10 ++--- src/core/OscServer.cpp | 3 +- src/core/OscServer.h | 2 +- src/core/Preferences.cpp | 12 ++---- src/core/Preferences.h | 6 +-- src/core/Sampler/Sampler.cpp | 4 +- src/core/Sampler/Sampler.h | 2 +- src/core/Smf/SMF.h | 20 +++++----- src/core/Smf/SMFEvent.h | 18 ++++----- src/core/Smf/Smf.cpp | 38 +++++-------------- src/core/Smf/SmfEvent.cpp | 32 +++++----------- src/core/Synth/Synth.cpp | 4 +- src/core/Synth/Synth.h | 2 +- src/core/Timeline.cpp | 3 +- src/core/Timeline.h | 2 +- src/gui/src/AboutDialogContributorList.cpp | 4 +- src/gui/src/AboutDialogContributorList.h | 2 +- src/gui/src/AudioEngineInfoForm.cpp | 3 +- src/gui/src/AudioEngineInfoForm.h | 2 +- .../src/AudioFileBrowser/AudioFileBrowser.cpp | 4 +- .../src/AudioFileBrowser/AudioFileBrowser.h | 2 +- .../AudioFileBrowser/SampleWaveDisplay.cpp | 4 +- .../src/AudioFileBrowser/SampleWaveDisplay.h | 2 +- src/gui/src/Director.cpp | 2 +- src/gui/src/ExportMidiDialog.cpp | 4 +- src/gui/src/ExportMidiDialog.h | 2 +- src/gui/src/ExportSongDialog.cpp | 4 +- src/gui/src/ExportSongDialog.h | 2 +- src/gui/src/FilesystemInfoForm.cpp | 4 +- src/gui/src/FilesystemInfoForm.h | 2 +- src/gui/src/HydrogenApp.cpp | 3 +- src/gui/src/HydrogenApp.h | 2 +- .../src/InstrumentEditor/InstrumentEditor.cpp | 4 +- .../src/InstrumentEditor/InstrumentEditor.h | 2 +- .../InstrumentEditorPanel.cpp | 3 +- .../InstrumentEditor/InstrumentEditorPanel.h | 2 +- src/gui/src/InstrumentEditor/LayerPreview.cpp | 4 +- src/gui/src/InstrumentEditor/LayerPreview.h | 2 +- src/gui/src/InstrumentEditor/WaveDisplay.cpp | 4 +- src/gui/src/InstrumentEditor/WaveDisplay.h | 2 +- src/gui/src/InstrumentRack.cpp | 4 +- src/gui/src/InstrumentRack.h | 2 +- src/gui/src/LadspaFXProperties.cpp | 4 +- src/gui/src/LadspaFXProperties.h | 2 +- src/gui/src/LadspaFXSelector.cpp | 4 +- src/gui/src/LadspaFXSelector.h | 2 +- src/gui/src/MainForm.cpp | 4 +- src/gui/src/MainForm.h | 2 +- src/gui/src/Mixer/Mixer.cpp | 4 +- src/gui/src/Mixer/Mixer.h | 2 +- src/gui/src/Mixer/MixerLine.cpp | 11 ++---- src/gui/src/Mixer/MixerLine.h | 12 +++--- src/gui/src/Mixer/MixerSettingsDialog.cpp | 4 +- src/gui/src/Mixer/MixerSettingsDialog.h | 2 +- .../src/PatternEditor/DrumPatternEditor.cpp | 4 +- src/gui/src/PatternEditor/DrumPatternEditor.h | 2 +- .../src/PatternEditor/NotePropertiesRuler.cpp | 4 +- .../src/PatternEditor/NotePropertiesRuler.h | 2 +- src/gui/src/PatternEditor/PatternEditor.cpp | 7 +--- src/gui/src/PatternEditor/PatternEditor.h | 4 +- .../PatternEditorInstrumentList.cpp | 7 +--- .../PatternEditorInstrumentList.h | 4 +- .../src/PatternEditor/PatternEditorPanel.cpp | 4 +- .../src/PatternEditor/PatternEditorPanel.h | 2 +- .../src/PatternEditor/PatternEditorRuler.cpp | 4 +- .../src/PatternEditor/PatternEditorRuler.h | 2 +- src/gui/src/PatternEditor/PianoRollEditor.cpp | 4 +- src/gui/src/PatternEditor/PianoRollEditor.h | 2 +- src/gui/src/PlayerControl.cpp | 8 +--- src/gui/src/PlayerControl.h | 4 +- src/gui/src/PlaylistEditor/PlaylistDialog.cpp | 3 +- src/gui/src/PlaylistEditor/PlaylistDialog.h | 2 +- src/gui/src/PreferencesDialog.cpp | 3 +- src/gui/src/PreferencesDialog.h | 2 +- .../src/SampleEditor/DetailWaveDisplay.cpp | 4 +- src/gui/src/SampleEditor/DetailWaveDisplay.h | 2 +- .../SampleEditor/MainSampleWaveDisplay.cpp | 4 +- .../src/SampleEditor/MainSampleWaveDisplay.h | 2 +- src/gui/src/SampleEditor/SampleEditor.cpp | 3 +- src/gui/src/SampleEditor/SampleEditor.h | 2 +- .../src/SampleEditor/TargetWaveDisplay.cpp | 4 +- src/gui/src/SampleEditor/TargetWaveDisplay.h | 2 +- src/gui/src/SongEditor/PatternFillDialog.cpp | 4 +- src/gui/src/SongEditor/PatternFillDialog.h | 2 +- .../SongEditor/PlaybackTrackWaveDisplay.cpp | 2 - .../src/SongEditor/PlaybackTrackWaveDisplay.h | 2 +- src/gui/src/SongEditor/SongEditor.cpp | 12 ++---- src/gui/src/SongEditor/SongEditor.h | 6 +-- src/gui/src/SongEditor/SongEditorPanel.cpp | 4 +- src/gui/src/SongEditor/SongEditorPanel.h | 2 +- .../SongEditor/SongEditorPanelBpmWidget.cpp | 4 +- .../src/SongEditor/SongEditorPanelBpmWidget.h | 2 +- .../SongEditor/SongEditorPanelTagWidget.cpp | 4 +- .../src/SongEditor/SongEditorPanelTagWidget.h | 2 +- .../src/SongEditor/VirtualPatternDialog.cpp | 4 +- src/gui/src/SongEditor/VirtualPatternDialog.h | 2 +- src/gui/src/SongPropertiesDialog.h | 2 +- src/gui/src/SoundLibrary/FileBrowser.cpp | 4 +- src/gui/src/SoundLibrary/FileBrowser.h | 2 +- .../SoundLibraryDatastructures.cpp | 10 ++--- .../SoundLibrary/SoundLibraryDatastructures.h | 4 +- .../SoundLibrary/SoundLibraryExportDialog.cpp | 4 +- .../SoundLibrary/SoundLibraryExportDialog.h | 2 +- .../SoundLibrary/SoundLibraryImportDialog.cpp | 3 +- .../SoundLibrary/SoundLibraryImportDialog.h | 2 +- .../SoundLibrary/SoundLibraryOpenDialog.cpp | 4 +- .../src/SoundLibrary/SoundLibraryOpenDialog.h | 2 +- .../src/SoundLibrary/SoundLibraryPanel.cpp | 4 +- src/gui/src/SoundLibrary/SoundLibraryPanel.h | 2 +- .../SoundLibraryPropertiesDialog.cpp | 4 +- .../SoundLibraryPropertiesDialog.h | 2 +- .../SoundLibraryRepositoryDialog.cpp | 4 +- .../SoundLibraryRepositoryDialog.h | 2 +- .../SoundLibrary/SoundLibrarySaveDialog.cpp | 4 +- .../src/SoundLibrary/SoundLibrarySaveDialog.h | 2 +- src/gui/src/SoundLibrary/SoundLibraryTree.cpp | 4 +- src/gui/src/SoundLibrary/SoundLibraryTree.h | 2 +- src/gui/src/SplashScreen.cpp | 4 +- src/gui/src/SplashScreen.h | 2 +- src/gui/src/Widgets/AutomationPathView.cpp | 4 +- src/gui/src/Widgets/AutomationPathView.h | 2 +- src/gui/src/Widgets/Button.cpp | 4 +- src/gui/src/Widgets/Button.h | 2 +- src/gui/src/Widgets/ColorSelectionButton.cpp | 4 +- src/gui/src/Widgets/ColorSelectionButton.h | 2 +- src/gui/src/Widgets/CpuLoadWidget.cpp | 4 +- src/gui/src/Widgets/CpuLoadWidget.h | 2 +- src/gui/src/Widgets/DownloadWidget.cpp | 4 +- src/gui/src/Widgets/DownloadWidget.h | 4 +- src/gui/src/Widgets/Fader.cpp | 8 +--- src/gui/src/Widgets/Fader.h | 4 +- src/gui/src/Widgets/LCD.cpp | 12 ++---- src/gui/src/Widgets/LCD.h | 6 +-- src/gui/src/Widgets/LCDCombo.cpp | 3 +- src/gui/src/Widgets/LCDCombo.h | 2 +- src/gui/src/Widgets/MidiActivityWidget.cpp | 3 +- src/gui/src/Widgets/MidiActivityWidget.h | 2 +- src/gui/src/Widgets/MidiSenseWidget.cpp | 4 +- src/gui/src/Widgets/MidiSenseWidget.h | 2 +- src/gui/src/Widgets/MidiTable.cpp | 4 +- src/gui/src/Widgets/MidiTable.h | 2 +- src/gui/src/Widgets/PixmapWidget.cpp | 4 +- src/gui/src/Widgets/PixmapWidget.h | 2 +- src/gui/src/Widgets/Rotary.cpp | 4 +- src/gui/src/Widgets/Rotary.h | 2 +- .../about_dialog_contributor_list_update.sh | 4 +- 238 files changed, 343 insertions(+), 607 deletions(-) diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index a675a58ef..8d28ee397 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -98,10 +98,8 @@ inline timeval currentTime2() return now; } -const char* AudioEngine::__class_name = "AudioEngine"; - AudioEngine::AudioEngine() - : Object( __class_name ) + : Object() , m_pSampler( nullptr ) , m_pSynth( nullptr ) , m_fElapsedTime( 0 ) diff --git a/src/core/AudioEngine.h b/src/core/AudioEngine.h index 80323c162..6b6460f24 100644 --- a/src/core/AudioEngine.h +++ b/src/core/AudioEngine.h @@ -100,7 +100,7 @@ namespace H2Core */ class AudioEngine : public H2Core::Object { - H2_OBJECT + H2_OBJECT(AudioEngine) public: /** diff --git a/src/core/AutomationPathSerializer.cpp b/src/core/AutomationPathSerializer.cpp index 5b0bcc0b6..d756dce2e 100644 --- a/src/core/AutomationPathSerializer.cpp +++ b/src/core/AutomationPathSerializer.cpp @@ -24,11 +24,9 @@ namespace H2Core { -const char* AutomationPathSerializer::__class_name = "AutomationPathSerializer"; - AutomationPathSerializer::AutomationPathSerializer() - : Object(__class_name) + : Object() { } diff --git a/src/core/AutomationPathSerializer.h b/src/core/AutomationPathSerializer.h index 631e1f437..9942a9f14 100644 --- a/src/core/AutomationPathSerializer.h +++ b/src/core/AutomationPathSerializer.h @@ -33,7 +33,7 @@ namespace H2Core class AutomationPathSerializer : private Object { - H2_OBJECT + H2_OBJECT(AutomationPathSerializer) public: AutomationPathSerializer(); diff --git a/src/core/Basics/Adsr.cpp b/src/core/Basics/Adsr.cpp index 7f4ed8ec1..cf04d0599 100644 --- a/src/core/Basics/Adsr.cpp +++ b/src/core/Basics/Adsr.cpp @@ -27,7 +27,6 @@ namespace H2Core { -const char* ADSR::__class_name = "ADSR"; inline static float linear_interpolation( float fVal_A, float fVal_B, double fVal ) { @@ -64,7 +63,7 @@ void ADSR::normalise() } } -ADSR::ADSR( unsigned int attack, unsigned int decay, float sustain, unsigned int release ) : Object( __class_name ), +ADSR::ADSR( unsigned int attack, unsigned int decay, float sustain, unsigned int release ) : Object(), __attack( attack ), __decay( decay ), __sustain( sustain ), @@ -77,7 +76,7 @@ ADSR::ADSR( unsigned int attack, unsigned int decay, float sustain, unsigned int normalise(); } -ADSR::ADSR( const std::shared_ptr other ) : Object( __class_name ), +ADSR::ADSR( const std::shared_ptr other ) : Object(), __attack( other->__attack ), __decay( other->__decay ), __sustain( other->__sustain ), diff --git a/src/core/Basics/Adsr.h b/src/core/Basics/Adsr.h index 5244dd992..b9ff47bc0 100644 --- a/src/core/Basics/Adsr.h +++ b/src/core/Basics/Adsr.h @@ -35,7 +35,7 @@ namespace H2Core */ class ADSR : public Object { - H2_OBJECT + H2_OBJECT(ADSR) public: /** diff --git a/src/core/Basics/AutomationPath.cpp b/src/core/Basics/AutomationPath.cpp index 9cbaddc67..41878ab61 100644 --- a/src/core/Basics/AutomationPath.cpp +++ b/src/core/Basics/AutomationPath.cpp @@ -25,10 +25,8 @@ namespace H2Core { -const char* AutomationPath::__class_name = "AutomationPath"; - AutomationPath::AutomationPath(float min, float max, float def) - : Object(__class_name), + : Object(), _min(min), _max(max), _def(def) diff --git a/src/core/Basics/AutomationPath.h b/src/core/Basics/AutomationPath.h index ce6a10b01..be619250c 100644 --- a/src/core/Basics/AutomationPath.h +++ b/src/core/Basics/AutomationPath.h @@ -35,7 +35,7 @@ namespace H2Core class AutomationPath : public Object { - H2_OBJECT + H2_OBJECT(AutomationPath) public: typedef std::map::iterator iterator; diff --git a/src/core/Basics/Drumkit.cpp b/src/core/Basics/Drumkit.cpp index eac214996..a51b54ade 100644 --- a/src/core/Basics/Drumkit.cpp +++ b/src/core/Basics/Drumkit.cpp @@ -47,9 +47,7 @@ namespace H2Core { -const char* Drumkit::__class_name = "Drumkit"; - -Drumkit::Drumkit() : Object( __class_name ), +Drumkit::Drumkit() : Object(), __samples_loaded( false ), __instruments( nullptr ), __name( "empty" ), @@ -63,7 +61,7 @@ Drumkit::Drumkit() : Object( __class_name ), } Drumkit::Drumkit( Drumkit* other ) : - Object( __class_name ), + Object(), __path( other->get_path() ), __name( other->get_name() ), __author( other->get_author() ), diff --git a/src/core/Basics/Drumkit.h b/src/core/Basics/Drumkit.h index 69c4d757e..63050962f 100644 --- a/src/core/Basics/Drumkit.h +++ b/src/core/Basics/Drumkit.h @@ -38,7 +38,7 @@ class DrumkitComponent; */ class Drumkit : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Drumkit) public: /** drumkit constructor, does nothing */ Drumkit(); diff --git a/src/core/Basics/DrumkitComponent.cpp b/src/core/Basics/DrumkitComponent.cpp index 1b8beb5ae..347cfc808 100644 --- a/src/core/Basics/DrumkitComponent.cpp +++ b/src/core/Basics/DrumkitComponent.cpp @@ -41,10 +41,9 @@ namespace H2Core { -const char* DrumkitComponent::__class_name = "DrumkitComponent"; DrumkitComponent::DrumkitComponent( const int id, const QString& name ) - : Object( __class_name ) + : Object() , __id( id ) , __name( name ) , __volume( 1.0 ) @@ -60,7 +59,7 @@ DrumkitComponent::DrumkitComponent( const int id, const QString& name ) } DrumkitComponent::DrumkitComponent( DrumkitComponent* other ) - : Object( __class_name ) + : Object() , __id( other->get_id() ) , __name( other->get_name() ) , __volume( other->__volume ) diff --git a/src/core/Basics/DrumkitComponent.h b/src/core/Basics/DrumkitComponent.h index 8fa03d77f..31430f2b8 100644 --- a/src/core/Basics/DrumkitComponent.h +++ b/src/core/Basics/DrumkitComponent.h @@ -37,7 +37,7 @@ class InstrumentLayer; class DrumkitComponent : public H2Core::Object { - H2_OBJECT + H2_OBJECT(DrumkitComponent) public: DrumkitComponent( const int id, const QString& name ); DrumkitComponent( DrumkitComponent* other ); diff --git a/src/core/Basics/Instrument.cpp b/src/core/Basics/Instrument.cpp index 733be6b34..86e3f4ae1 100644 --- a/src/core/Basics/Instrument.cpp +++ b/src/core/Basics/Instrument.cpp @@ -41,10 +41,8 @@ namespace H2Core { -const char* Instrument::__class_name = "Instrument"; - Instrument::Instrument( const int id, const QString& name, std::shared_ptr adsr ) - : Object( __class_name ) + : Object() , __id( id ) , __name( name ) , __gain( 1.0 ) @@ -96,7 +94,7 @@ Instrument::Instrument( const int id, const QString& name, std::shared_ptr } Instrument::Instrument( std::shared_ptr other ) - : Object( __class_name ) + : Object() , __id( other->get_id() ) , __name( other->get_name() ) , __gain( other->__gain ) diff --git a/src/core/Basics/Instrument.h b/src/core/Basics/Instrument.h index aa0835731..0a4236950 100644 --- a/src/core/Basics/Instrument.h +++ b/src/core/Basics/Instrument.h @@ -51,7 +51,7 @@ Instrument class */ class Instrument : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Instrument) public: enum SampleSelectionAlgo { VELOCITY, diff --git a/src/core/Basics/InstrumentComponent.cpp b/src/core/Basics/InstrumentComponent.cpp index 4ea91c83e..0b0cf437e 100644 --- a/src/core/Basics/InstrumentComponent.cpp +++ b/src/core/Basics/InstrumentComponent.cpp @@ -40,12 +40,10 @@ namespace H2Core { -const char* InstrumentComponent::__class_name = "InstrumentComponent"; - int InstrumentComponent::m_nMaxLayers; InstrumentComponent::InstrumentComponent( int related_drumkit_componentID ) - : Object( __class_name ) + : Object() , __related_drumkit_componentID( related_drumkit_componentID ) , __gain( 1.0 ) { @@ -56,7 +54,7 @@ InstrumentComponent::InstrumentComponent( int related_drumkit_componentID ) } InstrumentComponent::InstrumentComponent( std::shared_ptr other ) - : Object( __class_name ) + : Object() , __related_drumkit_componentID( other->__related_drumkit_componentID ) , __gain( other->__gain ) { diff --git a/src/core/Basics/InstrumentComponent.h b/src/core/Basics/InstrumentComponent.h index 4335a2b0e..1bdce2534 100644 --- a/src/core/Basics/InstrumentComponent.h +++ b/src/core/Basics/InstrumentComponent.h @@ -40,7 +40,7 @@ class DrumkitComponent; class InstrumentComponent : public H2Core::Object { - H2_OBJECT + H2_OBJECT(InstrumentComponent) public: InstrumentComponent( int related_drumkit_componentID ); InstrumentComponent( std::shared_ptr other ); diff --git a/src/core/Basics/InstrumentLayer.cpp b/src/core/Basics/InstrumentLayer.cpp index bd2c4e323..a1cf7c397 100644 --- a/src/core/Basics/InstrumentLayer.cpp +++ b/src/core/Basics/InstrumentLayer.cpp @@ -28,9 +28,7 @@ namespace H2Core { -const char* InstrumentLayer::__class_name = "InstrumentLayer"; - -InstrumentLayer::InstrumentLayer( std::shared_ptr sample ) : Object( __class_name ), +InstrumentLayer::InstrumentLayer( std::shared_ptr sample ) : Object(), __start_velocity( 0.0 ), __end_velocity( 1.0 ), __pitch( 0.0 ), @@ -39,7 +37,7 @@ InstrumentLayer::InstrumentLayer( std::shared_ptr sample ) : Object( __c { } -InstrumentLayer::InstrumentLayer( std::shared_ptr other ) : Object( __class_name ), +InstrumentLayer::InstrumentLayer( std::shared_ptr other ) : Object(), __start_velocity( other->get_start_velocity() ), __end_velocity( other->get_end_velocity() ), __pitch( other->get_pitch() ), @@ -48,7 +46,7 @@ InstrumentLayer::InstrumentLayer( std::shared_ptr other ) : Obj { } -InstrumentLayer::InstrumentLayer( std::shared_ptr other, std::shared_ptr sample ) : Object( __class_name ), +InstrumentLayer::InstrumentLayer( std::shared_ptr other, std::shared_ptr sample ) : Object(), __start_velocity( other->get_start_velocity() ), __end_velocity( other->get_end_velocity() ), __pitch( other->get_pitch() ), diff --git a/src/core/Basics/InstrumentLayer.h b/src/core/Basics/InstrumentLayer.h index 77f285cbc..71b0696bb 100644 --- a/src/core/Basics/InstrumentLayer.h +++ b/src/core/Basics/InstrumentLayer.h @@ -42,7 +42,7 @@ namespace H2Core */ class InstrumentLayer : public H2Core::Object { - H2_OBJECT + H2_OBJECT(InstrumentLayer) public: /** constructor * \param sample the sample to use diff --git a/src/core/Basics/InstrumentList.cpp b/src/core/Basics/InstrumentList.cpp index 6b0eee853..a6a101557 100644 --- a/src/core/Basics/InstrumentList.cpp +++ b/src/core/Basics/InstrumentList.cpp @@ -30,13 +30,11 @@ namespace H2Core { -const char* InstrumentList::__class_name = "InstrumentList"; - -InstrumentList::InstrumentList() : Object( __class_name ) +InstrumentList::InstrumentList() : Object() { } -InstrumentList::InstrumentList( InstrumentList* other ) : Object( __class_name ) +InstrumentList::InstrumentList( InstrumentList* other ) : Object() { assert( other ); assert( __instruments.size() == 0 ); diff --git a/src/core/Basics/InstrumentList.h b/src/core/Basics/InstrumentList.h index db9fe34d6..1b3a39246 100644 --- a/src/core/Basics/InstrumentList.h +++ b/src/core/Basics/InstrumentList.h @@ -37,7 +37,7 @@ class Instrument; */ class InstrumentList : public H2Core::Object { - H2_OBJECT + H2_OBJECT(InstrumentList) public: /** constructor */ InstrumentList(); diff --git a/src/core/Basics/Note.cpp b/src/core/Basics/Note.cpp index c2c1fd4ea..63ac2b5ec 100644 --- a/src/core/Basics/Note.cpp +++ b/src/core/Basics/Note.cpp @@ -35,11 +35,10 @@ namespace H2Core { -const char* Note::__class_name = "Note"; const char* Note::__key_str[] = { "C", "Cs", "D", "Ef", "E", "F", "Fs", "G", "Af", "A", "Bf", "B" }; Note::Note( std::shared_ptr instrument, int position, float velocity, float pan, int length, float pitch ) - : Object( __class_name ), + : Object(), __instrument( instrument ), __instrument_id( 0 ), __specific_compo_id( -1 ), @@ -82,7 +81,7 @@ Note::Note( std::shared_ptr instrument, int position, float velocity } Note::Note( Note* other, std::shared_ptr instrument ) - : Object( __class_name ), + : Object(), __instrument( other->get_instrument() ), __instrument_id( 0 ), __specific_compo_id( -1 ), diff --git a/src/core/Basics/Note.h b/src/core/Basics/Note.h index cf6bbde88..ad2ef7e59 100644 --- a/src/core/Basics/Note.h +++ b/src/core/Basics/Note.h @@ -67,7 +67,7 @@ struct SelectedLayerInfo { */ class Note : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Note) public: /** possible keys */ enum Key { C=KEY_MIN, Cs, D, Ef, E, F, Fs, G, Af, A, Bf, B }; diff --git a/src/core/Basics/Pattern.cpp b/src/core/Basics/Pattern.cpp index bd57c7814..f51d90777 100644 --- a/src/core/Basics/Pattern.cpp +++ b/src/core/Basics/Pattern.cpp @@ -36,10 +36,8 @@ namespace H2Core { -const char* Pattern::__class_name = "Pattern"; - Pattern::Pattern( const QString& name, const QString& info, const QString& category, int length, int denominator ) - : Object( __class_name ) + : Object() , __length( length ) , __denominator( denominator) , __name( name ) @@ -49,7 +47,7 @@ Pattern::Pattern( const QString& name, const QString& info, const QString& categ } Pattern::Pattern( Pattern* other ) - : Object( __class_name ) + : Object() , __length( other->get_length() ) , __denominator( other->get_denominator() ) , __name( other->get_name() ) diff --git a/src/core/Basics/Pattern.h b/src/core/Basics/Pattern.h index 502170187..33ad8ea45 100644 --- a/src/core/Basics/Pattern.h +++ b/src/core/Basics/Pattern.h @@ -41,7 +41,7 @@ Pattern class is a Note container */ class Pattern : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Pattern) public: ///< multimap note type typedef std::multimap notes_t; diff --git a/src/core/Basics/PatternList.cpp b/src/core/Basics/PatternList.cpp index 4fd8b17af..64c714b2a 100644 --- a/src/core/Basics/PatternList.cpp +++ b/src/core/Basics/PatternList.cpp @@ -31,13 +31,12 @@ namespace H2Core { -const char* PatternList::__class_name = "PatternList"; -PatternList::PatternList() : Object( __class_name ) +PatternList::PatternList() : Object() { } -PatternList::PatternList( PatternList* other ) : Object( __class_name ) +PatternList::PatternList( PatternList* other ) : Object() { assert( __patterns.size() == 0 ); for ( int i=0; isize(); i++ ) { diff --git a/src/core/Basics/PatternList.h b/src/core/Basics/PatternList.h index 091ec95a8..881614d16 100644 --- a/src/core/Basics/PatternList.h +++ b/src/core/Basics/PatternList.h @@ -38,7 +38,7 @@ class AudioEngineLocking; */ class PatternList : public H2Core::Object, public H2Core::AudioEngineLocking { - H2_OBJECT + H2_OBJECT(PatternList) public: /** constructor */ PatternList(); diff --git a/src/core/Basics/Playlist.cpp b/src/core/Basics/Playlist.cpp index 2b17ad09f..e4a5da5cf 100644 --- a/src/core/Basics/Playlist.cpp +++ b/src/core/Basics/Playlist.cpp @@ -33,10 +33,8 @@ namespace H2Core Playlist* Playlist::__instance = nullptr; -const char* Playlist::__class_name = "Playlist"; - Playlist::Playlist() - : Object( __class_name ) + : Object() { __filename = ""; m_nSelectedSongNumber = -1; diff --git a/src/core/Basics/Playlist.h b/src/core/Basics/Playlist.h index d48f2c4a1..fc95f59fd 100644 --- a/src/core/Basics/Playlist.h +++ b/src/core/Basics/Playlist.h @@ -34,7 +34,7 @@ namespace H2Core class Playlist : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Playlist) public: struct Entry diff --git a/src/core/Basics/Sample.cpp b/src/core/Basics/Sample.cpp index a7e16ec40..0eb6ad1a0 100644 --- a/src/core/Basics/Sample.cpp +++ b/src/core/Basics/Sample.cpp @@ -39,9 +39,6 @@ namespace H2Core { -const char* Sample::__class_name = "Sample"; -const char* EnvelopePoint::__class_name = "EnvolopePoint"; - const std::vector Sample::__loop_modes = { "forward", "reverse", "pingpong" }; #if defined(H2CORE_HAVE_RUBBERBAND) || _DOXYGEN_ @@ -51,15 +48,15 @@ static RubberBand::RubberBandStretcher::Options compute_rubberband_options( cons /* EnvelopePoint */ -EnvelopePoint::EnvelopePoint() : Object( EnvelopePoint::__class_name ), frame( 0 ), value( 0 ) +EnvelopePoint::EnvelopePoint() : Object(), frame( 0 ), value( 0 ) { } -EnvelopePoint::EnvelopePoint( int f, int v ) : Object( EnvelopePoint::__class_name ), frame( f ), value( v ) +EnvelopePoint::EnvelopePoint( int f, int v ) : Object(), frame( f ), value( v ) { } -EnvelopePoint::EnvelopePoint( const EnvelopePoint & other ) : Object( EnvelopePoint::__class_name ) +EnvelopePoint::EnvelopePoint( const EnvelopePoint & other ) : Object() { frame = other.frame; value = other.value; @@ -67,7 +64,7 @@ EnvelopePoint::EnvelopePoint( const EnvelopePoint & other ) : Object( EnvelopePo /* EnvelopePoint */ -Sample::Sample( const QString& filepath, int frames, int sample_rate, float* data_l, float* data_r ) : Object( Sample::__class_name ), +Sample::Sample( const QString& filepath, int frames, int sample_rate, float* data_l, float* data_r ) : Object(), __filepath( filepath ), __frames( frames ), __sample_rate( sample_rate ), @@ -78,7 +75,7 @@ Sample::Sample( const QString& filepath, int frames, int sample_rate, float* da assert( filepath.lastIndexOf( "/" ) >0 ); } -Sample::Sample( std::shared_ptr pOther ): Object( __class_name ), +Sample::Sample( std::shared_ptr pOther ): Object(), __filepath( pOther->get_filepath() ), __frames( pOther->get_frames() ), __sample_rate( pOther->get_sample_rate() ), diff --git a/src/core/Basics/Sample.h b/src/core/Basics/Sample.h index d53eb4a3b..3fc8f0266 100644 --- a/src/core/Basics/Sample.h +++ b/src/core/Basics/Sample.h @@ -39,7 +39,7 @@ namespace H2Core /** an envelope point within a frame */ class EnvelopePoint : public H2Core::Object { - H2_OBJECT + H2_OBJECT(EnvelopePoint) public: int frame; ///< frame index int value; ///< value @@ -64,7 +64,7 @@ class EnvelopePoint : public H2Core::Object class Sample : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Sample) public: /** define the type used to store pan envelope points */ diff --git a/src/core/Basics/Song.cpp b/src/core/Basics/Song.cpp index 67def762d..af0760888 100644 --- a/src/core/Basics/Song.cpp +++ b/src/core/Basics/Song.cpp @@ -62,10 +62,8 @@ namespace namespace H2Core { -const char* Song::__class_name = "Song"; - Song::Song( const QString& sName, const QString& sAuthor, float fBpm, float fVolume ) - : Object( __class_name ) + : Object() , m_bIsMuted( false ) , m_resolution( 48 ) , m_fBpm( fBpm ) @@ -627,10 +625,8 @@ bool Song::pasteInstrumentLineFromString( const QString& sSerialized, int nSelec // Implementation of SongReader class //----------------------------------------------------------------------------- -const char* SongReader::__class_name = "SongReader"; - SongReader::SongReader() - : Object( __class_name ) + : Object() { // infoLog("init"); } diff --git a/src/core/Basics/Song.h b/src/core/Basics/Song.h index ec65955d5..7554839dc 100644 --- a/src/core/Basics/Song.h +++ b/src/core/Basics/Song.h @@ -54,7 +54,7 @@ class AutomationPath; */ class Song : public H2Core::Object, public std::enable_shared_from_this { - H2_OBJECT + H2_OBJECT(Song) public: enum SongMode { PATTERN_MODE, @@ -556,7 +556,7 @@ inline float Song::getPanLawKNorm() const { */ class SongReader : public H2Core::Object { - H2_OBJECT + H2_OBJECT(SongReader) public: SongReader(); ~SongReader(); diff --git a/src/core/CoreActionController.cpp b/src/core/CoreActionController.cpp index 5870b6aaa..491659f6e 100644 --- a/src/core/CoreActionController.cpp +++ b/src/core/CoreActionController.cpp @@ -42,10 +42,8 @@ namespace H2Core { -const char* CoreActionController::__class_name = "CoreActionController"; - -CoreActionController::CoreActionController() : Object( __class_name ), +CoreActionController::CoreActionController() : Object(), m_nDefaultMidiFeedbackChannel(0) { //nothing diff --git a/src/core/CoreActionController.h b/src/core/CoreActionController.h index 0454bfc2b..5a757ae5b 100644 --- a/src/core/CoreActionController.h +++ b/src/core/CoreActionController.h @@ -30,7 +30,7 @@ namespace H2Core { class CoreActionController : public H2Core::Object { - H2_OBJECT + H2_OBJECT(CoreActionController) public: CoreActionController(); diff --git a/src/core/EventQueue.cpp b/src/core/EventQueue.cpp index e34ed938f..223bb0fd3 100644 --- a/src/core/EventQueue.cpp +++ b/src/core/EventQueue.cpp @@ -34,10 +34,9 @@ void EventQueue::create_instance() } } -const char* EventQueue::__class_name = "EventQueue"; EventQueue::EventQueue() - : Object( __class_name ) + : Object() , __read_index( 0 ) , __write_index( 0 ) { diff --git a/src/core/EventQueue.h b/src/core/EventQueue.h index 0b8273aad..b8c5a3e5a 100644 --- a/src/core/EventQueue.h +++ b/src/core/EventQueue.h @@ -185,7 +185,7 @@ class Event * documentation of HydrogenApp::onEventQueueTimer().*/ class EventQueue : public H2Core::Object { - H2_OBJECT + H2_OBJECT(EventQueue) public:/** * If #__instance equals 0, a new EventQueue singleton will be * created and stored in it. diff --git a/src/core/FX/Effects.cpp b/src/core/FX/Effects.cpp index 7fa4bf9a7..05c168c50 100644 --- a/src/core/FX/Effects.cpp +++ b/src/core/FX/Effects.cpp @@ -42,10 +42,9 @@ namespace H2Core // static data Effects* Effects::__instance = nullptr; -const char* Effects::__class_name = "Effects"; Effects::Effects() - : Object( __class_name ) + : Object() , m_pRootGroup( nullptr ) , m_pRecentGroup( nullptr ) { diff --git a/src/core/FX/Effects.h b/src/core/FX/Effects.h index 2e5989043..f2cad00ba 100644 --- a/src/core/FX/Effects.h +++ b/src/core/FX/Effects.h @@ -37,7 +37,7 @@ namespace H2Core { class Effects : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Effects) public: /** * If #__instance equals 0, a new Effects diff --git a/src/core/FX/LadspaFX.h b/src/core/FX/LadspaFX.h index aa654720a..05b0c5181 100644 --- a/src/core/FX/LadspaFX.h +++ b/src/core/FX/LadspaFX.h @@ -37,7 +37,7 @@ namespace H2Core class LadspaFXInfo : public H2Core::Object { - H2_OBJECT + H2_OBJECT(LadspaFXInfo) public: LadspaFXInfo( const QString& sName ); ~LadspaFXInfo(); @@ -59,7 +59,7 @@ class LadspaFXInfo : public H2Core::Object class LadspaFXGroup : public H2Core::Object { - H2_OBJECT + H2_OBJECT(LadspaFXGroup) public: LadspaFXGroup( const QString& sName ); ~LadspaFXGroup(); @@ -97,7 +97,7 @@ class LadspaFXGroup : public H2Core::Object class LadspaControlPort : public H2Core::Object { - H2_OBJECT + H2_OBJECT(LadspaControlPort) public: QString sName; bool isToggle; @@ -107,14 +107,14 @@ class LadspaControlPort : public H2Core::Object LADSPA_Data fLowerBound; LADSPA_Data fUpperBound; - LadspaControlPort() : Object( "LadspaControlPort" ) { } + LadspaControlPort() : Object( ) { } }; class LadspaFX : public H2Core::Object { - H2_OBJECT + H2_OBJECT(LadspaFX) public: enum { MONO_FX, diff --git a/src/core/FX/LadspaFx.cpp b/src/core/FX/LadspaFx.cpp index 0351fd62c..b7fb60813 100644 --- a/src/core/FX/LadspaFx.cpp +++ b/src/core/FX/LadspaFx.cpp @@ -35,10 +35,8 @@ namespace H2Core { -const char* LadspaFXGroup::__class_name = "LadspaFXGroup"; - LadspaFXGroup::LadspaFXGroup( const QString& sName ) - : Object( __class_name ) + : Object() { // infoLog( "INIT - " + sName ); m_sName = sName; @@ -82,10 +80,9 @@ void LadspaFXGroup::sort() //////////////// -const char* LadspaFXInfo::__class_name = "LadspaFXInfo"; LadspaFXInfo::LadspaFXInfo( const QString& sName ) - : Object( __class_name ) + : Object() { // infoLog( "INIT - " + sName ); m_sFilename = ""; @@ -112,11 +109,9 @@ bool LadspaFXInfo::alphabeticOrder( LadspaFXInfo* a, LadspaFXInfo* b ) /////////////////// -const char* LadspaFX::__class_name = "LadspaFX"; - // ctor LadspaFX::LadspaFX( const QString& sLibraryPath, const QString& sPluginLabel ) - : Object( __class_name ) + : Object() //, m_nBufferSize( 0 ) , m_pBuffer_L( nullptr ) , m_pBuffer_R( nullptr ) diff --git a/src/core/Helpers/Files.cpp b/src/core/Helpers/Files.cpp index 988f880e3..c585b8c22 100644 --- a/src/core/Helpers/Files.cpp +++ b/src/core/Helpers/Files.cpp @@ -30,7 +30,6 @@ namespace H2Core { - const char* Files::__class_name = "Files"; QString Files::savePattern( SaveMode mode, const QString& fileName, const Pattern* pPattern, std::shared_ptr pSong, const QString& drumkitName ) { diff --git a/src/core/Helpers/Files.h b/src/core/Helpers/Files.h index 3c838ed00..7a1dfdaaa 100644 --- a/src/core/Helpers/Files.h +++ b/src/core/Helpers/Files.h @@ -38,7 +38,7 @@ class Song; */ class Files : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Files) public: enum SaveMode { SAVE_NEW, // construct regular path, do not overwrite diff --git a/src/core/Helpers/Filesystem.cpp b/src/core/Helpers/Filesystem.cpp index 0a9f51705..0ba1ca8eb 100644 --- a/src/core/Helpers/Filesystem.cpp +++ b/src/core/Helpers/Filesystem.cpp @@ -80,7 +80,6 @@ namespace H2Core { Logger* Filesystem::__logger = nullptr; -const char* Filesystem::__class_name = "Filesystem"; const QString Filesystem::scripts_ext = ".sh"; const QString Filesystem::songs_ext = ".h2song"; diff --git a/src/core/Helpers/Filesystem.h b/src/core/Helpers/Filesystem.h index 8967399c3..acce8535a 100644 --- a/src/core/Helpers/Filesystem.h +++ b/src/core/Helpers/Filesystem.h @@ -34,7 +34,7 @@ namespace H2Core */ class Filesystem : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Filesystem) public: /** flags available for check_permissions() */ enum file_perms { diff --git a/src/core/Helpers/Legacy.cpp b/src/core/Helpers/Legacy.cpp index 499d5d3d9..edddd93c2 100644 --- a/src/core/Helpers/Legacy.cpp +++ b/src/core/Helpers/Legacy.cpp @@ -42,7 +42,6 @@ namespace H2Core { -const char* Legacy::__class_name = "Legacy"; Drumkit* Legacy::load_drumkit( const QString& dk_path ) { if ( version_older_than( 0, 9, 8 ) ) { diff --git a/src/core/Helpers/Legacy.h b/src/core/Helpers/Legacy.h index 334c9b0fb..f42cc3698 100644 --- a/src/core/Helpers/Legacy.h +++ b/src/core/Helpers/Legacy.h @@ -36,7 +36,7 @@ class InstrumentList; * Legacy is a container for legacy code which should be once removed */ class Legacy : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Legacy) public: /** * load drumkit information from a file diff --git a/src/core/Helpers/Xml.cpp b/src/core/Helpers/Xml.cpp index 9455bc61e..e9343e9de 100644 --- a/src/core/Helpers/Xml.cpp +++ b/src/core/Helpers/Xml.cpp @@ -55,10 +55,9 @@ class SilentMessageHandler : public QAbstractMessageHandler }; -const char* XMLNode::__class_name ="XMLNode"; -XMLNode::XMLNode() : Object( __class_name ) { } -XMLNode::XMLNode( QDomNode node ) : Object( __class_name ), QDomNode( node ) { } +XMLNode::XMLNode() : Object() { } +XMLNode::XMLNode( QDomNode node ) : Object(), QDomNode( node ) { } XMLNode XMLNode::createNode( const QString& name ) { @@ -200,9 +199,8 @@ void XMLNode::write_bool( const QString& name, const bool value ) write_child_node( name, QString( ( value ? "true" : "false" ) ) ); } -const char* XMLDoc::__class_name ="XMLDoc"; -XMLDoc::XMLDoc( ) : Object( __class_name ) { } +XMLDoc::XMLDoc( ) : Object() { } bool XMLDoc::read( const QString& filepath, const QString& schemapath ) { diff --git a/src/core/Helpers/Xml.h b/src/core/Helpers/Xml.h index ea2e5451a..251e9e3ce 100644 --- a/src/core/Helpers/Xml.h +++ b/src/core/Helpers/Xml.h @@ -35,7 +35,7 @@ namespace H2Core */ class XMLNode : public H2Core::Object, public QDomNode { - H2_OBJECT + H2_OBJECT(XMLNode) public: /** basic constructor */ XMLNode( ); @@ -150,7 +150,7 @@ class XMLNode : public H2Core::Object, public QDomNode */ class XMLDoc : public H2Core::Object, public QDomDocument { - H2_OBJECT + H2_OBJECT(XMLDoc) public: /** basic constructor */ XMLDoc( ); diff --git a/src/core/Hydrogen.cpp b/src/core/Hydrogen.cpp index 2eb90773c..ae30f2f90 100644 --- a/src/core/Hydrogen.cpp +++ b/src/core/Hydrogen.cpp @@ -101,10 +101,9 @@ namespace H2Core //---------------------------------------------------------------------------- Hydrogen* Hydrogen::__instance = nullptr; -const char* Hydrogen::__class_name = "Hydrogen"; Hydrogen::Hydrogen() - : Object( __class_name ) + : Object() { if ( __instance ) { ERRORLOG( "Hydrogen audio engine is already running" ); diff --git a/src/core/Hydrogen.h b/src/core/Hydrogen.h index ba6bed630..bd23e5037 100644 --- a/src/core/Hydrogen.h +++ b/src/core/Hydrogen.h @@ -50,7 +50,7 @@ namespace H2Core /// class Hydrogen : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Hydrogen) public: /** diff --git a/src/core/IO/AlsaAudioDriver.cpp b/src/core/IO/AlsaAudioDriver.cpp index 0bfc3a3a9..ba5e1d08f 100644 --- a/src/core/IO/AlsaAudioDriver.cpp +++ b/src/core/IO/AlsaAudioDriver.cpp @@ -111,10 +111,8 @@ void* alsaAudioDriver_processCaller( void* param ) } -const char* AlsaAudioDriver::__class_name = "AlsaAudioDriver"; - AlsaAudioDriver::AlsaAudioDriver( audioProcessCallback processCallback ) - : AudioOutput( __class_name ) + : AudioOutput() , m_bIsRunning( false ) , m_pOut_L( nullptr ) , m_pOut_R( nullptr ) diff --git a/src/core/IO/AlsaAudioDriver.h b/src/core/IO/AlsaAudioDriver.h index 19fafefd3..ce44d8cb5 100644 --- a/src/core/IO/AlsaAudioDriver.h +++ b/src/core/IO/AlsaAudioDriver.h @@ -35,7 +35,7 @@ namespace H2Core class AlsaAudioDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(AlsaAudioDriver) public: snd_pcm_t *m_pPlayback_handle; bool m_bIsRunning; @@ -74,7 +74,7 @@ namespace H2Core { class AlsaAudioDriver : public NullDriver { - H2_OBJECT + H2_OBJECT(AlsaAudioDriver) public: AlsaAudioDriver( audioProcessCallback processCallback ) : NullDriver( processCallback ) {} diff --git a/src/core/IO/AlsaMidiDriver.cpp b/src/core/IO/AlsaMidiDriver.cpp index 8636b9d92..9dc708431 100644 --- a/src/core/IO/AlsaMidiDriver.cpp +++ b/src/core/IO/AlsaMidiDriver.cpp @@ -197,10 +197,8 @@ void* alsaMidiDriver_thread( void* param ) -const char* AlsaMidiDriver::__class_name = "AlsaMidiDriver"; - AlsaMidiDriver::AlsaMidiDriver() - : MidiInput( __class_name ), MidiOutput( __class_name ), Object( __class_name ) + : MidiInput(), MidiOutput(), Object() { // infoLog("INIT"); } diff --git a/src/core/IO/AlsaMidiDriver.h b/src/core/IO/AlsaMidiDriver.h index 74814a0d7..5d94eceaa 100644 --- a/src/core/IO/AlsaMidiDriver.h +++ b/src/core/IO/AlsaMidiDriver.h @@ -41,7 +41,7 @@ namespace H2Core /// class AlsaMidiDriver : public virtual MidiInput, public virtual MidiOutput { - H2_OBJECT + H2_OBJECT(AlsaMidiDriver) public: AlsaMidiDriver(); virtual ~AlsaMidiDriver(); diff --git a/src/core/IO/AudioOutput.h b/src/core/IO/AudioOutput.h index 2972a3a7a..c9f0d8eaa 100644 --- a/src/core/IO/AudioOutput.h +++ b/src/core/IO/AudioOutput.h @@ -37,12 +37,13 @@ typedef int ( *audioProcessCallback )( uint32_t, void * ); /// class AudioOutput : public H2Core::Object { + H2_OBJECT(AudioOutput) public: /** Local instance of the TransportInfo. */ TransportInfo m_transport; - AudioOutput( const char* class_name ) - : Object( class_name ) { } + AudioOutput() + : Object() { } virtual ~AudioOutput() { } diff --git a/src/core/IO/CoreAudioDriver.cpp b/src/core/IO/CoreAudioDriver.cpp index 7e67713a4..380e65700 100644 --- a/src/core/IO/CoreAudioDriver.cpp +++ b/src/core/IO/CoreAudioDriver.cpp @@ -59,8 +59,6 @@ static OSStatus renderProc( namespace H2Core { -const char* CoreAudioDriver::__class_name = "CoreAudioDriver"; - void CoreAudioDriver::retrieveDefaultDevice(void) { diff --git a/src/core/IO/CoreAudioDriver.h b/src/core/IO/CoreAudioDriver.h index ed9ce8667..102f2a149 100644 --- a/src/core/IO/CoreAudioDriver.h +++ b/src/core/IO/CoreAudioDriver.h @@ -49,7 +49,7 @@ namespace H2Core class CoreAudioDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(CoreAudioDriver) public: audioProcessCallback mProcessCallback; @@ -99,7 +99,7 @@ class CoreAudioDriver : public AudioOutput class CoreAudioDriver : public NullDriver { - H2_OBJECT + H2_OBJECT(CoreAudioDriver) public: CoreAudioDriver( audioProcessCallback processCallback ) : NullDriver ( processCallback ) {} diff --git a/src/core/IO/CoreMidiDriver.cpp b/src/core/IO/CoreMidiDriver.cpp index 63120846d..db8818128 100644 --- a/src/core/IO/CoreMidiDriver.cpp +++ b/src/core/IO/CoreMidiDriver.cpp @@ -98,10 +98,8 @@ static void midiProc ( const MIDIPacketList * pktlist, } -const char* CoreMidiDriver::__class_name = "CoreMidiDriver"; - CoreMidiDriver::CoreMidiDriver() - : MidiInput( __class_name ) ,MidiOutput( __class_name ), Object( __class_name ) + : MidiInput( __class_name ) ,MidiOutput( __class_name ), Object() , m_bRunning( false ) { INFOLOG( "INIT" ); diff --git a/src/core/IO/CoreMidiDriver.h b/src/core/IO/CoreMidiDriver.h index 9801b1792..83eb735ab 100644 --- a/src/core/IO/CoreMidiDriver.h +++ b/src/core/IO/CoreMidiDriver.h @@ -40,7 +40,7 @@ namespace H2Core class CoreMidiDriver : public virtual MidiInput, public virtual MidiOutput { - H2_OBJECT + H2_OBJECT(CoreMidiDriver) public: CoreMidiDriver(); ~CoreMidiDriver(); diff --git a/src/core/IO/DiskWriterDriver.cpp b/src/core/IO/DiskWriterDriver.cpp index a6053da66..16b75f23d 100644 --- a/src/core/IO/DiskWriterDriver.cpp +++ b/src/core/IO/DiskWriterDriver.cpp @@ -280,10 +280,8 @@ void* diskWriterDriver_thread( void* param ) -const char* DiskWriterDriver::__class_name = "DiskWriterDriver"; - DiskWriterDriver::DiskWriterDriver( audioProcessCallback processCallback, unsigned nSamplerate, int nSampleDepth ) - : AudioOutput( __class_name ) + : AudioOutput() , m_nSampleRate( nSamplerate ) , m_nSampleDepth ( nSampleDepth ) , m_processCallback( processCallback ) diff --git a/src/core/IO/DiskWriterDriver.h b/src/core/IO/DiskWriterDriver.h index a14ebd8b9..7a13549fb 100644 --- a/src/core/IO/DiskWriterDriver.h +++ b/src/core/IO/DiskWriterDriver.h @@ -38,7 +38,7 @@ namespace H2Core /// class DiskWriterDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(DiskWriterDriver) public: unsigned m_nSampleRate; diff --git a/src/core/IO/FakeDriver.cpp b/src/core/IO/FakeDriver.cpp index 891726803..846b53d6a 100644 --- a/src/core/IO/FakeDriver.cpp +++ b/src/core/IO/FakeDriver.cpp @@ -25,10 +25,8 @@ namespace H2Core { -const char* FakeDriver::__class_name = "FakeDiskDriver"; - FakeDriver::FakeDriver( audioProcessCallback processCallback ) - : AudioOutput( __class_name ) + : AudioOutput() , m_processCallback( processCallback ) , m_pOut_L( nullptr ) , m_pOut_R( nullptr ) diff --git a/src/core/IO/FakeDriver.h b/src/core/IO/FakeDriver.h index 091a18c04..7ed63a60a 100644 --- a/src/core/IO/FakeDriver.h +++ b/src/core/IO/FakeDriver.h @@ -33,7 +33,7 @@ namespace H2Core */ class FakeDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(FakeDriver) public: FakeDriver( audioProcessCallback processCallback ); ~FakeDriver(); diff --git a/src/core/IO/JackAudioDriver.cpp b/src/core/IO/JackAudioDriver.cpp index b021496d3..c8bac4831 100644 --- a/src/core/IO/JackAudioDriver.cpp +++ b/src/core/IO/JackAudioDriver.cpp @@ -85,14 +85,13 @@ void JackAudioDriver::jackDriverShutdown( void* arg ) } -const char* JackAudioDriver::__class_name = "JackAudioDriver"; unsigned long JackAudioDriver::jackServerSampleRate = 0; jack_nframes_t JackAudioDriver::jackServerBufferSize = 0; JackAudioDriver* JackAudioDriver::pJackDriverInstance = nullptr; int JackAudioDriver::nWaits = 0; JackAudioDriver::JackAudioDriver( JackProcessCallback m_processCallback ) - : AudioOutput( __class_name ), + : AudioOutput(), m_frameOffset( 0 ), m_nTrackPortCount( 0 ), m_pClient( nullptr ), diff --git a/src/core/IO/JackAudioDriver.h b/src/core/IO/JackAudioDriver.h index 3c3c147ed..7c443a055 100644 --- a/src/core/IO/JackAudioDriver.h +++ b/src/core/IO/JackAudioDriver.h @@ -114,7 +114,7 @@ class InstrumentComponent; */ class JackAudioDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(JackAudioDriver) public: /** * Whether Hydrogen or another program is Jack timebase master. @@ -942,7 +942,7 @@ class JackAudioDriver : public AudioOutput namespace H2Core { class JackAudioDriver : public NullDriver { - H2_OBJECT + H2_OBJECT(JackAudioDriver) public: /** * Whether Hydrogen or another program is Jack timebase master. diff --git a/src/core/IO/JackMidiDriver.cpp b/src/core/IO/JackMidiDriver.cpp index 229e1fc0c..a2661c609 100644 --- a/src/core/IO/JackMidiDriver.cpp +++ b/src/core/IO/JackMidiDriver.cpp @@ -43,8 +43,6 @@ namespace H2Core { -const char* JackMidiDriver::__class_name = "JackMidiDriver"; - void JackMidiDriver::lock(void) { @@ -338,7 +336,7 @@ JackMidiShutdown(void *arg) } JackMidiDriver::JackMidiDriver() - : MidiInput( __class_name ), MidiOutput( __class_name ), Object( __class_name ) + : MidiInput(), MidiOutput(), Object() { pthread_mutex_init(&mtx, nullptr); diff --git a/src/core/IO/JackMidiDriver.h b/src/core/IO/JackMidiDriver.h index 49bb2ee12..8c6256c97 100644 --- a/src/core/IO/JackMidiDriver.h +++ b/src/core/IO/JackMidiDriver.h @@ -48,7 +48,7 @@ namespace H2Core class JackMidiDriver : public virtual MidiInput, public virtual MidiOutput { - H2_OBJECT + H2_OBJECT(JackMidiDriver) public: JackMidiDriver(); virtual ~JackMidiDriver(); diff --git a/src/core/IO/MidiInput.cpp b/src/core/IO/MidiInput.cpp index ea5d9e806..9bfd52d3d 100644 --- a/src/core/IO/MidiInput.cpp +++ b/src/core/IO/MidiInput.cpp @@ -34,8 +34,8 @@ namespace H2Core { -MidiInput::MidiInput( const char* class_name ) - : Object( class_name ) +MidiInput::MidiInput() + : Object() , m_bActive( false ) , __hihat_cc_openess ( 127 ) , __noteOffTick( 0 ) diff --git a/src/core/IO/MidiInput.h b/src/core/IO/MidiInput.h index 64278de37..acec70a17 100644 --- a/src/core/IO/MidiInput.h +++ b/src/core/IO/MidiInput.h @@ -37,7 +37,7 @@ namespace H2Core class MidiInput : public virtual Object { public: - MidiInput( const char* class_name ); + MidiInput(); virtual ~MidiInput(); virtual void open() = 0; diff --git a/src/core/IO/MidiOutput.cpp b/src/core/IO/MidiOutput.cpp index 335ca5d4e..1ee8afcb5 100644 --- a/src/core/IO/MidiOutput.cpp +++ b/src/core/IO/MidiOutput.cpp @@ -25,8 +25,8 @@ namespace H2Core { -MidiOutput::MidiOutput( const char* class_name ) - : Object( class_name ) +MidiOutput::MidiOutput() + : Object() { //INFOLOG( "INIT" ); } diff --git a/src/core/IO/MidiOutput.h b/src/core/IO/MidiOutput.h index 4da3aa0e8..827250954 100644 --- a/src/core/IO/MidiOutput.h +++ b/src/core/IO/MidiOutput.h @@ -38,8 +38,9 @@ class Note; */ class MidiOutput : public virtual Object { + H2_OBJECT(MidiOutput) public: - MidiOutput( const char* class_name ); + MidiOutput(); virtual ~MidiOutput(); virtual std::vector getInputPortList() = 0; diff --git a/src/core/IO/NullDriver.cpp b/src/core/IO/NullDriver.cpp index 7ec66d362..1f3be230e 100644 --- a/src/core/IO/NullDriver.cpp +++ b/src/core/IO/NullDriver.cpp @@ -27,10 +27,8 @@ namespace H2Core { -const char* NullDriver::__class_name = "NullDriver"; - NullDriver::NullDriver( audioProcessCallback processCallback ) - : AudioOutput( __class_name ) + : AudioOutput() { UNUSED( processCallback ); // INFOLOG( "INIT" ); diff --git a/src/core/IO/NullDriver.h b/src/core/IO/NullDriver.h index 7c25e4986..1478c7ff1 100644 --- a/src/core/IO/NullDriver.h +++ b/src/core/IO/NullDriver.h @@ -35,7 +35,7 @@ typedef int ( *audioProcessCallback )( uint32_t, void * ); class NullDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(NullDriver) public: NullDriver( audioProcessCallback processCallback ); ~NullDriver(); diff --git a/src/core/IO/OssDriver.cpp b/src/core/IO/OssDriver.cpp index d3dda68f6..23cf7d0c4 100644 --- a/src/core/IO/OssDriver.cpp +++ b/src/core/IO/OssDriver.cpp @@ -67,9 +67,6 @@ void* ossDriver_processCaller( void* param ) } - -const char* OssDriver::__class_name = "OssDriver"; - OssDriver::OssDriver( audioProcessCallback processCallback ) : AudioOutput( __class_name ) { diff --git a/src/core/IO/OssDriver.h b/src/core/IO/OssDriver.h index 058cdc1ef..f66acd900 100644 --- a/src/core/IO/OssDriver.h +++ b/src/core/IO/OssDriver.h @@ -62,7 +62,7 @@ namespace H2Core /// class OssDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(OssDriver) public: OssDriver( audioProcessCallback processCallback ); ~OssDriver(); @@ -102,7 +102,7 @@ namespace H2Core { class OssDriver : public NullDriver { - H2_OBJECT + H2_OBJECT(OssDriver) public: OssDriver( audioProcessCallback processCallback ) : NullDriver( processCallback ) {} diff --git a/src/core/IO/PortAudioDriver.h b/src/core/IO/PortAudioDriver.h index 60de94b37..b94428fee 100644 --- a/src/core/IO/PortAudioDriver.h +++ b/src/core/IO/PortAudioDriver.h @@ -38,7 +38,7 @@ namespace H2Core class PortAudioDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(PortAudioDriver) public: audioProcessCallback m_processCallback; float* m_pOut_L; @@ -77,7 +77,7 @@ namespace H2Core class PortAudioDriver : public NullDriver { - H2_OBJECT + H2_OBJECT(PortAudioDriver) public: PortAudioDriver( audioProcessCallback processCallback ) : NullDriver( processCallback ) {} diff --git a/src/core/IO/PortMidiDriver.h b/src/core/IO/PortMidiDriver.h index e0a533b55..b0d78a058 100644 --- a/src/core/IO/PortMidiDriver.h +++ b/src/core/IO/PortMidiDriver.h @@ -34,7 +34,7 @@ namespace H2Core class PortMidiDriver : public virtual MidiInput, public virtual MidiOutput { - H2_OBJECT + H2_OBJECT(PortMidiDriver) public: PmStream *m_pMidiIn; PmStream *m_pMidiOut; diff --git a/src/core/IO/PortaudioDriver.cpp b/src/core/IO/PortaudioDriver.cpp index e247a2e2b..75a2dd270 100644 --- a/src/core/IO/PortaudioDriver.cpp +++ b/src/core/IO/PortaudioDriver.cpp @@ -51,10 +51,8 @@ int portAudioCallback( } -const char* PortAudioDriver::__class_name = "PortAudioDriver"; - PortAudioDriver::PortAudioDriver( audioProcessCallback processCallback ) - : AudioOutput( __class_name ) + : AudioOutput() , m_processCallback( processCallback ) , m_pOut_L( nullptr ) , m_pOut_R( nullptr ) diff --git a/src/core/IO/PortmidiDriver.cpp b/src/core/IO/PortmidiDriver.cpp index dffbffb0a..4cad71aed 100644 --- a/src/core/IO/PortmidiDriver.cpp +++ b/src/core/IO/PortmidiDriver.cpp @@ -118,10 +118,8 @@ void* PortMidiDriver_thread( void* param ) return nullptr; } -const char* PortMidiDriver::__class_name = "PortMidiDriver"; - PortMidiDriver::PortMidiDriver() - : MidiInput( __class_name ), MidiOutput( __class_name ), Object( __class_name ) + : MidiInput(), MidiOutput(), Object() , m_bRunning( false ) , m_pMidiIn( nullptr ) , m_pMidiOut( nullptr ) diff --git a/src/core/IO/PulseAudioDriver.cpp b/src/core/IO/PulseAudioDriver.cpp index 712353b82..b71ed687e 100644 --- a/src/core/IO/PulseAudioDriver.cpp +++ b/src/core/IO/PulseAudioDriver.cpp @@ -32,7 +32,7 @@ namespace H2Core { PulseAudioDriver::PulseAudioDriver(audioProcessCallback processCallback) - : AudioOutput("PulseAudioDriver"), + : AudioOutput(), m_callback(processCallback), m_main_loop(nullptr), m_ctx(nullptr), diff --git a/src/core/IO/PulseAudioDriver.h b/src/core/IO/PulseAudioDriver.h index cd08f6e3e..dc374a2b6 100644 --- a/src/core/IO/PulseAudioDriver.h +++ b/src/core/IO/PulseAudioDriver.h @@ -40,7 +40,7 @@ namespace H2Core /// class PulseAudioDriver : public AudioOutput { - H2_OBJECT + H2_OBJECT(PulseAudioDriver) public: PulseAudioDriver(audioProcessCallback processCallback); ~PulseAudioDriver(); @@ -94,7 +94,7 @@ class PulseAudioDriver : public AudioOutput namespace H2Core { class PulseAudioDriver : public NullDriver { - H2_OBJECT + H2_OBJECT(PulseAudioDriver) public: PulseAudioDriver( audioProcessCallback processCallback ) : NullDriver( processCallback ) {} diff --git a/src/core/IO/TransportInfo.cpp b/src/core/IO/TransportInfo.cpp index 1cedd5274..e725015d8 100644 --- a/src/core/IO/TransportInfo.cpp +++ b/src/core/IO/TransportInfo.cpp @@ -25,10 +25,8 @@ namespace H2Core { -const char* TransportInfo::__class_name = "TransportInfo"; - TransportInfo::TransportInfo() - : Object( __class_name ) + : Object() { // INFOLOG( "INIT" ); m_status = STOPPED; diff --git a/src/core/IO/TransportInfo.h b/src/core/IO/TransportInfo.h index 3e7ae2c4b..0ef0b6336 100644 --- a/src/core/IO/TransportInfo.h +++ b/src/core/IO/TransportInfo.h @@ -34,7 +34,7 @@ namespace H2Core */ class TransportInfo : public H2Core::Object { - H2_OBJECT + H2_OBJECT(TransportInfo) public: enum { /** The audio engine is playing back or processing audio diff --git a/src/core/LocalFileMgr.cpp b/src/core/LocalFileMgr.cpp index 8e545e396..1e2fb0f48 100644 --- a/src/core/LocalFileMgr.cpp +++ b/src/core/LocalFileMgr.cpp @@ -58,10 +58,9 @@ namespace H2Core { -const char* LocalFileMng::__class_name = "LocalFileMng"; LocalFileMng::LocalFileMng() - : Object( __class_name ) + : Object() { // infoLog("INIT"); } @@ -357,10 +356,8 @@ QDomDocument LocalFileMng::openXmlDocument( const QString& filename ) // Implementation of SongWriter class //----------------------------------------------------------------------------- -const char* SongWriter::__class_name = "SongWriter"; - SongWriter::SongWriter() - : Object( __class_name ) + : Object() { // infoLog("init"); } diff --git a/src/core/LocalFileMng.h b/src/core/LocalFileMng.h index cbe2793dd..6de97b544 100644 --- a/src/core/LocalFileMng.h +++ b/src/core/LocalFileMng.h @@ -50,7 +50,7 @@ class Drumkit; */ class LocalFileMng : public H2Core::Object { - H2_OBJECT + H2_OBJECT(LocalFileMng) public: LocalFileMng(); ~LocalFileMng(); @@ -83,7 +83,7 @@ class LocalFileMng : public H2Core::Object */ class SongWriter : public H2Core::Object { - H2_OBJECT + H2_OBJECT(SongWriter) public: SongWriter(); ~SongWriter(); diff --git a/src/core/MidiAction.cpp b/src/core/MidiAction.cpp index e33521462..e9a0db9e0 100644 --- a/src/core/MidiAction.cpp +++ b/src/core/MidiAction.cpp @@ -66,9 +66,7 @@ using namespace H2Core; * */ -const char* Action::__class_name = "MidiAction"; - -Action::Action( QString typeString ) : Object( __class_name ) { +Action::Action( QString typeString ) : Object() { m_sType = typeString; m_sParameter1 = "0"; m_sParameter2 = "0"; @@ -88,9 +86,8 @@ Action::Action( QString typeString ) : Object( __class_name ) { * */ MidiActionManager* MidiActionManager::__instance = nullptr; -const char* MidiActionManager::__class_name = "ActionManager"; -MidiActionManager::MidiActionManager() : Object( __class_name ) { +MidiActionManager::MidiActionManager() : Object() { __instance = this; m_nLastBpmChangeCCParameter = -1; diff --git a/src/core/MidiAction.h b/src/core/MidiAction.h index e5168e362..38fd6de45 100644 --- a/src/core/MidiAction.h +++ b/src/core/MidiAction.h @@ -27,7 +27,7 @@ #include class Action : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Action) public: Action( QString ); @@ -64,7 +64,7 @@ namespace H2Core class MidiActionManager : public H2Core::Object { - H2_OBJECT + H2_OBJECT(MidiActionManager) private: /** * Object holding the current MidiActionManager diff --git a/src/core/MidiMap.cpp b/src/core/MidiMap.cpp index 560f7086a..99fb5440d 100644 --- a/src/core/MidiMap.cpp +++ b/src/core/MidiMap.cpp @@ -42,10 +42,9 @@ */ MidiMap * MidiMap::__instance = nullptr; -const char* MidiMap::__class_name = "MidiMap"; MidiMap::MidiMap() - : Object( __class_name ) + : Object() { __instance = this; QMutexLocker mx(&__mutex); diff --git a/src/core/MidiMap.h b/src/core/MidiMap.h index c7b2bda1b..ed3828a7b 100644 --- a/src/core/MidiMap.h +++ b/src/core/MidiMap.h @@ -33,7 +33,7 @@ class Action; class MidiMap : public H2Core::Object { - H2_OBJECT + H2_OBJECT(MidiMap) public: typedef std::map< QString, Action* > map_t; /** diff --git a/src/core/NsmClient.cpp b/src/core/NsmClient.cpp index 23380350d..7ffb3f4a0 100644 --- a/src/core/NsmClient.cpp +++ b/src/core/NsmClient.cpp @@ -39,12 +39,11 @@ #if defined(H2CORE_HAVE_OSC) || _DOXYGEN_ NsmClient * NsmClient::__instance = nullptr; -const char* NsmClient::__class_name = "NsmClient"; bool NsmClient::bNsmShutdown = false; NsmClient::NsmClient() - : Object( __class_name ), + : Object(), m_pNsm( nullptr ), m_bUnderSessionManagement( false ), m_NsmThread( 0 ), diff --git a/src/core/NsmClient.h b/src/core/NsmClient.h index 2d7e4a93a..63e4c59a3 100644 --- a/src/core/NsmClient.h +++ b/src/core/NsmClient.h @@ -56,7 +56,7 @@ class NsmClient : public H2Core::Object { - H2_OBJECT + H2_OBJECT(NsmClient) public: /** * Object holding the current NsmClient singleton. It diff --git a/src/core/Object.cpp b/src/core/Object.cpp index c9252c48d..90488ef8b 100644 --- a/src/core/Object.cpp +++ b/src/core/Object.cpp @@ -66,13 +66,13 @@ Object::~Object( ) { #endif } -Object::Object( const Object& obj ) : __class_name( obj.__class_name ) { +Object::Object( const Object& obj ) { #ifdef H2CORE_HAVE_DEBUG if( __count ) add_object( this, true ); #endif } -Object::Object( const char* class_name ) :__class_name( class_name ) { +Object::Object() { #ifdef H2CORE_HAVE_DEBUG if( __count ) add_object( this, false ); #endif diff --git a/src/core/Object.h b/src/core/Object.h index 71b6c5ab8..b19d8a19b 100644 --- a/src/core/Object.h +++ b/src/core/Object.h @@ -44,7 +44,7 @@ class Object { /** copy constructor */ Object( const Object& obj ); /** constructor */ - Object( const char* class_name ); + explicit Object(); /** an objects class map item type */ typedef struct { @@ -54,7 +54,7 @@ class Object { /** the objects class map type */ typedef std::map object_map_t; - const char* class_name( ) const { return __class_name; } ///< return the class name + static const char* class_name( ) { return "Object"; } ///< return the class name /** * enable/disable class instances counting * \param flag the counting status to set @@ -123,7 +123,6 @@ class Object { */ static void add_object( const Object* obj, bool copy ); - const char* __class_name; ///< the object class name static bool __count; ///< should we count class instances static int __objects_count; ///< total objects count static object_map_t __objects_map; ///< objects classes and instances count structure @@ -148,9 +147,8 @@ inline QDebug operator<<( QDebug d, std::shared_ptr o ) { } // Object inherited class declaration macro -#define H2_OBJECT \ - public: static const char* class_name() { return __class_name; } \ - private: static const char* __class_name; \ +#define H2_OBJECT(name) \ + public: static const char* class_name() { return #name; } \ // LOG MACROS #define __LOG_METHOD( lvl, msg ) if( __logger->should_log( (lvl) ) ) { __logger->log( (lvl), class_name(), __FUNCTION__, QString( "%1" ).arg( msg ) ); } diff --git a/src/core/OscServer.cpp b/src/core/OscServer.cpp index 2c4ae2031..708ee2389 100644 --- a/src/core/OscServer.cpp +++ b/src/core/OscServer.cpp @@ -42,7 +42,6 @@ #include "core/MidiAction.h" OscServer * OscServer::__instance = nullptr; -const char* OscServer::__class_name = "OscServer"; QString OscServer::qPrettyPrint(lo_type type,void * data) @@ -261,7 +260,7 @@ int OscServer::generic_handler(const char * path, -OscServer::OscServer( H2Core::Preferences* pPreferences ) : Object( __class_name ), +OscServer::OscServer( H2Core::Preferences* pPreferences ) : Object(), m_bInitialized( false ) { m_pPreferences = pPreferences; diff --git a/src/core/OscServer.h b/src/core/OscServer.h index dd8b2ea39..123db870a 100644 --- a/src/core/OscServer.h +++ b/src/core/OscServer.h @@ -87,7 +87,7 @@ namespace H2Core */ class OscServer : public H2Core::Object { - H2_OBJECT + H2_OBJECT(OscServer) public: /** * Object holding the current OscServer singleton. It is diff --git a/src/core/Preferences.cpp b/src/core/Preferences.cpp index 4fd7505d1..9b7c1e2f5 100644 --- a/src/core/Preferences.cpp +++ b/src/core/Preferences.cpp @@ -57,10 +57,8 @@ void Preferences::create_instance() } } -const char* Preferences::__class_name = "Preferences"; - Preferences::Preferences() - : Object( __class_name ) + : Object() { __instance = this; INFOLOG( "INIT" ); @@ -1345,10 +1343,8 @@ void Preferences::readUIStyle( QDomNode parent ) -const char* WindowProperties::__class_name = "WindowProperties"; - WindowProperties::WindowProperties() - : Object( __class_name ) + : Object() { // infoLog( "INIT" ); x = 0; @@ -1371,10 +1367,8 @@ WindowProperties::~WindowProperties() // ::::::::::::::::::::::::::::::: -const char* UIStyle::__class_name = "UIStyle"; - UIStyle::UIStyle() - : Object( __class_name ) + : Object() { // infoLog( "INIT" ); } diff --git a/src/core/Preferences.h b/src/core/Preferences.h index 3c7775b0a..81ac58bc5 100644 --- a/src/core/Preferences.h +++ b/src/core/Preferences.h @@ -48,7 +48,7 @@ const float FALLOFF_FAST = 1.5f; */ class WindowProperties : public H2Core::Object { - H2_OBJECT + H2_OBJECT(WindowProperties) public: int x; int y; @@ -73,7 +73,7 @@ class WindowProperties : public H2Core::Object */ class UIStyle : public H2Core::Object { - H2_OBJECT + H2_OBJECT(UIStyle) public: UIStyle(); QColor m_songEditor_backgroundColor; @@ -108,7 +108,7 @@ class UIStyle : public H2Core::Object */ class Preferences : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Preferences) public: enum { /** diff --git a/src/core/Sampler/Sampler.cpp b/src/core/Sampler/Sampler.cpp index 7ee448b35..60eb4aec9 100644 --- a/src/core/Sampler/Sampler.cpp +++ b/src/core/Sampler/Sampler.cpp @@ -54,8 +54,6 @@ namespace H2Core { -const char* Sampler::__class_name = "Sampler"; - static std::shared_ptr createInstrument(int id, const QString& filepath, float volume ) { auto pInstrument = std::make_shared( id, filepath ); @@ -69,7 +67,7 @@ static std::shared_ptr createInstrument(int id, const QString& filep } Sampler::Sampler() - : Object( __class_name ) + : Object() , m_pMainOut_L( nullptr ) , m_pMainOut_R( nullptr ) , m_pPreviewInstrument( nullptr ) diff --git a/src/core/Sampler/Sampler.h b/src/core/Sampler/Sampler.h index 8879e3a74..bccad5fa2 100644 --- a/src/core/Sampler/Sampler.h +++ b/src/core/Sampler/Sampler.h @@ -49,7 +49,7 @@ class AudioOutput; /// class Sampler : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Sampler) public: /** PAN LAWS diff --git a/src/core/Smf/SMF.h b/src/core/Smf/SMF.h index 7fde65970..f071ac92e 100644 --- a/src/core/Smf/SMF.h +++ b/src/core/Smf/SMF.h @@ -38,7 +38,7 @@ class Instrument; class SMFHeader : public SMFBase, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SMFHeader) public: SMFHeader( int nFormat, int nTracks, int nTPQN ); ~SMFHeader(); @@ -56,7 +56,7 @@ class SMFHeader : public SMFBase, public H2Core::Object class SMFTrack : public SMFBase, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SMFTrack) public: SMFTrack(); @@ -74,7 +74,7 @@ class SMFTrack : public SMFBase, public H2Core::Object class SMF : public SMFBase, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SMF) public: SMF( int nFormat, int nTPQN ); ~SMF(); @@ -95,9 +95,9 @@ typedef std::vector EventList; class SMFWriter : public H2Core::Object { - H2_OBJECT + H2_OBJECT(SMFWriter) public: - SMFWriter( const char* sWriterName ); + SMFWriter(); virtual ~SMFWriter(); void save( const QString& sFilename, std::shared_ptr pSong ); @@ -119,9 +119,9 @@ class SMFWriter : public H2Core::Object class SMF1Writer : public SMFWriter { - H2_OBJECT + H2_OBJECT(SMF1Writer) public: - SMF1Writer( const char* sWriterName ); + SMF1Writer(); virtual ~SMF1Writer(); protected: virtual SMF* createSMF( std::shared_ptr pSong ); @@ -130,7 +130,7 @@ class SMF1Writer : public SMFWriter class SMF1WriterSingle : public SMF1Writer { - H2_OBJECT + H2_OBJECT(SMF1WriterSingle) public: SMF1WriterSingle(); virtual ~SMF1WriterSingle(); @@ -145,7 +145,7 @@ class SMF1WriterSingle : public SMF1Writer class SMF1WriterMulti : public SMF1Writer { - H2_OBJECT + H2_OBJECT(SMF1WriterMulti) public: SMF1WriterMulti(); virtual ~SMF1WriterMulti(); @@ -163,7 +163,7 @@ class SMF1WriterMulti : public SMF1Writer class SMF0Writer : public SMFWriter { - H2_OBJECT + H2_OBJECT(SMF0Writer) public: SMF0Writer(); virtual ~SMF0Writer(); diff --git a/src/core/Smf/SMFEvent.h b/src/core/Smf/SMFEvent.h index ae459256c..65c544ba5 100644 --- a/src/core/Smf/SMFEvent.h +++ b/src/core/Smf/SMFEvent.h @@ -31,7 +31,7 @@ namespace H2Core class SMFBuffer : public H2Core::Object { - H2_OBJECT + H2_OBJECT(SMFBuffer) public: std::vector getBuffer() { return m_buffer; @@ -84,9 +84,9 @@ class SMFBase class SMFEvent : public SMFBase, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SMFEvent) public: - SMFEvent( const char* sEventName, unsigned nTicks ); + SMFEvent(unsigned nTicks ); virtual ~SMFEvent(); int m_nTicks; @@ -97,7 +97,7 @@ class SMFEvent : public SMFBase, public H2Core::Object class SMFTrackNameMetaEvent : public SMFEvent { - H2_OBJECT + H2_OBJECT(SMFTrackNameMetaEvent) public: SMFTrackNameMetaEvent( const QString& sTrackName, unsigned nDeltaTime ); virtual std::vector getBuffer(); @@ -111,7 +111,7 @@ class SMFTrackNameMetaEvent : public SMFEvent class SMFSetTempoMetaEvent : public SMFEvent { - H2_OBJECT + H2_OBJECT(SMFSetTempoMetaEvent) public: SMFSetTempoMetaEvent( float fBPM, unsigned nDeltaTime ); virtual std::vector getBuffer(); @@ -125,7 +125,7 @@ class SMFSetTempoMetaEvent : public SMFEvent class SMFCopyRightNoticeMetaEvent : public SMFEvent { - H2_OBJECT + H2_OBJECT(SMFCopyRightNoticeMetaEvent) public: SMFCopyRightNoticeMetaEvent( const QString& sAuthor, unsigned nDeltaTime ); virtual std::vector getBuffer(); @@ -139,7 +139,7 @@ class SMFCopyRightNoticeMetaEvent : public SMFEvent class SMFTimeSignatureMetaEvent : public SMFEvent { - H2_OBJECT + H2_OBJECT(SMFTimeSignatureMetaEvent) public: SMFTimeSignatureMetaEvent( unsigned nBeats, unsigned nNote , unsigned nMTPMC , unsigned nTSNP24 , unsigned nTicks ); virtual std::vector getBuffer(); @@ -153,7 +153,7 @@ class SMFTimeSignatureMetaEvent : public SMFEvent class SMFNoteOnEvent : public SMFEvent { - H2_OBJECT + H2_OBJECT(SMFNoteOnEvent) public: SMFNoteOnEvent( unsigned nTicks, int nChannel, int nPitch, int nVelocity ); @@ -169,7 +169,7 @@ class SMFNoteOnEvent : public SMFEvent class SMFNoteOffEvent : public SMFEvent { - H2_OBJECT + H2_OBJECT(SMFNoteOffEvent) public: SMFNoteOffEvent( unsigned nTicks, int nChannel, int nPitch, int nVelocity ); diff --git a/src/core/Smf/Smf.cpp b/src/core/Smf/Smf.cpp index 61ad675a3..fe793267e 100644 --- a/src/core/Smf/Smf.cpp +++ b/src/core/Smf/Smf.cpp @@ -32,10 +32,8 @@ namespace H2Core { -const char* SMFHeader::__class_name = "SMFHeader"; - SMFHeader::SMFHeader( int nFormat, int nTracks, int nTPQN ) - : Object( __class_name ) + : Object() , m_nFormat( nFormat ) , m_nTracks( nTracks ) , m_nTPQN( nTPQN ) @@ -70,12 +68,8 @@ std::vector SMFHeader::getBuffer() // ::::::::::::::: - -const char* SMFTrack::__class_name = "SMFTrack"; - -//SMFTrack::SMFTrack( const QString& sTrackName ) SMFTrack::SMFTrack() - : Object( __class_name ) + : Object() { INFOLOG( "INIT" ); } @@ -143,10 +137,8 @@ void SMFTrack::addEvent( SMFEvent *pEvent ) // :::::::::::::::::::::: -const char* SMF::__class_name = "SMF"; - SMF::SMF(int nFormat, int nTPQN ) - : Object( __class_name ) + : Object() { INFOLOG( "INIT" ); @@ -207,10 +199,8 @@ constexpr unsigned int TPQN = 192; constexpr unsigned int DRUM_CHANNEL = 9; constexpr unsigned int NOTE_LENGTH = 12; -const char* SMFWriter::__class_name = "SMFWriter"; - -SMFWriter::SMFWriter( const char* sWriterName ) - : Object( sWriterName ) +SMFWriter::SMFWriter() + : Object() { INFOLOG( "INIT" ); } @@ -364,10 +354,8 @@ void SMFWriter::saveSMF( const QString& sFilename, SMF* pSmf ) // SMF1Writer - base class for two smf1 writers -const char* SMF1Writer::__class_name = "SMF1Writer"; - -SMF1Writer::SMF1Writer( const char* sWriterName ) - : SMFWriter( sWriterName ) +SMF1Writer::SMF1Writer() + : SMFWriter() { } @@ -393,10 +381,8 @@ SMF* SMF1Writer::createSMF( std::shared_ptr pSong ){ // SMF1 MIDI SINGLE EXPROT -const char* SMF1WriterSingle::__class_name = "SMFWriterSingle"; - SMF1WriterSingle::SMF1WriterSingle() - : SMF1Writer( __class_name ), + : SMF1Writer(), m_eventList() { } @@ -448,10 +434,8 @@ void SMF1WriterSingle::packEvents( std::shared_ptr pSong, SMF* pSmf ) // SMF1 MIDI MULTI EXPORT -const char* SMF1WriterMulti::__class_name = "SMFWriterMulti"; - SMF1WriterMulti::SMF1WriterMulti() - : SMF1Writer( __class_name ), + : SMF1Writer(), m_eventLists() { } @@ -516,10 +500,8 @@ void SMF1WriterMulti::packEvents( std::shared_ptr pSong, SMF* pSmf ) // SMF0 MIDI EXPORT -const char* SMF0Writer::__class_name = "SMF0Writer"; - SMF0Writer::SMF0Writer() - : SMFWriter( __class_name ), + : SMFWriter(), m_pTrack( nullptr ), m_eventList() { diff --git a/src/core/Smf/SmfEvent.cpp b/src/core/Smf/SmfEvent.cpp index d1ebcab42..7b15fb1d8 100644 --- a/src/core/Smf/SmfEvent.cpp +++ b/src/core/Smf/SmfEvent.cpp @@ -26,9 +26,7 @@ namespace H2Core { -const char* SMFBuffer::__class_name = "SMFBuffer"; - -SMFBuffer::SMFBuffer() : Object( __class_name ) { } +SMFBuffer::SMFBuffer() : Object() { } void SMFBuffer::writeByte( short int nByte ) { @@ -95,10 +93,8 @@ void SMFBuffer::writeVarLen( long value ) // :::::::::::::::::: -const char* SMFTrackNameMetaEvent::__class_name = "SMFTrackNameMetaEvent"; - SMFTrackNameMetaEvent::SMFTrackNameMetaEvent( const QString& sTrackName, unsigned nTicks ) - : SMFEvent( __class_name, nTicks ) + : SMFEvent( nTicks ) , m_sTrackName( sTrackName ) { // it's always at the start of the song @@ -119,10 +115,8 @@ std::vector SMFTrackNameMetaEvent::getBuffer() // :::::::::::::::::: -const char* SMFSetTempoMetaEvent::__class_name = "SMFSetTempoMetaEvent"; - SMFSetTempoMetaEvent::SMFSetTempoMetaEvent( float fBPM, unsigned nTicks ) - : SMFEvent( __class_name, nTicks ) + : SMFEvent( nTicks ) , m_fBPM( fBPM ) { // it's always at the start of the song @@ -151,10 +145,8 @@ std::vector SMFSetTempoMetaEvent::getBuffer() // :::::::::::::::::: -const char* SMFCopyRightNoticeMetaEvent::__class_name = "SMFCopyRightNoticeMetaEvent"; - SMFCopyRightNoticeMetaEvent::SMFCopyRightNoticeMetaEvent( const QString& sAuthor, unsigned nTicks ) - : SMFEvent( __class_name, nTicks ) + : SMFEvent( nTicks ) , m_sAuthor( sAuthor ) { // it's always at the start of the song @@ -186,10 +178,8 @@ std::vector SMFCopyRightNoticeMetaEvent::getBuffer() // :::::::::::::::::: -const char* SMFTimeSignatureMetaEvent::__class_name = "SMFTimeSignatureMetaEvent"; - SMFTimeSignatureMetaEvent::SMFTimeSignatureMetaEvent( unsigned nBeats, unsigned nNote , unsigned nMTPMC , unsigned nTSNP24 , unsigned nTicks ) - : SMFEvent( __class_name, nTicks ) + : SMFEvent( nTicks ) , m_nBeats( nBeats ) , m_nNote( nNote ) , m_nMTPMC( nMTPMC ) @@ -225,8 +215,8 @@ std::vector SMFTimeSignatureMetaEvent::getBuffer() // ::::::::::::: -SMFEvent::SMFEvent( const char* sEventName, unsigned nTicks ) - : Object( sEventName ) +SMFEvent::SMFEvent( unsigned nTicks ) + : Object( ) , m_nTicks( nTicks ) , m_nDeltaTime( -1 ) { @@ -243,10 +233,8 @@ SMFEvent::~SMFEvent() // :::::::::::::: -const char* SMFNoteOnEvent::__class_name = "SMFNoteOnEvent"; - SMFNoteOnEvent::SMFNoteOnEvent( unsigned nTicks, int nChannel, int nPitch, int nVelocity ) - : SMFEvent( __class_name, nTicks ) + : SMFEvent( nTicks ) , m_nChannel( nChannel ) , m_nPitch( nPitch ) , m_nVelocity( nVelocity ) @@ -273,10 +261,8 @@ std::vector SMFNoteOnEvent::getBuffer() // ::::::::::: -const char* SMFNoteOffEvent::__class_name = "SMFNoteOffEvent"; - SMFNoteOffEvent::SMFNoteOffEvent( unsigned nTicks, int nChannel, int nPitch, int nVelocity ) - : SMFEvent( __class_name, nTicks ) + : SMFEvent( nTicks ) , m_nChannel( nChannel ) , m_nPitch( nPitch ) , m_nVelocity( nVelocity ) diff --git a/src/core/Synth/Synth.cpp b/src/core/Synth/Synth.cpp index 47487e645..a62a75008 100644 --- a/src/core/Synth/Synth.cpp +++ b/src/core/Synth/Synth.cpp @@ -31,10 +31,8 @@ namespace H2Core { -const char* Synth::__class_name = "Synth"; - Synth::Synth() - : Object( __class_name ) + : Object() { INFOLOG( "INIT" ); diff --git a/src/core/Synth/Synth.h b/src/core/Synth/Synth.h index 48179f7a2..21444c862 100644 --- a/src/core/Synth/Synth.h +++ b/src/core/Synth/Synth.h @@ -40,7 +40,7 @@ class AudioOutput; /// class Synth : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Synth) public: float *m_pOut_L; float *m_pOut_R; diff --git a/src/core/Timeline.cpp b/src/core/Timeline.cpp index a4834c4a5..26ee85f27 100644 --- a/src/core/Timeline.cpp +++ b/src/core/Timeline.cpp @@ -26,9 +26,8 @@ namespace H2Core { - const char* Timeline::__class_name = "Timeline"; - Timeline::Timeline() : Object( __class_name ) + Timeline::Timeline() : Object( ) { } diff --git a/src/core/Timeline.h b/src/core/Timeline.h index e42cc2d46..7d9886e04 100644 --- a/src/core/Timeline.h +++ b/src/core/Timeline.h @@ -39,7 +39,7 @@ namespace H2Core */ class Timeline : public H2Core::Object { - H2_OBJECT + H2_OBJECT(Timeline) public: Timeline(); diff --git a/src/gui/src/AboutDialogContributorList.cpp b/src/gui/src/AboutDialogContributorList.cpp index a2ec440c7..718422ec1 100644 --- a/src/gui/src/AboutDialogContributorList.cpp +++ b/src/gui/src/AboutDialogContributorList.cpp @@ -23,9 +23,7 @@ */ #include "AboutDialogContributorList.h" -const char* AboutDialogContributorList::__class_name = "AboutDialogContributorList"; - -AboutDialogContributorList::AboutDialogContributorList() : H2Core::Object( __class_name ) { +AboutDialogContributorList::AboutDialogContributorList() : H2Core::Object() { std::vector v{ "theGreatWhiteShark" diff --git a/src/gui/src/AboutDialogContributorList.h b/src/gui/src/AboutDialogContributorList.h index 0b3d922da..19f62f447 100644 --- a/src/gui/src/AboutDialogContributorList.h +++ b/src/gui/src/AboutDialogContributorList.h @@ -30,7 +30,7 @@ class AboutDialogContributorList : public H2Core::Object { -H2_OBJECT +H2_OBJECT(AboutDialogContributorList) public: AboutDialogContributorList(); ~AboutDialogContributorList(); diff --git a/src/gui/src/AudioEngineInfoForm.cpp b/src/gui/src/AudioEngineInfoForm.cpp index 62169e1cc..7101858e7 100644 --- a/src/gui/src/AudioEngineInfoForm.cpp +++ b/src/gui/src/AudioEngineInfoForm.cpp @@ -40,11 +40,10 @@ using namespace H2Core; #include "Skin.h" -const char* AudioEngineInfoForm::__class_name = "AudioEngineInfoForm"; AudioEngineInfoForm::AudioEngineInfoForm(QWidget* parent) : QWidget( parent ) - , Object( __class_name ) + , Object() { setupUi( this ); adjustSize(); diff --git a/src/gui/src/AudioEngineInfoForm.h b/src/gui/src/AudioEngineInfoForm.h index 4a7b20994..acbb55346 100644 --- a/src/gui/src/AudioEngineInfoForm.h +++ b/src/gui/src/AudioEngineInfoForm.h @@ -37,7 +37,7 @@ */ class AudioEngineInfoForm : public QWidget, public Ui_AudioEngineInfoForm_UI, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(AudioEngineInfoForm) Q_OBJECT private: QTimer* m_pTimer; diff --git a/src/gui/src/AudioFileBrowser/AudioFileBrowser.cpp b/src/gui/src/AudioFileBrowser/AudioFileBrowser.cpp index 9a4989a41..7f1d340b1 100644 --- a/src/gui/src/AudioFileBrowser/AudioFileBrowser.cpp +++ b/src/gui/src/AudioFileBrowser/AudioFileBrowser.cpp @@ -38,11 +38,9 @@ using namespace H2Core; -const char* AudioFileBrowser::__class_name = "AudioFileBrowser"; - AudioFileBrowser::AudioFileBrowser ( QWidget* pParent, bool bAllowMultiSelect, bool bShowInstrumentManipulationControls) : QDialog ( pParent ) - , Object ( __class_name ) + , Object () { setupUi ( this ); INFOLOG ( "INIT" ); diff --git a/src/gui/src/AudioFileBrowser/AudioFileBrowser.h b/src/gui/src/AudioFileBrowser/AudioFileBrowser.h index 84d17ec86..8450652fe 100644 --- a/src/gui/src/AudioFileBrowser/AudioFileBrowser.h +++ b/src/gui/src/AudioFileBrowser/AudioFileBrowser.h @@ -40,7 +40,7 @@ class SampleWaveDisplay; class AudioFileBrowser : public QDialog, public Ui_AudioFileBrowser_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(AudioFileBrowser) Q_OBJECT public: diff --git a/src/gui/src/AudioFileBrowser/SampleWaveDisplay.cpp b/src/gui/src/AudioFileBrowser/SampleWaveDisplay.cpp index c44b64201..67b97ec21 100644 --- a/src/gui/src/AudioFileBrowser/SampleWaveDisplay.cpp +++ b/src/gui/src/AudioFileBrowser/SampleWaveDisplay.cpp @@ -28,11 +28,9 @@ using namespace H2Core; #include "SampleWaveDisplay.h" #include "../Skin.h" -const char* SampleWaveDisplay::__class_name = "SampleWaveDisplay"; - SampleWaveDisplay::SampleWaveDisplay(QWidget* pParent) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_sSampleName( "" ) { // setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/src/gui/src/AudioFileBrowser/SampleWaveDisplay.h b/src/gui/src/AudioFileBrowser/SampleWaveDisplay.h index fbe8cad65..0624e41cb 100644 --- a/src/gui/src/AudioFileBrowser/SampleWaveDisplay.h +++ b/src/gui/src/AudioFileBrowser/SampleWaveDisplay.h @@ -31,7 +31,7 @@ class SampleWaveDisplay : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SampleWaveDisplay) Q_OBJECT public: diff --git a/src/gui/src/Director.cpp b/src/gui/src/Director.cpp index 45bcb04f3..85f6e4d3b 100644 --- a/src/gui/src/Director.cpp +++ b/src/gui/src/Director.cpp @@ -65,7 +65,7 @@ using namespace H2Core; Director::Director ( QWidget* pParent ) : QDialog ( pParent ) - , Object ( "Director" ) + , Object () { HydrogenApp::get_instance()->addEventListener( this ); diff --git a/src/gui/src/ExportMidiDialog.cpp b/src/gui/src/ExportMidiDialog.cpp index f93a6d663..4c31ae9c7 100644 --- a/src/gui/src/ExportMidiDialog.cpp +++ b/src/gui/src/ExportMidiDialog.cpp @@ -34,8 +34,6 @@ using namespace H2Core; -const char* ExportMidiDialog::__class_name = "ExportMidiDialog"; - enum ExportModes { EXPORT_SMF1_SINGLE, EXPORT_SMF1_MULTI, EXPORT_SMF0 }; // Here we are going to store export filename @@ -43,7 +41,7 @@ QString ExportMidiDialog::sLastFilename = ""; ExportMidiDialog::ExportMidiDialog( QWidget* parent ) : QDialog( parent ) - , Object( __class_name ) + , Object() , m_pHydrogen( Hydrogen::get_instance() ) , m_pPreferences( Preferences::get_instance() ) , m_bFileSelected( false ) diff --git a/src/gui/src/ExportMidiDialog.h b/src/gui/src/ExportMidiDialog.h index 98b27e741..40b4ee215 100644 --- a/src/gui/src/ExportMidiDialog.h +++ b/src/gui/src/ExportMidiDialog.h @@ -38,7 +38,7 @@ namespace H2Core { /// class ExportMidiDialog : public QDialog, public Ui_ExportMidiDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(ExportMidiDialog) Q_OBJECT public: diff --git a/src/gui/src/ExportSongDialog.cpp b/src/gui/src/ExportSongDialog.cpp index 955f414bf..7d1622e00 100644 --- a/src/gui/src/ExportSongDialog.cpp +++ b/src/gui/src/ExportSongDialog.cpp @@ -54,8 +54,6 @@ using namespace H2Core; -const char* ExportSongDialog::__class_name = "ExportSongDialog"; - enum ExportModes { EXPORT_TO_SINGLE_TRACK, EXPORT_TO_SEPARATE_TRACKS, EXPORT_TO_BOTH }; static int interpolateModeToComboBoxIndex(Interpolation::InterpolateMode interpolateMode) @@ -88,7 +86,7 @@ QString ExportSongDialog::sLastFilename = ""; ExportSongDialog::ExportSongDialog(QWidget* parent) : QDialog(parent) - , Object( __class_name ) + , Object() , m_bExporting( false ) , m_pHydrogen( Hydrogen::get_instance() ) , m_pPreferences( Preferences::get_instance() ) diff --git a/src/gui/src/ExportSongDialog.h b/src/gui/src/ExportSongDialog.h index 71c15d9e9..799b5bff7 100644 --- a/src/gui/src/ExportSongDialog.h +++ b/src/gui/src/ExportSongDialog.h @@ -44,7 +44,7 @@ namespace H2Core { /// class ExportSongDialog : public QDialog, public Ui_ExportSongDialog_UI, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(ExportSongDialog) Q_OBJECT public: diff --git a/src/gui/src/FilesystemInfoForm.cpp b/src/gui/src/FilesystemInfoForm.cpp index 1bd5136ba..973bfab4f 100644 --- a/src/gui/src/FilesystemInfoForm.cpp +++ b/src/gui/src/FilesystemInfoForm.cpp @@ -28,11 +28,9 @@ #include "core/Helpers/Filesystem.h" -const char* FilesystemInfoForm::__class_name = "FilesystemInfoForm"; - FilesystemInfoForm::FilesystemInfoForm( QWidget *parent ) : QWidget( parent ), - H2Core::Object( __class_name ), + H2Core::Object(), ui(new Ui::FilesystemInfoForm) { ui->setupUi(this); diff --git a/src/gui/src/FilesystemInfoForm.h b/src/gui/src/FilesystemInfoForm.h index 5ade2307c..b51662e45 100644 --- a/src/gui/src/FilesystemInfoForm.h +++ b/src/gui/src/FilesystemInfoForm.h @@ -32,7 +32,7 @@ class FilesystemInfoForm; class FilesystemInfoForm : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(FilesystemInfoForm) Q_OBJECT public: diff --git a/src/gui/src/HydrogenApp.cpp b/src/gui/src/HydrogenApp.cpp index d5887019b..7545594e4 100644 --- a/src/gui/src/HydrogenApp.cpp +++ b/src/gui/src/HydrogenApp.cpp @@ -68,10 +68,9 @@ using namespace H2Core; HydrogenApp* HydrogenApp::m_pInstance = nullptr; -const char* HydrogenApp::__class_name = "HydrogenApp"; HydrogenApp::HydrogenApp( MainForm *pMainForm ) - : Object( __class_name ) + : Object() , m_pMainForm( pMainForm ) , m_pMixer( nullptr ) , m_pPatternEditorPanel( nullptr ) diff --git a/src/gui/src/HydrogenApp.h b/src/gui/src/HydrogenApp.h index 988929d9a..f727a8d0f 100644 --- a/src/gui/src/HydrogenApp.h +++ b/src/gui/src/HydrogenApp.h @@ -71,7 +71,7 @@ class InfoBar; class HydrogenApp : public QObject, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(HydrogenApp) Q_OBJECT public: HydrogenApp( MainForm* pMainForm ); diff --git a/src/gui/src/InstrumentEditor/InstrumentEditor.cpp b/src/gui/src/InstrumentEditor/InstrumentEditor.cpp index 843a65589..aa9a6b2c9 100644 --- a/src/gui/src/InstrumentEditor/InstrumentEditor.cpp +++ b/src/gui/src/InstrumentEditor/InstrumentEditor.cpp @@ -55,11 +55,9 @@ using namespace H2Core; #include "LayerPreview.h" #include "AudioFileBrowser/AudioFileBrowser.h" -const char* InstrumentEditor::__class_name = "InstrumentEditor"; - InstrumentEditor::InstrumentEditor( QWidget* pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_pInstrument( nullptr ) , m_nSelectedLayer( 0 ) { diff --git a/src/gui/src/InstrumentEditor/InstrumentEditor.h b/src/gui/src/InstrumentEditor/InstrumentEditor.h index 70c5aa14a..76a430f8e 100644 --- a/src/gui/src/InstrumentEditor/InstrumentEditor.h +++ b/src/gui/src/InstrumentEditor/InstrumentEditor.h @@ -51,7 +51,7 @@ class LayerPreview; /// class InstrumentEditor : public QWidget, protected WidgetWithScalableFont<10, 12, 14>, public H2Core::Object, public EventListener { - H2_OBJECT + H2_OBJECT(InstrumentEditor) Q_OBJECT public: diff --git a/src/gui/src/InstrumentEditor/InstrumentEditorPanel.cpp b/src/gui/src/InstrumentEditor/InstrumentEditorPanel.cpp index eaf3d464f..44bdf7775 100644 --- a/src/gui/src/InstrumentEditor/InstrumentEditorPanel.cpp +++ b/src/gui/src/InstrumentEditor/InstrumentEditorPanel.cpp @@ -33,7 +33,6 @@ InstrumentEditorPanel* InstrumentEditorPanel::m_pInstance = nullptr; -const char* InstrumentEditorPanel::__class_name = "InstrumentEditorPanel"; InstrumentEditorPanel* InstrumentEditorPanel::get_instance() { @@ -46,7 +45,7 @@ InstrumentEditorPanel* InstrumentEditorPanel::get_instance() InstrumentEditorPanel::InstrumentEditorPanel( QWidget *pParent ) - : Object( __class_name ) + : Object() { UNUSED( pParent ); diff --git a/src/gui/src/InstrumentEditor/InstrumentEditorPanel.h b/src/gui/src/InstrumentEditor/InstrumentEditorPanel.h index 4ecd14776..10a52ad76 100644 --- a/src/gui/src/InstrumentEditor/InstrumentEditorPanel.h +++ b/src/gui/src/InstrumentEditor/InstrumentEditorPanel.h @@ -35,7 +35,7 @@ /// class InstrumentEditorPanel : public QWidget, private H2Core::Object, public EventListener { - H2_OBJECT + H2_OBJECT(InstrumentEditorPanel) Q_OBJECT public: static InstrumentEditorPanel* get_instance(); diff --git a/src/gui/src/InstrumentEditor/LayerPreview.cpp b/src/gui/src/InstrumentEditor/LayerPreview.cpp index 7e376de3e..1554562b6 100644 --- a/src/gui/src/InstrumentEditor/LayerPreview.cpp +++ b/src/gui/src/InstrumentEditor/LayerPreview.cpp @@ -39,11 +39,9 @@ using namespace H2Core; #include "InstrumentEditorPanel.h" #include "LayerPreview.h" -const char* LayerPreview::__class_name = "LayerPreview"; - LayerPreview::LayerPreview( QWidget* pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_pInstrument( nullptr ) , m_nSelectedComponent( 0 ) , m_nSelectedLayer( 0 ) diff --git a/src/gui/src/InstrumentEditor/LayerPreview.h b/src/gui/src/InstrumentEditor/LayerPreview.h index eb8ad6b20..6379fe9ef 100644 --- a/src/gui/src/InstrumentEditor/LayerPreview.h +++ b/src/gui/src/InstrumentEditor/LayerPreview.h @@ -39,7 +39,7 @@ class InstrumentLayer; class LayerPreview : public QWidget, protected WidgetWithScalableFont<5, 6, 7>, public H2Core::Object, public EventListener { - H2_OBJECT + H2_OBJECT(LayerPreview) Q_OBJECT public: diff --git a/src/gui/src/InstrumentEditor/WaveDisplay.cpp b/src/gui/src/InstrumentEditor/WaveDisplay.cpp index 16b146e23..c45dabf07 100644 --- a/src/gui/src/InstrumentEditor/WaveDisplay.cpp +++ b/src/gui/src/InstrumentEditor/WaveDisplay.cpp @@ -30,11 +30,9 @@ using namespace H2Core; #include "../Skin.h" #include "../HydrogenApp.h" -const char* WaveDisplay::__class_name = "WaveDisplay"; - WaveDisplay::WaveDisplay(QWidget* pParent) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_nCurrentWidth( 0 ) , m_sSampleName( "-" ) , m_pLayer( nullptr ) diff --git a/src/gui/src/InstrumentEditor/WaveDisplay.h b/src/gui/src/InstrumentEditor/WaveDisplay.h index 983e3349c..678b07113 100644 --- a/src/gui/src/InstrumentEditor/WaveDisplay.h +++ b/src/gui/src/InstrumentEditor/WaveDisplay.h @@ -37,7 +37,7 @@ namespace H2Core class WaveDisplay : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, public H2Core::Object { - H2_OBJECT + H2_OBJECT(WaveDisplay) Q_OBJECT public: diff --git a/src/gui/src/InstrumentRack.cpp b/src/gui/src/InstrumentRack.cpp index ba10e259e..a384b64f1 100644 --- a/src/gui/src/InstrumentRack.cpp +++ b/src/gui/src/InstrumentRack.cpp @@ -29,11 +29,9 @@ #include -const char* InstrumentRack::__class_name = "InstrumentRack"; - InstrumentRack::InstrumentRack( QWidget *pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() { INFOLOG( "INIT" ); diff --git a/src/gui/src/InstrumentRack.h b/src/gui/src/InstrumentRack.h index ac49faac5..a00495eeb 100644 --- a/src/gui/src/InstrumentRack.h +++ b/src/gui/src/InstrumentRack.h @@ -36,7 +36,7 @@ class SoundLibraryPanel; class InstrumentRack : public QWidget, protected WidgetWithScalableFont<5, 6, 7>, private H2Core::Object { - H2_OBJECT + H2_OBJECT(InstrumentRack) Q_OBJECT public: explicit InstrumentRack( QWidget *pParent ); diff --git a/src/gui/src/LadspaFXProperties.cpp b/src/gui/src/LadspaFXProperties.cpp index 16ac674ed..8ad234d58 100644 --- a/src/gui/src/LadspaFXProperties.cpp +++ b/src/gui/src/LadspaFXProperties.cpp @@ -40,11 +40,9 @@ using namespace H2Core; -const char* LadspaFXProperties::__class_name = "LadspaFXProperties"; - LadspaFXProperties::LadspaFXProperties(QWidget* parent, uint nLadspaFX) : QWidget( parent ) - , Object( __class_name ) + , Object() { // INFOLOG( "INIT" ); diff --git a/src/gui/src/LadspaFXProperties.h b/src/gui/src/LadspaFXProperties.h index b275cb0d1..b4c72ae43 100644 --- a/src/gui/src/LadspaFXProperties.h +++ b/src/gui/src/LadspaFXProperties.h @@ -35,7 +35,7 @@ class LCDDisplay; class InstrumentNameWidget; class LadspaFXProperties : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(LadspaFXProperties) Q_OBJECT public: diff --git a/src/gui/src/LadspaFXSelector.cpp b/src/gui/src/LadspaFXSelector.cpp index bf9da9286..5911a6add 100644 --- a/src/gui/src/LadspaFXSelector.cpp +++ b/src/gui/src/LadspaFXSelector.cpp @@ -32,11 +32,9 @@ using namespace H2Core; -const char* LadspaFXSelector::__class_name = "LadspaFXSelector"; - LadspaFXSelector::LadspaFXSelector(int nLadspaFX) : QDialog( nullptr ) - , Object( __class_name ) + , Object() , m_pCurrentItem( nullptr ) { //INFOLOG( "INIT" ); diff --git a/src/gui/src/LadspaFXSelector.h b/src/gui/src/LadspaFXSelector.h index 679a662d1..4d75ce123 100644 --- a/src/gui/src/LadspaFXSelector.h +++ b/src/gui/src/LadspaFXSelector.h @@ -42,7 +42,7 @@ namespace H2Core { class LadspaFXSelector : public QDialog, public Ui_LadspaFXSelector_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(LadspaFXSelector) Q_OBJECT public: diff --git a/src/gui/src/MainForm.cpp b/src/gui/src/MainForm.cpp index bb19d1140..78c0ff58c 100644 --- a/src/gui/src/MainForm.cpp +++ b/src/gui/src/MainForm.cpp @@ -83,11 +83,9 @@ using namespace H2Core; int MainForm::sigusr1Fd[2]; -const char* MainForm::__class_name = "MainForm"; - MainForm::MainForm( QApplication * pQApplication ) : QMainWindow( nullptr ) - , Object( __class_name ) + , Object() { setObjectName( "MainForm" ); setMinimumSize( QSize( 1000, 500 ) ); diff --git a/src/gui/src/MainForm.h b/src/gui/src/MainForm.h index c8403555e..6bc785670 100644 --- a/src/gui/src/MainForm.h +++ b/src/gui/src/MainForm.h @@ -44,7 +44,7 @@ class QUndoView;///debug only /// class MainForm : public QMainWindow, protected WidgetWithScalableFont<8, 10, 12>, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(MainForm) Q_OBJECT public: diff --git a/src/gui/src/Mixer/Mixer.cpp b/src/gui/src/Mixer/Mixer.cpp index 5a468b0de..9108af42c 100644 --- a/src/gui/src/Mixer/Mixer.cpp +++ b/src/gui/src/Mixer/Mixer.cpp @@ -48,11 +48,9 @@ using namespace H2Core; #define MIXER_STRIP_WIDTH 56 #define MASTERMIXER_STRIP_WIDTH 126 -const char* Mixer::__class_name = "Mixer"; - Mixer::Mixer( QWidget* pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() { setWindowTitle( tr( "Mixer" ) ); setMaximumHeight( 284 ); diff --git a/src/gui/src/Mixer/Mixer.h b/src/gui/src/Mixer/Mixer.h index 1f4388563..6c729ee22 100644 --- a/src/gui/src/Mixer/Mixer.h +++ b/src/gui/src/Mixer/Mixer.h @@ -42,7 +42,7 @@ class PixmapWidget; class Mixer : public QWidget, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(Mixer) Q_OBJECT public: explicit Mixer(QWidget* parent); diff --git a/src/gui/src/Mixer/MixerLine.cpp b/src/gui/src/Mixer/MixerLine.cpp index bb95cb139..59a1b7dee 100644 --- a/src/gui/src/Mixer/MixerLine.cpp +++ b/src/gui/src/Mixer/MixerLine.cpp @@ -48,10 +48,8 @@ using namespace H2Core; using namespace H2Core; -const char* MixerLine::__class_name = "MixerLine"; - MixerLine::MixerLine(QWidget* parent, int nInstr) - : PixmapWidget( parent, __class_name ) + : PixmapWidget( parent ) { // INFOLOG( "INIT" ); @@ -414,10 +412,8 @@ void MixerLine::setSelected( bool bIsSelected ) // :::::::::::::::::::::::::::: -const char* ComponentMixerLine::__class_name = "ComponentMixerLine"; - ComponentMixerLine::ComponentMixerLine(QWidget* parent, int CompoID) - : PixmapWidget( parent, __class_name ) + : PixmapWidget( parent ) { // INFOLOG( "INIT" ); @@ -632,10 +628,9 @@ float ComponentMixerLine::getPeak_R() { // :::::::::::::::::::::::::::: -const char* MasterMixerLine::__class_name = "MasterMixerLine"; MasterMixerLine::MasterMixerLine(QWidget* parent) - : PixmapWidget( parent, __class_name ) + : PixmapWidget( parent ) { m_nWidth = MASTERMIXERLINE_WIDTH; m_nHeight = MASTERMIXERLINE_HEIGHT; diff --git a/src/gui/src/Mixer/MixerLine.h b/src/gui/src/Mixer/MixerLine.h index 70ce69081..73b9fcdfc 100644 --- a/src/gui/src/Mixer/MixerLine.h +++ b/src/gui/src/Mixer/MixerLine.h @@ -45,7 +45,7 @@ class Rotary; class InstrumentNameWidget : public PixmapWidget, protected WidgetWithScalableFont<8, 10, 12> { - H2_OBJECT + H2_OBJECT(InstrumentNameWidget) Q_OBJECT public: explicit InstrumentNameWidget(QWidget* parent); @@ -85,7 +85,7 @@ public slots: /// class MixerLine: public PixmapWidget { - H2_OBJECT + H2_OBJECT(MixerLine) Q_OBJECT public: MixerLine(QWidget* parent, int nInstr); @@ -168,7 +168,7 @@ class MixerLine: public PixmapWidget class ComponentMixerLine: public PixmapWidget { - H2_OBJECT + H2_OBJECT(ComponentMixerLine) Q_OBJECT public: ComponentMixerLine(QWidget* parent, int CompoID); @@ -231,7 +231,7 @@ class ComponentMixerLine: public PixmapWidget class MasterMixerLine: public PixmapWidget { - H2_OBJECT + H2_OBJECT(MasterMixerLine) Q_OBJECT public: explicit MasterMixerLine(QWidget* parent); @@ -286,7 +286,7 @@ class MasterMixerLine: public PixmapWidget /// class FxMixerLine: public PixmapWidget { - H2_OBJECT + H2_OBJECT(FxMixerLine) Q_OBJECT public: explicit FxMixerLine(QWidget* parent); @@ -332,7 +332,7 @@ class FxMixerLine: public PixmapWidget class LadspaFXMixerLine : public PixmapWidget { - H2_OBJECT + H2_OBJECT(LadspaMixerLine) Q_OBJECT public: explicit LadspaFXMixerLine(QWidget* parent); diff --git a/src/gui/src/Mixer/MixerSettingsDialog.cpp b/src/gui/src/Mixer/MixerSettingsDialog.cpp index e42ca6509..5e1e53ac7 100644 --- a/src/gui/src/Mixer/MixerSettingsDialog.cpp +++ b/src/gui/src/Mixer/MixerSettingsDialog.cpp @@ -45,11 +45,9 @@ using namespace H2Core; -const char* MixerSettingsDialog::__class_name = "MixerSettingsDialog"; - MixerSettingsDialog::MixerSettingsDialog(QWidget* parent) : QDialog( parent ) - , Object( __class_name ) + , Object() { setupUi( this ); diff --git a/src/gui/src/Mixer/MixerSettingsDialog.h b/src/gui/src/Mixer/MixerSettingsDialog.h index cee14d843..8ba868010 100644 --- a/src/gui/src/Mixer/MixerSettingsDialog.h +++ b/src/gui/src/Mixer/MixerSettingsDialog.h @@ -33,7 +33,7 @@ /// class MixerSettingsDialog : public QDialog, private Ui_MixerSettingsDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(MixerSettingsDialog) Q_OBJECT public: explicit MixerSettingsDialog( QWidget* parent ); diff --git a/src/gui/src/PatternEditor/DrumPatternEditor.cpp b/src/gui/src/PatternEditor/DrumPatternEditor.cpp index 291253641..f44f4e18f 100644 --- a/src/gui/src/PatternEditor/DrumPatternEditor.cpp +++ b/src/gui/src/PatternEditor/DrumPatternEditor.cpp @@ -51,10 +51,8 @@ using namespace H2Core; -const char* DrumPatternEditor::__class_name = "DrumPatternEditor"; - DrumPatternEditor::DrumPatternEditor(QWidget* parent, PatternEditorPanel *panel) - : PatternEditor( parent, __class_name, panel ) + : PatternEditor( parent, panel ) { m_nGridHeight = Preferences::get_instance()->getPatternEditorGridHeight(); m_nEditorHeight = m_nGridHeight * MAX_INSTRUMENTS; diff --git a/src/gui/src/PatternEditor/DrumPatternEditor.h b/src/gui/src/PatternEditor/DrumPatternEditor.h index f790aa1cd..c654580db 100644 --- a/src/gui/src/PatternEditor/DrumPatternEditor.h +++ b/src/gui/src/PatternEditor/DrumPatternEditor.h @@ -43,7 +43,7 @@ class PatternEditorInstrumentList; /// class DrumPatternEditor : public PatternEditor, protected WidgetWithScalableFont<7, 9, 11> { - H2_OBJECT + H2_OBJECT(DrumPatternEditor) Q_OBJECT public: diff --git a/src/gui/src/PatternEditor/NotePropertiesRuler.cpp b/src/gui/src/PatternEditor/NotePropertiesRuler.cpp index bdfb98b4f..231f7eaf3 100644 --- a/src/gui/src/PatternEditor/NotePropertiesRuler.cpp +++ b/src/gui/src/PatternEditor/NotePropertiesRuler.cpp @@ -38,10 +38,8 @@ using namespace H2Core; #include "DrumPatternEditor.h" #include "PianoRollEditor.h" -const char* NotePropertiesRuler::__class_name = "NotePropertiesRuler"; - NotePropertiesRuler::NotePropertiesRuler( QWidget *parent, PatternEditorPanel *pPatternEditorPanel, NotePropertiesMode mode ) - : PatternEditor( parent, __class_name, pPatternEditorPanel ) + : PatternEditor( parent, pPatternEditorPanel ) { //infoLog("INIT"); //setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/src/gui/src/PatternEditor/NotePropertiesRuler.h b/src/gui/src/PatternEditor/NotePropertiesRuler.h index 0bde240e2..8a1f1a3e0 100644 --- a/src/gui/src/PatternEditor/NotePropertiesRuler.h +++ b/src/gui/src/PatternEditor/NotePropertiesRuler.h @@ -45,7 +45,7 @@ class PatternEditorPanel; class NotePropertiesRuler : public PatternEditor, protected WidgetWithScalableFont<7, 9, 11> { - H2_OBJECT + H2_OBJECT(NotePropertiesRuler) Q_OBJECT public: //! NotePropertiesEditor is (currently) a single class instantiated in different "modes" to select diff --git a/src/gui/src/PatternEditor/PatternEditor.cpp b/src/gui/src/PatternEditor/PatternEditor.cpp index 14f9b7a8e..93f987daf 100644 --- a/src/gui/src/PatternEditor/PatternEditor.cpp +++ b/src/gui/src/PatternEditor/PatternEditor.cpp @@ -47,12 +47,9 @@ using namespace std; using namespace H2Core; -const char* PatternEditor::__class_name = "PatternEditor"; - - -PatternEditor::PatternEditor( QWidget *pParent, const char *sClassName, +PatternEditor::PatternEditor( QWidget *pParent, PatternEditorPanel *panel ) - : Object ( sClassName ), QWidget( pParent ), m_selection( this ) { + : Object (), QWidget( pParent ), m_selection( this ) { m_nResolution = 8; m_bUseTriplets = false; m_pDraggedNote = nullptr; diff --git a/src/gui/src/PatternEditor/PatternEditor.h b/src/gui/src/PatternEditor/PatternEditor.h index 409a1ebba..184984455 100644 --- a/src/gui/src/PatternEditor/PatternEditor.h +++ b/src/gui/src/PatternEditor/PatternEditor.h @@ -57,11 +57,11 @@ class PatternEditor : public QWidget, public H2Core::Object, public SelectionWidget { - H2_OBJECT + H2_OBJECT(PatternEditor) Q_OBJECT public: - PatternEditor( QWidget *pParent, const char *sClassName, + PatternEditor( QWidget *pParent, PatternEditorPanel *panel ); diff --git a/src/gui/src/PatternEditor/PatternEditorInstrumentList.cpp b/src/gui/src/PatternEditor/PatternEditorInstrumentList.cpp index 54b0e42b7..93c0590ba 100644 --- a/src/gui/src/PatternEditor/PatternEditorInstrumentList.cpp +++ b/src/gui/src/PatternEditor/PatternEditorInstrumentList.cpp @@ -49,10 +49,9 @@ using namespace H2Core; #include #include // for std::min -const char* InstrumentLine::__class_name = "InstrumentLine"; InstrumentLine::InstrumentLine(QWidget* pParent) - : PixmapWidget(pParent, __class_name) + : PixmapWidget(pParent) , m_bIsSelected(false) { int h = Preferences::get_instance()->getPatternEditorGridHeight(); @@ -557,11 +556,9 @@ void InstrumentLine::onPreferencesChanged( bool bAppearanceOnly ) { ////// -const char* PatternEditorInstrumentList::__class_name = "PatternEditorInstrumentList"; - PatternEditorInstrumentList::PatternEditorInstrumentList( QWidget *parent, PatternEditorPanel *pPatternEditorPanel ) : QWidget( parent ) - , Object( __class_name ) + , Object() { //INFOLOG("INIT"); m_pPattern = nullptr; diff --git a/src/gui/src/PatternEditor/PatternEditorInstrumentList.h b/src/gui/src/PatternEditor/PatternEditorInstrumentList.h index 6e0cffb61..24629f1a6 100644 --- a/src/gui/src/PatternEditor/PatternEditorInstrumentList.h +++ b/src/gui/src/PatternEditor/PatternEditorInstrumentList.h @@ -47,7 +47,7 @@ class Button; class InstrumentLine : public PixmapWidget, protected WidgetWithScalableFont<8, 10, 12> { - H2_OBJECT + H2_OBJECT(InstrumentLine) Q_OBJECT public: @@ -109,7 +109,7 @@ public slots: class PatternEditorInstrumentList : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(PatternEditorInstrumentList) Q_OBJECT public: diff --git a/src/gui/src/PatternEditor/PatternEditorPanel.cpp b/src/gui/src/PatternEditor/PatternEditorPanel.cpp index 1ef50044c..998ba9dd9 100644 --- a/src/gui/src/PatternEditor/PatternEditorPanel.cpp +++ b/src/gui/src/PatternEditor/PatternEditorPanel.cpp @@ -60,12 +60,10 @@ void PatternEditorPanel::updateSLnameLabel( ) m_pSLlabel->setText( Hydrogen::get_instance()->getCurrentDrumkitName() ); } -const char* PatternEditorPanel::__class_name = "PatternEditorPanel"; - PatternEditorPanel::PatternEditorPanel( QWidget *pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_pPattern( nullptr ) { setAcceptDrops(true); diff --git a/src/gui/src/PatternEditor/PatternEditorPanel.h b/src/gui/src/PatternEditor/PatternEditorPanel.h index 3eb71b5d1..67a2eee4c 100644 --- a/src/gui/src/PatternEditor/PatternEditorPanel.h +++ b/src/gui/src/PatternEditor/PatternEditorPanel.h @@ -56,7 +56,7 @@ namespace H2Core /// class PatternEditorPanel : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(PatternEditorPanel) Q_OBJECT public: diff --git a/src/gui/src/PatternEditor/PatternEditorRuler.cpp b/src/gui/src/PatternEditor/PatternEditorRuler.cpp index 9f821bdff..e3b629cce 100644 --- a/src/gui/src/PatternEditor/PatternEditorRuler.cpp +++ b/src/gui/src/PatternEditor/PatternEditorRuler.cpp @@ -38,11 +38,9 @@ using namespace H2Core; #include "../Skin.h" -const char* PatternEditorRuler::__class_name = "PatternEditorRuler"; - PatternEditorRuler::PatternEditorRuler( QWidget* parent ) : QWidget( parent ) - , Object( __class_name ) + , Object() { setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/src/gui/src/PatternEditor/PatternEditorRuler.h b/src/gui/src/PatternEditor/PatternEditorRuler.h index 5b4b52b67..352e5a75f 100644 --- a/src/gui/src/PatternEditor/PatternEditorRuler.h +++ b/src/gui/src/PatternEditor/PatternEditorRuler.h @@ -40,7 +40,7 @@ namespace H2Core class PatternEditorRuler : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, public H2Core::Object, public EventListener { - H2_OBJECT + H2_OBJECT(PatternEditorRuler) Q_OBJECT public: diff --git a/src/gui/src/PatternEditor/PianoRollEditor.cpp b/src/gui/src/PatternEditor/PianoRollEditor.cpp index ae2884dd5..1dd3ff826 100644 --- a/src/gui/src/PatternEditor/PianoRollEditor.cpp +++ b/src/gui/src/PatternEditor/PianoRollEditor.cpp @@ -39,11 +39,9 @@ using namespace H2Core; #include "../HydrogenApp.h" -const char* PianoRollEditor::__class_name = "PianoRollEditor"; - PianoRollEditor::PianoRollEditor( QWidget *pParent, PatternEditorPanel *panel, QScrollArea *pScrollView) - : PatternEditor( pParent, __class_name, panel ) + : PatternEditor( pParent, panel ) , m_pScrollView( pScrollView ) { INFOLOG( "INIT" ); diff --git a/src/gui/src/PatternEditor/PianoRollEditor.h b/src/gui/src/PatternEditor/PianoRollEditor.h index 08035535e..f1ecb86b4 100644 --- a/src/gui/src/PatternEditor/PianoRollEditor.h +++ b/src/gui/src/PatternEditor/PianoRollEditor.h @@ -36,7 +36,7 @@ class PianoRollEditor: public PatternEditor, protected WidgetWithScalableFont<7, 9, 11> { - H2_OBJECT + H2_OBJECT(PianoRollEditor) Q_OBJECT public: PianoRollEditor( QWidget *pParent, PatternEditorPanel *panel, diff --git a/src/gui/src/PlayerControl.cpp b/src/gui/src/PlayerControl.cpp index e30f3dd9c..b4c709889 100644 --- a/src/gui/src/PlayerControl.cpp +++ b/src/gui/src/PlayerControl.cpp @@ -48,11 +48,9 @@ using namespace H2Core; int bcDisplaystatus = 0; //~ beatcounter -const char* PlayerControl::__class_name = "PlayerControl"; - PlayerControl::PlayerControl(QWidget *parent) : QLabel(parent) - , Object( __class_name ) + , Object() { setObjectName( "PlayerControl" ); HydrogenApp::get_instance()->addEventListener( this ); @@ -1156,11 +1154,9 @@ void PlayerControl::onPreferencesChanged( bool bAppearanceOnly ) { //:::::::::::::::::::::::::::::::::::::::::::::::: -const char* MetronomeWidget::__class_name = "MetronomeWidget"; - MetronomeWidget::MetronomeWidget(QWidget *pParent) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_nValue( 0 ) , m_state( METRO_OFF ) { diff --git a/src/gui/src/PlayerControl.h b/src/gui/src/PlayerControl.h index d8c8a11af..77c97542e 100644 --- a/src/gui/src/PlayerControl.h +++ b/src/gui/src/PlayerControl.h @@ -49,7 +49,7 @@ class PixmapWidget; /// class MetronomeWidget : public QWidget,public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(MetronomeWidget) Q_OBJECT public: explicit MetronomeWidget(QWidget *pParent); @@ -85,7 +85,7 @@ class MetronomeWidget : public QWidget,public EventListener, public H2Core::Obje /// class PlayerControl : public QLabel, protected WidgetWithScalableFont<5, 6, 7>, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(PlayerControl) Q_OBJECT public: explicit PlayerControl(QWidget *parent); diff --git a/src/gui/src/PlaylistEditor/PlaylistDialog.cpp b/src/gui/src/PlaylistEditor/PlaylistDialog.cpp index ab3dd812a..eba066272 100644 --- a/src/gui/src/PlaylistEditor/PlaylistDialog.cpp +++ b/src/gui/src/PlaylistEditor/PlaylistDialog.cpp @@ -52,11 +52,10 @@ using namespace H2Core; -const char* PlaylistDialog::__class_name = "PlaylistDialog"; PlaylistDialog::PlaylistDialog ( QWidget* pParent ) : QDialog ( pParent ) - , Object ( __class_name ) + , Object () { setupUi ( this ); diff --git a/src/gui/src/PlaylistEditor/PlaylistDialog.h b/src/gui/src/PlaylistEditor/PlaylistDialog.h index f95a1ba9a..645b51d22 100644 --- a/src/gui/src/PlaylistEditor/PlaylistDialog.h +++ b/src/gui/src/PlaylistEditor/PlaylistDialog.h @@ -43,7 +43,7 @@ class PixmapWidget; class PlaylistDialog : public QDialog, protected WidgetWithScalableFont<8, 10, 12>, public Ui_PlaylistDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(PlaylistDialog) Q_OBJECT public: diff --git a/src/gui/src/PreferencesDialog.cpp b/src/gui/src/PreferencesDialog.cpp index 55c26749a..a625476f4 100644 --- a/src/gui/src/PreferencesDialog.cpp +++ b/src/gui/src/PreferencesDialog.cpp @@ -47,13 +47,12 @@ using namespace H2Core; -const char* PreferencesDialog::__class_name = "PreferencesDialog"; QString PreferencesDialog::m_sColorRed = "#ca0003"; PreferencesDialog::PreferencesDialog(QWidget* parent) : QDialog( parent ) - , Object( __class_name ) + , Object() { setupUi( this ); diff --git a/src/gui/src/PreferencesDialog.h b/src/gui/src/PreferencesDialog.h index cc0c52e78..8f40f6ba6 100644 --- a/src/gui/src/PreferencesDialog.h +++ b/src/gui/src/PreferencesDialog.h @@ -36,7 +36,7 @@ /// class PreferencesDialog : public QDialog, private Ui_PreferencesDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(PreferencesDialog) Q_OBJECT public: explicit PreferencesDialog( QWidget* parent ); diff --git a/src/gui/src/SampleEditor/DetailWaveDisplay.cpp b/src/gui/src/SampleEditor/DetailWaveDisplay.cpp index 40b7076cd..ad9e063d8 100644 --- a/src/gui/src/SampleEditor/DetailWaveDisplay.cpp +++ b/src/gui/src/SampleEditor/DetailWaveDisplay.cpp @@ -28,11 +28,9 @@ using namespace H2Core; #include "DetailWaveDisplay.h" #include "../Skin.h" -const char* DetailWaveDisplay::__class_name = "DetailWaveDisplay"; - DetailWaveDisplay::DetailWaveDisplay(QWidget* pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_sSampleName( "" ) , m_pPeakDatal( nullptr ) , m_pPeakDatar( nullptr ) diff --git a/src/gui/src/SampleEditor/DetailWaveDisplay.h b/src/gui/src/SampleEditor/DetailWaveDisplay.h index be1437ddb..651f6287f 100644 --- a/src/gui/src/SampleEditor/DetailWaveDisplay.h +++ b/src/gui/src/SampleEditor/DetailWaveDisplay.h @@ -35,7 +35,7 @@ namespace H2Core class DetailWaveDisplay : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(DetailWaveDisplay) Q_OBJECT public: diff --git a/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp b/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp index 87a5bf0c8..33b7ca11e 100644 --- a/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp +++ b/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp @@ -30,11 +30,9 @@ using namespace H2Core; #include "MainSampleWaveDisplay.h" #include "../Skin.h" -const char* MainSampleWaveDisplay::__class_name = "MainSampleWaveDisplay"; - MainSampleWaveDisplay::MainSampleWaveDisplay(QWidget* pParent) : QWidget( pParent ) - , Object( __class_name ) + , Object() { // setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/src/gui/src/SampleEditor/MainSampleWaveDisplay.h b/src/gui/src/SampleEditor/MainSampleWaveDisplay.h index 780ed36bd..30c184800 100644 --- a/src/gui/src/SampleEditor/MainSampleWaveDisplay.h +++ b/src/gui/src/SampleEditor/MainSampleWaveDisplay.h @@ -32,7 +32,7 @@ class SampleEditor; class MainSampleWaveDisplay : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(MainSampleWaveDisplay) Q_OBJECT public: diff --git a/src/gui/src/SampleEditor/SampleEditor.cpp b/src/gui/src/SampleEditor/SampleEditor.cpp index ebf49ce4d..607e3e8fd 100644 --- a/src/gui/src/SampleEditor/SampleEditor.cpp +++ b/src/gui/src/SampleEditor/SampleEditor.cpp @@ -49,11 +49,10 @@ using namespace H2Core; -const char* SampleEditor::__class_name = "SampleEditor"; SampleEditor::SampleEditor ( QWidget* pParent, int nSelectedComponent, int nSelectedLayer, QString sSampleFilename ) : QDialog ( pParent ) - , Object ( __class_name ) + , Object () { setupUi ( this ); INFOLOG ( "INIT" ); diff --git a/src/gui/src/SampleEditor/SampleEditor.h b/src/gui/src/SampleEditor/SampleEditor.h index e093aede7..3854e7917 100644 --- a/src/gui/src/SampleEditor/SampleEditor.h +++ b/src/gui/src/SampleEditor/SampleEditor.h @@ -44,7 +44,7 @@ class DetailWaveDisplay; /// class SampleEditor : public QDialog, public Ui_SampleEditor_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SampleEditor) Q_OBJECT public: diff --git a/src/gui/src/SampleEditor/TargetWaveDisplay.cpp b/src/gui/src/SampleEditor/TargetWaveDisplay.cpp index 79082fa05..b5c2648fc 100644 --- a/src/gui/src/SampleEditor/TargetWaveDisplay.cpp +++ b/src/gui/src/SampleEditor/TargetWaveDisplay.cpp @@ -42,11 +42,9 @@ using namespace H2Core; static TargetWaveDisplay::EnvelopeEditMode getEnvelopeEditMode(); -const char* TargetWaveDisplay::__class_name = "TargetWaveDisplay"; - TargetWaveDisplay::TargetWaveDisplay(QWidget* pParent) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_sSampleName( "" ) { // setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/src/gui/src/SampleEditor/TargetWaveDisplay.h b/src/gui/src/SampleEditor/TargetWaveDisplay.h index c1b3f3db7..52471b9cc 100644 --- a/src/gui/src/SampleEditor/TargetWaveDisplay.h +++ b/src/gui/src/SampleEditor/TargetWaveDisplay.h @@ -40,7 +40,7 @@ namespace H2Core class TargetWaveDisplay : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(TargetWaveDisplay) Q_OBJECT public: diff --git a/src/gui/src/SongEditor/PatternFillDialog.cpp b/src/gui/src/SongEditor/PatternFillDialog.cpp index c397a9884..be62eb088 100644 --- a/src/gui/src/SongEditor/PatternFillDialog.cpp +++ b/src/gui/src/SongEditor/PatternFillDialog.cpp @@ -29,11 +29,9 @@ #include "Skin.h" -const char* PatternFillDialog::__class_name = "PatternFillDialog"; - PatternFillDialog::PatternFillDialog(QWidget* parent, FillRange* pRange) : QDialog(parent) - , Object( __class_name ) + , Object() { setupUi( this ); diff --git a/src/gui/src/SongEditor/PatternFillDialog.h b/src/gui/src/SongEditor/PatternFillDialog.h index a38259a60..57a2ca308 100644 --- a/src/gui/src/SongEditor/PatternFillDialog.h +++ b/src/gui/src/SongEditor/PatternFillDialog.h @@ -49,7 +49,7 @@ struct FillRange { /// class PatternFillDialog : public QDialog, public Ui_PatternFillDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(PatternFillDialog) Q_OBJECT public: PatternFillDialog( QWidget* parent, FillRange* range ); diff --git a/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.cpp b/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.cpp index 12507893d..0365f5c3a 100644 --- a/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.cpp +++ b/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.cpp @@ -39,8 +39,6 @@ using namespace H2Core; #include "SongEditor.h" #include "SongEditorPanel.h" -const char* PlaybackTrackWaveDisplay::__class_name = "PlaybackTrackWaveDisplay"; - PlaybackTrackWaveDisplay::PlaybackTrackWaveDisplay(QWidget* pParent) : WaveDisplay( pParent ) { diff --git a/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.h b/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.h index 2026dca07..5c6a2d147 100644 --- a/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.h +++ b/src/gui/src/SongEditor/PlaybackTrackWaveDisplay.h @@ -37,7 +37,7 @@ namespace H2Core class PlaybackTrackWaveDisplay : public WaveDisplay { - H2_OBJECT + H2_OBJECT(PlaybackTrackWaveDisplay) Q_OBJECT public: diff --git a/src/gui/src/SongEditor/SongEditor.cpp b/src/gui/src/SongEditor/SongEditor.cpp index 9f4a6544e..b87655f68 100644 --- a/src/gui/src/SongEditor/SongEditor.cpp +++ b/src/gui/src/SongEditor/SongEditor.cpp @@ -64,8 +64,6 @@ using namespace H2Core; #include #endif -const char* SongEditor::__class_name = "SongEditor"; - struct PatternDisplayInfo { bool bActive; bool bNext; @@ -75,7 +73,7 @@ struct PatternDisplayInfo { SongEditor::SongEditor( QWidget *parent, QScrollArea *pScrollView, SongEditorPanel *pSongEditorPanel ) : QWidget( parent ) - , Object( __class_name ) + , Object() , m_bSequenceChanged( true ) , m_pScrollView( pScrollView ) , m_pSongEditorPanel( pSongEditorPanel ) @@ -1157,11 +1155,9 @@ void SongEditor::onPreferencesChanged( bool bAppearanceOnly ) { // ::::::::::::::::::: -const char* SongEditorPatternList::__class_name = "SongEditorPatternList"; - SongEditorPatternList::SongEditorPatternList( QWidget *parent ) : QWidget( parent ) - , Object( __class_name ) + , Object() , EventListener() , m_pBackgroundPixmap( nullptr ) { @@ -2108,11 +2104,9 @@ void SongEditorPatternList::onPreferencesChanged( bool bAppearanceOnly ) { // :::::::::::::::::::::::::: -const char* SongEditorPositionRuler::__class_name = "SongEditorPositionRuler"; - SongEditorPositionRuler::SongEditorPositionRuler( QWidget *parent ) : QWidget( parent ) - , Object( __class_name ) + , Object() , m_bRightBtnPressed( false ) { m_pHydrogen = Hydrogen::get_instance(); diff --git a/src/gui/src/SongEditor/SongEditor.h b/src/gui/src/SongEditor/SongEditor.h index cf8d5e7d8..9342cab92 100644 --- a/src/gui/src/SongEditor/SongEditor.h +++ b/src/gui/src/SongEditor/SongEditor.h @@ -65,7 +65,7 @@ static const uint SONG_EDITOR_MAX_GRID_WIDTH = 16; //! class SongEditor : public QWidget, public H2Core::Object, public SelectionWidget { - H2_OBJECT + H2_OBJECT(SongEditor) Q_OBJECT struct GridCell { @@ -240,7 +240,7 @@ inline int SongEditor::getCursorColumn() const { /// class SongEditorPatternList : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, public H2Core::Object, public EventListener { - H2_OBJECT + H2_OBJECT(SongEditorPatternList) Q_OBJECT public: @@ -326,7 +326,7 @@ class SongEditorPatternList : public QWidget, protected WidgetWithScalableFont<8 class SongEditorPositionRuler : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SongEditorPositionRuler) Q_OBJECT public: diff --git a/src/gui/src/SongEditor/SongEditorPanel.cpp b/src/gui/src/SongEditor/SongEditorPanel.cpp index 206bf756b..124d644a5 100644 --- a/src/gui/src/SongEditor/SongEditorPanel.cpp +++ b/src/gui/src/SongEditor/SongEditorPanel.cpp @@ -49,12 +49,10 @@ #endif using namespace H2Core; -const char* SongEditorPanel::__class_name = "SongEditorPanel"; - SongEditorPanel::SongEditorPanel(QWidget *pParent) : QWidget( pParent ) - , Object( __class_name ) + , Object() { m_nInitialWidth = 600; m_nInitialHeight = 250; diff --git a/src/gui/src/SongEditor/SongEditorPanel.h b/src/gui/src/SongEditor/SongEditorPanel.h index 55e155338..d3919bb8b 100644 --- a/src/gui/src/SongEditor/SongEditorPanel.h +++ b/src/gui/src/SongEditor/SongEditorPanel.h @@ -44,7 +44,7 @@ class PlaybackTrackWaveDisplay; class SongEditorPanel : public QWidget, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SongEditorPanel) Q_OBJECT public: diff --git a/src/gui/src/SongEditor/SongEditorPanelBpmWidget.cpp b/src/gui/src/SongEditor/SongEditorPanelBpmWidget.cpp index 81883a735..6052e4df9 100644 --- a/src/gui/src/SongEditor/SongEditorPanelBpmWidget.cpp +++ b/src/gui/src/SongEditor/SongEditorPanelBpmWidget.cpp @@ -34,11 +34,9 @@ namespace H2Core { -const char* SongEditorPanelBpmWidget::__class_name = "SongEditorPanelBpmWidget"; - SongEditorPanelBpmWidget::SongEditorPanelBpmWidget( QWidget* pParent, int beat ) : QDialog( pParent ) - , Object( __class_name ) + , Object() , m_stimelineposition ( beat ) { setupUi( this ); diff --git a/src/gui/src/SongEditor/SongEditorPanelBpmWidget.h b/src/gui/src/SongEditor/SongEditorPanelBpmWidget.h index dbd606f29..983e71bc8 100644 --- a/src/gui/src/SongEditor/SongEditorPanelBpmWidget.h +++ b/src/gui/src/SongEditor/SongEditorPanelBpmWidget.h @@ -35,7 +35,7 @@ namespace H2Core class SongEditorPanelBpmWidget : public QDialog, public Ui_SongEditorPanelBpmWidget_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SongEditorPanelBpmWidget) //lineEditBEAT //lineEditBPM diff --git a/src/gui/src/SongEditor/SongEditorPanelTagWidget.cpp b/src/gui/src/SongEditor/SongEditorPanelTagWidget.cpp index 006e7b529..99a8437b1 100644 --- a/src/gui/src/SongEditor/SongEditorPanelTagWidget.cpp +++ b/src/gui/src/SongEditor/SongEditorPanelTagWidget.cpp @@ -35,11 +35,9 @@ namespace H2Core { -const char* SongEditorPanelTagWidget::__class_name = "SongEditorPanelTagWidget"; - SongEditorPanelTagWidget::SongEditorPanelTagWidget( QWidget* pParent, int beat ) : QDialog( pParent ) - , Object( __class_name ) + , Object() , m_stimelineposition ( beat ) { setupUi( this ); diff --git a/src/gui/src/SongEditor/SongEditorPanelTagWidget.h b/src/gui/src/SongEditor/SongEditorPanelTagWidget.h index f991d81b1..5c853b739 100644 --- a/src/gui/src/SongEditor/SongEditorPanelTagWidget.h +++ b/src/gui/src/SongEditor/SongEditorPanelTagWidget.h @@ -35,7 +35,7 @@ namespace H2Core class SongEditorPanelTagWidget : public QDialog, public Ui_SongEditorPanelTagWidget_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SongEditorPanelTagWidget) //lineEditBEAT //lineEditBPM diff --git a/src/gui/src/SongEditor/VirtualPatternDialog.cpp b/src/gui/src/SongEditor/VirtualPatternDialog.cpp index b708b4520..7c1836756 100644 --- a/src/gui/src/SongEditor/VirtualPatternDialog.cpp +++ b/src/gui/src/SongEditor/VirtualPatternDialog.cpp @@ -30,11 +30,9 @@ #include "Skin.h" -const char* VirtualPatternDialog::__class_name = "VirtualPatternDialog"; - VirtualPatternDialog::VirtualPatternDialog(QWidget* parent) : QDialog(parent) - , Object( __class_name ) + , Object() { setupUi( this ); setWindowTitle( tr( "Select virtual pattern" ) ); diff --git a/src/gui/src/SongEditor/VirtualPatternDialog.h b/src/gui/src/SongEditor/VirtualPatternDialog.h index f0389fa08..e758a3ef6 100644 --- a/src/gui/src/SongEditor/VirtualPatternDialog.h +++ b/src/gui/src/SongEditor/VirtualPatternDialog.h @@ -43,7 +43,7 @@ namespace H2Core /// class VirtualPatternDialog : public QDialog, public Ui_VirtualPatternDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(VirtualPatternDialog) Q_OBJECT public: explicit VirtualPatternDialog( QWidget* parent ); diff --git a/src/gui/src/SongPropertiesDialog.h b/src/gui/src/SongPropertiesDialog.h index e26bb5930..6544d6d14 100644 --- a/src/gui/src/SongPropertiesDialog.h +++ b/src/gui/src/SongPropertiesDialog.h @@ -32,7 +32,7 @@ */ class SongPropertiesDialog : public QDialog, private Ui_SongPropertiesDialog_UI { - H2_OBJECT + H2_OBJECT(SongPropertiesDialog) Q_OBJECT public: diff --git a/src/gui/src/SoundLibrary/FileBrowser.cpp b/src/gui/src/SoundLibrary/FileBrowser.cpp index f0990948b..d26584005 100644 --- a/src/gui/src/SoundLibrary/FileBrowser.cpp +++ b/src/gui/src/SoundLibrary/FileBrowser.cpp @@ -33,11 +33,9 @@ #include using namespace H2Core; -const char* FileBrowser::__class_name = "FileBrowser"; - FileBrowser::FileBrowser( QWidget* pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() { INFOLOG( "[FileBrowser]" ); diff --git a/src/gui/src/SoundLibrary/FileBrowser.h b/src/gui/src/SoundLibrary/FileBrowser.h index 73641ed49..c05c5f8d7 100644 --- a/src/gui/src/SoundLibrary/FileBrowser.h +++ b/src/gui/src/SoundLibrary/FileBrowser.h @@ -31,7 +31,7 @@ class FileBrowser : public QWidget, private H2Core::Object { - H2_OBJECT + H2_OBJECT(FileBrowser) Q_OBJECT public: explicit FileBrowser( QWidget* pParent ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryDatastructures.cpp b/src/gui/src/SoundLibrary/SoundLibraryDatastructures.cpp index bf8d2a31f..5752f97ce 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryDatastructures.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryDatastructures.cpp @@ -45,9 +45,7 @@ using namespace H2Core; SoundLibraryDatabase* SoundLibraryDatabase::__instance = nullptr; -const char* SoundLibraryDatabase::__class_name = "SoundLibraryDatabase"; - -SoundLibraryDatabase::SoundLibraryDatabase() : Object( __class_name ) +SoundLibraryDatabase::SoundLibraryDatabase() : Object() { INFOLOG( "INIT" ); patternVector = new soundLibraryInfoVector(); @@ -137,14 +135,12 @@ soundLibraryInfoVector* SoundLibraryDatabase::getAllPatterns() const - -const char* SoundLibraryInfo::__class_name = "SoundLibraryInfo"; -SoundLibraryInfo::SoundLibraryInfo() : Object( __class_name ) +SoundLibraryInfo::SoundLibraryInfo() : Object() { //default constructor } -SoundLibraryInfo::SoundLibraryInfo(const QString &path) : Object( __class_name ) +SoundLibraryInfo::SoundLibraryInfo(const QString &path) : Object() { /* *Use the provided file instantiate this object with the corresponding meta diff --git a/src/gui/src/SoundLibrary/SoundLibraryDatastructures.h b/src/gui/src/SoundLibrary/SoundLibraryDatastructures.h index 4e4e6b6f8..a625fdbe6 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryDatastructures.h +++ b/src/gui/src/SoundLibrary/SoundLibraryDatastructures.h @@ -43,7 +43,7 @@ typedef std::vector soundLibraryInfoVector; class SoundLibraryDatabase: public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryDatabase) public: SoundLibraryDatabase(); ~SoundLibraryDatabase(); @@ -85,7 +85,7 @@ class SoundLibraryDatabase: public H2Core::Object class SoundLibraryInfo : public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryInfo) public: SoundLibraryInfo(); explicit SoundLibraryInfo( const QString& path); diff --git a/src/gui/src/SoundLibrary/SoundLibraryExportDialog.cpp b/src/gui/src/SoundLibrary/SoundLibraryExportDialog.cpp index 02ae20d99..8f6a0fa9c 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryExportDialog.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryExportDialog.cpp @@ -49,11 +49,9 @@ using namespace H2Core; -const char* SoundLibraryExportDialog::__class_name = "SoundLibraryExportDialog"; - SoundLibraryExportDialog::SoundLibraryExportDialog( QWidget* pParent, const QString& sSelectedKit, H2Core::Filesystem::Lookup lookup ) : QDialog( pParent ) - , Object( __class_name ) + , Object() , m_sPreselectedKit( sSelectedKit ) , m_preselectedKitLookup( lookup ) { diff --git a/src/gui/src/SoundLibrary/SoundLibraryExportDialog.h b/src/gui/src/SoundLibrary/SoundLibraryExportDialog.h index 7d971e995..879e5dc97 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryExportDialog.h +++ b/src/gui/src/SoundLibrary/SoundLibraryExportDialog.h @@ -37,7 +37,7 @@ /// class SoundLibraryExportDialog : public QDialog, public Ui_SoundLibraryExportDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryExportDialog) Q_OBJECT public: SoundLibraryExportDialog( QWidget* pParent, const QString& sSelectedKit, H2Core::Filesystem::Lookup lookup ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryImportDialog.cpp b/src/gui/src/SoundLibrary/SoundLibraryImportDialog.cpp index 8f3bea7ef..dc53d543d 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryImportDialog.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryImportDialog.cpp @@ -44,12 +44,11 @@ #include -const char* SoundLibraryImportDialog::__class_name = "SoundLibraryImportDialog"; const int max_redirects = 30; SoundLibraryImportDialog::SoundLibraryImportDialog( QWidget* pParent, bool bOnlineImport ) : QDialog( pParent ) - , Object( __class_name ) + , Object() { setupUi( this ); INFOLOG( "INIT" ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryImportDialog.h b/src/gui/src/SoundLibrary/SoundLibraryImportDialog.h index 93ce0f1e2..763c73711 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryImportDialog.h +++ b/src/gui/src/SoundLibrary/SoundLibraryImportDialog.h @@ -36,7 +36,7 @@ /// class SoundLibraryImportDialog : public QDialog, public Ui_SoundLibraryImportDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryImportDialog) Q_OBJECT public: SoundLibraryImportDialog( QWidget* pParent, bool bOnlineImport ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.cpp b/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.cpp index 859e3c2bd..a5f1537e9 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.cpp @@ -28,11 +28,9 @@ using namespace H2Core; -const char* SoundLibraryOpenDialog::__class_name = "SoundLibraryOpenDialog"; - SoundLibraryOpenDialog::SoundLibraryOpenDialog( QWidget* pParent ) : QDialog( pParent ) - , Object( __class_name ) + , Object() { INFOLOG( "INIT" ); setWindowTitle( tr( "Open Sound Library" ) ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.h b/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.h index fe2c88395..e9b4e7d4f 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.h +++ b/src/gui/src/SoundLibrary/SoundLibraryOpenDialog.h @@ -32,7 +32,7 @@ class SoundLibraryPanel; class SoundLibraryOpenDialog : public QDialog, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryOpenDialog) Q_OBJECT public: explicit SoundLibraryOpenDialog( QWidget* pParent ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryPanel.cpp b/src/gui/src/SoundLibrary/SoundLibraryPanel.cpp index 3b85e9d1c..1454ea7ac 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryPanel.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryPanel.cpp @@ -61,11 +61,9 @@ using namespace H2Core; #include -const char* SoundLibraryPanel::__class_name = "SoundLibraryPanel"; - SoundLibraryPanel::SoundLibraryPanel( QWidget *pParent, bool bInItsOwnDialog ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , __sound_library_tree( nullptr ) , __drumkit_menu( nullptr ) , __instrument_menu( nullptr ) diff --git a/src/gui/src/SoundLibrary/SoundLibraryPanel.h b/src/gui/src/SoundLibrary/SoundLibraryPanel.h index 47d16246d..980ddbf87 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryPanel.h +++ b/src/gui/src/SoundLibrary/SoundLibraryPanel.h @@ -46,7 +46,7 @@ class ToggleButton; class SoundLibraryPanel : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, private H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryPanel) Q_OBJECT public: SoundLibraryPanel( QWidget* parent, bool bInItsOwnDialog ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.cpp b/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.cpp index 04036f7cb..e54532263 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.cpp @@ -34,11 +34,9 @@ namespace H2Core { -const char* SoundLibraryPropertiesDialog::__class_name = "SoundLibraryPropertiesDialog"; - SoundLibraryPropertiesDialog::SoundLibraryPropertiesDialog( QWidget* pParent, Drumkit *pDrumkitInfo, Drumkit *pPreDrumkit ) : QDialog( pParent ) - , Object( __class_name ) + , Object() , m_pDrumkitInfo( pDrumkitInfo ) , m_pPreDrumkitInfo( pPreDrumkit ) { diff --git a/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.h b/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.h index 9b874153a..c115f20ed 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.h +++ b/src/gui/src/SoundLibrary/SoundLibraryPropertiesDialog.h @@ -35,7 +35,7 @@ class Drumkit; class SoundLibraryPropertiesDialog : public QDialog, public Ui_SoundLibraryPropertiesDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryPropertiesDialog) Q_OBJECT public: SoundLibraryPropertiesDialog(QWidget* pParent , Drumkit *pDrumkitInfo, Drumkit *pPreDrumKit ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.cpp b/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.cpp index adf269878..3ecadfe07 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.cpp @@ -28,11 +28,9 @@ #include #include -const char* SoundLibraryRepositoryDialog::__class_name = "SoundLibraryRepositoryDialog"; - SoundLibraryRepositoryDialog::SoundLibraryRepositoryDialog( QWidget* pParent ) : QDialog( pParent ) - , Object( __class_name ) + , Object() { setupUi( this ); INFOLOG( "INIT" ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.h b/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.h index 364a812e9..b3e53b333 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.h +++ b/src/gui/src/SoundLibrary/SoundLibraryRepositoryDialog.h @@ -31,7 +31,7 @@ /// class SoundLibraryRepositoryDialog : public QDialog, public Ui_SoundLibraryRepositoryDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryRepositoryDialog) Q_OBJECT public: explicit SoundLibraryRepositoryDialog( QWidget* pParent ); diff --git a/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.cpp b/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.cpp index 99f2c5af8..dfba2d76c 100644 --- a/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.cpp +++ b/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.cpp @@ -28,11 +28,9 @@ #include "../HydrogenApp.h" #include "../Skin.h" -const char* SoundLibrarySaveDialog::__class_name = "SoundLibrarySaveDialog"; - SoundLibrarySaveDialog::SoundLibrarySaveDialog( QWidget* pParent ) : QDialog( pParent ) - , Object( __class_name ) + , Object() { setupUi( this ); INFOLOG( "INIT" ); diff --git a/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.h b/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.h index 46eb58b39..f0a7265e4 100644 --- a/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.h +++ b/src/gui/src/SoundLibrary/SoundLibrarySaveDialog.h @@ -31,7 +31,7 @@ /// class SoundLibrarySaveDialog : public QDialog, public Ui_SoundLibrarySaveDialog_UI, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibrarySaveDialog) Q_OBJECT public: explicit SoundLibrarySaveDialog( QWidget* pParent ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryTree.cpp b/src/gui/src/SoundLibrary/SoundLibraryTree.cpp index 7d2951493..2b095b256 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryTree.cpp +++ b/src/gui/src/SoundLibrary/SoundLibraryTree.cpp @@ -23,11 +23,9 @@ #include "SoundLibraryTree.h" #include -const char* SoundLibraryTree::__class_name = "SoundLibraryTree"; - SoundLibraryTree::SoundLibraryTree( QWidget *pParent ) : QTreeWidget( pParent ) - , Object( __class_name ) + , Object() { setHeaderLabels( QStringList( tr( "Sound library" ) ) ); setAlternatingRowColors( true ); diff --git a/src/gui/src/SoundLibrary/SoundLibraryTree.h b/src/gui/src/SoundLibrary/SoundLibraryTree.h index c7ad2b765..e27bd3d0d 100644 --- a/src/gui/src/SoundLibrary/SoundLibraryTree.h +++ b/src/gui/src/SoundLibrary/SoundLibraryTree.h @@ -30,7 +30,7 @@ class SoundLibraryTree : public QTreeWidget, private H2Core::Object { - H2_OBJECT + H2_OBJECT(SoundLibraryTree) Q_OBJECT public: explicit SoundLibraryTree( QWidget *pParent ); diff --git a/src/gui/src/SplashScreen.cpp b/src/gui/src/SplashScreen.cpp index d0b57143e..9a8c91f77 100644 --- a/src/gui/src/SplashScreen.cpp +++ b/src/gui/src/SplashScreen.cpp @@ -29,11 +29,9 @@ #include "Skin.h" -const char* SplashScreen::__class_name = "SplashScreen"; - SplashScreen::SplashScreen() : QSplashScreen() - , Object( __class_name ) + , Object() { //INFOLOG( "SplashScreen" ); diff --git a/src/gui/src/SplashScreen.h b/src/gui/src/SplashScreen.h index 8398545ce..cd5e3f72c 100644 --- a/src/gui/src/SplashScreen.h +++ b/src/gui/src/SplashScreen.h @@ -32,7 +32,7 @@ class SplashScreen : public QSplashScreen, public H2Core::Object { - H2_OBJECT + H2_OBJECT(SplashScreen) Q_OBJECT public: SplashScreen(); diff --git a/src/gui/src/Widgets/AutomationPathView.cpp b/src/gui/src/Widgets/AutomationPathView.cpp index 96311d7ec..03bb16acf 100644 --- a/src/gui/src/Widgets/AutomationPathView.cpp +++ b/src/gui/src/Widgets/AutomationPathView.cpp @@ -24,13 +24,11 @@ #include #include "../SongEditor/SongEditor.h" -const char* AutomationPathView::__class_name = "AutomationPathView"; - using namespace H2Core; AutomationPathView::AutomationPathView(QWidget *parent) : QWidget(parent), - H2Core::Object(__class_name), + H2Core::Object(), m_nGridWidth(16), m_nMarginWidth(10), m_nMarginHeight(4), diff --git a/src/gui/src/Widgets/AutomationPathView.h b/src/gui/src/Widgets/AutomationPathView.h index a15ae79c9..397d62576 100644 --- a/src/gui/src/Widgets/AutomationPathView.h +++ b/src/gui/src/Widgets/AutomationPathView.h @@ -32,7 +32,7 @@ class AutomationPathView : public QWidget, public H2Core::Object { Q_OBJECT - H2_OBJECT + H2_OBJECT(AutomationPathView) H2Core::AutomationPath *_path; int m_nGridWidth; /** < Width of song grid cell size - in order to properly align AutomationPathView and SongEditor */ diff --git a/src/gui/src/Widgets/Button.cpp b/src/gui/src/Widgets/Button.cpp index 932c969e8..804343432 100644 --- a/src/gui/src/Widgets/Button.cpp +++ b/src/gui/src/Widgets/Button.cpp @@ -31,11 +31,9 @@ #include -const char* Button::__class_name = "Button"; - Button::Button( QWidget * pParent, const QString& sOnImage, const QString& sOffImage, const QString& sOverImage, QSize size, bool use_skin_style, bool enable_press_hold ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_bPressed( false ) , m_onPixmap( size ) , m_offPixmap( size ) diff --git a/src/gui/src/Widgets/Button.h b/src/gui/src/Widgets/Button.h index 2a8b0fdde..1572ad132 100644 --- a/src/gui/src/Widgets/Button.h +++ b/src/gui/src/Widgets/Button.h @@ -43,7 +43,7 @@ class PixmapWidget; */ class Button : public QWidget, protected WidgetWithScalableFont<6, 8, 10>, public H2Core::Object, public MidiLearnable { - H2_OBJECT + H2_OBJECT(Button) Q_OBJECT public: diff --git a/src/gui/src/Widgets/ColorSelectionButton.cpp b/src/gui/src/Widgets/ColorSelectionButton.cpp index 09b0f7d7e..75f9a958f 100644 --- a/src/gui/src/Widgets/ColorSelectionButton.cpp +++ b/src/gui/src/Widgets/ColorSelectionButton.cpp @@ -25,11 +25,9 @@ #include #include -const char* ColorSelectionButton::__class_name = "ColorSelectionButton"; - ColorSelectionButton::ColorSelectionButton( QWidget* pParent, QColor sInitialColor, int nSize ) : QPushButton( pParent ) - , Object( __class_name ) + , Object() , m_sColor( sInitialColor ) , m_bMouseOver( false ) { diff --git a/src/gui/src/Widgets/ColorSelectionButton.h b/src/gui/src/Widgets/ColorSelectionButton.h index 2cf059554..cabc55375 100644 --- a/src/gui/src/Widgets/ColorSelectionButton.h +++ b/src/gui/src/Widgets/ColorSelectionButton.h @@ -34,7 +34,7 @@ class ColorSelectionButton : public QPushButton, public H2Core::Object { - H2_OBJECT + H2_OBJECT(ColorSelectionButton) Q_OBJECT public: diff --git a/src/gui/src/Widgets/CpuLoadWidget.cpp b/src/gui/src/Widgets/CpuLoadWidget.cpp index 4b8f10124..79aab1cc8 100644 --- a/src/gui/src/Widgets/CpuLoadWidget.cpp +++ b/src/gui/src/Widgets/CpuLoadWidget.cpp @@ -33,11 +33,9 @@ #include #include -const char* CpuLoadWidget::__class_name = "CpuLoadWidget"; - CpuLoadWidget::CpuLoadWidget( QWidget *pParent ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_fValue( 0 ) { setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/src/gui/src/Widgets/CpuLoadWidget.h b/src/gui/src/Widgets/CpuLoadWidget.h index c6db5a986..d6d0c72d5 100644 --- a/src/gui/src/Widgets/CpuLoadWidget.h +++ b/src/gui/src/Widgets/CpuLoadWidget.h @@ -37,7 +37,7 @@ /// class CpuLoadWidget : public QWidget, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(CpuLoadWidget) Q_OBJECT public: diff --git a/src/gui/src/Widgets/DownloadWidget.cpp b/src/gui/src/Widgets/DownloadWidget.cpp index c5506af91..26d2f4265 100644 --- a/src/gui/src/Widgets/DownloadWidget.cpp +++ b/src/gui/src/Widgets/DownloadWidget.cpp @@ -28,11 +28,9 @@ #include -const char* Download::__class_name = "Download"; - Download::Download( QWidget* pParent, const QString& download_url, const QString& local_file ) : QDialog( pParent ) - , Object( __class_name ) + , Object() , __download_percent( 0 ) , __eta( 0 ) , __bytes_current( 0 ) diff --git a/src/gui/src/Widgets/DownloadWidget.h b/src/gui/src/Widgets/DownloadWidget.h index f18e75515..8b7a9b396 100644 --- a/src/gui/src/Widgets/DownloadWidget.h +++ b/src/gui/src/Widgets/DownloadWidget.h @@ -34,7 +34,7 @@ class QNetworkReply; class Download : public QDialog, public H2Core::Object { - H2_OBJECT + H2_OBJECT(Download) Q_OBJECT public: @@ -74,7 +74,7 @@ private slots: class DownloadWidget : public Download { - H2_OBJECT + H2_OBJECT(DownloadWidget) Q_OBJECT public: diff --git a/src/gui/src/Widgets/Fader.cpp b/src/gui/src/Widgets/Fader.cpp index 2367f230a..5c14e0028 100644 --- a/src/gui/src/Widgets/Fader.cpp +++ b/src/gui/src/Widgets/Fader.cpp @@ -31,11 +31,9 @@ #include -const char* Fader::__class_name = "Fader"; - Fader::Fader( QWidget *pParent, bool bUseIntSteps, bool bWithoutKnob) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_bWithoutKnob( bWithoutKnob ) , m_bUseIntSteps( bUseIntSteps ) , m_fPeakValue_L( 0.0 ) @@ -450,11 +448,9 @@ void VerticalFader::paintEvent( QPaintEvent *ev) ////////////////////////////////// -const char* MasterFader::__class_name = "MasterFader"; - MasterFader::MasterFader(QWidget *pParent, bool bWithoutKnob) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_bWithoutKnob( bWithoutKnob ) , m_fPeakValue_L( 0.0 ) , m_fPeakValue_R( 0.0 ) diff --git a/src/gui/src/Widgets/Fader.h b/src/gui/src/Widgets/Fader.h index 2ce0d91ec..a5634e29a 100644 --- a/src/gui/src/Widgets/Fader.h +++ b/src/gui/src/Widgets/Fader.h @@ -36,7 +36,7 @@ /// class Fader : public QWidget, public H2Core::Object, public MidiLearnable { - H2_OBJECT + H2_OBJECT(Fader) Q_OBJECT public: @@ -108,7 +108,7 @@ class VerticalFader : public Fader class MasterFader : public QWidget, public H2Core::Object, public MidiLearnable { - H2_OBJECT + H2_OBJECT(MasterFader) Q_OBJECT public: diff --git a/src/gui/src/Widgets/LCD.cpp b/src/gui/src/Widgets/LCD.cpp index 56c29bc1b..2b069f8a5 100644 --- a/src/gui/src/Widgets/LCD.cpp +++ b/src/gui/src/Widgets/LCD.cpp @@ -30,11 +30,9 @@ QPixmap* LCDDigit::m_pSmallRedFontSet = nullptr; QPixmap* LCDDigit::m_pLargeGrayFontSet = nullptr; QPixmap* LCDDigit::m_pSmallGrayFontSet = nullptr; -const char* LCDDigit::__class_name = "LCDDigit"; - LCDDigit::LCDDigit( QWidget * pParent, LCDType type ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_type( type ) { setAttribute(Qt::WA_OpaquePaintEvent); @@ -196,11 +194,9 @@ void LCDDigit::setSmallBlue() // :::::::::::::::::: -const char* LCDDisplay::__class_name = "LCDDisplay"; - LCDDisplay::LCDDisplay( QWidget * pParent, LCDDigit::LCDType type, int nDigits, bool leftAlign ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_sMsg( "" ) , m_bLeftAlign( leftAlign ) { @@ -315,12 +311,10 @@ void LCDDisplay::digitClicked() // ::::::::::::::::::: -const char* LCDSpinBox::__class_name = "LCDSpinBox"; - // used in PlayerControl LCDSpinBox::LCDSpinBox( QWidget *pParent, int nDigits, LCDSpinBoxType type, int nMin, int nMax ) : QWidget( pParent ) - , Object( __class_name ) + , Object() , m_type( type ) , m_fValue( 0 ) , m_nMinValue( nMin ) diff --git a/src/gui/src/Widgets/LCD.h b/src/gui/src/Widgets/LCD.h index 7ab4246e0..c410ffe40 100644 --- a/src/gui/src/Widgets/LCD.h +++ b/src/gui/src/Widgets/LCD.h @@ -33,7 +33,7 @@ class LCDDigit : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(LCDDigit) Q_OBJECT public: enum LCDType { @@ -72,7 +72,7 @@ class LCDDigit : public QWidget, public H2Core::Object class LCDDisplay : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(LCDDisplay) Q_OBJECT public: LCDDisplay( QWidget * pParent, LCDDigit::LCDType type, int nDigits, bool leftAlign = false ); @@ -99,7 +99,7 @@ class LCDDisplay : public QWidget, public H2Core::Object class LCDSpinBox : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(LCDSpinBox) Q_OBJECT public: enum LCDSpinBoxType { diff --git a/src/gui/src/Widgets/LCDCombo.cpp b/src/gui/src/Widgets/LCDCombo.cpp index bc6b24d8e..7ad3dbc01 100644 --- a/src/gui/src/Widgets/LCDCombo.cpp +++ b/src/gui/src/Widgets/LCDCombo.cpp @@ -28,11 +28,10 @@ #include -const char* LCDCombo::__class_name = "LCDCombo"; LCDCombo::LCDCombo( QWidget *pParent, int digits, bool bAllowMenuOverflow ) : QWidget(pParent) - , Object( __class_name ) + , Object() , m_bAllowMenuOverflow( bAllowMenuOverflow ) { INFOLOG( "INIT" ); diff --git a/src/gui/src/Widgets/LCDCombo.h b/src/gui/src/Widgets/LCDCombo.h index 23fa60f41..4920da2f7 100644 --- a/src/gui/src/Widgets/LCDCombo.h +++ b/src/gui/src/Widgets/LCDCombo.h @@ -34,7 +34,7 @@ class LCDDisplay; class LCDCombo : public QWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(LCDCombo) Q_OBJECT public: explicit LCDCombo( QWidget *pParent, int digits = 5, bool bAllowMenuOverflow = false ); diff --git a/src/gui/src/Widgets/MidiActivityWidget.cpp b/src/gui/src/Widgets/MidiActivityWidget.cpp index 16e9aa5ff..1a02a3197 100644 --- a/src/gui/src/Widgets/MidiActivityWidget.cpp +++ b/src/gui/src/Widgets/MidiActivityWidget.cpp @@ -30,11 +30,10 @@ #include #include -const char* MidiActivityWidget::__class_name = "MidiActivityWidget"; MidiActivityWidget::MidiActivityWidget( QWidget * parent ) : QWidget( parent ) - , Object( __class_name ) + , Object() , m_bValue( false ) { setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/src/gui/src/Widgets/MidiActivityWidget.h b/src/gui/src/Widgets/MidiActivityWidget.h index ba2b8984f..e342dcde0 100644 --- a/src/gui/src/Widgets/MidiActivityWidget.h +++ b/src/gui/src/Widgets/MidiActivityWidget.h @@ -33,7 +33,7 @@ class MidiActivityWidget : public QWidget, public EventListener, public H2Core::Object { - H2_OBJECT + H2_OBJECT(MidiActivityWidget) Q_OBJECT public: explicit MidiActivityWidget(QWidget * parent); diff --git a/src/gui/src/Widgets/MidiSenseWidget.cpp b/src/gui/src/Widgets/MidiSenseWidget.cpp index 232fd43bc..9a5c97eec 100644 --- a/src/gui/src/Widgets/MidiSenseWidget.cpp +++ b/src/gui/src/Widgets/MidiSenseWidget.cpp @@ -24,9 +24,7 @@ #include "MidiSenseWidget.h" #include -const char* MidiSenseWidget::__class_name = "MidiSenseWidget"; - -MidiSenseWidget::MidiSenseWidget(QWidget* pParent, bool directWr, Action* pAction): QDialog( pParent ) , Object(__class_name) +MidiSenseWidget::MidiSenseWidget(QWidget* pParent, bool directWr, Action* pAction): QDialog( pParent ) , Object() { m_DirectWrite = directWr; m_pAction = pAction; diff --git a/src/gui/src/Widgets/MidiSenseWidget.h b/src/gui/src/Widgets/MidiSenseWidget.h index 327a47536..afa457eac 100644 --- a/src/gui/src/Widgets/MidiSenseWidget.h +++ b/src/gui/src/Widgets/MidiSenseWidget.h @@ -31,7 +31,7 @@ class MidiSenseWidget : public QDialog ,public H2Core::Object { - H2_OBJECT + H2_OBJECT(MidiSenseWidget) Q_OBJECT public: diff --git a/src/gui/src/Widgets/MidiTable.cpp b/src/gui/src/Widgets/MidiTable.cpp index f6da1c1ab..68f8a36ea 100644 --- a/src/gui/src/Widgets/MidiTable.cpp +++ b/src/gui/src/Widgets/MidiTable.cpp @@ -32,11 +32,9 @@ #include -const char* MidiTable::__class_name = "MidiTable"; - MidiTable::MidiTable( QWidget *pParent ) : QTableWidget( pParent ) - , Object( __class_name ) + , Object() { __row_count = 0; setupMidiTable(); diff --git a/src/gui/src/Widgets/MidiTable.h b/src/gui/src/Widgets/MidiTable.h index 89c629265..1a0aa7e7a 100644 --- a/src/gui/src/Widgets/MidiTable.h +++ b/src/gui/src/Widgets/MidiTable.h @@ -30,7 +30,7 @@ class MidiTable : public QTableWidget, public H2Core::Object { - H2_OBJECT + H2_OBJECT(MidiTable) Q_OBJECT public: explicit MidiTable( QWidget* pParent ); diff --git a/src/gui/src/Widgets/PixmapWidget.cpp b/src/gui/src/Widgets/PixmapWidget.cpp index 94bd38cd8..a0cfd8251 100644 --- a/src/gui/src/Widgets/PixmapWidget.cpp +++ b/src/gui/src/Widgets/PixmapWidget.cpp @@ -26,10 +26,8 @@ #include -const char* PixmapWidget::__class_name = "PixmapWidget"; - PixmapWidget::PixmapWidget( QWidget *pParent, const char* sClassName ) - : Object( __class_name ) + : Object() , QWidget( pParent ) , m_sPixmapPath( "" ) , __expand_horiz(false) diff --git a/src/gui/src/Widgets/PixmapWidget.h b/src/gui/src/Widgets/PixmapWidget.h index 0ad667b3c..f6da9863a 100644 --- a/src/gui/src/Widgets/PixmapWidget.h +++ b/src/gui/src/Widgets/PixmapWidget.h @@ -30,7 +30,7 @@ class PixmapWidget : public H2Core::Object, public QWidget { - H2_OBJECT + H2_OBJECT(PixmapWidget) public: PixmapWidget( QWidget *pParent, const char* = "PixmapWidget" ); ~PixmapWidget(); diff --git a/src/gui/src/Widgets/Rotary.cpp b/src/gui/src/Widgets/Rotary.cpp index fefcbb0a9..11c8d2ddc 100644 --- a/src/gui/src/Widgets/Rotary.cpp +++ b/src/gui/src/Widgets/Rotary.cpp @@ -64,11 +64,9 @@ QPixmap* Rotary::m_background_normal = nullptr; QPixmap* Rotary::m_background_center = nullptr; QPixmap* Rotary::m_background_small = nullptr; -const char* Rotary::__class_name = "Rotary"; - Rotary::Rotary( QWidget* parent, RotaryType type, QString sToolTip, bool bUseIntSteps, bool bUseValueTip, float fMin, float fMax ) : QWidget( parent ) - , Object( __class_name ) + , Object() , m_bUseIntSteps( bUseIntSteps ) , m_type( type ) , m_fMin( fMin ) diff --git a/src/gui/src/Widgets/Rotary.h b/src/gui/src/Widgets/Rotary.h index 9fbb74014..e565fccb7 100644 --- a/src/gui/src/Widgets/Rotary.h +++ b/src/gui/src/Widgets/Rotary.h @@ -48,7 +48,7 @@ class RotaryTooltip : public QWidget class Rotary : public QWidget, public H2Core::Object, public MidiLearnable { - H2_OBJECT + H2_OBJECT(Rotary) Q_OBJECT public: enum RotaryType { diff --git a/src/gui/src/about_dialog_contributor_list_update.sh b/src/gui/src/about_dialog_contributor_list_update.sh index 59d6200c7..572423b83 100755 --- a/src/gui/src/about_dialog_contributor_list_update.sh +++ b/src/gui/src/about_dialog_contributor_list_update.sh @@ -71,9 +71,7 @@ cat > AboutDialogContributorList.cpp <<"EOF" */ #include "AboutDialogContributorList.h" -const char* AboutDialogContributorList::__class_name = "AboutDialogContributorList"; - -AboutDialogContributorList::AboutDialogContributorList() : H2Core::Object( __class_name ) { +AboutDialogContributorList::AboutDialogContributorList() : H2Core::Object() { std::vector v{ EOF From d5cce319ed8d9d9c8d73777ed6b2ad19ec46c999 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Wed, 7 Jul 2021 21:15:27 +0200 Subject: [PATCH 16/24] wait for envelopes/envelope points --- src/bindings/h2core.yaml | 4 ++-- src/bindings/h2core_module.cpp | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index e2c752944..4277ff798 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -146,8 +146,8 @@ module: - H2Core::Preferences::getDataDirectory - H2Core::LadspaControlPort::__class_name - H2Core::LadspaControlPort::class_name - # - H2Core::Sample::get_pan_envelope # unique pointers in stl containers, pybind11 can't cope with this. - # - H2Core::Sample::get_velocity_envelope + - H2Core::Sample::get_pan_envelope # unique pointers in stl containers, pybind11 can't cope with this. + - H2Core::Sample::get_velocity_envelope - H2Core::Object::Object(const H2Core::Object &) - std::runtime_error::runtime_error(const std::runtime_error &) cleaners: diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index f0a79ec84..c8e7b297a 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -1186,10 +1186,10 @@ using namespace H2Core; PYBIND11_MODULE(h2core, m) { py::class_> _Object(m, "Object"); - _Object.def(py::init()); + _Object.def(py::init<>()); _Object.def_property_readonly_static("alive_object_count", [](py::object) { return H2Core::Object::getAliveObjectCount(); }); _Object.def_property_readonly_static("object_map", [](py::object) { return H2Core::Object::getObjectMap(); }); - _Object.def("class_name", &H2Core::Object::class_name); + _Object.def_static("class_name", &H2Core::Object::class_name); _Object.def_static("count_active", &H2Core::Object::count_active); _Object.def_static("objects_count", &H2Core::Object::objects_count); // [] _Object.def_static("write_objects_map_to", &H2Core::Object::write_objects_map_to, @@ -1738,8 +1738,9 @@ PYBIND11_MODULE(h2core, m) { "Displays general information about the transport state in the #INFOLOG"); py::class_> _MidiOutput(m, "MidiOutput"); - _MidiOutput.def(py::init()); + _MidiOutput.def(py::init<>()); _MidiOutput.def_property_readonly("input_port_list", &H2Core::MidiOutput::getInputPortList); + _MidiOutput.def_static("class_name", &H2Core::MidiOutput::class_name); _MidiOutput.def("handleQueueNote", &H2Core::MidiOutput::handleQueueNote, py::arg("pNote")); _MidiOutput.def("handleQueueNoteOff", &H2Core::MidiOutput::handleQueueNoteOff, @@ -1753,7 +1754,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("channel")); py::class_> _MidiInput(m, "MidiInput"); - _MidiInput.def(py::init()); + _MidiInput.def(py::init<>()); _MidiInput.def_property_readonly("output_port_list", &H2Core::MidiInput::getOutputPortList); _MidiInput.def("open", &H2Core::MidiInput::open); _MidiInput.def("close", &H2Core::MidiInput::close); @@ -1769,10 +1770,11 @@ PYBIND11_MODULE(h2core, m) { py::arg("msg")); py::class_> _AudioOutput(m, "AudioOutput"); - _AudioOutput.def(py::init()); + _AudioOutput.def(py::init<>()); _AudioOutput.def_readwrite("m_transport", &H2Core::AudioOutput::m_transport); _AudioOutput.def_property_readonly("buffer_size", &H2Core::AudioOutput::getBufferSize); _AudioOutput.def_property_readonly("sample_rate", &H2Core::AudioOutput::getSampleRate); + _AudioOutput.def_static("class_name", &H2Core::AudioOutput::class_name); _AudioOutput.def("init", &H2Core::AudioOutput::init, py::arg("nBufferSize")); _AudioOutput.def("connect", &H2Core::AudioOutput::connect); @@ -2890,8 +2892,6 @@ PYBIND11_MODULE(h2core, m) { } ); _Sample.def_property("is_modified", &H2Core::Sample::get_is_modified, &H2Core::Sample::set_is_modified); - _Sample.def_property_readonly("pan_envelope", &H2Core::Sample::get_pan_envelope); - _Sample.def_property_readonly("velocity_envelope", &H2Core::Sample::get_velocity_envelope); _Sample.def_property_readonly("loops", &H2Core::Sample::get_loops); _Sample.def_property_readonly("rubberband", &H2Core::Sample::get_rubberband); _Sample.def_property_readonly("loop_mode_string", &H2Core::Sample::get_loop_mode_string); @@ -2937,6 +2937,10 @@ PYBIND11_MODULE(h2core, m) { py::arg("rb")); _Sample.def("is_empty", &H2Core::Sample::is_empty, "Returns true if both data channels are null pointers"); + // [banned] _Sample.def("get_pan_envelope", &H2Core::Sample::get_pan_envelope, + // [banned] "Returns #__pan_envelope"); + // [banned] _Sample.def("get_velocity_envelope", &H2Core::Sample::get_velocity_envelope, + // [banned] "Returns #__velocity_envelope"); _Sample.def_static("parse_loop_mode", &H2Core::Sample::parse_loop_mode, "parse the given string and rturn the corresponding loop_mode", py::arg("string")); From 08f306533f0e38b383f9c5780b3cebebbf42209c Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Mon, 5 Jul 2021 00:18:19 +0200 Subject: [PATCH 17/24] rework envelope, make envelope points lightweight --- src/core/Basics/Sample.cpp | 6 ++---- src/core/Basics/Sample.h | 2 +- src/gui/src/SampleEditor/SampleEditor.cpp | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/Basics/Sample.cpp b/src/core/Basics/Sample.cpp index 0eb6ad1a0..50e21cd25 100644 --- a/src/core/Basics/Sample.cpp +++ b/src/core/Basics/Sample.cpp @@ -52,14 +52,12 @@ EnvelopePoint::EnvelopePoint() : Object(), frame( 0 ), value( 0 ) { } -EnvelopePoint::EnvelopePoint( int f, int v ) : Object(), frame( f ), value( v ) +EnvelopePoint::EnvelopePoint( int f, int v ) : Object(), frame( f ), value( v ) { } -EnvelopePoint::EnvelopePoint( const EnvelopePoint & other ) : Object() +EnvelopePoint::EnvelopePoint( const EnvelopePoint& other ) : Object(), frame ( other.frame ), value ( other.value ) { - frame = other.frame; - value = other.value; } /* EnvelopePoint */ diff --git a/src/core/Basics/Sample.h b/src/core/Basics/Sample.h index 3fc8f0266..ef72c2ad5 100644 --- a/src/core/Basics/Sample.h +++ b/src/core/Basics/Sample.h @@ -37,7 +37,7 @@ namespace H2Core */ /** an envelope point within a frame */ -class EnvelopePoint : public H2Core::Object +class EnvelopePoint: public H2Core::Object { H2_OBJECT(EnvelopePoint) public: diff --git a/src/gui/src/SampleEditor/SampleEditor.cpp b/src/gui/src/SampleEditor/SampleEditor.cpp index 607e3e8fd..88e8d64a7 100644 --- a/src/gui/src/SampleEditor/SampleEditor.cpp +++ b/src/gui/src/SampleEditor/SampleEditor.cpp @@ -211,7 +211,6 @@ void SampleEditor::getAllFrameInfos() m_pTargetSampleView->get_velocity()->push_back( EnvelopePoint( m_pTargetSampleView->width(), 0 ) ); } else { m_pTargetSampleView->get_velocity()->clear(); - for(auto& pt : *pSample->get_velocity_envelope() ){ m_pTargetSampleView->get_velocity()->emplace_back( pt ); } From 749830dedc91f053883a56a38228fb722f2b4144 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Mon, 5 Jul 2021 01:08:54 +0200 Subject: [PATCH 18/24] sample editor: instant audiovisual feedback Should close #811 and #1304 --- .../SampleEditor/MainSampleWaveDisplay.cpp | 183 ++++---- .../src/SampleEditor/MainSampleWaveDisplay.h | 30 +- src/gui/src/SampleEditor/SampleEditor.cpp | 400 +++++++++++------- src/gui/src/SampleEditor/SampleEditor.h | 45 +- .../src/SampleEditor/TargetWaveDisplay.cpp | 126 +++--- src/gui/src/SampleEditor/TargetWaveDisplay.h | 25 +- 6 files changed, 450 insertions(+), 359 deletions(-) diff --git a/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp b/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp index 33b7ca11e..de30b7bad 100644 --- a/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp +++ b/src/gui/src/SampleEditor/MainSampleWaveDisplay.cpp @@ -56,11 +56,8 @@ MainSampleWaveDisplay::MainSampleWaveDisplay(QWidget* pParent) m_bUpdatePosition = false; m_nSampleLength = 0; - m_bStartSliderIsMoved = false; - m_bLoopSliderIsMoved = false; - m_bEndSliderIsmoved = false; - - m_SelectedSlider = NONE; + m_SelectedSlider = SampleEditor::Slider::NoSlider; + m_pEditedSample = nullptr; setMouseTracking(true); } @@ -87,14 +84,14 @@ void MainSampleWaveDisplay::paintLocatorEvent( int pos, bool updateposi) update(); } -static void set_paint_color(QPainter & painter, const QColor & color, bool selected, MainSampleWaveDisplay::Slider which) +static void set_paint_color(QPainter & painter, const QColor & color, bool selected, SampleEditor::Slider which) { if (!selected) { painter.setPen( color ); } else { - QColor highlight = QColor(std::min(255, color.red() + 20 + 20 * (which == MainSampleWaveDisplay::END)), - std::min(255, color.green() + 20 + 20 * (which == MainSampleWaveDisplay::START)), - std::min(255, color.blue() + 20 + 20 * (which == MainSampleWaveDisplay::LOOP))); + QColor highlight = QColor(std::min(255, color.red() + 20 + 20 * (which == SampleEditor::EndSlider)), + std::min(255, color.green() + 20 + 20 * (which == SampleEditor::StartSlider)), + std::min(255, color.blue() + 20 + 20 * (which == SampleEditor::LoopSlider))); painter.setPen ( highlight ); } @@ -117,13 +114,13 @@ void MainSampleWaveDisplay::paintEvent(QPaintEvent *ev) for ( int x = 25; x < width() -25; x++ ) { if ( !issmaller || x <= m_nSampleLength){ painter.drawLine( x, -m_pPeakDatal[x -25] +VCenterl, x, -m_pPeakDatal[x -24] +VCenterl ); - painter.drawLine( x, -m_pPeakDatar[x -25] +VCenterr, x, -m_pPeakDatar[x -24] +VCenterr ); + painter.drawLine( x, -m_pPeakDatar[x -25] +VCenterr, x, -m_pPeakDatar[x -24] +VCenterr ); }else { painter.drawLine( x, 0 +VCenterl, x, 0 +VCenterl ); painter.drawLine( x, 0 +VCenterr, x, 0 +VCenterr ); } - + } @@ -145,15 +142,15 @@ void MainSampleWaveDisplay::paintEvent(QPaintEvent *ev) font.setWeight( 63 ); painter.setFont( font ); //start frame pointer - set_paint_color(painter, startColor, m_SelectedSlider == START, m_SelectedSlider); - painter.drawLine( m_nStartFramePosition, 4, m_nStartFramePosition, height() -4 ); + set_paint_color(painter, startColor, m_SelectedSlider == SampleEditor::Slider::StartSlider, m_SelectedSlider); + painter.drawLine( m_nStartFramePosition, 4, m_nStartFramePosition, height() -4 ); painter.drawText( m_nStartFramePosition -10, 250, 10,20, Qt::AlignRight, "S" ); //endframe pointer - set_paint_color(painter, endColor, m_SelectedSlider == END, m_SelectedSlider); + set_paint_color(painter, endColor, m_SelectedSlider == SampleEditor::Slider::EndSlider, m_SelectedSlider); painter.drawLine( m_nEndFramePosition, 4, m_nEndFramePosition, height() -4 ); painter.drawText( m_nEndFramePosition -10, 123, 10, 20, Qt::AlignRight, "E" ); //loopframe pointer - set_paint_color(painter, loopColor, m_SelectedSlider == LOOP, m_SelectedSlider); + set_paint_color(painter, loopColor, m_SelectedSlider == SampleEditor::Slider::LoopSlider, m_SelectedSlider); painter.drawLine( m_nLoopFramePosition, 4, m_nLoopFramePosition, height() -4 ); painter.drawText( m_nLoopFramePosition , 0, 10, 20, Qt::AlignLeft, "L" ); @@ -169,78 +166,76 @@ void MainSampleWaveDisplay::updateDisplayPointer() -void MainSampleWaveDisplay::updateDisplay( const QString& filename ) +std::shared_ptr MainSampleWaveDisplay::loadSampleAndUpdateDisplay( const QString& filename ) { auto pNewSample = Sample::load( filename ); - - if ( pNewSample ) { - - int nSampleLength = pNewSample->get_frames(); - m_nSampleLength = nSampleLength; - float nScaleFactor = nSampleLength / (width() -50); - if ( nScaleFactor < 1 ){ - nScaleFactor = 1; - } + if ( ! pNewSample ) { + update(); + return nullptr; + } + m_pEditedSample = pNewSample; + int nSampleLength = pNewSample->get_frames(); + m_nSampleLength = nSampleLength; + float nScaleFactor = nSampleLength / (width() -50); + if ( nScaleFactor < 1 ){ + nScaleFactor = 1; + } - float fGain = height() / 4.0 * 1.0; - - auto pSampleDatal = pNewSample->get_data_l(); - auto pSampleDatar = pNewSample->get_data_r(); - - unsigned nSamplePos = 0; - int nVall = 0; - int nValr = 0; - int newVall = 0; - int newValr = 0; - for ( int i = 0; i < width(); ++i ){ - for ( int j = 0; j < nScaleFactor; ++j ) { - if ( j < nSampleLength && nSamplePos < nSampleLength) { - if ( pSampleDatal[ nSamplePos ] && pSampleDatar[ nSamplePos ] ){ - newVall = static_cast( pSampleDatal[ nSamplePos ] * fGain ); - newValr = static_cast( pSampleDatar[ nSamplePos ] * fGain ); - nVall = newVall; - nValr = newValr; - }else - { - nVall = 0; - nValr = 0; - } + float fGain = height() / 4.0 * 1.0; + + auto pSampleDatal = pNewSample->get_data_l(); + auto pSampleDatar = pNewSample->get_data_r(); + + unsigned nSamplePos = 0; + int nVall = 0; + int nValr = 0; + int newVall = 0; + int newValr = 0; + for ( int i = 0; i < width(); ++i ){ + for ( int j = 0; j < nScaleFactor; ++j ) { + if ( j < nSampleLength && nSamplePos < nSampleLength) { + if ( pSampleDatal[ nSamplePos ] && pSampleDatar[ nSamplePos ] ){ + newVall = static_cast( pSampleDatal[ nSamplePos ] * fGain ); + newValr = static_cast( pSampleDatar[ nSamplePos ] * fGain ); + nVall = newVall; + nValr = newValr; + }else + { + nVall = 0; + nValr = 0; } - ++nSamplePos; } - m_pPeakDatal[ i ] = nVall; - m_pPeakDatar[ i ] = nValr; + ++nSamplePos; } + m_pPeakDatal[ i ] = nVall; + m_pPeakDatar[ i ] = nValr; } update(); - -} -void MainSampleWaveDisplay::mouseUpdateDone() { - HydrogenApp::get_instance()->getSampleEditor()->returnAllMainWaveDisplayValues(); - m_bStartSliderIsMoved = false; - m_bLoopSliderIsMoved = false; - m_bEndSliderIsmoved = false; + return pNewSample; } - void MainSampleWaveDisplay::mouseMoveEvent(QMouseEvent *ev) { - if (ev->buttons() && Qt::LeftButton) { - testPosition( ev ); + if ( ev->buttons() && Qt::LeftButton ) { + if ( m_SelectedSlider != SampleEditor::Slider::NoSlider ) { + testPosition( ev ); + emit sliderEdited( m_SelectedSlider ); + } } else { chooseSlider( ev ); } update(); - mouseUpdateDone(); } void MainSampleWaveDisplay::mousePressEvent(QMouseEvent *ev) { chooseSlider( ev ); - testPosition( ev ); + if ( m_SelectedSlider != SampleEditor::Slider::NoSlider ) { + testPosition( ev ); + emit sliderEdited( m_SelectedSlider ); + } update(); - mouseUpdateDone(); } void MainSampleWaveDisplay::testPosition( QMouseEvent *ev ) @@ -249,35 +244,29 @@ void MainSampleWaveDisplay::testPosition( QMouseEvent *ev ) //startframepointer int x = std::min(width() - 25, std::max(25, ev->x())); - if ( m_SelectedSlider == START ) { + if ( m_SelectedSlider == SampleEditor::Slider::StartSlider ) { m_nStartFramePosition = x; - m_bStartSliderIsMoved = true; if ( m_nStartFramePosition > m_nLoopFramePosition ){ m_nLoopFramePosition = m_nStartFramePosition; - m_bLoopSliderIsMoved = true; } if ( m_nStartFramePosition > m_nEndFramePosition ){ m_nEndFramePosition = m_nStartFramePosition; - m_bEndSliderIsmoved = true; } } //loopframeposition - else if ( m_SelectedSlider == LOOP ) { + else if ( m_SelectedSlider == SampleEditor::Slider::LoopSlider ) { if (x >= m_nStartFramePosition && x <= m_nEndFramePosition ) { m_nLoopFramePosition = x ; - m_bLoopSliderIsMoved = true; } } //endframeposition - else if ( m_SelectedSlider == END) { + else if ( m_SelectedSlider == SampleEditor::Slider::EndSlider) { if (x >= m_nStartFramePosition) { m_nEndFramePosition = x ; - m_bEndSliderIsmoved = true; } if ( m_nEndFramePosition < m_nLoopFramePosition ){ m_nLoopFramePosition = m_nEndFramePosition; - m_bLoopSliderIsMoved = true; } } } @@ -285,9 +274,11 @@ void MainSampleWaveDisplay::testPosition( QMouseEvent *ev ) void MainSampleWaveDisplay::mouseReleaseEvent(QMouseEvent *ev) { - m_SelectedSlider = NONE; + if ( m_SelectedSlider != SampleEditor::Slider::NoSlider ) { + emit doneEditingSlider( m_SelectedSlider ); + } + m_SelectedSlider = SampleEditor::Slider::NoSlider; update(); - mouseUpdateDone(); } @@ -295,23 +286,33 @@ void MainSampleWaveDisplay::mouseReleaseEvent(QMouseEvent *ev) void MainSampleWaveDisplay::chooseSlider(QMouseEvent * ev) { - assert(ev); - - QPoint start = QPoint(m_nStartFramePosition, height()); - QPoint end = QPoint(m_nEndFramePosition, height() / 2); - QPoint loop = QPoint(m_nLoopFramePosition, 0); - - int ds = (ev->pos() - start).manhattanLength(); - int de = (ev->pos() - end).manhattanLength(); - int dl = (ev->pos() - loop).manhattanLength(); - m_SelectedSlider = NONE; - - if (ds <= de && ds <= dl) { - m_SelectedSlider = START; - } else if (de < ds && de <= dl) { - m_SelectedSlider = END; + int ds = std::abs(ev->x() - m_nStartFramePosition); + int de = std::abs(ev->x() - m_nEndFramePosition); + int dl = std::abs(ev->x() - m_nLoopFramePosition); + + if (ds < de && ds < dl) { + m_SelectedSlider = SampleEditor::Slider::StartSlider; + } else if (de < ds && de < dl) { + m_SelectedSlider = SampleEditor::Slider::EndSlider; } else if (dl < ds && dl < de) { - m_SelectedSlider = LOOP; + m_SelectedSlider = SampleEditor::Slider::LoopSlider; + } else { + QPoint start = QPoint(m_nStartFramePosition, height()); + QPoint end = QPoint(m_nEndFramePosition, height() / 2); + QPoint loop = QPoint(m_nLoopFramePosition, 0); + + ds = (ev->pos() - start).manhattanLength(); + de = (ev->pos() - end).manhattanLength(); + dl = (ev->pos() - loop).manhattanLength(); + if (ds <= de && ds <= dl) { + m_SelectedSlider = SampleEditor::Slider::StartSlider; + } else if (de < ds && de <= dl) { + m_SelectedSlider = SampleEditor::Slider::EndSlider; + } else if (dl < ds && dl < de) { + m_SelectedSlider = SampleEditor::Slider::LoopSlider; + } else { + m_SelectedSlider = SampleEditor::Slider::NoSlider; // should never occur + } } } diff --git a/src/gui/src/SampleEditor/MainSampleWaveDisplay.h b/src/gui/src/SampleEditor/MainSampleWaveDisplay.h index 30c184800..bd3089cb8 100644 --- a/src/gui/src/SampleEditor/MainSampleWaveDisplay.h +++ b/src/gui/src/SampleEditor/MainSampleWaveDisplay.h @@ -28,7 +28,6 @@ #include #include "SampleEditor.h" -class SampleEditor; class MainSampleWaveDisplay : public QWidget, public H2Core::Object { @@ -36,35 +35,29 @@ class MainSampleWaveDisplay : public QWidget, public H2Core::Object Q_OBJECT public: - - enum Slider { - NONE, - START, - LOOP, - END - }; - explicit MainSampleWaveDisplay(QWidget* pParent); ~MainSampleWaveDisplay(); - void updateDisplay( const QString& filename ); + std::shared_ptr loadSampleAndUpdateDisplay( const QString& filename ); void updateDisplayPointer(); void paintLocatorEvent( int pos, bool last_event); void paintEvent(QPaintEvent *ev); - + void testPositionFromSampleeditor(); - + int m_nStartFramePosition; int m_nLoopFramePosition; int m_nEndFramePosition; - bool m_bStartSliderIsMoved; - bool m_bLoopSliderIsMoved; - bool m_bEndSliderIsmoved; - Slider m_SelectedSlider; + SampleEditor::Slider m_SelectedSlider; + std::shared_ptr getEditedSample() { return m_pEditedSample; } + + signals: + void doneEditingSlider ( SampleEditor::Slider slider ); + void sliderEdited ( SampleEditor::Slider slider ); private: virtual void mouseMoveEvent(QMouseEvent *ev); @@ -73,11 +66,12 @@ class MainSampleWaveDisplay : public QWidget, public H2Core::Object void testPosition( QMouseEvent *ev ); void chooseSlider( QMouseEvent *ev ); void mouseUpdateDone(); - + + std::shared_ptr m_pEditedSample; QPixmap m_background; int* m_pPeakDatal; int* m_pPeakDatar; - + int m_nSampleLength; int m_nLocator; bool m_bUpdatePosition; diff --git a/src/gui/src/SampleEditor/SampleEditor.cpp b/src/gui/src/SampleEditor/SampleEditor.cpp index 88e8d64a7..9c1d5c1d0 100644 --- a/src/gui/src/SampleEditor/SampleEditor.cpp +++ b/src/gui/src/SampleEditor/SampleEditor.cpp @@ -62,7 +62,6 @@ SampleEditor::SampleEditor ( QWidget* pParent, int nSelectedComponent, int nSele m_pTargetDisplayTimer = new QTimer(this); connect(m_pTargetDisplayTimer, SIGNAL(timeout()), this, SLOT(updateTargetsamplePositionRuler())); - setClean(); m_nSelectedLayer = nSelectedLayer; m_nSelectedComponent = nSelectedComponent; m_sSampleName = sSampleFilename; @@ -93,7 +92,7 @@ SampleEditor::SampleEditor ( QWidget* pParent, int nSelectedComponent, int nSele if ( m_pSampleFromFile == nullptr ) { reject(); } - + // m_pEditedSample = std::make_shared(m_pSampleFromFile); unsigned slframes = m_pSampleFromFile->get_frames(); LoopCountSpinBox->setRange(0, 20000 ); @@ -106,26 +105,43 @@ SampleEditor::SampleEditor ( QWidget* pParent, int nSelectedComponent, int nSele __rubberband.use = false; __rubberband.divider = 1.0; + __rubberband.pitch = 0.0; + openDisplays(); getAllFrameInfos(); + doneEditing(); + setClean(); + + m_bAdjusting = false; + m_bSampleEditorClean = true; adjustSize(); setFixedSize ( width(), height() ); + connect( StartFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedStartFrameSpinBox(int) ) ); + connect( LoopFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedLoopFrameSpinBox(int) ) ); + connect( EndFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedEndFrameSpinBox(int) ) ); + connect( LoopCountSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedLoopCountSpinBox( int ) ) ); + connect( ProcessingTypeComboBox, SIGNAL( currentIndexChanged ( const QString ) ), this, SLOT( valueChangedProcessingTypeComboBox( const QString ) ) ); + connect( rubberComboBox, SIGNAL( currentIndexChanged ( const QString ) ), this, SLOT( valueChangedrubberComboBox( const QString ) ) ); + connect( rubberbandCsettingscomboBox, SIGNAL( currentIndexChanged ( const QString ) ), this, SLOT( valueChangedrubberbandCsettingscomboBox( const QString ) ) ); + connect( pitchdoubleSpinBox, SIGNAL ( valueChanged( double ) ), this, SLOT( valueChangedpitchdoubleSpinBox( double ) ) ); + connect( EditTypeComboBox, SIGNAL ( currentIndexChanged ( int ) ), this, SLOT( valueChangedEditTypeComboBox( int ) ) ); + + connect( m_pTargetSampleView, SIGNAL ( envelopeEdited ( SampleEditor::EnvelopeType ) ), this, SLOT( envelopeEdited ( SampleEditor::EnvelopeType ) ) ); + connect( m_pTargetSampleView, SIGNAL ( doneEditingEnvelope ( SampleEditor::EnvelopeType ) ), this, SLOT( envelopeEdited ( SampleEditor::EnvelopeType ) ) ); + + connect( m_pMainSampleWaveDisplay, SIGNAL ( sliderEdited ( SampleEditor::Slider ) ), this, SLOT( sliderEdited ( SampleEditor::Slider ) ) ); + connect( m_pMainSampleWaveDisplay, SIGNAL ( doneEditingSlider ( SampleEditor::Slider ) ), this, SLOT( sliderEdited ( SampleEditor::Slider ) ) ); + + #ifndef H2CORE_HAVE_RUBBERBAND if ( !Filesystem::file_executable( Preferences::get_instance()->m_rubberBandCLIexecutable , true /* silent */) ) { RubberbandCframe->setDisabled ( true ); - setClean(); } #else RubberbandCframe->setDisabled ( false ); - setClean(); #endif - - __rubberband.pitch = 0.0; - - m_bAdjusting = false; - m_bSampleEditorClean = true; } @@ -147,6 +163,37 @@ SampleEditor::~SampleEditor() INFOLOG ( "DESTROY" ); } +void SampleEditor::envelopeEdited( SampleEditor::EnvelopeType mode) +{ + returnAllTargetDisplayValues(); + setUnclean(); + doneEditing(); +} + +void SampleEditor::doneEditing() { + auto edited = std::make_shared(m_pSampleFromFile); + edited->apply(__loops, + __rubberband, + *m_pTargetSampleView->get_velocity(), + *m_pTargetSampleView->get_pan()); + m_pTargetSampleView->updateDisplay( edited, 1.0 ); + m_pEditedSample = edited; +} + +void SampleEditor::sliderEdited( SampleEditor::Slider slider ) +{ + returnAllMainWaveDisplayValues(); + if ( __rubberband.use && + (slider == SampleEditor::Slider::StartSlider || + slider == SampleEditor::Slider::EndSlider || + slider == SampleEditor::Slider::LoopSlider && __loops.count) + ) { + __rubberband.divider = computeNoopRubberbandDivider(); + } + setUnclean(); + doneEditing(); +} + void SampleEditor::closeEvent(QCloseEvent *event) { @@ -167,26 +214,34 @@ void SampleEditor::closeEvent(QCloseEvent *event) void SampleEditor::getAllFrameInfos() { + H2Core::Hydrogen *hydrogen = Hydrogen::get_instance(); std::shared_ptr pInstrument = nullptr; - std::shared_ptr pSample; - std::shared_ptr pSong = Hydrogen::get_instance()->getSong(); - - if (pSong != nullptr) { - InstrumentList *pInstrList = pSong->getInstrumentList(); - int nInstr = Hydrogen::get_instance()->getSelectedInstrumentNumber(); - if ( nInstr >= static_cast(pInstrList->size()) ) { - nInstr = -1; - } + std::shared_ptr pSample = nullptr; + std::shared_ptr pSong = nullptr; - if (nInstr == -1) { - pInstrument = nullptr; - } - else { - pInstrument = pInstrList->get( nInstr ); - //INFOLOG( "new instr: " + pInstrument->m_sName ); - } + if ( ! hydrogen ) { + // qWarning() << "no hydrogen"; + return; } - + pSong = hydrogen->getSong(); + if ( ! pSong ) { + // qWarning() << "no song"; + return; + } + InstrumentList *pInstrList = pSong->getInstrumentList(); + int nInstr = hydrogen->getSelectedInstrumentNumber(); + if ( nInstr >= static_cast(pInstrList->size()) ) { + nInstr = -1; + } + + if (nInstr == -1) { + pInstrument = nullptr; + } + else { + pInstrument = pInstrList->get( nInstr ); + //INFOLOG( "new instr: " + pInstrument->m_sName ); + } + assert( pInstrument ); auto pCompo = pInstrument->get_component(0); @@ -196,7 +251,7 @@ void SampleEditor::getAllFrameInfos() if ( pLayer ) { pSample = pLayer->get_sample(); } - + assert( pSample ); //this values are needed if we restore a sample from disk if a new song with sample changes will load @@ -204,6 +259,9 @@ void SampleEditor::getAllFrameInfos() m_nSamplerate = pSample->get_sample_rate(); __loops = pSample->get_loops(); __rubberband = pSample->get_rubberband(); + qWarning() << "gafi rb use " << __rubberband.use + << "divider: " << __rubberband.divider + << "pitch: " << __rubberband.pitch; if ( pSample->get_velocity_envelope()->size()==0 ) { m_pTargetSampleView->get_velocity()->clear(); @@ -237,7 +295,7 @@ void SampleEditor::getAllFrameInfos() if ( __loops.mode == Sample::Loops::PINGPONG ) { ProcessingTypeComboBox->setCurrentIndex ( 2 ); } - + StartFrameSpinBox->setValue( __loops.start_frame ); LoopFrameSpinBox->setValue( __loops.loop_frame ); EndFrameSpinBox->setValue( __loops.end_frame ); @@ -250,24 +308,21 @@ void SampleEditor::getAllFrameInfos() m_pMainSampleWaveDisplay->m_nEndFramePosition = __loops.end_frame / m_divider + 25 ; m_pMainSampleWaveDisplay->updateDisplayPointer(); - if( !__rubberband.use ) { - rubberComboBox->setCurrentIndex( 0 ); - } - rubberbandCsettingscomboBox->setCurrentIndex( __rubberband.c_settings ); - if( !__rubberband.use ) { - rubberbandCsettingscomboBox->setCurrentIndex( 4 ); - } - + pitchdoubleSpinBox->setValue( __rubberband.pitch ); - if( !__rubberband.use ) { + if( !__rubberband.use ) { pitchdoubleSpinBox->setValue( 0.0 ); } - if( __rubberband.divider == 1.0/64.0) { + setSamplelengthFrames(); + qWarning() << "currentRatio: " << computeCurrentRatio(); + if ( !__rubberband.use || (std::abs(computeCurrentRatio() - 1.0) < 0.0001) ) { + qWarning() << "Setting"; + rubberComboBox->setCurrentIndex( 0 ); + } else if( __rubberband.divider == 1.0/64.0) { rubberComboBox->setCurrentIndex( 1 ); - } - else if( __rubberband.divider == 1.0/32.0) { + } else if( __rubberband.divider == 1.0/32.0) { rubberComboBox->setCurrentIndex( 2 ); } else if( __rubberband.divider == 1.0/16.0) { rubberComboBox->setCurrentIndex( 3 ); @@ -277,24 +332,14 @@ void SampleEditor::getAllFrameInfos() rubberComboBox->setCurrentIndex( 5 ); } else if( __rubberband.divider == 1.0/2.0) { rubberComboBox->setCurrentIndex( 6 ); - } else if( __rubberband.use && ( __rubberband.divider >= 1.0 ) ) { + } else if( __rubberband.use && ( __rubberband.divider >= 1.0 ) ) { rubberComboBox->setCurrentIndex( (int)(__rubberband.divider + 6) ); } - - setSamplelengthFrames(); + checkRatioSettings(); } m_pTargetSampleView->updateDisplay( pLayer ); - - connect( StartFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedStartFrameSpinBox(int) ) ); - connect( LoopFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedLoopFrameSpinBox(int) ) ); - connect( EndFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedEndFrameSpinBox(int) ) ); - connect( LoopCountSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedLoopCountSpinBox( int ) ) ); - connect( ProcessingTypeComboBox, SIGNAL( currentIndexChanged ( const QString ) ), this, SLOT( valueChangedProcessingTypeComboBox( const QString ) ) ); - connect( rubberComboBox, SIGNAL( currentIndexChanged ( const QString ) ), this, SLOT( valueChangedrubberComboBox( const QString ) ) ); - connect( rubberbandCsettingscomboBox, SIGNAL( currentIndexChanged ( const QString ) ), this, SLOT( valueChangedrubberbandCsettingscomboBox( const QString ) ) ); - connect( pitchdoubleSpinBox, SIGNAL ( valueChanged( double ) ), this, SLOT( valueChangedpitchdoubleSpinBox( double ) ) ); } void SampleEditor::getAllLocalFrameInfos() @@ -311,13 +356,14 @@ void SampleEditor::openDisplays() { // wavedisplays m_divider = m_pSampleFromFile->get_frames() / 574.0F; - m_pMainSampleWaveDisplay->updateDisplay( m_sSampleName ); + auto sample = m_pMainSampleWaveDisplay->loadSampleAndUpdateDisplay( m_sSampleName ); + m_pMainSampleWaveDisplay->move( 1, 1 ); m_pSampleAdjustView->updateDisplay( m_sSampleName ); m_pSampleAdjustView->move( 1, 1 ); - m_pTargetSampleView->move( 1, 1 ); + m_pTargetSampleView->updateDisplay( sample, 1.0 ); } @@ -392,7 +438,7 @@ void SampleEditor::createNewLayer() pInstrument = pInstrList->get( nInstr ); } } - + std::shared_ptr pLayer = nullptr; if( pInstrument ) { pLayer = pInstrument->get_component(0)->get_layer( m_nSelectedLayer ); @@ -424,13 +470,15 @@ bool SampleEditor::returnAllMainWaveDisplayValues() testpTimer(); // QMessageBox::information ( this, "Hydrogen", tr ( "jep %1" ).arg(m_pSample->get_frames())); - m_bSampleIsModified = true; - if( m_pMainSampleWaveDisplay->m_bStartSliderIsMoved ) __loops.start_frame = m_pMainSampleWaveDisplay->m_nStartFramePosition * m_divider - 25 * m_divider; - if( m_pMainSampleWaveDisplay->m_bLoopSliderIsMoved ) __loops.loop_frame = m_pMainSampleWaveDisplay->m_nLoopFramePosition * m_divider - 25 * m_divider; - if( m_pMainSampleWaveDisplay->m_bEndSliderIsmoved ) __loops.end_frame = m_pMainSampleWaveDisplay->m_nEndFramePosition * m_divider - 25 * m_divider ; - StartFrameSpinBox->setValue( __loops.start_frame ); - LoopFrameSpinBox->setValue( __loops.loop_frame ); - EndFrameSpinBox->setValue( __loops.end_frame ); + if (m_pMainSampleWaveDisplay->m_SelectedSlider != SampleEditor::NoSlider) { + m_bSampleIsModified = true; + __loops.start_frame = m_pMainSampleWaveDisplay->m_nStartFramePosition * m_divider - 25 * m_divider; + __loops.loop_frame = m_pMainSampleWaveDisplay->m_nLoopFramePosition * m_divider - 25 * m_divider; + __loops.end_frame = m_pMainSampleWaveDisplay->m_nEndFramePosition * m_divider - 25 * m_divider ; + StartFrameSpinBox->setValue( __loops.start_frame ); + LoopFrameSpinBox->setValue( __loops.loop_frame ); + EndFrameSpinBox->setValue( __loops.end_frame ); + } m_bOnewayStart = true; m_bOnewayLoop = true; m_bOnewayEnd = true; @@ -461,20 +509,17 @@ void SampleEditor::setClean() PrevChangesPushButton->setFlat ( true ); } -void SampleEditor::valueChangedStartFrameSpinBox( int ) +void SampleEditor::valueChangedStartFrameSpinBox( int value) { - testpTimer(); - m_pDetailFrame = StartFrameSpinBox->value(); - if (m_pDetailFrame == __loops.start_frame) { // no actual change - if (! m_bAdjusting ) on_PlayPushButton_clicked(); - return; - } + bool change = (value != __loops.start_frame); + if ( change && ! m_bAdjusting ) testpTimer(); + m_pDetailFrame = value; m_sLineColor = "Start"; if ( !m_bOnewayStart ){ m_pMainSampleWaveDisplay->m_nStartFramePosition = StartFrameSpinBox->value() / m_divider + 25 ; m_pMainSampleWaveDisplay->updateDisplayPointer(); m_pSampleAdjustView->setDetailSamplePosition( m_pDetailFrame, m_fZoomfactor , m_sLineColor); - __loops.start_frame = m_pDetailFrame; + __loops.start_frame = value; }else { @@ -482,107 +527,71 @@ void SampleEditor::valueChangedStartFrameSpinBox( int ) m_bOnewayStart = false; } testPositionsSpinBoxes(); - setUnclean(); setSamplelengthFrames(); + if ( change ) { + setUnclean(); + } + doneEditing(); } -void SampleEditor::valueChangedLoopFrameSpinBox( int ) +void SampleEditor::valueChangedLoopFrameSpinBox( int value ) { - testpTimer(); - m_pDetailFrame = LoopFrameSpinBox->value(); - if (m_pDetailFrame == __loops.loop_frame) { - if ( ! m_bAdjusting ) on_PlayPushButton_clicked(); - return; - } + bool change = (value != __loops.loop_frame); + if ( change && ! m_bAdjusting ) testpTimer(); + m_pDetailFrame = value; m_sLineColor = "Loop"; if ( !m_bOnewayLoop ){ m_pMainSampleWaveDisplay->m_nLoopFramePosition = LoopFrameSpinBox->value() / m_divider + 25 ; m_pMainSampleWaveDisplay->updateDisplayPointer(); m_pSampleAdjustView->setDetailSamplePosition( m_pDetailFrame, m_fZoomfactor , m_sLineColor); - __loops.loop_frame = m_pDetailFrame; + __loops.loop_frame = value; }else { m_pSampleAdjustView->setDetailSamplePosition( m_pDetailFrame, m_fZoomfactor , m_sLineColor); m_bOnewayLoop = false; } testPositionsSpinBoxes(); - setUnclean(); setSamplelengthFrames(); + if ( change ) { + setUnclean(); + } + doneEditing(); } -void SampleEditor::valueChangedEndFrameSpinBox( int ) +void SampleEditor::valueChangedEndFrameSpinBox( int value) { - testpTimer(); - m_pDetailFrame = EndFrameSpinBox->value(); - if ( m_pDetailFrame == __loops.end_frame) { - if ( ! m_bAdjusting ) on_PlayPushButton_clicked(); - return; - } + bool change = (value != __loops.end_frame); + if ( change && ! m_bAdjusting ) testpTimer(); + m_pDetailFrame = value; m_sLineColor = "End"; if ( !m_bOnewayEnd ){ m_pMainSampleWaveDisplay->m_nEndFramePosition = EndFrameSpinBox->value() / m_divider + 25 ; m_pMainSampleWaveDisplay->updateDisplayPointer(); m_pSampleAdjustView->setDetailSamplePosition( m_pDetailFrame, m_fZoomfactor , m_sLineColor); - __loops.end_frame = m_pDetailFrame; + __loops.end_frame = value; }else { m_bOnewayEnd = false; m_pSampleAdjustView->setDetailSamplePosition( m_pDetailFrame, m_fZoomfactor , m_sLineColor); } testPositionsSpinBoxes(); - setUnclean(); setSamplelengthFrames(); + if ( change ) { + setUnclean(); + } + doneEditing(); } void SampleEditor::on_PlayPushButton_clicked() { - Hydrogen* pHydrogen = Hydrogen::get_instance(); - - if (PlayPushButton->text() == "Stop" ){ + if (PlayPushButton->text() == "Stop" ){ // this should be a better way if we want to translate this label testpTimer(); return; } - const float fPan = 0.f; - const int nLength = -1; - const float fPitch = 0.0f; - const int selectedLayer = InstrumentEditorPanel::get_instance()->getSelectedLayer(); - - std::shared_ptr pSong = Hydrogen::get_instance()->getSong(); - if ( pSong == nullptr ) { - return; - } - auto pInstr = pSong->getInstrumentList()->get( Hydrogen::get_instance()->getSelectedInstrumentNumber() ); - if ( pInstr == nullptr ) { - return; - } - Note *pNote = new Note( pInstr, 0, pInstr->get_component( m_nSelectedComponent )->get_layer( selectedLayer )->get_end_velocity() - 0.01, fPan, nLength, fPitch); - pNote->set_specific_compo_id( m_nSelectedComponent ); - pHydrogen->getAudioEngine()->getSampler()->noteOn(pNote); - - setSamplelengthFrames(); - createPositionsRulerPath(); - m_bPlayButton = true; - m_pMainSampleWaveDisplay->paintLocatorEvent( StartFrameSpinBox->value() / m_divider + 24 , true); - m_pSampleAdjustView->setDetailSamplePosition( __loops.start_frame, m_fZoomfactor , nullptr); - - if( __rubberband.use == false ){ - m_pTimer->start(40); // update ruler at 25 fps - } + playSample(m_pEditedSample); - - m_nRealtimeFrameEnd = pHydrogen->getRealtimeFrames() + m_nSlframes; - - //calculate the new rubberband sample length - if( __rubberband.use ){ - m_nRealtimeFrameEndForTarget = pHydrogen->getRealtimeFrames() + (m_nSlframes * m_fRatio + 0.1); - }else - { - m_nRealtimeFrameEndForTarget = m_nRealtimeFrameEnd; - } - m_pTargetDisplayTimer->start(40); // update ruler at 25 fps PlayPushButton->setText( QString( "Stop") ); - } void SampleEditor::on_PlayOrigPushButton_clicked() @@ -592,6 +601,13 @@ void SampleEditor::on_PlayOrigPushButton_clicked() return; } + playSample(m_pSampleFromFile); + + PlayOrigPushButton->setText( QString( "Stop") ); +} + +void SampleEditor::playSample(const std::shared_ptr sample) +{ const int selectedlayer = InstrumentEditorPanel::get_instance()->getSelectedLayer(); std::shared_ptr pSong = Hydrogen::get_instance()->getSong(); auto pInstr = pSong->getInstrumentList()->get( Hydrogen::get_instance()->getSelectedInstrumentNumber() ); @@ -601,7 +617,7 @@ void SampleEditor::on_PlayOrigPushButton_clicked() *instrument. Otherwise pInstr would be deleted if consumed by preview_instrument. */ auto pTmpInstrument = Instrument::load_instrument( pInstr->get_drumkit_name(), pInstr->get_name() ); - auto pNewSample = Sample::load( pInstr->get_component(0)->get_layer( selectedlayer )->get_sample()->get_filepath() ); + auto pNewSample = std::make_shared(sample); if ( pNewSample != nullptr ){ int length = ( ( pNewSample->get_frames() / pNewSample->get_sample_rate() + 1) * 100 ); @@ -614,7 +630,6 @@ void SampleEditor::on_PlayOrigPushButton_clicked() m_pSampleAdjustView->setDetailSamplePosition( __loops.start_frame, m_fZoomfactor , nullptr); m_pTimer->start(40); // update ruler at 25 fps m_nRealtimeFrameEnd = Hydrogen::get_instance()->getRealtimeFrames() + m_nSlframes; - PlayOrigPushButton->setText( QString( "Stop") ); } void SampleEditor::updateMainsamplePositionRuler() @@ -776,28 +791,26 @@ void SampleEditor::setSamplelengthFrames() -void SampleEditor::valueChangedLoopCountSpinBox( int ) +void SampleEditor::valueChangedLoopCountSpinBox( int value ) { - testpTimer(); - int count = LoopCountSpinBox->value(); + Hydrogen *hydrogen = Hydrogen::get_instance(); + bool change = (value != __loops.count); - if (count == __loops.count) { - if ( ! m_bAdjusting ) on_PlayOrigPushButton_clicked(); - return; - } - if ( m_nSlframes > Hydrogen::get_instance()->getAudioOutput()->getSampleRate() * 60 ){ - Hydrogen::get_instance()->getAudioEngine()->getSampler()->stopPlayingNotes(); + if ( change && ! m_bAdjusting ) testpTimer(); + + if ( hydrogen && m_nSlframes > hydrogen->getAudioOutput()->getSampleRate() * 60 ){ + hydrogen->getAudioEngine()->getSampler()->stopPlayingNotes(); m_pMainSampleWaveDisplay->paintLocatorEvent( -1 , false); m_pTimer->stop(); m_bPlayButton = false; } - __loops.count = count; - setUnclean(); + __loops.count = value; setSamplelengthFrames(); - if ( m_nSlframes > Hydrogen::get_instance()->getAudioOutput()->getSampleRate() * 60 * 30){ // >30 min + if ( hydrogen && m_nSlframes > hydrogen->getAudioOutput()->getSampleRate() * 60 * 30){ // >30 min LoopCountSpinBox->setMaximum(LoopCountSpinBox->value() -1); } - + if (change) setUnclean(); + doneEditing(); } @@ -805,12 +818,12 @@ void SampleEditor::valueChangedLoopCountSpinBox( int ) void SampleEditor::valueChangedrubberbandCsettingscomboBox( const QString ) { int new_settings = rubberbandCsettingscomboBox->currentIndex(); - if (new_settings == __rubberband.c_settings) { - if (! m_bAdjusting ) on_PlayPushButton_clicked(); - return; - } + bool change = (new_settings != __rubberband.c_settings); + + if ( ! change && ! m_bAdjusting ) testpTimer(); __rubberband.c_settings = new_settings; - setUnclean(); + if ( change ) setUnclean(); + doneEditing(); } @@ -818,30 +831,41 @@ void SampleEditor::valueChangedrubberbandCsettingscomboBox( const QString ) void SampleEditor::valueChangedpitchdoubleSpinBox( double ) { double new_value = pitchdoubleSpinBox->value(); - if (std::abs(new_value - __rubberband.pitch) < 0.0001) { - if (! m_bAdjusting ) on_PlayPushButton_clicked(); - return; + bool change = (std::abs(new_value - __rubberband.pitch) >= 0.0001); + if ( change ) { + bool used = __rubberband.use; + __rubberband.pitch = new_value; + __rubberband.use |= __rubberband.use = std::abs(__rubberband.pitch) >= 0.0001; + if (!used && __rubberband.use) { + valueChangedrubberComboBox(""); + } + // f (used != __rubberband.use) { + // if (!used) { + // __rubberband.divider == computeNoopRubberbandDivider(); + // // checkRatioSettings(); + // } + // } + setUnclean(); } - __rubberband.pitch = new_value; - setUnclean(); + doneEditing(); } void SampleEditor::valueChangedrubberComboBox( const QString ) { - + bool current_usage = __rubberband.use; + float current_divider = __rubberband.divider; if( rubberComboBox->currentText() != "off" ){ __rubberband.use = true; }else { - __rubberband.use = false; - __rubberband.divider = 1.0; + __rubberband.use = std::abs(__rubberband.pitch) >= 0.0001; } switch ( rubberComboBox->currentIndex() ){ case 0 :// - __rubberband.divider = 4.0; + __rubberband.divider = computeNoopRubberbandDivider(); break; case 1 :// __rubberband.divider = 1.0/64.0; @@ -870,17 +894,37 @@ void SampleEditor::valueChangedrubberComboBox( const QString ) // QMessageBox::information ( this, "Hydrogen", tr ( "divider %1" ).arg( __rubberband.divider )); // float __rubberband.divider; setSamplelengthFrames(); + bool change = (current_usage != __rubberband.use) || (std::abs(current_divider - __rubberband.divider) >= 0.0001); + if ( change ) setUnclean(); + doneEditing(); +} +double SampleEditor::computeNoopRubberbandDivider() +{ + double bpm = Hydrogen::get_instance()->getNewBpmJTM(); + double duration = (double) m_nSlframes / (double) m_nSamplerate; + return duration * bpm / 60; +} + +double SampleEditor::computeCurrentRatio() +{ + double durationtime = 60.0 / Hydrogen::get_instance()->getNewBpmJTM() * __rubberband.divider; + double induration = (double) m_nSlframes / (double) m_nSamplerate; + qWarning() << "induration: "<< induration << "durationtime: " << durationtime; + if (induration == 0.0) + return -1; + double ratio = durationtime / induration; + qWarning() << "ratio: " << ratio; + return ratio; + +// if (induration != 0.0) m_fRatio = durationtime / induration; - setUnclean(); } void SampleEditor::checkRatioSettings() { //calculate ratio - double durationtime = 60.0 / Hydrogen::get_instance()->getNewBpmJTM() * __rubberband.divider; - double induration = (double) m_nSlframes / (double) m_nSamplerate; - if (induration != 0.0) m_fRatio = durationtime / induration; + m_fRatio = computeCurrentRatio(); //my personal ratio quality settings //ratios < 0.1 || > 3.0 are bad (red) or experimental sounds @@ -916,6 +960,7 @@ void SampleEditor::checkRatioSettings() void SampleEditor::valueChangedProcessingTypeComboBox( const QString unused ) { + Sample::Loops::LoopMode previous = __loops.mode; switch ( ProcessingTypeComboBox->currentIndex() ){ case 0 :// __loops.mode = Sample::Loops::FORWARD; @@ -929,11 +974,38 @@ void SampleEditor::valueChangedProcessingTypeComboBox( const QString unused ) default: __loops.mode = Sample::Loops::FORWARD; } - setUnclean(); + if (previous != __loops.mode) { + setUnclean(); + } + doneEditing(); } + +void SampleEditor::valueChangedEditTypeComboBox( int index ) +{ + if ( ! m_pTargetSampleView ) { + // qWarning() << "no TargetSampleView!"; + return; + } + switch ( index ){ + case 0 :// + m_pTargetSampleView->setEditMode( SampleEditor::EnvelopeType::VelocityEnvelope ); + break; + case 1 :// + if ( m_pTargetSampleView ) { + m_pTargetSampleView->setEditMode( SampleEditor::EnvelopeType::PanEnvelope ); + } + break; + default: + if ( m_pTargetSampleView ) { + m_pTargetSampleView->setEditMode( SampleEditor::EnvelopeType::NoEnvelope ); + } + } +} + + void SampleEditor::on_verticalzoomSlider_valueChanged( int value ) { m_fZoomfactor = value / 10 +1; diff --git a/src/gui/src/SampleEditor/SampleEditor.h b/src/gui/src/SampleEditor/SampleEditor.h index 3854e7917..2b2d7b35b 100644 --- a/src/gui/src/SampleEditor/SampleEditor.h +++ b/src/gui/src/SampleEditor/SampleEditor.h @@ -47,8 +47,20 @@ class SampleEditor : public QDialog, public Ui_SampleEditor_UI, public H2Core::O H2_OBJECT(SampleEditor) Q_OBJECT public: - - SampleEditor( QWidget* pParent, int nSelectedComponent, int nSelectedLayer, QString nSampleFilename ); + + enum Slider { + NoSlider, + StartSlider, + EndSlider, + LoopSlider + }; + enum EnvelopeType { + NoEnvelope, + VelocityEnvelope, + PanEnvelope + }; + SampleEditor( QWidget* pParent, + int nSelectedComponent, int nSelectedLayer, QString nSampleFilename ); ~SampleEditor(); void setSampleName( QString name); @@ -58,9 +70,24 @@ class SampleEditor : public QDialog, public Ui_SampleEditor_UI, public H2Core::O void setUnclean(); void setClean(); + void playSample(const std::shared_ptr sample); + double computeNoopRubberbandDivider(); + double computeCurrentRatio(); //this values come from the real sample to restore a frm song loaded sample bool m_bSampleIsModified; ///< true if sample is modified + protected: + MainSampleWaveDisplay *m_pMainSampleWaveDisplay; + TargetWaveDisplay *m_pTargetSampleView; + DetailWaveDisplay *m_pSampleAdjustView; + + public slots: + void envelopeEdited( SampleEditor::EnvelopeType mode); + void sliderEdited( SampleEditor::Slider slider); + void doneEditing(); + + public slots: + void valueChangedEditTypeComboBox( int ); private slots: void valueChangedLoopCountSpinBox( int ); void valueChangedProcessingTypeComboBox( const QString ); @@ -69,9 +96,11 @@ class SampleEditor : public QDialog, public Ui_SampleEditor_UI, public H2Core::O void valueChangedpitchdoubleSpinBox( double ); void on_ClosePushButton_clicked(); void on_PrevChangesPushButton_clicked(); + void valueChangedStartFrameSpinBox( int ); void valueChangedLoopFrameSpinBox( int ); void valueChangedEndFrameSpinBox( int ); + void on_PlayPushButton_clicked(); void on_PlayOrigPushButton_clicked(); void on_verticalzoomSlider_valueChanged ( int value ); @@ -95,16 +124,14 @@ class SampleEditor : public QDialog, public Ui_SampleEditor_UI, public H2Core::O void checkRatioSettings(); virtual void mouseReleaseEvent(QMouseEvent *ev); - - MainSampleWaveDisplay *m_pMainSampleWaveDisplay; - TargetWaveDisplay *m_pTargetSampleView; - DetailWaveDisplay *m_pSampleAdjustView; - + + std::shared_ptr m_pSampleFromFile; + std::shared_ptr m_pEditedSample; int m_nSelectedLayer; int m_nSelectedComponent; QString m_sSampleName; - + double m_divider; float m_fZoomfactor; unsigned m_pDetailFrame; @@ -116,7 +143,7 @@ class SampleEditor : public QDialog, public Ui_SampleEditor_UI, public H2Core::O bool m_bPlayButton; bool m_bAdjusting; bool m_bSampleEditorClean; - + unsigned long m_nRealtimeFrameEnd; unsigned long m_nRealtimeFrameEndForTarget; unsigned m_nSlframes; diff --git a/src/gui/src/SampleEditor/TargetWaveDisplay.cpp b/src/gui/src/SampleEditor/TargetWaveDisplay.cpp index b5c2648fc..f62e3533f 100644 --- a/src/gui/src/SampleEditor/TargetWaveDisplay.cpp +++ b/src/gui/src/SampleEditor/TargetWaveDisplay.cpp @@ -40,7 +40,6 @@ using namespace H2Core; #include "TargetWaveDisplay.h" #include "../Skin.h" -static TargetWaveDisplay::EnvelopeEditMode getEnvelopeEditMode(); TargetWaveDisplay::TargetWaveDisplay(QWidget* pParent) : QWidget( pParent ) @@ -68,12 +67,11 @@ TargetWaveDisplay::TargetWaveDisplay(QWidget* pParent) m_UpdatePosition = false; m_nSelectedEnvelopePoint = -1; m_nSnapRadius = 6; + m_EditMode = SampleEditor::VelocityEnvelope; setMouseTracking(true); } - - TargetWaveDisplay::~TargetWaveDisplay() { //INFOLOG( "DESTROY" ); @@ -82,6 +80,12 @@ TargetWaveDisplay::~TargetWaveDisplay() delete[] m_pPeakData_Right; } +void TargetWaveDisplay::setEditMode(SampleEditor::EnvelopeType mode) +{ + // qWarning() << "SetEditMode:" << mode; + m_EditMode = mode; +} + static void paintEnvelope(Sample::VelocityEnvelope &envelope, QPainter &painter, int selected, const QColor & lineColor, const QColor & handleColor, const QColor & selectedColor) { @@ -114,8 +118,6 @@ void TargetWaveDisplay::paintEvent(QPaintEvent *ev) { QPainter painter( this ); - m_EditMode = getEnvelopeEditMode(); - painter.setRenderHint( QPainter::Antialiasing ); painter.drawPixmap( ev->rect(), m_Background, ev->rect() ); painter.setPen( QColor( 252, 142, 73 )); @@ -148,10 +150,10 @@ void TargetWaveDisplay::paintEvent(QPaintEvent *ev) QColor selectedtHandleColor = QColor( 255, 100, 90 ); //volume line - paintEnvelope(m_VelocityEnvelope, painter, m_EditMode == TargetWaveDisplay::VELOCITY ? m_nSelectedEnvelopePoint : -1, + paintEnvelope(m_VelocityEnvelope, painter, m_EditMode == SampleEditor::VelocityEnvelope ? m_nSelectedEnvelopePoint : -1, volumeLineColor, volumeHandleColor, selectedtHandleColor); //pan line - paintEnvelope(m_PanEnvelope, painter, m_EditMode == TargetWaveDisplay::PAN ? m_nSelectedEnvelopePoint : -1, + paintEnvelope(m_PanEnvelope, painter, m_EditMode == SampleEditor::PanEnvelope ? m_nSelectedEnvelopePoint : -1, panLineColor, panHandleColor, selectedtHandleColor); painter.setPen( QPen( QColor( 255, 255, 255 ), 1, Qt::DotLine ) ); @@ -202,45 +204,54 @@ void TargetWaveDisplay::paintLocatorEventTargetDisplay( int pos, bool updateposi void TargetWaveDisplay::updateDisplay( std::shared_ptr pLayer ) { - if ( pLayer && pLayer->get_sample() ) { - - int nSampleLength = pLayer->get_sample()->get_frames(); - float nScaleFactor = nSampleLength / width(); - - float fGain = (height() - 8) / 2.0 * pLayer->get_gain(); - - auto pSampleDatal = pLayer->get_sample()->get_data_l(); - auto pSampleDatar = pLayer->get_sample()->get_data_r(); - int nSamplePos = 0; - int nVall; - int nValr; - for ( int i = 0; i < width(); ++i ){ - nVall = 0; - nValr = 0; - for ( int j = 0; j < nScaleFactor; ++j ) { - if ( j < nSampleLength ) { - if ( pSampleDatal[ nSamplePos ] < 0 ){ - int newVal = static_cast( pSampleDatal[ nSamplePos ] * -fGain ); - nVall = newVal; - }else - { - int newVal = static_cast( pSampleDatal[ nSamplePos ] * fGain ); - nVall = newVal; - } - if ( pSampleDatar[ nSamplePos ] > 0 ){ - int newVal = static_cast( pSampleDatar[ nSamplePos ] * -fGain ); - nValr = newVal; - }else - { - int newVal = static_cast( pSampleDatar[ nSamplePos ] * fGain ); - nValr = newVal; - } + // qWarning() << "TargetWaveDisplay::updateDisplay: layer:" << pLayer; + if ( ! pLayer ) { + return; + } + updateDisplay( pLayer->get_sample(), pLayer->get_gain() ); +} + +void TargetWaveDisplay::updateDisplay( std::shared_ptr sample, double gain ) +{ + // qWarning() << "TargetWaveDisplay::updateDisplay: sample:" << sample; + + int nSampleLength = sample->get_frames(); + float nScaleFactor = nSampleLength / width(); + + float fGain = (height() - 8) / 2.0 * gain; + + auto pSampleDatal = sample->get_data_l(); + auto pSampleDatar = sample->get_data_r(); + + int nSamplePos = 0; + int nVall; + int nValr; + for ( int i = 0; i < width(); ++i ){ + nVall = 0; + nValr = 0; + for ( int j = 0; j < nScaleFactor; ++j ) { + if ( j < nSampleLength ) { + if ( pSampleDatal[ nSamplePos ] < 0 ){ + int newVal = static_cast( pSampleDatal[ nSamplePos ] * -fGain ); + nVall = newVal; + }else + { + int newVal = static_cast( pSampleDatal[ nSamplePos ] * fGain ); + nVall = newVal; + } + if ( pSampleDatar[ nSamplePos ] > 0 ){ + int newVal = static_cast( pSampleDatar[ nSamplePos ] * -fGain ); + nValr = newVal; + }else + { + int newVal = static_cast( pSampleDatar[ nSamplePos ] * fGain ); + nValr = newVal; } - ++nSamplePos; } - m_pPeakData_Left[ i ] = nVall; - m_pPeakData_Right[ i ] = nValr; + ++nSamplePos; } + m_pPeakData_Left[ i ] = nVall; + m_pPeakData_Right[ i ] = nValr; } update(); @@ -249,8 +260,7 @@ void TargetWaveDisplay::updateDisplay( std::shared_ptr void TargetWaveDisplay::updateMouseSelection(QMouseEvent *ev) { - m_EditMode = getEnvelopeEditMode(); - const Sample::VelocityEnvelope & envelope = (m_EditMode == TargetWaveDisplay::VELOCITY) ? m_VelocityEnvelope : m_PanEnvelope; + const Sample::VelocityEnvelope & envelope = (m_EditMode == SampleEditor::VelocityEnvelope) ? m_VelocityEnvelope : m_PanEnvelope; m_nX = std::min(UI_WIDTH, std::max(0, ev->x())); m_nY = std::min(UI_HEIGHT, std::max(0, ev->y())); @@ -284,8 +294,7 @@ void TargetWaveDisplay::updateEnvelope() if ( m_nSelectedEnvelopePoint == -1 ) { return; } - m_EditMode = getEnvelopeEditMode(); - Sample::VelocityEnvelope & envelope = (m_EditMode == TargetWaveDisplay::VELOCITY) ? m_VelocityEnvelope : m_PanEnvelope; + Sample::VelocityEnvelope & envelope = (m_EditMode == SampleEditor::VelocityEnvelope) ? m_VelocityEnvelope : m_PanEnvelope; envelope.erase( envelope.begin() + m_nSelectedEnvelopePoint ); if ( m_nSelectedEnvelopePoint == 0 ){ m_nX = 0; @@ -316,15 +325,14 @@ void TargetWaveDisplay::mouseMoveEvent(QMouseEvent *ev) updateEnvelope(); updateMouseSelection(ev); update(); - HydrogenApp::get_instance()->getSampleEditor()->setUnclean(); + emit envelopeEdited ( m_EditMode ); } void TargetWaveDisplay::mousePressEvent(QMouseEvent *ev) { - m_EditMode = getEnvelopeEditMode(); - Sample::VelocityEnvelope & envelope = (m_EditMode == TargetWaveDisplay::VELOCITY) ? m_VelocityEnvelope : m_PanEnvelope; + Sample::VelocityEnvelope & envelope = (m_EditMode == SampleEditor::VelocityEnvelope) ? m_VelocityEnvelope : m_PanEnvelope; updateMouseSelection(ev); @@ -368,7 +376,7 @@ void TargetWaveDisplay::mousePressEvent(QMouseEvent *ev) updateMouseSelection(ev); update(); - HydrogenApp::get_instance()->getSampleEditor()->setUnclean(); + emit envelopeEdited ( m_EditMode ); } @@ -379,19 +387,5 @@ void TargetWaveDisplay::mouseReleaseEvent(QMouseEvent *ev) { updateMouseSelection(ev); update(); - HydrogenApp::get_instance()->getSampleEditor()->returnAllTargetDisplayValues(); -} - - -static TargetWaveDisplay::EnvelopeEditMode getEnvelopeEditMode() -{ - int editType = HydrogenApp::get_instance()->getSampleEditor()->EditTypeComboBox->currentIndex(); - if (editType == 0) { - return TargetWaveDisplay::VELOCITY; - } else if (editType == 1) { - return TargetWaveDisplay::PAN; - } else { - // combo options added - return TargetWaveDisplay::PAN; - } + emit doneEditingEnvelope( m_EditMode ); } diff --git a/src/gui/src/SampleEditor/TargetWaveDisplay.h b/src/gui/src/SampleEditor/TargetWaveDisplay.h index 52471b9cc..6fc2cb2d0 100644 --- a/src/gui/src/SampleEditor/TargetWaveDisplay.h +++ b/src/gui/src/SampleEditor/TargetWaveDisplay.h @@ -30,7 +30,7 @@ #include #include -class SampleEditor; +#include "SampleEditor.h" namespace H2Core { @@ -47,11 +47,7 @@ class TargetWaveDisplay : public QWidget, public H2Core::Object explicit TargetWaveDisplay(QWidget* pParent); ~TargetWaveDisplay(); - enum EnvelopeEditMode { - VELOCITY = 0, - PAN = 1 - }; - + void updateDisplay( const std::shared_ptr pSample, double gain ); void updateDisplay( std::shared_ptr pLayer ); void updateDisplayPointer(); void paintLocatorEventTargetDisplay( int pos, bool last_event); @@ -59,6 +55,13 @@ class TargetWaveDisplay : public QWidget, public H2Core::Object H2Core::Sample::PanEnvelope* get_pan() { return &m_PanEnvelope; } H2Core::Sample::VelocityEnvelope* get_velocity() { return &m_VelocityEnvelope; } + signals: + void envelopeEdited(SampleEditor::EnvelopeType which); + void doneEditingEnvelope(SampleEditor::EnvelopeType which); + + public slots: + void setEditMode(SampleEditor::EnvelopeType which); + private: QPixmap m_Background; @@ -75,9 +78,13 @@ class TargetWaveDisplay : public QWidget, public H2Core::Object unsigned m_nSampleLength; bool m_UpdatePosition; - EnvelopeEditMode m_EditMode; int m_nSnapRadius; + SampleEditor::EnvelopeType m_EditMode; + H2Core::Sample::PanEnvelope m_PanEnvelope; + H2Core::Sample::VelocityEnvelope m_VelocityEnvelope; + + int m_nSelectedEnvelopePoint; virtual void mouseMoveEvent(QMouseEvent *ev); virtual void mousePressEvent(QMouseEvent *ev); @@ -86,10 +93,6 @@ class TargetWaveDisplay : public QWidget, public H2Core::Object virtual void updateMouseSelection(QMouseEvent *ev); virtual void updateEnvelope(); - H2Core::Sample::PanEnvelope m_PanEnvelope; - H2Core::Sample::VelocityEnvelope m_VelocityEnvelope; - - int m_nSelectedEnvelopePoint; }; #endif From e5681e1b15e138a5e30d5524696f07a590ab5c6e Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Mon, 5 Jul 2021 21:47:03 +0200 Subject: [PATCH 19/24] property support --- src/bindings/h2core_module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index c8e7b297a..d6d6deb22 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -1977,7 +1977,7 @@ PYBIND11_MODULE(h2core, m) { _CoreActionController.def("openSong", py::overload_cast(&H2Core::CoreActionController::openSong), "Opens the #Song specified in songPath.", py::arg("songPath")); - _CoreActionController.def("openSong", py::overload_cast(&H2Core::CoreActionController::openSong), + _CoreActionController.def("openSong", py::overload_cast>(&H2Core::CoreActionController::openSong), "Opens the #Song specified in songPath.", py::arg("pSong")); _CoreActionController.def("saveSong", &H2Core::CoreActionController::saveSong, From 80928b28679ac1d99b129ec76d040bbfc351ba5d Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Thu, 8 Jul 2021 00:09:50 +0200 Subject: [PATCH 20/24] ban more symbols --- src/bindings/h2core.yaml | 1 + src/bindings/h2core_module.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index 4277ff798..de20c54b6 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -150,6 +150,7 @@ module: - H2Core::Sample::get_velocity_envelope - H2Core::Object::Object(const H2Core::Object &) - std::runtime_error::runtime_error(const std::runtime_error &) + - QColor::Spec::ExtendedRgb cleaners: - qtreset.h plugins: diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index d6d6deb22..b64df8e08 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -3508,6 +3508,7 @@ PYBIND11_MODULE(h2core, m) { .value("Hsv", QColor::Spec::Hsv) .value("Cmyk", QColor::Spec::Cmyk) .value("Hsl", QColor::Spec::Hsl) + // [banned] .value("ExtendedRgb", QColor::Spec::ExtendedRgb) .value("ExtendedRgb", QColor::Spec::ExtendedRgb); // enum Octave From 728fb57b5b0ac906533d179d3f981995c3076f52 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Thu, 8 Jul 2021 19:49:44 +0200 Subject: [PATCH 21/24] bug in hydragen enum code generator --- src/bindings/h2core_module.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index b64df8e08..7b4130e75 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -3508,8 +3508,7 @@ PYBIND11_MODULE(h2core, m) { .value("Hsv", QColor::Spec::Hsv) .value("Cmyk", QColor::Spec::Cmyk) .value("Hsl", QColor::Spec::Hsl) - // [banned] .value("ExtendedRgb", QColor::Spec::ExtendedRgb) - .value("ExtendedRgb", QColor::Spec::ExtendedRgb); + // [banned] .value("ExtendedRgb", QColor::Spec::ExtendedRgb); // enum Octave // From 0327b336f6cf5d0a10fadd10557a338cf9d6b8f5 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Thu, 8 Jul 2021 19:53:48 +0200 Subject: [PATCH 22/24] ban a QColor constructor not present in appveyor's Qt version --- src/bindings/h2core.yaml | 1 + src/bindings/h2core_module.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index de20c54b6..93fe7101e 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -151,6 +151,7 @@ module: - H2Core::Object::Object(const H2Core::Object &) - std::runtime_error::runtime_error(const std::runtime_error &) - QColor::Spec::ExtendedRgb + - QColor::QColor(QColor::Spec, ushort, ushort, ushort, ushort, ushort) cleaners: - qtreset.h plugins: diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index 7b4130e75..827de2a26 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -1286,7 +1286,6 @@ PYBIND11_MODULE(h2core, m) { _QColor.def(py::init()); _QColor.def(py::init()); _QColor.def(py::init()); - _QColor.def(py::init()); // [banned] _QColor.def("operator=", py::overload_cast(&QColor::operator=), // [banned] py::arg("other")); // [banned] _QColor.def("operator=", py::overload_cast(&QColor::operator=), From 6be8c478baa406675ce185feb9d108f04289afce Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Thu, 8 Jul 2021 21:00:01 +0200 Subject: [PATCH 23/24] don't ban, shield --- src/bindings/h2core.yaml | 18 +- src/bindings/h2core_module.cpp | 332 ++++++++++++++++++++++++++++++--- 2 files changed, 327 insertions(+), 23 deletions(-) diff --git a/src/bindings/h2core.yaml b/src/bindings/h2core.yaml index 93fe7101e..2931674e2 100644 --- a/src/bindings/h2core.yaml +++ b/src/bindings/h2core.yaml @@ -117,8 +117,8 @@ module: - H2Core::AlsaAudioDriver::AlsaAudioDriver() - H2Core::AlsaMidiDriver::midi_action - H2Core::JackAudioDriver::m_pClient - - H2Core::PortMidiDriver - - H2Core::PortAudioDriver + #- H2Core::PortMidiDriver + #- H2Core::PortAudioDriver # std::vector - H2Core::Synth::m_playingNotesQueue - H2Core::Hydrogen::m_nInstrumentLookupTable @@ -152,6 +152,20 @@ module: - std::runtime_error::runtime_error(const std::runtime_error &) - QColor::Spec::ExtendedRgb - QColor::QColor(QColor::Spec, ushort, ushort, ushort, ushort, ushort) + shield: + H2Core::AlsaAudioDriver: H2CORE_HAVE_ALSA + H2Core::AlsaMidiDriver: H2CORE_HAVE_ALSA + H2Core::AlsaAudioDriver: H2CORE_HAVE_ALSA + H2Core::AlsaMidiDriver: H2CORE_HAVE_ALSA + H2Core::JackAudioDriver: H2CORE_HAVE_JACK + H2Core::JackMidiDriver: H2CORE_HAVE_JACK + H2Core::JackAudioDriver: H2CORE_HAVE_JACK + H2Core::JackMidiDriver: H2CORE_HAVE_JACK + H2Core::PortAudioDriver: H2CORE_HAVE_PORTAUDIO + H2Core::PortMidiDriver: H2CORE_HAVE_PORTAUDIO + H2Core::PulseAudioDriver: H2CORE_HAVE_PULSEAUDIO + H2Core::OssDriver: H2CORE_HAVE_OSS + cleaners: - qtreset.h plugins: diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index 827de2a26..b1b727d32 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -19,6 +19,8 @@ class PyB11_Object: public H2Core::Object { }; + + class PyB11_runtime_error: public std::runtime_error { public: // Inherit the constructors @@ -34,6 +36,8 @@ class PyB11_runtime_error: public std::runtime_error { }; + + class PyB11_Note: public H2Core::Note { public: // Inherit the constructors @@ -51,6 +55,8 @@ class PyB11_Note: public H2Core::Note { }; + + class PyB11_MidiOutput: public H2Core::MidiOutput { public: // Inherit the constructors @@ -105,6 +111,8 @@ class PyB11_MidiOutput: public H2Core::MidiOutput { }; + + class PyB11_MidiInput: public H2Core::MidiInput { public: // Inherit the constructors @@ -136,6 +144,8 @@ class PyB11_MidiInput: public H2Core::MidiInput { }; + + class PyB11_AudioOutput: public H2Core::AudioOutput { public: // Inherit the constructors @@ -242,6 +252,8 @@ class PyB11_AudioOutput: public H2Core::AudioOutput { }; + + class PyB11_Timeline: public H2Core::Timeline { public: // Inherit the constructors @@ -259,6 +271,8 @@ class PyB11_Timeline: public H2Core::Timeline { }; + + class PyB11_Hydrogen: public H2Core::Hydrogen { public: // Inherit the constructors @@ -276,6 +290,8 @@ class PyB11_Hydrogen: public H2Core::Hydrogen { }; + + class PyB11_Song: public H2Core::Song { public: // Inherit the constructors @@ -293,6 +309,8 @@ class PyB11_Song: public H2Core::Song { }; + + class PyB11_AutomationPath: public H2Core::AutomationPath { public: // Inherit the constructors @@ -310,6 +328,8 @@ class PyB11_AutomationPath: public H2Core::AutomationPath { }; + + class PyB11_Pattern: public H2Core::Pattern { public: // Inherit the constructors @@ -327,6 +347,8 @@ class PyB11_Pattern: public H2Core::Pattern { }; + + class PyB11_Playlist: public H2Core::Playlist { public: // Inherit the constructors @@ -344,6 +366,8 @@ class PyB11_Playlist: public H2Core::Playlist { }; + + class PyB11_Sample: public H2Core::Sample { public: // Inherit the constructors @@ -361,6 +385,8 @@ class PyB11_Sample: public H2Core::Sample { }; + + class PyB11_InstrumentList: public H2Core::InstrumentList { public: // Inherit the constructors @@ -378,6 +404,8 @@ class PyB11_InstrumentList: public H2Core::InstrumentList { }; + + class PyB11_InstrumentLayer: public H2Core::InstrumentLayer { public: // Inherit the constructors @@ -395,6 +423,8 @@ class PyB11_InstrumentLayer: public H2Core::InstrumentLayer { }; + + class PyB11_InstrumentComponent: public H2Core::InstrumentComponent { public: // Inherit the constructors @@ -412,6 +442,8 @@ class PyB11_InstrumentComponent: public H2Core::InstrumentComponent { }; + + class PyB11_Instrument: public H2Core::Instrument { public: // Inherit the constructors @@ -429,6 +461,8 @@ class PyB11_Instrument: public H2Core::Instrument { }; + + class PyB11_ADSR: public H2Core::ADSR { public: // Inherit the constructors @@ -446,6 +480,8 @@ class PyB11_ADSR: public H2Core::ADSR { }; + + class PyB11_DrumkitComponent: public H2Core::DrumkitComponent { public: // Inherit the constructors @@ -463,6 +499,8 @@ class PyB11_DrumkitComponent: public H2Core::DrumkitComponent { }; + + class PyB11_Drumkit: public H2Core::Drumkit { public: // Inherit the constructors @@ -480,6 +518,8 @@ class PyB11_Drumkit: public H2Core::Drumkit { }; + + class PyB11_PatternList: public H2Core::PatternList { public: // Inherit the constructors @@ -497,6 +537,91 @@ class PyB11_PatternList: public H2Core::PatternList { }; + +#ifdef H2CORE_HAVE_PORTAUDIO + +class PyB11_PortMidiDriver: public H2Core::PortMidiDriver { + public: + // Inherit the constructors + using H2Core::PortMidiDriver::PortMidiDriver; + + void open() override { + PYBIND11_OVERRIDE( + void, + H2Core::PortMidiDriver, + open + ); + } + + void close() override { + PYBIND11_OVERRIDE( + void, + H2Core::PortMidiDriver, + close + ); + } + + std::vector getInputPortList() override { + PYBIND11_OVERRIDE( + std::vector, + H2Core::PortMidiDriver, + getInputPortList + ); + } + + std::vector getOutputPortList() override { + PYBIND11_OVERRIDE( + std::vector, + H2Core::PortMidiDriver, + getOutputPortList + ); + } + + void handleQueueNote(H2Core::Note * pNote) override { + PYBIND11_OVERRIDE( + void, + H2Core::PortMidiDriver, + handleQueueNote, + pNote + ); + } + + void handleQueueNoteOff(int channel, int key, int velocity) override { + PYBIND11_OVERRIDE( + void, + H2Core::PortMidiDriver, + handleQueueNoteOff, + channel, + key, + velocity + ); + } + + void handleQueueAllNoteOff() override { + PYBIND11_OVERRIDE( + void, + H2Core::PortMidiDriver, + handleQueueAllNoteOff + ); + } + + void handleOutgoingControlChange(int param, int value, int channel) override { + PYBIND11_OVERRIDE( + void, + H2Core::PortMidiDriver, + handleOutgoingControlChange, + param, + value, + channel + ); + } + + }; +#endif // H2CORE_HAVE_PORTAUDIO + + +#ifdef H2CORE_HAVE_JACK + class PyB11_JackMidiDriver: public H2Core::JackMidiDriver { public: // Inherit the constructors @@ -574,6 +699,10 @@ class PyB11_JackMidiDriver: public H2Core::JackMidiDriver { } }; +#endif // H2CORE_HAVE_JACK + + +#ifdef H2CORE_HAVE_ALSA class PyB11_AlsaMidiDriver: public H2Core::AlsaMidiDriver { public: @@ -652,6 +781,119 @@ class PyB11_AlsaMidiDriver: public H2Core::AlsaMidiDriver { } }; +#endif // H2CORE_HAVE_ALSA + + +#ifdef H2CORE_HAVE_PORTAUDIO + +class PyB11_PortAudioDriver: public H2Core::PortAudioDriver { + public: + // Inherit the constructors + using H2Core::PortAudioDriver::PortAudioDriver; + + int init(unsigned int nBufferSize) override { + PYBIND11_OVERRIDE( + int, + H2Core::PortAudioDriver, + init, + nBufferSize + ); + } + + int connect() override { + PYBIND11_OVERRIDE( + int, + H2Core::PortAudioDriver, + connect + ); + } + + void disconnect() override { + PYBIND11_OVERRIDE( + void, + H2Core::PortAudioDriver, + disconnect + ); + } + + unsigned int getBufferSize() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::PortAudioDriver, + getBufferSize + ); + } + + unsigned int getSampleRate() override { + PYBIND11_OVERRIDE( + unsigned int, + H2Core::PortAudioDriver, + getSampleRate + ); + } + + float * getOut_L() override { + PYBIND11_OVERRIDE( + float *, + H2Core::PortAudioDriver, + getOut_L + ); + } + + float * getOut_R() override { + PYBIND11_OVERRIDE( + float *, + H2Core::PortAudioDriver, + getOut_R + ); + } + + void updateTransportInfo() override { + PYBIND11_OVERRIDE( + void, + H2Core::PortAudioDriver, + updateTransportInfo + ); + } + + void play() override { + PYBIND11_OVERRIDE( + void, + H2Core::PortAudioDriver, + play + ); + } + + void stop() override { + PYBIND11_OVERRIDE( + void, + H2Core::PortAudioDriver, + stop + ); + } + + void locate(unsigned long nFrame) override { + PYBIND11_OVERRIDE( + void, + H2Core::PortAudioDriver, + locate, + nFrame + ); + } + + void setBpm(float fBPM) override { + PYBIND11_OVERRIDE( + void, + H2Core::PortAudioDriver, + setBpm, + fBPM + ); + } + + }; +#endif // H2CORE_HAVE_PORTAUDIO + + class PyB11_NullDriver: public H2Core::NullDriver { public: @@ -759,6 +1001,9 @@ class PyB11_NullDriver: public H2Core::NullDriver { }; + +#ifdef H2CORE_HAVE_JACK + class PyB11_JackAudioDriver: public H2Core::JackAudioDriver { public: // Inherit the constructors @@ -864,6 +1109,9 @@ class PyB11_JackAudioDriver: public H2Core::JackAudioDriver { } }; +#endif // H2CORE_HAVE_JACK + + class PyB11_FakeDriver: public H2Core::FakeDriver { public: @@ -971,6 +1219,8 @@ class PyB11_FakeDriver: public H2Core::FakeDriver { }; + + class PyB11_DiskWriterDriver: public H2Core::DiskWriterDriver { public: // Inherit the constructors @@ -1077,6 +1327,9 @@ class PyB11_DiskWriterDriver: public H2Core::DiskWriterDriver { }; + +#ifdef H2CORE_HAVE_ALSA + class PyB11_AlsaAudioDriver: public H2Core::AlsaAudioDriver { public: // Inherit the constructors @@ -1182,6 +1435,9 @@ class PyB11_AlsaAudioDriver: public H2Core::AlsaAudioDriver { } }; +#endif // H2CORE_HAVE_ALSA + + using namespace H2Core; PYBIND11_MODULE(h2core, m) { @@ -3398,7 +3654,6 @@ PYBIND11_MODULE(h2core, m) { .value("Constructors", H2Core::Logger::log_levels::Constructors) .value("AELockTracing", H2Core::Logger::log_levels::AELockTracing) .export_values(); - // enum MidiMessageType // py::enum_(_MidiMessage, "MidiMessageType") @@ -3417,7 +3672,6 @@ PYBIND11_MODULE(h2core, m) { .value("STOP", H2Core::MidiMessage::MidiMessageType::STOP) .value("SONG_POS", H2Core::MidiMessage::MidiMessageType::SONG_POS) .value("QUARTER_FRAME", H2Core::MidiMessage::MidiMessageType::QUARTER_FRAME); - py::class_> _H2Exception(m, "H2Exception"); _H2Exception.def(py::init()); @@ -3498,7 +3752,6 @@ PYBIND11_MODULE(h2core, m) { py::enum_(_QColor, "NameFormat") .value("HexRgb", QColor::NameFormat::HexRgb) .value("HexArgb", QColor::NameFormat::HexArgb); - // enum Spec // py::enum_(_QColor, "Spec") @@ -3507,8 +3760,8 @@ PYBIND11_MODULE(h2core, m) { .value("Hsv", QColor::Spec::Hsv) .value("Cmyk", QColor::Spec::Cmyk) .value("Hsl", QColor::Spec::Hsl) - // [banned] .value("ExtendedRgb", QColor::Spec::ExtendedRgb); - + // [banned] .value("ExtendedRgb", QColor::Spec::ExtendedRgb) +; // enum Octave // py::enum_(_Note, "Octave") @@ -3519,7 +3772,6 @@ PYBIND11_MODULE(h2core, m) { .value("P8A", H2Core::Note::Octave::P8A) .value("P8B", H2Core::Note::Octave::P8B) .value("P8C", H2Core::Note::Octave::P8C); - // enum Key // py::enum_(_Note, "Key") @@ -3535,7 +3787,6 @@ PYBIND11_MODULE(h2core, m) { .value("A", H2Core::Note::Key::A) .value("Bf", H2Core::Note::Key::Bf) .value("B", H2Core::Note::Key::B); - // enum PAN_LAW_TYPES // py::enum_(_Sampler, "PAN_LAW_TYPES") @@ -3555,7 +3806,31 @@ PYBIND11_MODULE(h2core, m) { .value("RATIO_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::RATIO_CONST_K_NORM) .value("POLAR_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::POLAR_CONST_K_NORM) .value("QUADRATIC_CONST_K_NORM", H2Core::Sampler::PAN_LAW_TYPES::QUADRATIC_CONST_K_NORM); +#ifdef H2CORE_HAVE_PORTAUDIO + py::class_> _PortMidiDriver(m, "PortMidiDriver"); + _PortMidiDriver.def(py::init<>()); + _PortMidiDriver.def_readwrite("m_pMidiIn", &H2Core::PortMidiDriver::m_pMidiIn); + _PortMidiDriver.def_readwrite("m_pMidiOut", &H2Core::PortMidiDriver::m_pMidiOut); + _PortMidiDriver.def_readwrite("m_bRunning", &H2Core::PortMidiDriver::m_bRunning); + _PortMidiDriver.def_property_readonly("input_port_list", &H2Core::PortMidiDriver::getInputPortList); + _PortMidiDriver.def_property_readonly("output_port_list", &H2Core::PortMidiDriver::getOutputPortList); + _PortMidiDriver.def_static("class_name", &H2Core::PortMidiDriver::class_name); + _PortMidiDriver.def("open", &H2Core::PortMidiDriver::open); + _PortMidiDriver.def("close", &H2Core::PortMidiDriver::close); + _PortMidiDriver.def("handleQueueNote", &H2Core::PortMidiDriver::handleQueueNote, + py::arg("pNote")); + _PortMidiDriver.def("handleQueueNoteOff", &H2Core::PortMidiDriver::handleQueueNoteOff, + py::arg("channel"), + py::arg("key"), + py::arg("velocity")); + _PortMidiDriver.def("handleQueueAllNoteOff", &H2Core::PortMidiDriver::handleQueueAllNoteOff); + _PortMidiDriver.def("handleOutgoingControlChange", &H2Core::PortMidiDriver::handleOutgoingControlChange, + py::arg("param"), + py::arg("value"), + py::arg("channel")); +#endif // H2CORE_HAVE_PORTAUDIO +#ifdef H2CORE_HAVE_JACK py::class_> _JackMidiDriver(m, "JackMidiDriver"); _JackMidiDriver.def(py::init<>()); _JackMidiDriver.def_property_readonly("input_port_list", &H2Core::JackMidiDriver::getInputPortList); @@ -3582,7 +3857,9 @@ PYBIND11_MODULE(h2core, m) { py::arg("param"), py::arg("value"), py::arg("channel")); +#endif // H2CORE_HAVE_JACK +#ifdef H2CORE_HAVE_ALSA py::class_> _AlsaMidiDriver(m, "AlsaMidiDriver"); _AlsaMidiDriver.def(py::init<>()); _AlsaMidiDriver.def_property_readonly("input_port_list", &H2Core::AlsaMidiDriver::getInputPortList); @@ -3607,6 +3884,29 @@ PYBIND11_MODULE(h2core, m) { py::arg("param"), py::arg("value"), py::arg("channel")); +#endif // H2CORE_HAVE_ALSA + +#ifdef H2CORE_HAVE_PORTAUDIO + py::class_> _PortAudioDriver(m, "PortAudioDriver"); + _PortAudioDriver.def(py::init()); + _PortAudioDriver.def_readwrite("m_pOut_L", &H2Core::PortAudioDriver::m_pOut_L); + _PortAudioDriver.def_readwrite("m_pOut_R", &H2Core::PortAudioDriver::m_pOut_R); + _PortAudioDriver.def_readwrite("m_nBufferSize", &H2Core::PortAudioDriver::m_nBufferSize); + _PortAudioDriver.def_property_readonly("buffer_size", &H2Core::PortAudioDriver::getBufferSize); + _PortAudioDriver.def_property_readonly("sample_rate", &H2Core::PortAudioDriver::getSampleRate); + _PortAudioDriver.def_static("class_name", &H2Core::PortAudioDriver::class_name); + _PortAudioDriver.def("init", &H2Core::PortAudioDriver::init, + py::arg("nBufferSize")); + _PortAudioDriver.def("connect", &H2Core::PortAudioDriver::connect); + _PortAudioDriver.def("disconnect", &H2Core::PortAudioDriver::disconnect); + _PortAudioDriver.def("getOut_L", &H2Core::PortAudioDriver::getOut_L); + _PortAudioDriver.def("getOut_R", &H2Core::PortAudioDriver::getOut_R); + _PortAudioDriver.def("updateTransportInfo", &H2Core::PortAudioDriver::updateTransportInfo); + _PortAudioDriver.def("play", &H2Core::PortAudioDriver::play); + _PortAudioDriver.def("stop", &H2Core::PortAudioDriver::stop); + _PortAudioDriver.def("locate", &H2Core::PortAudioDriver::locate, + py::arg("nFrame")); +#endif // H2CORE_HAVE_PORTAUDIO py::class_> _NullDriver(m, "NullDriver"); _NullDriver.def(py::init()); @@ -3625,6 +3925,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("nFrame")); _NullDriver.def("updateTransportInfo", &H2Core::NullDriver::updateTransportInfo); +#ifdef H2CORE_HAVE_JACK py::class_> _JackAudioDriver(m, "JackAudioDriver"); _JackAudioDriver.def(py::init()); _JackAudioDriver.def_readwrite("m_currentPos", &H2Core::JackAudioDriver::m_currentPos); @@ -3690,6 +3991,7 @@ PYBIND11_MODULE(h2core, m) { "Callback function for the JACK audio server to set the buffer size #jackServerBufferSize.", py::arg("nframes"), py::arg("arg")); +#endif // H2CORE_HAVE_JACK py::class_> _FakeDriver(m, "FakeDriver"); _FakeDriver.def(py::init()); @@ -3736,6 +4038,7 @@ PYBIND11_MODULE(h2core, m) { py::arg("nFrame")); _DiskWriterDriver.def("updateTransportInfo", &H2Core::DiskWriterDriver::updateTransportInfo); +#ifdef H2CORE_HAVE_ALSA py::class_> _AlsaAudioDriver(m, "AlsaAudioDriver"); _AlsaAudioDriver.def(py::init()); _AlsaAudioDriver.def_readwrite("m_bIsRunning", &H2Core::AlsaAudioDriver::m_bIsRunning); @@ -3758,6 +4061,7 @@ PYBIND11_MODULE(h2core, m) { _AlsaAudioDriver.def("stop", &H2Core::AlsaAudioDriver::stop); _AlsaAudioDriver.def("locate", &H2Core::AlsaAudioDriver::locate, py::arg("nFrame")); +#endif // H2CORE_HAVE_ALSA py::class_> _Tag(m, "Tag"); _Tag.def_readwrite("nBar", &H2Core::Timeline::Tag::nBar); @@ -3791,21 +4095,18 @@ PYBIND11_MODULE(h2core, m) { .value("JACK_CANNOT_CLOSE_CLIENT", H2Core::Hydrogen::ErrorMessages::JACK_CANNOT_CLOSE_CLIENT) .value("JACK_ERROR_IN_PORT_REGISTER", H2Core::Hydrogen::ErrorMessages::JACK_ERROR_IN_PORT_REGISTER) .value("OSC_CANNOT_CONNECT_TO_PORT", H2Core::Hydrogen::ErrorMessages::OSC_CANNOT_CONNECT_TO_PORT); - // enum GUIState // py::enum_(_Hydrogen, "GUIState") .value("notReady", H2Core::Hydrogen::GUIState::notReady) .value("unavailable", H2Core::Hydrogen::GUIState::unavailable) .value("ready", H2Core::Hydrogen::GUIState::ready); - // enum Lookup // py::enum_(_Filesystem, "Lookup") .value("stacked", H2Core::Filesystem::Lookup::stacked) .value("user", H2Core::Filesystem::Lookup::user) .value("system", H2Core::Filesystem::Lookup::system); - // enum file_perms // py::enum_(_Filesystem, "file_perms") @@ -3814,19 +4115,16 @@ PYBIND11_MODULE(h2core, m) { .value("is_readable", H2Core::Filesystem::file_perms::is_readable) .value("is_writable", H2Core::Filesystem::file_perms::is_writable) .value("is_executable", H2Core::Filesystem::file_perms::is_executable); - // enum ActionMode // py::enum_(_Song, "ActionMode") .value("selectMode", H2Core::Song::ActionMode::selectMode) .value("drawMode", H2Core::Song::ActionMode::drawMode); - // enum SongMode // py::enum_(_Song, "SongMode") .value("PATTERN_MODE", H2Core::Song::SongMode::PATTERN_MODE) .value("SONG_MODE", H2Core::Song::SongMode::SONG_MODE); - py::class_> _Entry(m, "Entry"); _Entry.def_readwrite("filePath", &H2Core::Playlist::Entry::filePath); _Entry.def_readwrite("fileExists", &H2Core::Playlist::Entry::fileExists); @@ -3839,32 +4137,27 @@ PYBIND11_MODULE(h2core, m) { .value("UI_SCALING_SMALLER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SMALLER) .value("UI_SCALING_SYSTEM", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_SYSTEM) .value("UI_SCALING_LARGER", H2Core::Preferences::UI_SCALING_POLICY::UI_SCALING_LARGER); - // enum UI_LAYOUT_TYPES // py::enum_(_Preferences, "UI_LAYOUT_TYPES") .value("UI_LAYOUT_SINGLE_PANE", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_SINGLE_PANE) .value("UI_LAYOUT_TABBED", H2Core::Preferences::UI_LAYOUT_TYPES::UI_LAYOUT_TABBED); - // enum FontSize // py::enum_(_Preferences, "FontSize") .value("Normal", H2Core::Preferences::FontSize::Normal) .value("Small", H2Core::Preferences::FontSize::Small) .value("Large", H2Core::Preferences::FontSize::Large); - // enum JackBBTSyncMethod // py::enum_(_Preferences, "JackBBTSyncMethod") .value("constMeasure", H2Core::Preferences::JackBBTSyncMethod::constMeasure) .value("identicalBars", H2Core::Preferences::JackBBTSyncMethod::identicalBars); - // enum JackTrackOutputMode // py::enum_(_Preferences, "JackTrackOutputMode") .value("postFader", H2Core::Preferences::JackTrackOutputMode::postFader) .value("preFader", H2Core::Preferences::JackTrackOutputMode::preFader); - py::class_> _Rubberband(m, "Rubberband"); _Rubberband.def(py::init<>()); _Rubberband.def(py::init()); @@ -3900,19 +4193,16 @@ PYBIND11_MODULE(h2core, m) { .value("VELOCITY", H2Core::Instrument::SampleSelectionAlgo::VELOCITY) .value("ROUND_ROBIN", H2Core::Instrument::SampleSelectionAlgo::ROUND_ROBIN) .value("RANDOM", H2Core::Instrument::SampleSelectionAlgo::RANDOM); - // enum Timebase // py::enum_(_JackAudioDriver, "Timebase") .value("Master", H2Core::JackAudioDriver::Timebase::Master) .value("Slave", H2Core::JackAudioDriver::Timebase::Slave) .value("None", H2Core::JackAudioDriver::Timebase::None); - // enum LoopMode // py::enum_(_Loops, "LoopMode") .value("FORWARD", H2Core::Sample::Loops::LoopMode::FORWARD) .value("REVERSE", H2Core::Sample::Loops::LoopMode::REVERSE) .value("PINGPONG", H2Core::Sample::Loops::LoopMode::PINGPONG); - } \ No newline at end of file From 7dcd01d3a2a95edc3e7755dba51d5bf9fe6f3c8a Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Thu, 15 Jul 2021 22:03:15 +0200 Subject: [PATCH 24/24] expose adsr state --- src/bindings/h2core_module.cpp | 61 ++++++++++++++++++++++++++++++++-- src/core/Basics/Adsr.h | 28 +++++++++++----- 2 files changed, 77 insertions(+), 12 deletions(-) diff --git a/src/bindings/h2core_module.cpp b/src/bindings/h2core_module.cpp index b1b727d32..43f32d77b 100644 --- a/src/bindings/h2core_module.cpp +++ b/src/bindings/h2core_module.cpp @@ -1480,8 +1480,14 @@ PYBIND11_MODULE(h2core, m) { _Logger.def("should_log", &H2Core::Logger::should_log, "return true if the level is set in the bitmask", py::arg("lvl")); + _Logger.def_static("set_bit_mask", &H2Core::Logger::set_bit_mask, + "set the bitmask", + py::arg("msk")); _Logger.def_static("bit_mask", &H2Core::Logger::bit_mask, "return the current log level bit mask"); + _Logger.def("set_use_file", &H2Core::Logger::set_use_file, + "set use file flag", + py::arg("use")); _Logger.def("use_file", &H2Core::Logger::use_file, "return __use_file"); _Logger.def_static("parse_log_level", &H2Core::Logger::parse_log_level, @@ -1565,10 +1571,18 @@ PYBIND11_MODULE(h2core, m) { // [] _QColor.def_static("colorNames", &QColor::colorNames); _QColor.def("spec", &QColor::spec); _QColor.def("alpha", &QColor::alpha); + _QColor.def("setAlpha", &QColor::setAlpha, + py::arg("alpha")); _QColor.def("alphaF", &QColor::alphaF); _QColor.def("red", &QColor::red); _QColor.def("green", &QColor::green); _QColor.def("blue", &QColor::blue); + _QColor.def("setRed", &QColor::setRed, + py::arg("red")); + _QColor.def("setGreen", &QColor::setGreen, + py::arg("green")); + _QColor.def("setBlue", &QColor::setBlue, + py::arg("blue")); _QColor.def("redF", &QColor::redF); _QColor.def("greenF", &QColor::greenF); _QColor.def("blueF", &QColor::blueF); @@ -1596,6 +1610,8 @@ PYBIND11_MODULE(h2core, m) { py::arg("a")); _QColor.def("rgba64", &QColor::rgba64); _QColor.def("rgba", &QColor::rgba); + _QColor.def("setRgba", &QColor::setRgba, + py::arg("rgba")); _QColor.def("rgb", &QColor::rgb); _QColor.def("hue", &QColor::hue); _QColor.def("saturation", &QColor::saturation); @@ -1803,6 +1819,14 @@ PYBIND11_MODULE(h2core, m) { _QRgba64.def("green", &QRgba64::green); _QRgba64.def("blue", &QRgba64::blue); _QRgba64.def("alpha", &QRgba64::alpha); + _QRgba64.def("setRed", &QRgba64::setRed, + py::arg("_red")); + _QRgba64.def("setGreen", &QRgba64::setGreen, + py::arg("_green")); + _QRgba64.def("setBlue", &QRgba64::setBlue, + py::arg("_blue")); + _QRgba64.def("setAlpha", &QRgba64::setAlpha, + py::arg("_alpha")); _QRgba64.def("red8", &QRgba64::red8); _QRgba64.def("green8", &QRgba64::green8); _QRgba64.def("blue8", &QRgba64::blue8); @@ -1914,7 +1938,6 @@ PYBIND11_MODULE(h2core, m) { _Sampler.def_readwrite("m_pMainOut_R", &H2Core::Sampler::m_pMainOut_R); _Sampler.def_property_readonly("playing_notes_number", &H2Core::Sampler::getPlayingNotesNumber); _Sampler.def_property("interpolate_mode", &H2Core::Sampler::getInterpolateMode, &H2Core::Sampler::setInterpolateMode); - _Sampler.def_property_readonly("preview_instrument", &H2Core::Sampler::getPreviewInstrument); _Sampler.def_property_readonly("playback_track_instrument", &H2Core::Sampler::getPlaybackTrackInstrument); _Sampler.def_static("class_name", &H2Core::Sampler::class_name); _Sampler.def_static("ratioStraightPolygonalPanLaw", &H2Core::Sampler::ratioStraightPolygonalPanLaw, @@ -1973,12 +1996,15 @@ PYBIND11_MODULE(h2core, m) { _Sampler.def("preview_sample", &H2Core::Sampler::preview_sample, py::arg("pSample"), py::arg("length")); + _Sampler.def("preview_instrument", &H2Core::Sampler::preview_instrument, + py::arg("pInstr")); _Sampler.def("setPlayingNotelength", &H2Core::Sampler::setPlayingNotelength, py::arg("pInstrument"), py::arg("ticks"), py::arg("noteOnTick")); _Sampler.def("isInstrumentPlaying", &H2Core::Sampler::isInstrumentPlaying, py::arg("pInstr")); + _Sampler.def("getPreviewInstrument", &H2Core::Sampler::getPreviewInstrument); _Sampler.def("reinitializePlaybackTrack", &H2Core::Sampler::reinitializePlaybackTrack, "Loading of the playback track."); @@ -3414,8 +3440,16 @@ PYBIND11_MODULE(h2core, m) { "get the queued status of the instrument"); _Instrument.def("is_stop_notes", &H2Core::Instrument::is_stop_notes, "get the stop notes of the instrument"); + _Instrument.def("set_sample_selection_alg", &H2Core::Instrument::set_sample_selection_alg, + py::arg("selected_algo")); _Instrument.def("sample_selection_alg", &H2Core::Instrument::sample_selection_alg); + _Instrument.def("set_is_preview_instrument", &H2Core::Instrument::set_is_preview_instrument, + "Mark the instrument as hydrogen's preview instrument", + py::arg("isPreview")); _Instrument.def("is_preview_instrument", &H2Core::Instrument::is_preview_instrument); + _Instrument.def("set_is_metronome_instrument", &H2Core::Instrument::set_is_metronome_instrument, + "Mark the instrument as metronome instrument", + py::arg("isMetronome")); _Instrument.def("is_metronome_instrument", &H2Core::Instrument::is_metronome_instrument); _Instrument.def("get_component", &H2Core::Instrument::get_component, py::arg("DrumkitComponentID")); @@ -3434,14 +3468,27 @@ PYBIND11_MODULE(h2core, m) { py::class_> _ADSR(m, "ADSR"); _ADSR.def(py::init()); _ADSR.def(py::init>()); - _ADSR.def_property("attack", &H2Core::ADSR::get_attack, &H2Core::ADSR::set_attack); _ADSR.def_property("decay", &H2Core::ADSR::get_decay, &H2Core::ADSR::set_decay); _ADSR.def_property("sustain", &H2Core::ADSR::get_sustain, &H2Core::ADSR::set_sustain); - _ADSR.def_property("release", &H2Core::ADSR::get_release, &H2Core::ADSR::set_release); + _ADSR.def_property_readonly("state", &H2Core::ADSR::get_state); _ADSR.def_static("class_name", &H2Core::ADSR::class_name); + _ADSR.def("set_attack", &H2Core::ADSR::set_attack, + "__attack setter", + py::arg("value")); + _ADSR.def("get_attack", &H2Core::ADSR::get_attack, + "__attack accessor"); + _ADSR.def("set_release", &H2Core::ADSR::set_release, + "__release setter", + py::arg("value")); + _ADSR.def("get_release", &H2Core::ADSR::get_release, + "__release accessor"); + _ADSR.def("attack", &H2Core::ADSR::attack, + "sets state to ATTACK"); _ADSR.def("get_value", &H2Core::ADSR::get_value, "compute the value and return it", py::arg("step")); + _ADSR.def("release", &H2Core::ADSR::release, + "sets state to RELEASE, returns 0 if the state is IDLE, __value if the state is RELEASE, set state to RELEASE, save __release_value and return it."); _ADSR.def("toQString", &H2Core::ADSR::toQString, "Formatted string version for debugging purposes.", py::arg("sPrefix"), @@ -4193,6 +4240,14 @@ PYBIND11_MODULE(h2core, m) { .value("VELOCITY", H2Core::Instrument::SampleSelectionAlgo::VELOCITY) .value("ROUND_ROBIN", H2Core::Instrument::SampleSelectionAlgo::ROUND_ROBIN) .value("RANDOM", H2Core::Instrument::SampleSelectionAlgo::RANDOM); + // enum ADSRState + // + py::enum_(_ADSR, "ADSRState") + .value("ATTACK", H2Core::ADSR::ADSRState::ATTACK) + .value("DECAY", H2Core::ADSR::ADSRState::DECAY) + .value("SUSTAIN", H2Core::ADSR::ADSRState::SUSTAIN) + .value("RELEASE", H2Core::ADSR::ADSRState::RELEASE) + .value("IDLE", H2Core::ADSR::ADSRState::IDLE); // enum Timebase // py::enum_(_JackAudioDriver, "Timebase") diff --git a/src/core/Basics/Adsr.h b/src/core/Basics/Adsr.h index b9ff47bc0..459b4f19d 100644 --- a/src/core/Basics/Adsr.h +++ b/src/core/Basics/Adsr.h @@ -37,7 +37,13 @@ class ADSR : public Object { H2_OBJECT(ADSR) public: - + enum ADSRState { + ATTACK=0, + DECAY, + SUSTAIN, + RELEASE, + IDLE + }; /** * constructor * \param attack tick duration @@ -86,6 +92,10 @@ class ADSR : public Object * sets state to ATTACK */ void attack(); + /** + * get current state + */ + ADSRState get_state(); /** * compute the value and return it * \param step the increment to be added to __ticks @@ -114,13 +124,7 @@ class ADSR : public Object float __sustain; ///< Sustain level unsigned int __release; ///< Release tick count /** possible states */ - enum ADSRState { - ATTACK=0, - DECAY, - SUSTAIN, - RELEASE, - IDLE - }; + ADSRState __state; ///< current state float __ticks; ///< current tick count float __value; ///< current value @@ -170,7 +174,13 @@ inline unsigned int ADSR::get_release() return __release; } -}; + +inline ADSR::ADSRState ADSR::get_state() +{ + return __state; +} + +}; // namespace H2Core #endif // H2C_ADRS_H