Hi Pawel!

I had a short look at the code that you've mentioned and it has really a 
quite bad design. I don't have the time to refactor those parts, i would 
rather spent my hydrogen-time on fixing bugs for 0.9.6. But if you want 
to make a first try and clean up the code,  i can offer to help you with 
that and have a look at your patches and help if you don't now how to 
proceed.

So what has to be done? Basically, all non-gui stuff (setting the song, 
storing it into the 'Preferences' class) should go definitely into the 
core of hydrogen (class hydrogen in src/core/src) or into playlist.cpp. 
The Event that you have found should trigger only the refreshing of the 
gui elements which show song/playlist dependent stuff. I don't think 
that the changes will be huge, since the playlist functionality is quite 
small.

Hope that helps,
Sebastian

On 2013-06-19 9:43, Pawel wrote:
> Thanks Sebastian !
> 
> I was dig a little into code and looks that playlist code is strongly
> bind to gui code. I was able to implement code for loading playlist ,
> but this is not enough for load songs. For now there is only possible
> to load first Song on start (because we can get path from playlist
> array), but changing song is not possible , because related event:
> EVENT_PLAYLIST_LOADSONG
> 
> Is handled by gui/src/HydrogenApp.cpp file. Unfortunately it's far
> away from my C++/Hydrogen code knowledge to clean this mess (to many
> dependencies).
> 
> Therefore I see two option:
> - someone else clean this mess and then I provide patch for h2cli
> (better option)
> - I re-implement load playlist code and EVENT_PLAYLIST_LOADSONG event 
> handling.
> 
> P.
> 
> Dnia Niedziela, 16 Czerwca 2013 21:21 <[email protected]> napisał(a)
>> Hi Pawel,
>> 
>> thanks again for the patch! I've just pushed it into our git
>> repository.
>> About the playlist stuff: I haven't written the playlist code, so i
>> don't have an answer to your question without looking closer at the
>> code. But i guess if you look at main.cpp and MainForm.cpp, you should
>> find the (gui) code for the playlist initialization (if there is 
>> any..).
>> If you have any problems with the integration just ask again, then i
>> will have a deeper look at the code on the next weekend :)
>> Best regards,
>> Sebastian
>> 
>> On 15.06.2013 13:06, Pawel wrote:
>> > Hi,
>> >
>> > I improved this patch to allow also map Program Change messages - so
>> > now user can change songs using Program Change messages ;-)
>> >
>> > It is still possible to use PC messages as in previous version (for
>> > select next pattern) if user map appropriate action.
>> >
>> > Please append it to official repo.
>> >
>> > BTW. my first question from previous mail is still valid.
>> >
>> > Pawel
>> >
>> > Dnia Poniedziałek, 10 Czerwca 2013 22:54 Pawel <[email protected]> napisał(a)
>> >> Hi,
>> >>
>> >> I've done simple patch for handling playlist via MIDI. For my
>> >> purpose I use it for precisely select song to play live (via CC). In
>> >> my M-Audio Axiom I can set fixed MIDI CC value to buttons.
>> >>
>> >> Meantime I have two question:
>> >> 1) I want to add support for playlist in h2cli. Please tell me it is
>> >> enough to just call
>> >> LocalFileMng::loadPlayList
>> >>
>> >> ?
>> >>
>> >> 2) Currently Program Change messages are restricted to pattern
>> >> switching , will be OK for you to add support for mapping this
>> >> messages ? I imagine scenario where I could load playlist in h2cli and
>> >> change songs via Program Change messages - this is actually my long
>> >> term goal ;-)
>> >>
>> >> Best Regards
>> >> Xj
>> 
>> 
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Windows:
>> 
>> Build for Windows Store.
>> 
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> Hydrogen-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/hydrogen-devel
> 
> 
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
> 
> Build for Windows Store.
> 
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Hydrogen-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to