Defined VcCodecBase, new Vc interfaces and started CiscoCodec class

This commit is contained in:
Neil Dorin
2017-08-31 18:12:52 -06:00
parent 88de2a2ee0
commit 617e2bdc4f
10 changed files with 318 additions and 44 deletions

View File

@@ -46,6 +46,14 @@
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cisco One Button To Push, Version=1.0.0.30876, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\CodeBlue\libraries\Cisco CODEC\Cisco One Button To Push\Cisco One Button To Push\bin\Cisco One Button To Push.dll</HintPath>
</Reference>
<Reference Include="Cisco SX80 Corporate Phone Book, Version=1.0.0.15355, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\CodeBlue\libraries\Cisco CODEC\Cisco SX80 Corporate Phone Book\Cisco SX80 Corporate Phone Book\bin\Cisco SX80 Corporate Phone Book.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
@@ -119,6 +127,8 @@
<Compile Include="SetTopBox\IRSetTopBoxBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Streaming\Roku.cs" />
<Compile Include="VC\CiscoCodec.cs" />
<Compile Include="VC\VcCodecBase.cs" />
<None Include="Properties\ControlSystem.cfg" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />

View File

@@ -0,0 +1,123 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Cisco_One_Button_To_Push;
using Cisco_SX80_Corporate_Phone_Book;
namespace PepperDash.Essentials.Devices.VC
{
public class CiscoCodec : VcCodecBase
{
private CiscoOneButtonToPush Codec;
private Corporate_Phone_Book PhoneBook;
public CiscoCodec(string key, string name)
: base(key, name)
{
Codec = new CiscoOneButtonToPush();
PhoneBook = new Corporate_Phone_Book();
Codec.Initialize();
Codec.GetMeetings();
}
public override void ExecuteSwitch(object selector)
{
throw new NotImplementedException();
}
protected override Func<bool> InCallFeedbackFunc
{
get { throw new NotImplementedException(); }
}
protected override Func<bool> TransmitMuteFeedbackFunc
{
get { throw new NotImplementedException(); }
}
protected override Func<bool> ReceiveMuteFeedbackFunc
{
get { throw new NotImplementedException(); }
}
protected override Func<bool> PrivacyModeFeedbackFunc
{
get { throw new NotImplementedException(); }
}
public override void Dial()
{
throw new NotImplementedException();
}
public override void EndCall()
{
throw new NotImplementedException();
}
public override void ReceiveMuteOff()
{
throw new NotImplementedException();
}
public override void ReceiveMuteOn()
{
throw new NotImplementedException();
}
public override void ReceiveMuteToggle()
{
throw new NotImplementedException();
}
public override void SetReceiveVolume(ushort level)
{
throw new NotImplementedException();
}
public override void TransmitMuteOff()
{
throw new NotImplementedException();
}
public override void TransmitMuteOn()
{
throw new NotImplementedException();
}
public override void TransmitMuteToggle()
{
throw new NotImplementedException();
}
public override void SetTransmitVolume(ushort level)
{
throw new NotImplementedException();
}
public override void PrivacyModeOn()
{
throw new NotImplementedException();
}
public override void PrivacyModeOff()
{
throw new NotImplementedException();
}
public override void PrivacyModeToggle()
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.VC
{
public abstract class VcCodecBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer//, ICodecAudio
{
#region IUsageTracking Members
public UsageTracking UsageTracker { get; set; }
#endregion
#region IRoutingInputs Members
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
#endregion
public BoolFeedback InCallFeedback { get; protected set; }
abstract protected Func<bool> InCallFeedbackFunc { get; }
abstract protected Func<bool> TransmitMuteFeedbackFunc { get; }
abstract protected Func<bool> ReceiveMuteFeedbackFunc { get; }
abstract protected Func<bool> PrivacyModeFeedbackFunc { get; }
public VcCodecBase(string key, string name)
: base(key, name)
{
InCallFeedback = new BoolFeedback(InCallFeedbackFunc);
ReceiveMuteIsOnFeedback = new BoolFeedback(ReceiveMuteFeedbackFunc);
TransmitMuteIsOnFeedback = new BoolFeedback(TransmitMuteFeedbackFunc);
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeFeedbackFunc);
InputPorts = new RoutingPortCollection<RoutingInputPort>();
InCallFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
}
void InCallFeedback_OutputChange(object sender, EventArgs e)
{
if (UsageTracker != null)
{
if (InCallFeedback.BoolValue)
UsageTracker.StartDeviceUsage();
else
UsageTracker.EndDeviceUsage();
}
}
public abstract void Dial();
public abstract void EndCall();
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
InCallFeedback,
ReceiveMuteIsOnFeedback,
TransmitMuteIsOnFeedback,
PrivacyModeIsOnFeedback
};
}
}
public abstract void ExecuteSwitch(object selector);
#region ICodecAudio Members
public IntFeedback ReceiveLevelFeedback { get; private set; }
public BoolFeedback ReceiveMuteIsOnFeedback { get; private set; }
public abstract void ReceiveMuteOff();
public abstract void ReceiveMuteOn();
public abstract void ReceiveMuteToggle();
public abstract void SetReceiveVolume(ushort level);
public IntFeedback TransmitLevelFeedback { get; private set; }
public BoolFeedback TransmitMuteIsOnFeedback { get; private set; }
public abstract void TransmitMuteOff();
public abstract void TransmitMuteOn();
public abstract void TransmitMuteToggle();
public abstract void SetTransmitVolume(ushort level);
public abstract void PrivacyModeOn();
public abstract void PrivacyModeOff();
public abstract void PrivacyModeToggle();
public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
#endregion
}
}