C# deezer native api: adapting to C#

99封情书 提交于 2019-12-01 14:24:52

You are miscasting the returned value. Most of the functions return dz_error_t (you can find the enum values in deezer-object.h) the enum CONNECT_EVENT_TYPE is mapped on dz_connect_event_t. I would suggest to create a new enum mapped on dz_error_t and cast with this new enum.

Moreover, as described in http://developers.deezer.com/sdk/native (Section Playing a song) for the moment only DZ_TRACKLIST_AUTOPLAY_MANUAL is supported. So I would suggest to change the dz_player_play call into:

dz_player_play(libcPlayerHndl, IntPtr.Zero, IntPtr.Zero, cmd, TRACKLIST_AUTOPLAY_MODE.MANUAL, idx);

and dPlayer.Play into:

dPlayer.Play(0, PLAYER_COMMANDS.START_TRACKLIST);

If you still have an issue, please also post the traces returned by your application.

Do you have files created in the path provided by ccUserProfilePath ?

If you still have an issue, be sure you have right to play the song by trying to play it with your Internet browser at this address http://www.deezer.com/track/97206076.

Regards,

Cyril

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!