Git Product home page Git Product logo

Comments (11)

howdood avatar howdood commented on August 23, 2024 2

Just to note: this bug still exists when attempting to build from 'main' branch. Any help to build a working version greatly appreciated!

from frontend-qt.

kblaschke avatar kblaschke commented on August 23, 2024 1

I've merged a few changes, these should fix everything to make the PulseAudio app compile against libprojectM's current master state.

While you can still play around with the application, in its current state it's mostly broken as audio capturing doesn't work properly anymore and then there's still the OpenGL rendering issues after the transition to QOpenGLWindow. So expect presets to look totally broken and unresponsive. For the time being, I recommend using the SDL2 application. It doesn't (yet) have the playlist editing features, but it works flawlessly.

That said, while the Qt app is currently not our development focus, don't expect the core team to fix this application anytime soon. If someone else wants to take this task and help fixing the mentioned issues, please go ahead!

I'm closing the issue for now, but expect more breakages as the libprojectM API will change again in the near future.

from frontend-qt.

tari3x avatar tari3x commented on August 23, 2024

Fixed some further errors and a crash (for some reason loading config from file was failing). Here's the diff

git diff | cat 
diff --git a/src/common/qprojectm.hpp b/src/common/qprojectm.hpp
index 9e284c3..ab68b23 100644
--- a/src/common/qprojectm.hpp
+++ b/src/common/qprojectm.hpp
@@ -30,53 +30,83 @@
 class QProjectM : public QObject
 {
 
-Q_OBJECT
+  Q_OBJECT
 
 public:
-    explicit QProjectM(const QString& config_file)
-        : _projectM(projectm_create(config_file.toLocal8Bit().data(), projectm_flags::PROJECTM_FLAG_DISABLE_PLAYLIST_LOAD))
+  explicit QProjectM(const QString& config_file) 
+    : _projectM(projectm_create(NULL, PROJECTM_FLAG_DISABLE_PLAYLIST_LOAD))
+  {
+    if (!_projectM)
     {
-        projectm_set_preset_switched_event_callback(_projectM, &QProjectM::presetSwitchedEvent, this);
-        projectm_set_preset_switch_failed_event_callback(_projectM, &QProjectM::presetSwitchFailedEvent, this);
-        projectm_set_preset_rating_changed_event_callback(_projectM, &QProjectM::presetRatingChanged, this);
+      projectm_settings settings{};
+
+      // Window/rendering settings
+      settings.window_width = 1023;
+      settings.window_height = 1024;
+      settings.fps = 60;
+      settings.mesh_x = 220;
+      settings.mesh_y = 125;
+      settings.aspect_correction = true;
+
+      // Preset display settings
+      settings.preset_duration = 30;
+      settings.soft_cut_duration = 3;
+      settings.hard_cut_enabled = false;
+      settings.hard_cut_duration = 20;
+      settings.hard_cut_sensitivity = 1.0;
+      settings.beat_sensitivity = 1.0;
+      settings.shuffle_enabled = false;
+      // settings.preset_url = &presetPath[0];
+
+      // Unsupported settings
+      // settings.soft_cut_ratings_enabled = false;
+      // settings.menu_font_url = nullptr;
+      // settings.title_font_url = nullptr;
+
+      _projectM = projectm_create_settings(&settings, PROJECTM_FLAG_NONE);
     }
 
-    projectm* instance() const
-    {
-        return _projectM;
-    }
+    projectm_set_preset_switched_event_callback(_projectM, &QProjectM::presetSwitchedEvent, this);
+    projectm_set_preset_switch_failed_event_callback(_projectM, &QProjectM::presetSwitchFailedEvent, this);
+    projectm_set_preset_rating_changed_event_callback(_projectM, &QProjectM::presetRatingChanged, this);
+  }
+
+  projectm* instance() const
+  {
+    return _projectM;
+  }
 
 signals:
 
-    void presetSwitchedSignal(bool hardCut, unsigned int index) const;
+  void presetSwitchedSignal(bool hardCut, unsigned int index) const;
 
-    void presetSwitchFailedSignal(bool hardCut, unsigned int index, const QString& message) const;
+  void presetSwitchFailedSignal(bool hardCut, unsigned int index, const QString& message) const;
 
-    void presetRatingChangedSignal(unsigned int index, int rating,
-                                   projectm_preset_rating_type ratingType) const;
+  void presetRatingChangedSignal(unsigned int index, int rating,
+                                 projectm_preset_rating_type ratingType) const;
 
 protected:
 
-    static void presetSwitchedEvent(bool hardCut, unsigned int index, void* context)
-    {
-        auto qProjectM = reinterpret_cast<QProjectM*>(context);
-        qProjectM->presetSwitchedSignal(hardCut, index);
-    }
-
-    static void presetSwitchFailedEvent(bool hardCut, unsigned int index, const char* message, void* context)
-    {
-        auto qProjectM = reinterpret_cast<QProjectM*>(context);
-        qProjectM->presetSwitchFailedSignal(hardCut, index, QString(message));
-    }
-
-    static void presetRatingChanged(unsigned int index, int rating,
-                                    projectm_preset_rating_type ratingType, void* context)
-    {
-        auto qProjectM = reinterpret_cast<QProjectM*>(context);
-        qProjectM->presetRatingChangedSignal(index, rating, ratingType);
-    }
-
-    projectm* _projectM{ nullptr };
+  static void presetSwitchedEvent(bool hardCut, unsigned int index, void* context)
+  {
+    auto qProjectM = reinterpret_cast<QProjectM*>(context);
+    qProjectM->presetSwitchedSignal(hardCut, index);
+  }
+
+  static void presetSwitchFailedEvent(bool hardCut, unsigned int index, const char* message, void* context)
+  {
+    auto qProjectM = reinterpret_cast<QProjectM*>(context);
+    qProjectM->presetSwitchFailedSignal(hardCut, index, QString(message));
+  }
+
+  static void presetRatingChanged(unsigned int index, int rating,
+                                  projectm_preset_rating_type ratingType, void* context)
+  {
+    auto qProjectM = reinterpret_cast<QProjectM*>(context);
+    qProjectM->presetRatingChangedSignal(index, rating, ratingType);
+  }
+
+  projectm* _projectM{ nullptr };
 };
 
 #endif
diff --git a/src/common/qprojectm_mainwindow.cpp b/src/common/qprojectm_mainwindow.cpp
index 44cd591..9bf58d6 100644
--- a/src/common/qprojectm_mainwindow.cpp
+++ b/src/common/qprojectm_mainwindow.cpp
@@ -232,7 +232,7 @@ projectm* QProjectM_MainWindow::GetProjectM()
 
 void QProjectM_MainWindow::addPCM(float * buffer, unsigned int bufferSize)
 {
-    projectm_pcm_add_float_2ch_data(qprojectM()->instance(), buffer, bufferSize);
+  projectm_pcm_add_float(qprojectM()->instance(), buffer, bufferSize, PROJECTM_STEREO);
 }
 
 void QProjectM_MainWindow::updatePlaylistSelection ( bool hardCut, unsigned int index )

from frontend-qt.

kbader94 avatar kbader94 commented on August 23, 2024

I can confirm these bugs exist, and the patch applied remedies the crash as well, although this patch seems to disable using the config file altogether. @tari3x thanks for your work! Do you have any insight to what's causing the segfault when loading the config file? It'd be nice to be able to properly load the config. I don't quite have time to debug this further this weekend, although I might get to it later this week if you don't beat me to it.

from frontend-qt.

tari3x avatar tari3x commented on August 23, 2024

Didn't dig deeper I'm afraid. Seems like the config format changed and the config reading function doesn't fail gracefully when reading it.

from frontend-qt.

tari3x avatar tari3x commented on August 23, 2024

Fwiw, I ended up using the SDK front-end, works well for me.

from frontend-qt.

howdood avatar howdood commented on August 23, 2024

Thanks! Unfortunately, although I was able to build the SDK front end on Ubuntu, it segfaults every time I launch it with no further debugging info. The 'new' SDK frontend does not compile at all on R-Pi, although I have been able to complete and install the current build of libprojectM. It looks like the decision to take the two frontends into separate repos has meant that changes to libprojectm that break them do not get noticed in the same way they would if they were part of the main build...

from frontend-qt.

alwzfolwd avatar alwzfolwd commented on August 23, 2024

This may sound like a dumb question, but im having exactly the same issue. how do I implement the patch above?

from frontend-qt.

tari3x avatar tari3x commented on August 23, 2024

If this front-end basically doesn't work, would it make sense to remove the repo until this is fixed, or at least make it very loud (in the README?) that people should be using the SDL front-end instead? This would save a lot of users a couple of hours of stumbling around.

from frontend-qt.

kblaschke avatar kblaschke commented on August 23, 2024

You can't "remove" the repo from GitHub without losing all issues and other associated history, and there's also no way of hiding it, so this is not an option.

Adding it to the README would be an option, but such a note is often not removed when the app is working again, also setting a false flag.

I've added a (hopefully) visible note to the repository description.

from frontend-qt.

revmischa avatar revmischa commented on August 23, 2024

it can be archived as well

from frontend-qt.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.