Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki committed Feb 8, 2024
1 parent 1058d09 commit 117a28d
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 130 deletions.
18 changes: 6 additions & 12 deletions modules/juce_python/bindings/ScriptJuceAudioBasicsBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@

namespace popsicle::Bindings {

using namespace juce;

namespace py = pybind11;
using namespace pybind11::literals;

// ============================================================================================

template <template <class> class Class, class... Types>
void registerAudioBuffer (pybind11::module_& m)
void registerAudioBuffer (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand All @@ -46,7 +45,7 @@ void registerAudioBuffer (pybind11::module_& m)

auto class_ = py::class_<T> (m, className.toRawUTF8(), py::buffer_protocol())
.def (py::init<>())
.def (py::init<int, int>(), py::arg("numChannels"), py::arg("numSamples"))
.def (py::init<int, int>(), "numChannels"_a, "numSamples"_a)
//.def (py::init ([](py::buffer dataToReferTo, int numChannelsToUse, int startSample, int numSamples) {})
.def ("getNumChannels", &T::getNumChannels)
.def ("getNumSamples", &T::getNumSamples)
Expand Down Expand Up @@ -141,13 +140,8 @@ void registerAudioBuffer (pybind11::module_& m)

// ============================================================================================

void registerJuceAudioBasicsBindings (pybind11::module_& m)
void registerJuceAudioBasicsBindings (py::module_& m)
{
using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// ============================================================================================ juce::ArrayView

py::class_<PyArrayView<const float>> classConstFloatArrayView (m, "ConstFloatArrayView", py::buffer_protocol());
Expand Down
12 changes: 6 additions & 6 deletions modules/juce_python/bindings/ScriptJuceAudioDevicesBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

namespace popsicle::Bindings {

// ============================================================================================
using namespace juce;

void registerJuceAudioDevicesBindings (pybind11::module_& m)
{
using namespace juce;
namespace py = pybind11;
using namespace py::literals;

namespace py = pybind11;
using namespace py::literals;
// ============================================================================================

void registerJuceAudioDevicesBindings (py::module_& m)
{
// ============================================================================================ juce::WASAPIDeviceMode

py::enum_<WASAPIDeviceMode> (m, "WASAPIDeviceMode")
Expand Down
11 changes: 6 additions & 5 deletions modules/juce_python/bindings/ScriptJuceAudioFormatsBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@

namespace popsicle::Bindings {

using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// ============================================================================================

void registerJuceAudioFormatsBindings ([[maybe_unused]] pybind11::module_& m)
void registerJuceAudioFormatsBindings ([[maybe_unused]] py::module_& m)
{
using namespace juce;

namespace py = pybind11;
using namespace py::literals;
}

} // namespace popsicle::Bindings
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@

namespace popsicle::Bindings {

using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// ============================================================================================

void registerJuceAudioProcessorsBindings ([[maybe_unused]] pybind11::module_& m)
void registerJuceAudioProcessorsBindings ([[maybe_unused]] py::module_& m)
{
using namespace juce;

namespace py = pybind11;
using namespace py::literals;
}

} // namespace popsicle::Bindings
12 changes: 6 additions & 6 deletions modules/juce_python/bindings/ScriptJuceAudioUtilsBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@

namespace popsicle::Bindings {

// ============================================================================================
using namespace juce;

void registerJuceAudioUtilsBindings ([[maybe_unused]] pybind11::module_& m)
{
using namespace juce;
namespace py = pybind11;
using namespace py::literals;

namespace py = pybind11;
using namespace py::literals;
// ============================================================================================

void registerJuceAudioUtilsBindings ([[maybe_unused]] py::module_& m)
{
// ============================================================================================ juce::AudioAppComponent

py::class_<AudioAppComponent, Component, PyAudioAppComponent<>> classAudioAppComponent (m, "AudioAppComponent");
Expand Down
30 changes: 9 additions & 21 deletions modules/juce_python/bindings/ScriptJuceCoreBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,16 @@ handle type_caster<juce::var>::cast (const juce::var& src, return_value_policy p

namespace popsicle::Bindings {

using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// ============================================================================================

template <template <class> class Class, class... Types>
void registerMathConstants (pybind11::module_& m)
void registerMathConstants (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -417,12 +418,8 @@ void registerMathConstants (pybind11::module_& m)
// ============================================================================================

template <template <class> class Class, class... Types>
void registerRange (pybind11::module_& m)
void registerRange (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -486,12 +483,8 @@ void registerRange (pybind11::module_& m)
// ============================================================================================

template <template <class> class Class, class... Types>
void registerAtomic (pybind11::module_& m)
void registerAtomic (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -528,13 +521,8 @@ void registerAtomic (pybind11::module_& m)
m.add_object ("Atomic", type);
}

void registerJuceCoreBindings (pybind11::module_& m)
void registerJuceCoreBindings (py::module_& m)
{
using namespace juce;

namespace py = pybind11;
using namespace py::literals;

#if !JUCE_PYTHON_EMBEDDED_INTERPRETER
juce::SystemStats::setApplicationCrashHandler (Helpers::applicationCrashHandler);
#endif
Expand Down
18 changes: 7 additions & 11 deletions modules/juce_python/bindings/ScriptJuceDataStructuresBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@

namespace popsicle::Bindings {

using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// =================================================================================================

template <template <class> class Class, class... Types>
void registerCachedValue (pybind11::module_& m)
void registerCachedValue (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -77,13 +78,8 @@ void registerCachedValue (pybind11::module_& m)
m.add_object ("CachedValue", type);
}

void registerJuceDataStructuresBindings (pybind11::module_& m)
void registerJuceDataStructuresBindings (py::module_& m)
{
using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// ============================================================================================ juce::UndoableAction

py::class_<UndoableAction, PyUndoableAction> classUndoableAction (m, "UndoableAction");
Expand Down
10 changes: 5 additions & 5 deletions modules/juce_python/bindings/ScriptJuceEventsBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ namespace juce {

namespace popsicle::Bindings {

void registerJuceEventsBindings (pybind11::module_& m)
{
using namespace juce;
using namespace juce;

namespace py = pybind11;
using namespace py::literals;
namespace py = pybind11;
using namespace py::literals;

void registerJuceEventsBindings (py::module_& m)
{
// ============================================================================================ juce::NotificationType

py::enum_<NotificationType> (m, "NotificationType")
Expand Down
48 changes: 12 additions & 36 deletions modules/juce_python/bindings/ScriptJuceGraphicsBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@

namespace popsicle::Bindings {

using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// ============================================================================================

template <template <class> class Class, class... Types>
void registerPoint (pybind11::module_& m)
void registerPoint (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -123,12 +124,8 @@ void registerPoint (pybind11::module_& m)
// ============================================================================================

template <template <class> class Class, class... Types>
void registerLine (pybind11::module_& m)
void registerLine (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -206,12 +203,8 @@ void registerLine (pybind11::module_& m)
// ============================================================================================

template <template <class> class Class, class... Types>
void registerRectangle (pybind11::module_& m)
void registerRectangle (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -356,12 +349,8 @@ void registerRectangle (pybind11::module_& m)
// ============================================================================================

template <template <class> class Class, class... Types>
void registerRectangleList (pybind11::module_& m)
void registerRectangleList (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -421,12 +410,8 @@ void registerRectangleList (pybind11::module_& m)
// ============================================================================================

template <template <class> class Class, class... Types>
void registerParallelogram (pybind11::module_& m)
void registerParallelogram (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -493,12 +478,8 @@ void registerParallelogram (pybind11::module_& m)
// ============================================================================================

template <template <class> class Class, class... Types>
void registerBorderSize (pybind11::module_& m)
void registerBorderSize (py::module_& m)
{
using namespace juce;

namespace py = pybind11;

py::dict type;

([&]
Expand Down Expand Up @@ -553,13 +534,8 @@ void registerBorderSize (pybind11::module_& m)

// ============================================================================================

void registerJuceGraphicsBindings (pybind11::module_& m)
void registerJuceGraphicsBindings (py::module_& m)
{
using namespace juce;

namespace py = pybind11;
using namespace py::literals;

// ============================================================================================ juce::Justification

py::class_<Justification> classJustification (m, "Justification");
Expand Down
12 changes: 6 additions & 6 deletions modules/juce_python/bindings/ScriptJuceGuiBasicsBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ struct polymorphic_type_hook<juce::Component>

namespace popsicle::Bindings {

// ============================================================================================
using namespace juce;

void registerJuceGuiBasicsBindings (pybind11::module_& m)
{
using namespace juce;
namespace py = pybind11;
using namespace py::literals;

namespace py = pybind11;
using namespace py::literals;
// ============================================================================================

void registerJuceGuiBasicsBindings (py::module_& m)
{
// ============================================================================================ juce::JUCEApplication

py::class_<JUCEApplication, PyJUCEApplication> classJUCEApplication (m, "JUCEApplication");
Expand Down
Loading

0 comments on commit 117a28d

Please sign in to comment.