On 18-Jan-09, at 9:32 PM, Sean M. Pappalardo wrote: > > > Albert Santoni wrote: >> I think the real problem is a conceptual one - Each "mapping" of a >> <device, controltype, miditype, midino, midichan> onto a <group, key> >> should be an object, and it currently isn't. > > What about ConfigValueMidi? ;) That's an object, and currently where > each mapping is stored for engine use. > >> The MidiMapping class >> you're creating should contain a list of these "mappings", and >> perhaps >> the name of your class should be changed then too (to something more >> plural). > > Sounds fine to me but I'm not up to doing that now. I just want to get > the QtScript stuff into the correct threads to try and solve the > crashing issue. Hopefully the work I have done already will be > useful in > implementing what you suggest in the future. Garth and I chatted a > little about this on IRC too and he likes the idea, so long as there > are > adequate interface functions the dlg can call to tell MidiMappings' > internal storage mechanism that particular keys have been added, > changed, or deleted.
Hint: Use slots and signals. When a particular mapping (ConfigValueMidi or whatever we want to call it) gets changed, the bulk MidiMapping would emit a mappingChanged(ConfigValueMidi) signal and update the GUI. But yeah, go ahead and see if you can get your QtScript stuff working once it's reorganized as much as it needs to be to make it work. We can worry about this massive refactoring later. (This MidiMapping/ prefs dialog stuff is complimentary to the MIDI work I did over the break.) > > >> #include "configobject.h" in midiscriptengine.h. There's something >> weird >> about MidiCategory and I couldn't get a forward declaration for it to >> work when I was doing my MIDI stuff. > > Garth took a look at it and added some forward declarations and other > tweaks and that problem is gone now. But I still have one I can't > figure > out: > > src/midiobject.h:126: error: field 'm_pMidiMapping' has incomplete > type > > What the hell is an incomplete type?! It means that MidiMapping is declared but not defined within the scope of that file. The declaration is the "class MidiMapping;" forward declaration that you have at the top of midiobject.h (I'm assuming). This is a problem, for example, because the compiler doesn't know how much memory to allocate for a MidiMapping object, so a MidiObject can't be constructed. If you make m_pMidiMapping a pointer, then the compiler knows that it only needs to allocate 32-bits for the pointer when MidiObject is constructed. The rest of the memory that MidiMapping needs is allocated when you say "m_pMidiMapping = new MidiMapping(blah);". Hope this helps! Albert ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Mixxx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mixxx-devel
