make indent less terrible

This commit is contained in:
Bruno Morais 2019-09-09 08:46:15 -04:00
parent e27138af76
commit 62389a97cb
2 changed files with 50 additions and 53 deletions

View File

@ -255,50 +255,48 @@ static int sd_response_mimetypes(sd_bus* bus, const char* path, const char* ifac
return sd_bus_message_append_strv(reply, (char**)mime);
}
const sd_bus_vtable musikcube_mp_table[] =
{
SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("CanQuit", "b", sd_response_false, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanRaise", "b", sd_response_false, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("HasTrackList", "b", sd_response_false, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Identity", "s", sd_response_id, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("SupportedUriSchemes", "as", sd_response_urischemes, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("SupportedMimeTypes", "as", sd_response_mimetypes, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_METHOD("Raise", "", "", sd_method_nop, 0),
SD_BUS_METHOD("Quit", "", "", sd_method_nop, 0),
SD_BUS_VTABLE_END
};
const sd_bus_vtable musikcube_mp_table[] = {
SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("CanQuit", "b", sd_response_false, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanRaise", "b", sd_response_false, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("HasTrackList", "b", sd_response_false, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Identity", "s", sd_response_id, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("SupportedUriSchemes", "as", sd_response_urischemes, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("SupportedMimeTypes", "as", sd_response_mimetypes, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_METHOD("Raise", "", "", sd_method_nop, 0),
SD_BUS_METHOD("Quit", "", "", sd_method_nop, 0),
SD_BUS_VTABLE_END
};
const sd_bus_vtable musikcube_mpp_table[] =
{
SD_BUS_VTABLE_START(0),
SD_BUS_METHOD("Next", "", "", next_wrapper, 0),
SD_BUS_METHOD("Previous", "", "", prev_wrapper, 0),
SD_BUS_METHOD("Pause", "", "", pause_wrapper, 0),
SD_BUS_METHOD("PlayPause", "", "", playpause_wrapper, 0),
SD_BUS_METHOD("Stop", "", "", stop_wrapper, 0),
SD_BUS_METHOD("Play", "", "", play_wrapper, 0),
SD_BUS_METHOD("Seek", "x", "", seek_wrapper, 0),
SD_BUS_PROPERTY("PlaybackStatus", "s", get_playback_status, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_WRITABLE_PROPERTY("LoopStatus", "s", get_loop_status, set_loop_status, 0,
SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_WRITABLE_PROPERTY("Shuffle", "b", get_shuffle_status, set_shuffle_status, 0,
SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Position", "x", get_position, 0, 0),
SD_BUS_WRITABLE_PROPERTY("Volume", "d", get_volume, set_volume,
0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Metadata", "a{sv}", get_metadata, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanGoNext", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanGoPrevious", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanPlay", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanPause", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanSeek", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanControl", "b", sd_response_true, 0, 0),
SD_BUS_PROPERTY("MinimumRate", "d", sd_response_rate, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("MaximumRate", "d", sd_response_rate, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_WRITABLE_PROPERTY("Rate", "d", sd_response_rate, sd_write_nop, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_METHOD("SetPosition", "ox", "", sd_method_nop, 0), // TODO implement
SD_BUS_METHOD("OpenUri", "s", "", sd_method_nop, 0), // TODO verify possibility for implementation
SD_BUS_SIGNAL("Seeked", "x", 0),
SD_BUS_VTABLE_END
};
const sd_bus_vtable musikcube_mpp_table[] = {
SD_BUS_VTABLE_START(0),
SD_BUS_METHOD("Next", "", "", next_wrapper, 0),
SD_BUS_METHOD("Previous", "", "", prev_wrapper, 0),
SD_BUS_METHOD("Pause", "", "", pause_wrapper, 0),
SD_BUS_METHOD("PlayPause", "", "", playpause_wrapper, 0),
SD_BUS_METHOD("Stop", "", "", stop_wrapper, 0),
SD_BUS_METHOD("Play", "", "", play_wrapper, 0),
SD_BUS_METHOD("Seek", "x", "", seek_wrapper, 0),
SD_BUS_PROPERTY("PlaybackStatus", "s", get_playback_status, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_WRITABLE_PROPERTY("LoopStatus", "s", get_loop_status, set_loop_status, 0,
SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_WRITABLE_PROPERTY("Shuffle", "b", get_shuffle_status, set_shuffle_status, 0,
SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Position", "x", get_position, 0, 0),
SD_BUS_WRITABLE_PROPERTY("Volume", "d", get_volume, set_volume,
0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Metadata", "a{sv}", get_metadata, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanGoNext", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanGoPrevious", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanPlay", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanPause", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanSeek", "b", sd_response_true, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanControl", "b", sd_response_true, 0, 0),
SD_BUS_PROPERTY("MinimumRate", "d", sd_response_rate, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("MaximumRate", "d", sd_response_rate, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_WRITABLE_PROPERTY("Rate", "d", sd_response_rate, sd_write_nop, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_METHOD("SetPosition", "ox", "", sd_method_nop, 0), // TODO implement
SD_BUS_METHOD("OpenUri", "s", "", sd_method_nop, 0), // TODO verify possibility for implementation
SD_BUS_SIGNAL("Seeked", "x", 0),
SD_BUS_VTABLE_END
};

View File

@ -12,13 +12,12 @@ extern "C" {
using namespace musik::core::sdk;
enum MPRISProperty
{
Volume = 1,
PlaybackStatus = 2,
LoopStatus = 3,
Shuffle = 4,
Metadata = 5,
enum MPRISProperty {
Volume = 1,
PlaybackStatus = 2,
LoopStatus = 3,
Shuffle = 4,
Metadata = 5,
};
struct MPRISMetadataValues {