Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 51423benam

Pages: 1 [2]
16
Audio / Re: undefined reference to _imp___ZN2sf11SoundStreamC2Ev
« on: May 14, 2018, 10:07:34 pm »
Can that also happen when I am including it multiple times? For example: file A includes audio.hpp, file B includes audio.hpp, file B includes A. Could that also be a reason?

17
Audio / undefined reference to _imp___ZN2sf11SoundStreamC2Ev
« on: May 14, 2018, 06:43:35 pm »
Hello,

I am facing that error when implementing a custom soundstream inherited class.
Here is the code where it is complaining:
#ifndef AUDIOMANAGER_H_INCLUDED
#define AUDIOMANAGER_H_INCLUDED

#include <memory>
#include <vector>

#include <SFML/Audio.hpp>

#include "../nodes/outputNode.h"

class AudioManager;

class customAudioStream : sf::SoundStream{       // HERE IT IS THROWING THE ERROR!

public:

private:
    virtual bool onGetData(Chunk& data);
    virtual void onSeek(sf::Time timeOffset);
    void registerAudioManager(AudioManager* audioManager);

    AudioManager* manager;
};

class AudioManager{
public:

    AudioManager();
    ~AudioManager();
    void registerOutputNode(std::unique_ptr<outputNode> newOutNode);
    std::vector<sf::Int16> getOutputAudio();

private:
    std::unique_ptr<outputNode> outNode;
    customAudioStream stream;
};


#endif // AUDIOMANAGER_H_INCLUDED

There is some code for outputNode and so on that is missing, since the error seems to be unrelated to that parts.
Do you have any idea what that could be?


18
Audio / Re: Soundstream understanding
« on: May 13, 2018, 11:16:18 am »
Ah ok, yes, I only worked with stl containers before because they are pretty save.

19
Audio / Re: Soundstream understanding
« on: May 12, 2018, 10:18:03 pm »
So I have to cast the variants to int16 (maybe just with assigning it to an int16)?
Quote
It is a pointer to an array of int16, not to just a single int16. That's why there's another "size" member in data.
But in the example in the tutorials data.samples is just assigned to a pointer of the (currentSampleIndex)'th
sample. So it seems to be just a pointer to a single int16? How can it be a pointer to an array if it's a pointer to a single element? I thought that sfml just uses the address of that pointer and then steps through the vector by doing pointer address arithmetics?

20
Audio / Soundstream understanding
« on: May 11, 2018, 11:36:11 pm »
Hello,
I want to implement a custom Soundstream. For that, I also have to override onGetData, but I don't really understand how I can feed it data. Why is data.samples a pointer to a int16? That doesn't make sense to me, I expected that I pass an array or something like that. Also, is it necessary to use a vector like in the example? My theory is that you are giving a pointer to a start int16, and then SFML is stepping through the vector by incrementing the sample pointer address by the size of int16 to get to the next sample. Is that right?

Another question, I deliver the data through a vector <boost::variant <int, int16, maybe something else...>>. Is there a way to give soundstream the data through that? Of course, the actual data in each variant passed to the soundstream will ALWAYS be an int16, but I need that variant for flexibility reasons (the vectors with the data is passed through a pipeline before it gets to the soundstream).
Thanks!

21
Graphics / Re: Nice way to write a GUI organization system
« on: January 20, 2018, 05:06:46 pm »
Theoretical, existing librarys would be OK to, but: I want to have FULL control about my GUI, and also I need audio and network, so I want to stay at SFML and write a GUI organization layer on top of it (with widgets, containers, and so on).

22
Graphics / Nice way to write a GUI organization system
« on: January 19, 2018, 06:00:23 pm »
Hello,

the following question might be a bit unspecific, but I hope I can ask it like that.
I want to write a node-based audio creation program (kind of a DAW for sound designers. The node system and look should be like the attached image (it's a nodetree from Blender).
Now I wrote a few Widgets and node organization classes, but I don't know really how to write the whole program in a nice and universal structure, but that might be a problem later for me and co-programmers. Can you maybe share some tips or link to good documents/books/whatever?
 I know it's a blurry question and topic, but I can't ask soneone else. Thanks!

23
Graphics / Re: I can handle sf::Drawable only with pointers?
« on: January 01, 2018, 02:24:18 pm »
Ok, I've looked it up, but I don't understand, why this is only causing problems in relationship to normal variables and not to pointers.

24
Graphics / I can handle sf::Drawable only with pointers?
« on: December 31, 2017, 12:04:30 pm »
Hello,

I have a class "Container", which is just a Container for self-written widgets derived from sf::Drawable. It has a vector, which holds them. Also, I have the class "GUIManager", which is a class containing ALL widgets of the GUI (also in a vector). It has a function to add a Container to the GUI, in which all widgets from the vector of the Container are copied to his vector of all widgets.

I made the whole thing with shared_ptr s, because it seemed handy to me. So in the vectors of the Containers and also of the GUIManager are shared_ptr s to the widgets. But that becomes a problem more and more and gets to complicated, so I tried to store the widgets normal, without pointers, and just pass pointers of them to the GUIManager.
But I can't declare normal variables to classes derived from sf::Drawable, because sf::Drawable is a abstract class.
How can I do this (store object from classes derived from sf::Drawable in a normal variable)?

25
Graphics / Re: sf::Text problem with a shared_ptr
« on: December 28, 2017, 10:03:07 pm »
Oops, I just forgot make_shared  :o, thanks!

26
Graphics / sf::Text problem with a shared_ptr
« on: December 28, 2017, 01:51:45 pm »
Hello,

I have a shared_ptr to a sf::Text object, declaration:
    std::shared_ptr<sf::Text> title;

But when I want for example to set the character size like so:
    title->setCharacterSize(24);

... a exception is thrown:
    "this" was "Nullptr"   (in Visual Studio 2017)

But, strangely, when I set the font before that, like so:
    title->setFont(titleFont);

... the exception still appears at setCharacterSize, setFont works fine!

Do you know why this could happen?

Pages: 1 [2]