code sync with platform/core/csapi/sync-manager
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Remoting / Interop / Interop.MediaControllerServer.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.Runtime.InteropServices;
19 using Tizen.Multimedia.Remoting;
20
21 internal static partial class Interop
22 {
23     internal static partial class MediaControllerServer
24     {
25         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
26         internal delegate void PlaybackStateCommandReceivedCallback(string clientName,
27             MediaControllerPlaybackCode state, IntPtr userData);
28
29         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_create")]
30         internal static extern MediaControllerError Create(out IntPtr handle);
31
32         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_destroy")]
33         internal static extern MediaControllerError Destroy(IntPtr handle);
34
35         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state")]
36         internal static extern MediaControllerError SetPlaybackState(IntPtr handle,
37             MediaControllerPlaybackCode state);
38
39         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_position")]
40         internal static extern MediaControllerError SetPlaybackPosition(IntPtr handle, ulong position);
41
42         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_playback_info")]
43         internal static extern MediaControllerError UpdatePlayback(IntPtr handle);
44
45         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_metadata")]
46         internal static extern MediaControllerError SetMetadata(IntPtr handle,
47             MediaControllerAttribute attribute, string value);
48
49         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_metadata")]
50         internal static extern MediaControllerError UpdateMetadata(IntPtr handle);
51
52         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_shuffle_mode")]
53         internal static extern MediaControllerError UpdateShuffleMode(IntPtr handle,
54             MediaControllerShuffleMode mode);
55
56         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_repeat_mode")]
57         internal static extern MediaControllerError UpdateRepeatMode(IntPtr handle, NativeRepeatMode mode);
58
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));
62
63         [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_playback_state_command_received_cb")]
64         internal static extern MediaControllerError UnsetPlaybackStateCmdRecvCb(IntPtr handle);
65     }
66 }