public void SetOfflineMode(bool offlineModeForced, dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { if (dz_connect_offline_mode(Handle, cb, operationUserData, offlineModeForced) != 0) { throw new ConnectionRequestFailedException("Failed to set offline mode."); } }
public void SetAccessToken(string token, dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { if (dz_connect_set_access_token(Handle, cb, operationUserData, token) != 0) { throw new ConnectionRequestFailedException("Could not set access token. Check connection and that the token is valid."); } }
public void Resume(dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { if (dz_player_resume(Handle, cb, operationUserData) != 0) { throw new PlayerRequestFailedException("Unable to resume current track."); } }
public void PlayAudioAds(dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { if (dz_player_play_audioads(Handle, cb, operationUserData) != 0) { throw new PlayerRequestFailedException("Unable to load audio ads."); } }
public void Seek(int microseconds, dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { if (Handle.ToInt64() != 0) { dz_player_seek(Handle, cb, operationUserData, microseconds); } }
public void Shutdown(dz_activity_operation_callback cb = null, IntPtr operationuserData = default(IntPtr)) { if (Handle.ToInt64() != 0) { dz_player_deactivate(Handle, cb, operationuserData); } }
public void CachePathSet(string path, dz_activity_operation_callback cb = null, IntPtr operationUserdata = default(IntPtr)) { if (dz_connect_cache_path_set(Handle, cb, operationUserdata, path) != 0) { throw new ConnectionRequestFailedException("Cache path was not set. Check connection."); } }
public void Shutdown(dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { if (Handle.ToInt64() != 0) { dz_connect_deactivate(Handle, cb, operationUserData); Active = false; } }
public static extern dz_error_t dz_player_load(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata, string tracklist_data);
public static extern dz_error_t dz_player_seek(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata, UInt64 pos_usecond);
public void Load(string content = null, dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { currentContent = content; if (dz_player_load(Handle, cb, operationUserData, currentContent) != 0) { throw new PlayerRequestFailedException("Unable to load content. Check the given dzmedia entry."); } }
public static extern dz_error_t dz_connect_offline_mode(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata, bool offline_mode_forced);
public static extern dz_error_t dz_player_set_output_volume(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata, Int32 volume);
public static extern dz_error_t dz_connect_set_access_token(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata, [MarshalAs(UnmanagedType.LPStr)] string access_token);
public static extern dz_error_t dz_connect_cache_path_set(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata, [MarshalAs(UnmanagedType.LPStr)] string local_path);
public static extern dz_error_t dz_player_play(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata, dz_player_play_command_t command, Int32 idx);
public void Play(dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr), DZPlayerCommand command = DZPlayerCommand.START_TRACKLIST, Int64 index = -1) { if (index == -1) { index = Marshal.SizeOf(IntPtr.Zero) == 4 ? DZPlayerIndex32.CURRENT : DZPlayerIndex64.CURRENT; } if (dz_player_play(Handle, cb, operationUserData, (int)command, (uint)index) > 1) { throw new PlayerRequestFailedException("Unable to play content."); } }
[DllImport(DZImport.LibPath)] private static extern int dz_player_enable_shuffle_mode(IntPtr playerHandle, dz_activity_operation_callback cb, IntPtr data, bool shuffle_mode);
public void UpdateRepeatMode(DZPlayerRepeatMode mode, dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { dz_player_set_repeat_mode(Handle, cb, operationUserData, (int)mode); }
public static extern dz_error_t dz_player_deactivate(IntPtr self, [MarshalAs(UnmanagedType.FunctionPtr)] dz_activity_operation_callback cb, IntPtr operation_userdata);
[DllImport(DZImport.LibPath)] public static extern int dz_connect_deactivate(IntPtr connectHandle, dz_activity_operation_callback cb, IntPtr data);
[DllImport(DZImport.LibPath)] public static extern int dz_connect_offline_mode(IntPtr self, dz_activity_operation_callback cb, IntPtr data, bool offline_mode_forced);
[DllImport(DZImport.LibPath)] public static extern int dz_connect_set_access_token(IntPtr self, dz_activity_operation_callback cb, IntPtr data, [MarshalAs(UnmanagedType.LPStr)] string token);
[DllImport(DZImport.LibPath)] public static extern int dz_connect_cache_path_set(IntPtr self, dz_activity_operation_callback cb, IntPtr data, [MarshalAs(UnmanagedType.LPStr)] string local_path);
public void EnableShuffleMode(bool shuffleMode, dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr)) { dz_player_enable_shuffle_mode(Handle, cb, operationUserData, shuffleMode); }
[DllImport(DZImport.LibPath)] private static extern int dz_player_load(IntPtr playerHandle, dz_activity_operation_callback cb, IntPtr data, [MarshalAs(UnmanagedType.LPStr)] string tracklistData);
[DllImport(DZImport.LibPath)] private static extern int dz_player_play(IntPtr playerHandle, dz_activity_operation_callback cb, IntPtr data, int command, uint idx);
[DllImport(DZImport.LibPath)] private static extern int dz_player_resume(IntPtr playerHandle, dz_activity_operation_callback cb, IntPtr data);
[DllImport(DZImport.LibPath)] private static extern int dz_player_seek(IntPtr playerHandle, dz_activity_operation_callback cb, IntPtr data, int microseconds);
[DllImport(DZImport.LibPath)] private static extern int dz_player_set_repeat_mode(IntPtr playerHandle, dz_activity_operation_callback cb, IntPtr data, int mode);