Hi Bruno On Tue, Apr 27, 2010 at 5:56 AM, Bruno Buccolo <[email protected]> wrote: > Hi, > > I've ran into some issues I'd like to discuss before continuing > implementation: > > The Learn button should update a given midi mapping. As of now, it is just > creating > another midi mapping, with the same controls/group as the selected one and > with > the midi code/type the user "moves" in the controller. For a correct > behaviour, it should > update instead of creating and deleting. For updating we would need the > "primary keys" > so we can find the correct midi mappings to update. I don't know why, but it > feels dirty > to pass that arguments to the Dialog, I guess there's no way around it?
I see what you mean but I don't think there's any way around it. The list of controls that we want mapped should be an "input" for this dialog, so I think passing it as a parameter to the constructor is probably the right thing to do. > > At first, I was trying to reuse all the DlgMidiLearning code, but I feel > that I'll have to add > much complexity to it, so instead: > > 1) I think I'll create another DlgMidiLearning, and maybe rename the first, > the original, to DlgMidiLearningWizard. This way I can be more flexible > about it, but will not reuse > the code as intended. > > 2) Or I can refactor a bit of the DlgMidiLearning so my new methods don't > get > complicated and better reuse code. Which is preferred? (I like 2 better) One way you can do this is to pass a QList of the MixxxControls that you want mapped into the constructor of DlgMidiLearning. You could make that replace the default m_controlsToBind if the parameter is passed. If an empty QList is passed into the function, then you can make it use the default m_controlsToBind. The constructor would look like: DlgMidiLearning::DlgMidiLearning(QWidget * parent, MidiMapping* mapping, QList<MixxxControl> controlsToLearn) Does that make sense? > > This also leads me to question: What kind of code should be in a Dialog? > Are there any consistency restrictions Qt-wise? C++ code! :) Style-wise, a general suggestion is to make your code blend in with existing code. Mixxx's code isn't super consistent in style though. When in doubt, follow the Google C++ Style Guide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml (Is that what you meant?) Good stuff! Thanks, Albert > > Well even tough it's moving slowly, I'm pretty happy to have something > working =) > > Thanks! > > > 2010/4/18 Arnaud LE BRETON <[email protected]> >> >> Hello to all, >> >> On 18 April 2010 17:59, Bruno Buccolo <[email protected]> wrote: >> > Hmmm I like the idea of the context menu. >> > Doesn't seem like much trouble, it's just one more button >> > and a slot to connect. =) >> >> Just for info: >> >> an example of this context button for MIDI learning can be found in >> sooperlooper, a live sampling looper for Linux and OS X: >> >> http://sonosaurus.com/sooperlooper/index.html >> >> I have used it and it is a really smooth way to edit the midi mappings. >> >> >> > >> > I created a branch for this, but haven't commited yet. >> > >> > >> > On Apr 18, 2010, at 2:58 AM, Sean M. Pappalardo - D.J. Pegasus wrote: >> > >> >> Hello, Bruno. >> >> >> >> All of your ideas sound good to me, and I think it makes sense to have >> >> all of them, since I can see using the wizard with a custom set of >> >> controls when there are many the user wants to map, and I can see doing >> >> them one-at-a-time directly in the table when the user is just >> >> tweaking. >> >> >> >> The only suggestion I'd give is for the one-at-a-time, >> >> directly-in-the-table method, that you add a right-click context menu >> >> with a "Learn this entry" option or similar, if it's not too much >> >> trouble. >> >> >> >> Sincerely, >> >> Sean M. Pappalardo >> >> "D.J. Pegasus" >> > >> > Bruno Buccolo >> > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Download Intel® Parallel Studio Eval >> > Try the new software tools for yourself. Speed compiling, find bugs >> > proactively, and fine-tune applications for parallel performance. >> > See why Intel Parallel Studio got high marks during beta. >> > http://p.sf.net/sfu/intel-sw-dev >> > _______________________________________________ >> > Mixxx-devel mailing list >> > [email protected] >> > https://lists.sourceforge.net/lists/listinfo/mixxx-devel >> > >> >> >> >> -- >> Arnaud LE BRETON >> >> "Computers are useless they can only give answers." >> Pablo Picasso > > > > -- > Bruno de Campos Buccolo > > ------------------------------------------------------------------------------ > > _______________________________________________ > Mixxx-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mixxx-devel > > ------------------------------------------------------------------------------ _______________________________________________ Mixxx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mixxx-devel
