Hello All,
I've been working on pooling the ALSA system exclusive messages while
recording. To properly manage these I had created a map so I could track
incomplete messages. Here is what I used in the AlsaDriver.h file (these are
private members):
> typedef std::map<unsigned int,
> std::pair<MappedEvent *, std::string> > DeviceEventMap;
> DeviceEventMap *m_pendSysExcMap;
I tried very hard to not use the DeviceEventMap *. I wanted to use the stack
(just DeviceEventMap without the *). I could get my code to compile without
warning (other than the existing ones in the codebase) creating on the stack
but the RG would bomb just about without fail in different places during the
initial startup.
I even reverted all of my changes added, those two lines to the .h file along
with a #include "MappedEvent.h" and got the same result. I wasn't even using
m_pendSysExcMap in the .cpp file.
I was able avoid using a pointer in the Instrument.h/.cpp StaticControllers.
Here are the two lines in Instrument.h that is related to it.
> typedef std::vector<std::pair<MidiByte, MidiByte> > StaticControllers;
and
> StaticControllers m_staticControllers;
These were in the codebase before I started that fix, so I went with what they
had.
Is there something I'm missing? I see that I'm using the map container with a
nested pair for the value element for the DeviceEventMap and the
StaticControllers is a vector with just a pair as its element. But I'm not
seeing why one works and the other doesn't.
I think I'm just misunderstanding something. I've looked through N. Josuttis
"The C++ Standard Library," and have read several wiki and websites related to
the map and vector class, but I can't figure out why I need the DeviceEventMap
on the heap and why I was able to use our existing RG codebase for
StaticControllers which is built on the stack.
Any thoughts or suggestions to help me understand this better would be helpful.
Sincerely,
Julie S.
PS - I currently am testing with DeviceEventMap built on the heap in the
constructor and clear and delete it in the destructor. Rg does not crash, but
I haven't actually tested the logic I wrote that uses this map.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel