2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Runtime.InteropServices;
19 using Tizen.Multimedia.Remoting;
21 internal static partial class Interop
23 internal static partial class MediaControllerServer
25 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
26 internal delegate void PlaybackStateCommandReceivedCallback(string clientName,
27 MediaControllerPlaybackCode state, IntPtr userData);
29 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_create")]
30 internal static extern MediaControllerError Create(out IntPtr handle);
32 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_destroy")]
33 internal static extern MediaControllerError Destroy(IntPtr handle);
35 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state")]
36 internal static extern MediaControllerError SetPlaybackState(IntPtr handle,
37 MediaControllerPlaybackCode state);
39 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_position")]
40 internal static extern MediaControllerError SetPlaybackPosition(IntPtr handle, ulong position);
42 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_playback_info")]
43 internal static extern MediaControllerError UpdatePlayback(IntPtr handle);
45 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_metadata")]
46 internal static extern MediaControllerError SetMetadata(IntPtr handle,
47 MediaControllerAttribute attribute, string value);
49 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_metadata")]
50 internal static extern MediaControllerError UpdateMetadata(IntPtr handle);
52 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_shuffle_mode")]
53 internal static extern MediaControllerError UpdateShuffleMode(IntPtr handle,
54 MediaControllerShuffleMode mode);
56 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_repeat_mode")]
57 internal static extern MediaControllerError UpdateRepeatMode(IntPtr handle, NativeRepeatMode mode);
59 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state_command_received_cb")]
60 internal static extern MediaControllerError SetPlaybackStateCmdRecvCb(IntPtr handle,
61 PlaybackStateCommandReceivedCallback callback, IntPtr userData = default(IntPtr));
63 [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_playback_state_command_received_cb")]
64 internal static extern MediaControllerError UnsetPlaybackStateCmdRecvCb(IntPtr handle);