mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-02 06:14:52 +00:00
Refactor complete
This commit is contained in:
@@ -93,7 +93,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
var sscRoom = Room as IHasCurrentSourceInfoChange;
|
||||
if(sscRoom != null)
|
||||
sscRoom.CurrentSingleDisplaySourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
sscRoom.CurrentSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
|
||||
var vcRoom = Room as IHasVideoCodec;
|
||||
if (vcRoom != null && vcRoom.VideoCodec != null)
|
||||
|
||||
@@ -486,7 +486,7 @@ namespace PepperDash.Essentials
|
||||
DeviceManager.AddDevice(room);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
||||
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
||||
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge...");
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
else if (typeName == "roomonwhenoccupancydetectedfeature")
|
||||
{
|
||||
return new Room.Behaviours.RoomOnToDefaultSourceWhenOccupied(dc);
|
||||
return new RoomOnToDefaultSourceWhenOccupied(dc);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -14,7 +14,7 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Core.Fusion;
|
||||
using PepperDash.Essentials.Core.Fusion;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace PepperDash.Essentials.Room.Config
|
||||
/// <param name="props"></param>
|
||||
/// <param name="room"></param>
|
||||
/// <returns></returns>
|
||||
public static PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(
|
||||
public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy(
|
||||
EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
|
||||
{
|
||||
var microphonePrivacy = props.MicrophonePrivacy;
|
||||
|
||||
@@ -1,68 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Devices;
|
||||
//using PepperDash.Essentials.Core.Config;
|
||||
//using PepperDash.Essentials.Room.Config;
|
||||
//using PepperDash.Essentials.Devices.Common.Codec;
|
||||
//using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
//using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Types
|
||||
{
|
||||
public class EssentialsDualDisplayRoom : EssentialsNDisplayRoomBase, IHasCurrentVolumeControls,
|
||||
IRunRouteAction, IPrivacy, IPrivacy, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec
|
||||
{
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
//namespace PepperDash.Essentials.Room.Types
|
||||
//{
|
||||
// public class EssentialsDualDisplayRoom : EssentialsNDisplayRoomBase, IHasCurrentVolumeControls,
|
||||
// IRunRouteAction, IPrivacy, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec
|
||||
// {
|
||||
// public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
|
||||
public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
|
||||
// public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
//************************
|
||||
// Call-related stuff
|
||||
// //************************
|
||||
// // Call-related stuff
|
||||
|
||||
public BoolFeedback InCallFeedback { get; private set; }
|
||||
// public BoolFeedback InCallFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
|
||||
/// </summary>
|
||||
public IntFeedback CallTypeFeedback { get; private set; }
|
||||
// /// <summary>
|
||||
// /// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
|
||||
// /// </summary>
|
||||
// public IntFeedback CallTypeFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// When something in the room is sharing with the far end or through other means
|
||||
/// </summary>
|
||||
public BoolFeedback IsSharingFeedback { get; private set; }
|
||||
// /// <summary>
|
||||
// /// When something in the room is sharing with the far end or through other means
|
||||
// /// </summary>
|
||||
// public BoolFeedback IsSharingFeedback { get; private set; }
|
||||
|
||||
IRoutingSinkWithSwitching LeftDisplay { get; private set; }
|
||||
IRoutingSinkWithSwitching RightDisplay { get; private set; }
|
||||
// IRoutingSinkWithSwitching LeftDisplay { get; private set; }
|
||||
// IRoutingSinkWithSwitching RightDisplay { get; private set; }
|
||||
|
||||
|
||||
protected override Func<bool> OnFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
var leftDisp = LeftDisplay as DisplayBase;
|
||||
var rightDisp = RightDisplay as DisplayBase;
|
||||
var val = leftDisp != null && leftDisp.CurrentSourceInfo != null
|
||||
&& leftDisp.CurrentSourceInfo.Type == eSourceListItemType.Route
|
||||
&& rightDisp != null && rightDisp.CurrentSourceInfo != null
|
||||
&& rightDisp.CurrentSourceInfo.Type == eSourceListItemType.Route;
|
||||
return val;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// protected override Func<bool> OnFeedbackFunc
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return () =>
|
||||
// {
|
||||
// var leftDisp = LeftDisplay as DisplayBase;
|
||||
// var rightDisp = RightDisplay as DisplayBase;
|
||||
// var val = leftDisp != null && leftDisp.CurrentSourceInfo != null
|
||||
// && leftDisp.CurrentSourceInfo.Type == eSourceListItemType.Route
|
||||
// && rightDisp != null && rightDisp.CurrentSourceInfo != null
|
||||
// && rightDisp.CurrentSourceInfo.Type == eSourceListItemType.Route;
|
||||
// return val;
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -13,7 +13,7 @@ using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasCurrentVolumeControls
|
||||
public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasCurrentVolumeControls, IHasDefaultDisplay
|
||||
{
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
@@ -16,8 +16,8 @@ using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange,
|
||||
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec
|
||||
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange,
|
||||
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay
|
||||
{
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
@@ -112,11 +112,6 @@ namespace PepperDash.Essentials
|
||||
public AudioCodecBase AudioCodec { get; private set; }
|
||||
|
||||
public bool ExcludeFromGlobalFunctions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The config name of the source list
|
||||
/// </summary>
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
public string DefaultSourceItem { get; set; }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ using PepperDash.Essentials.Core.PageManagers;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsTouchpanelController : Device
|
||||
public class EssentialsTouchpanelController : Device, IHasBasicTriListWithSmartObject
|
||||
{
|
||||
public BasicTriListWithSmartObject Panel { get; private set; }
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
public void RegisterForSourceChange(IHasCurrentSourceInfoChange room)
|
||||
{
|
||||
room.CurrentSingleDisplaySourceChange -= room_CurrentSourceInfoChange;
|
||||
room.CurrentSingleDisplaySourceChange += room_CurrentSourceInfoChange;
|
||||
room.CurrentSourceChange -= room_CurrentSourceInfoChange;
|
||||
room.CurrentSourceChange += room_CurrentSourceInfoChange;
|
||||
}
|
||||
|
||||
void room_CurrentSourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
|
||||
|
||||
@@ -1123,7 +1123,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
//uint attrNum = Convert.ToUInt32(keyNum);
|
||||
|
||||
// Check for UI devices
|
||||
var uiDev = dev as EssentialsTouchpanelController;
|
||||
var uiDev = dev as IHasBasicTriListWithSmartObject;
|
||||
if (uiDev != null)
|
||||
{
|
||||
if (uiDev.Panel is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
|
||||
@@ -1204,7 +1204,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
||||
}
|
||||
|
||||
var defaultDisplay = (Room as EssentialsHuddleSpaceRoom).DefaultDisplay as DisplayBase;
|
||||
var defaultDisplay = (Room as IHasDefaultDisplay).DefaultDisplay as DisplayBase;
|
||||
if (defaultDisplay == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
|
||||
@@ -1269,7 +1269,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
string displayName = string.Format("Display {0} - ", displayIndex);
|
||||
|
||||
|
||||
if (display == (Room as EssentialsHuddleSpaceRoom).DefaultDisplay)
|
||||
if (display == (Room as IHasDefaultDisplay).DefaultDisplay)
|
||||
{
|
||||
// Display volume
|
||||
var defaultDisplayVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
|
||||
|
||||
@@ -229,6 +229,7 @@
|
||||
<Compile Include="Routing\TieLine.cs" />
|
||||
<Compile Include="Timers\CountdownTimer.cs" />
|
||||
<Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" />
|
||||
<Compile Include="Touchpanels\Interfaces.cs" />
|
||||
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
|
||||
<Compile Include="Touchpanels\MOVED LargeTouchpanelControllerBase.cs" />
|
||||
<Compile Include="Touchpanels\TriListExtensions.cs" />
|
||||
|
||||
@@ -6,6 +6,10 @@ using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public interface IHasDefaultDisplay
|
||||
{
|
||||
IRoutingSinkWithSwitching DefaultDisplay { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with routing
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public interface IHasBasicTriListWithSmartObject
|
||||
{
|
||||
BasicTriListWithSmartObject Panel { get; }
|
||||
}
|
||||
}
|
||||
@@ -136,12 +136,12 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
|
||||
else if (typeName == "inroompc")
|
||||
{
|
||||
return new InRoomPc(key, name);
|
||||
return new Core.Devices.InRoomPc(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "laptop")
|
||||
{
|
||||
return new Laptop(key, name);
|
||||
return new Core.Devices.Laptop(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "mockvc")
|
||||
@@ -299,9 +299,9 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
|
||||
else if (typeName == "microphoneprivacycontroller")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<Microphones.MicrophonePrivacyControllerConfig>(properties.ToString());
|
||||
var props = JsonConvert.DeserializeObject<Core.Privacy.MicrophonePrivacyControllerConfig>(properties.ToString());
|
||||
|
||||
return new Microphones.MicrophonePrivacyController(key, props);
|
||||
return new Core.Privacy.MicrophonePrivacyController(key, props);
|
||||
}
|
||||
else if (typeName == "roku")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user