1 /* 2 * Copyright 2015, Dario Casalinuovo. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 #include <MediaClient.h> 7 #include <MediaConnection.h> 8 9 #include "debug.h" 10 11 12 media_client_id 13 media_client::Id() const 14 { 15 return node.node; 16 } 17 18 19 media_client_kinds 20 media_client::Kinds() const 21 { 22 return kinds; 23 } 24 25 26 const media_client& 27 media_connection::Client() const 28 { 29 return client; 30 } 31 32 33 media_connection_id 34 media_connection::Id() const 35 { 36 return id; 37 } 38 39 40 media_connection_kinds 41 media_connection::Kinds() const 42 { 43 return kinds; 44 } 45 46 47 bool 48 media_connection::IsInput() const 49 { 50 return Kinds() == B_MEDIA_INPUT; 51 } 52 53 54 bool 55 media_connection::IsOutput() const 56 { 57 return Kinds() == B_MEDIA_OUTPUT; 58 } 59 60 61 media_input 62 media_connection::_MediaInput() const 63 { 64 media_input input; 65 input.node = client.node; 66 input.source = source; 67 input.destination = destination; 68 input.format = format; 69 return input; 70 } 71 72 73 media_output 74 media_connection::_MediaOutput() const 75 { 76 media_output output; 77 output.node = client.node; 78 output.source = source; 79 output.destination = destination; 80 output.format = format; 81 return output; 82 } 83 84 85 const media_source& 86 media_connection::_Source() const 87 { 88 return source; 89 } 90 91 92 const media_destination& 93 media_connection::_Destination() const 94 { 95 return destination; 96 } 97 98 99 media_node 100 media_connection::_RemoteNode() const 101 { 102 return remote_node; 103 } 104 105 106 media_node 107 media_connection::_Node() const 108 { 109 return client.node; 110 } 111