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 <string.h> 10 11 #include "MediaDebug.h" 12 13 14 media_client_id 15 media_client::Id() const 16 { 17 return node.node; 18 } 19 20 21 media_client_kinds 22 media_client::Kinds() const 23 { 24 return kinds; 25 } 26 27 28 const media_client& 29 media_connection::Client() const 30 { 31 return client; 32 } 33 34 35 media_connection_id 36 media_connection::Id() const 37 { 38 return id; 39 } 40 41 42 media_connection_kinds 43 media_connection::Kinds() const 44 { 45 return kinds; 46 } 47 48 49 bool 50 media_connection::IsInput() const 51 { 52 return Kinds() == B_MEDIA_INPUT; 53 } 54 55 56 bool 57 media_connection::IsOutput() const 58 { 59 return Kinds() == B_MEDIA_OUTPUT; 60 } 61 62 63 media_input 64 media_connection::_BuildMediaInput() const 65 { 66 media_input input; 67 input.node = client.node; 68 input.source = source; 69 input.destination = destination; 70 input.format = format; 71 strcpy(input.name, name); 72 return input; 73 } 74 75 76 media_output 77 media_connection::_BuildMediaOutput() const 78 { 79 media_output output; 80 output.node = client.node; 81 output.source = source; 82 output.destination = destination; 83 output.format = format; 84 strcpy(output.name, name); 85 return output; 86 } 87 88 89 media_node 90 media_connection::_Node() const 91 { 92 return client.node; 93 } 94