示例#1
0
 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.");
     }
 }
示例#2
0
 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.");
     }
 }
示例#3
0
 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.");
     }
 }
示例#4
0
 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.");
     }
 }
示例#5
0
 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);
     }
 }
示例#6
0
 public void Shutdown(dz_activity_operation_callback cb = null, IntPtr operationuserData = default(IntPtr))
 {
     if (Handle.ToInt64() != 0)
     {
         dz_player_deactivate(Handle, cb, operationuserData);
     }
 }
示例#7
0
 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.");
     }
 }
示例#8
0
 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);
示例#11
0
 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.");
     }
 }
示例#12
0
        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);
示例#14
0
        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);
示例#15
0
        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);
示例#17
0
 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.");
     }
 }
示例#18
0
 [DllImport(DZImport.LibPath)] private static extern int dz_player_enable_shuffle_mode(IntPtr playerHandle,
                                                                                       dz_activity_operation_callback cb, IntPtr data, bool shuffle_mode);
示例#19
0
 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);
示例#21
0
 [DllImport(DZImport.LibPath)] public static extern int dz_connect_deactivate(IntPtr connectHandle, dz_activity_operation_callback cb, IntPtr data);
示例#22
0
 [DllImport(DZImport.LibPath)] public static extern int dz_connect_offline_mode(IntPtr self, dz_activity_operation_callback cb, IntPtr data, bool offline_mode_forced);
示例#23
0
 [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);
示例#24
0
 [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);
示例#25
0
 public void EnableShuffleMode(bool shuffleMode, dz_activity_operation_callback cb = null, IntPtr operationUserData = default(IntPtr))
 {
     dz_player_enable_shuffle_mode(Handle, cb, operationUserData, shuffleMode);
 }
示例#26
0
 [DllImport(DZImport.LibPath)] private static extern int dz_player_load(IntPtr playerHandle,
                                                                        dz_activity_operation_callback cb, IntPtr data, [MarshalAs(UnmanagedType.LPStr)] string tracklistData);
示例#27
0
 [DllImport(DZImport.LibPath)] private static extern int dz_player_play(IntPtr playerHandle,
                                                                        dz_activity_operation_callback cb, IntPtr data, int command, uint idx);
示例#28
0
 [DllImport(DZImport.LibPath)] private static extern int dz_player_resume(IntPtr playerHandle,
                                                                          dz_activity_operation_callback cb, IntPtr data);
示例#29
0
 [DllImport(DZImport.LibPath)] private static extern int dz_player_seek(IntPtr playerHandle,
                                                                        dz_activity_operation_callback cb, IntPtr data, int microseconds);
示例#30
0
 [DllImport(DZImport.LibPath)] private static extern int dz_player_set_repeat_mode(IntPtr playerHandle,
                                                                                   dz_activity_operation_callback cb, IntPtr data, int mode);