C# deezer native api: adapting to C#

后端 未结 1 1130
[愿得一人]
[愿得一人] 2021-01-17 05:32

I\'m trying to use a C# class that wraps C++ native api into CLI C# class. It seems that there are some problems (it really near to be working) and would like some help to f

相关标签:
1条回答
  • 2021-01-17 05:55

    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

    0 讨论(0)
提交回复
热议问题