On 15-05-14 03:45 AM, Raine M. Ekman wrote: > Quoting midi-pascal <[email protected]>: > >> The idea of naming the imported tracks and CC is a very nice feature too! >> However the tracks name import does not work as expected: >> The tracks are named Track 1, Track2... Track n, even if they have a >> name in the original MIDI file. > It did work back when I first made the PR :) PR #1984 changed stuff, > and I didn't check after rebasing #2006... my mistake. > > >> This issue comes from two minor bugs: >> In MidiImport.cpp, the condition: >> if( attr == "tracknames" && evt->get_update_type() == 'a' ) { >> should be: >> if( attr == "tracknames" && evt->get_update_type() == 's' ) { >> since the track name is a string, and >> trackName = evt->get_atom_value(); >> should be: >> trackName = evt->get_string_value(); >> >> But in allegro.cpp, the function get_string_value() has a bug since it >> returns the name of the event ("Trackname") instead of its contents. >> In get_string_value(), the line: >> return update->parameter.attr_name(); >> should be: >> return update->parameter.a; > My solution to that was to just use get_atom_value() and call it a > day, as that seemed to do what was needed. But your reasoning does > make sense. The tricky thing is get_atom_value() will not work for the trackname event in debug mode because there is an assert(get_update_type() == 'a')) in it. For the trackname event, get_update_type() returns 's'. So lmms crashes when debuging the MidiImport code. As you may know, assert() is a no-op when the code is compiled in optimized mode so the crash does not happen in this case. This is the reason why I choosed to fix the code this way. > >> This feature could be enhanced a bit for the standard MIDI controls, >> i.e. "CC 7" could be displayed as "Volume" , "CC 10" as "Panning" etc. > Sure. > > > Qoting Tres: >> Probably best to use tr("Track") + "%1" moving forward so that translators >> don't try to fix percent signs. :) > Translation suggestions noted, too. > Will you modify the code in your PR or should I wait for it to be pulled in the master branch? Your choice :-)
------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ LMMS-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lmms-devel
