Tizen 2.0 Release
[framework/osp/media.git] / src / FMediaAudioRouteInfo.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 #include <FBaseSysLog.h>
20 #include <FMediaAudioRouteInfo.h>
21 #include "FMedia_AudioRouteInfoImpl.h"
22
23 using namespace Tizen::Base;
24
25 namespace Tizen { namespace Media
26 {
27
28 AudioRouteInfo::AudioRouteInfo(InputAudioDevice in, OutputAudioDevice out)
29 {
30         __pAudioRouteInfoImpl = new (std::nothrow) _AudioRouteInfoImpl(in,out);
31 }
32
33 AudioRouteInfo::~AudioRouteInfo()
34 {
35         if (__pAudioRouteInfoImpl)
36         {
37                 delete __pAudioRouteInfoImpl;
38                 __pAudioRouteInfoImpl = null;
39         }
40 }
41
42 AudioRouteInfo::AudioRouteInfo(const AudioRouteInfo& rhs)
43 {
44         if (rhs.__pAudioRouteInfoImpl)
45         {
46                 __pAudioRouteInfoImpl = new (std::nothrow)_AudioRouteInfoImpl(*(rhs.__pAudioRouteInfoImpl));
47         }
48 }
49
50 void
51 AudioRouteInfo::SetInputAudioDevice(InputAudioDevice in)
52 {
53         __pAudioRouteInfoImpl->SetInputAudioDevice(in);
54
55 }
56
57 void
58 AudioRouteInfo::SetOutputAudioDevice(OutputAudioDevice out)
59 {
60
61         __pAudioRouteInfoImpl->SetOutputAudioDevice(out);
62 }
63
64 InputAudioDevice
65 AudioRouteInfo::GetInputAudioDevice(void) const
66 {
67         return __pAudioRouteInfoImpl->GetInputAudioDevice();
68 }
69
70 OutputAudioDevice
71 AudioRouteInfo::GetOutputAudioDevice(void) const
72 {
73         return __pAudioRouteInfoImpl->GetOutputAudioDevice();
74 }
75
76 AudioRouteInfo&
77 AudioRouteInfo::operator =(const AudioRouteInfo& rhs)
78 {
79         if (this == &rhs)
80         {
81                 return *this;
82         }
83         *__pAudioRouteInfoImpl = *(rhs.__pAudioRouteInfoImpl);
84         return *this;
85 }
86
87 bool
88 AudioRouteInfo::Equals(const Object& obj) const
89 {
90         const AudioRouteInfo *pRhs = dynamic_cast<const AudioRouteInfo *>(&obj);
91         if (pRhs == null)
92         {
93                 return false;
94         }
95         return __pAudioRouteInfoImpl->Equals(*pRhs->__pAudioRouteInfoImpl);
96
97 }
98
99 int
100 AudioRouteInfo::GetHashCode(void) const
101 {
102         return __pAudioRouteInfoImpl->GetHashCode();
103 }
104
105 };};            //Tizen::Media