public UiOptions(IHelper aHelper) { iWindowWidth = new OptionDouble("windowwidth", "WindowWidth", "", 1024); iWindowHeight = new OptionDouble("windowheight", "WindowHeight", "", 600); iWindowLocationX = new OptionDouble("windowx", "WindowLocationX", "", -1); iWindowLocationY = new OptionDouble("windowy", "WindowLocationY", "", -1); iBrowserSplitterLocationLeft = new OptionInt("browsersplitterleft", "BrowserSplitterLocationLeft", "", 652); iBrowserSplitterLocationRight = new OptionInt("browsersplitterright", "BrowserSplitterLocationRight", "", 404); iFullscreen = new OptionBool("fullscreen", "Fullscreen", "", false); iMiniMode = new OptionBool("minimode", "MiniMode", "", false); iContainerView = new OptionUint("containerview", "ContainerView", "", 0); iContainerViewSizeThumbsView = new OptionDouble("containerviewsizethumbs", "ContainerViewSizeThumbs", "", 150); iContainerViewSizeListView = new OptionDouble("containerviewsizelist", "ContainerViewSizeList", "", 100); iOptionDialogSettings = new OptionDialogSettings(); aHelper.AddOption(iWindowWidth); aHelper.AddOption(iWindowHeight); aHelper.AddOption(iWindowLocationX); aHelper.AddOption(iWindowLocationY); aHelper.AddOption(iBrowserSplitterLocationLeft); aHelper.AddOption(iBrowserSplitterLocationRight); aHelper.AddOption(iFullscreen); aHelper.AddOption(iMiniMode); aHelper.AddOption(iContainerView); aHelper.AddOption(iContainerViewSizeThumbsView); aHelper.AddOption(iContainerViewSizeListView); aHelper.AddOption(iOptionDialogSettings); }
public UiOptions(IHelper aHelper) { iWindowWidth = new OptionInt("windowwidth", "WindowWidth", "", 1024); iWindowHeight = new OptionInt("windowheight", "WindowHeight", "", 600); iWindowLocationX = new OptionInt("windowx", "WindowLocationX", "", -1); iWindowLocationY = new OptionInt("windowy", "WindowLocationY", "", -1); iSplitterLocation = new OptionInt("splitterx", "SplitterLocation", "", 502); iFullscreen = new OptionBool("fullscreen", "Fullscreen", "", false); iMiniMode = new OptionBool("minimode", "MiniMode", "", false); iMiniModeWidth = new OptionInt("minimodewidth", "MiniModeWidth", "", Screen.PrimaryScreen.WorkingArea.Width / 2); iMiniModeLocationX = new OptionInt("minimodex", "MiniModeLocationX", "", Screen.PrimaryScreen.WorkingArea.Width / 2); iMiniModeLocationY = new OptionInt("minimodey", "MiniModeLocationY", "", Screen.PrimaryScreen.WorkingArea.Height - 100); iAlbumView = new OptionUint("albumview", "AlbumView", "", 0); iContainerView = new OptionUint("containerview", "ContainerView", "", 0); iContainerViewSize = new OptionUint("containerviewsize", "ContainerViewSize", "", 0); aHelper.AddOption(iWindowWidth); aHelper.AddOption(iWindowHeight); aHelper.AddOption(iWindowLocationX); aHelper.AddOption(iWindowLocationY); aHelper.AddOption(iSplitterLocation); aHelper.AddOption(iFullscreen); aHelper.AddOption(iMiniMode); aHelper.AddOption(iMiniModeWidth); aHelper.AddOption(iMiniModeLocationX); aHelper.AddOption(iMiniModeLocationY); aHelper.AddOption(iAlbumView); aHelper.AddOption(iContainerView); aHelper.AddOption(iContainerViewSize); }
public HelperKinsky(string[] aArgs, IInvoker aInvoker) : base(aArgs) { iInvoker = aInvoker; iEventServer = new EventServerUpnp(); iListenerNotify = new SsdpListenerMulticast(); IModelFactory factory = new ModelFactory(); iTopologyHouse = new Linn.Topology.House(iListenerNotify, iEventServer, factory); iSenders = new ModelSenders(iListenerNotify, iEventServer); iHouse = new House(iTopologyHouse, iInvoker, iSenders); OptionPage optionPage = new OptionPage("Startup Room"); iOptionStartupRoom = new OptionStartupRoom(iHouse); optionPage.Add(iOptionStartupRoom); AddOptionPage(optionPage); //optionPage = new OptionPage("Cloud Servers"); iOptionCloudServers = new OptionListUri("cloudservers", "Server locations", "List of locations for cloud media servers", new List <Uri>()); //optionPage.Add(iOptionCloudServers); //AddOptionPage(optionPage); iOptionInstallId = new OptionString("installid", "InstallId", "Unique installation identifer", Guid.NewGuid().ToString()); AddOption(iOptionInstallId); iOptionLastNotificationVersion = new OptionUint("lastnotificationversion", "LastNotificationVersion", "last version of notification feed viewed", 0); AddOption(iOptionLastNotificationVersion); iOptionLastAcknowledgedNotificationVersion = new OptionUint("lastacknowledgednotificationversion", "LastAcknowledgedNotificationVersion", "last version of notification feed acknowledged", 0); AddOption(iOptionLastAcknowledgedNotificationVersion); iOptionLastNotificationDate = new OptionDateTime("lastnotificationdate", "LastNotificationDate", "last date notification feed viewed", DateTime.MinValue); AddOption(iOptionLastNotificationDate); iOptionLastSelectedRoom = new OptionString("lastroom", "Last Selected Room", "The last room selected", string.Empty); AddOption(iOptionLastSelectedRoom); iOptionLastLocation = new OptionBreadcrumbTrail("lastlocation", "Last Location", "The last location visited by the browser", BreadcrumbTrail.Default); AddOption(iOptionLastLocation); iBookmarkManager = new BookmarkManager(Path.Combine(DataPath.FullName, "Bookmarks.xml")); Stack.SetStack(this); }
public Preferences(Helper aHelper) { iOptionPagePrivacy = new OptionPagePrivacy(aHelper); aHelper.AddOptionPage(iOptionPagePrivacy); iOptionReceiverList = new OptionString("linn.songcaster", "Media player list", "List of media players that have ever been seen", new MediaPlayerConfiguration().Save()); iOptionSelectedReceiverUdn = new OptionString("songcast.selectedreceiverudn", "Selected Receiver UDN", "The UDN of the currently selected Songcast receiver", string.Empty); iOptionSubnetAddress = new OptionUint("songcaster.subnet", "Subnet", "Subnet to songcast over", 0); iOptionMulticast = new OptionBool("songcast.usemulticast", "Multicast", "Send audio over multicast rather than unicast", false); iOptionChannel = new OptionUint("songcaster.channel", "Channel", "Multcast channel to send audio over", 0); iOptionUseMusicLatency = new OptionBool("songcast.usemusiclatency", "Use Music Latency", "Send audio using the music latency rather than video latency", true); iOptionMusicLatencyMs = new OptionUint("songcast.musiclatencyms", "Music Latency (ms)", "Songcast music latency", kDefaultMusicLatencyMs); iOptionVideoLatencyMs = new OptionUint("songcast.videolatencyms", "Video Latency (ms)", "Songcast video latency", kDefaultVideoLatencyMs); iOptionRotaryVolumeControl = new OptionBool("songcast.rotaryvolumecontrol", "Rotary volume control", "Whether to use rotary or rocker volume control", true); aHelper.AddOption(iOptionReceiverList); aHelper.AddOption(iOptionSelectedReceiverUdn); aHelper.AddOption(iOptionSubnetAddress); aHelper.AddOption(iOptionMulticast); aHelper.AddOption(iOptionChannel); aHelper.AddOption(iOptionUseMusicLatency); aHelper.AddOption(iOptionMusicLatencyMs); aHelper.AddOption(iOptionVideoLatencyMs); aHelper.AddOption(iOptionRotaryVolumeControl); if (iOptionChannel.Native == 0) { // channel has not been set - assign a random value Random r = new Random(); int byte1 = r.Next(254) + 1; // in range [1,254] int byte2 = r.Next(254) + 1; // in range [1,254] int channel = byte1 << 8 | byte2; iOptionChannel.Native = (uint)channel; } iTrackerAccount = kTrackerAccountDev; if (aHelper.BuildType == EBuildType.Release) { iTrackerAccount = kTrackerAccountRelease; } else if (aHelper.BuildType == EBuildType.Beta) { iTrackerAccount = kTrackerAccountBeta; } }
public Preferences(Helper aHelper) { iOptionPagePrivacy = new OptionPagePrivacy(aHelper); aHelper.AddOptionPage(iOptionPagePrivacy); iOptionFirmwareBeta = new OptionBool("konfig.firmwarebeta", "Participate in firmware beta programme", "Include beta firmware when checking for available updates", false); iOptionNetwork = new OptionUint("konfig.network", "Network", "Network to use", 0); iOptionSelectedProductUdn = new OptionString("konfig.selectedproductudn", "Selected product UDN", "UDN of the product to automatically select for configuration", string.Empty); iOptionSendDsCrashData = new OptionBool("konfig.senddscrashdata", "Send DS crash data to Linn", "Automatically send DS crash data to Linn", false); aHelper.AddOption(iOptionFirmwareBeta); aHelper.AddOption(iOptionNetwork); aHelper.AddOption(iOptionSelectedProductUdn); aHelper.AddOption(iOptionSendDsCrashData); iTrackerAccount = kTrackerAccountDev; if (aHelper.BuildType == EBuildType.Release) { iTrackerAccount = kTrackerAccountRelease; } else if (aHelper.BuildType == EBuildType.Beta) { iTrackerAccount = kTrackerAccountBeta; } }
public HelperKinskyDesktop(string[] aArgs, Rect aScreenRect, IInvoker aInvoker) : base(aArgs, aInvoker) { float goldenRatio = 0.6180339887f; float windowWidth = aScreenRect.Width * goldenRatio; float windowHeight = windowWidth * goldenRatio; iOptionPageGeneral = new OptionPageGeneral("General"); AddOptionPage(iOptionPageGeneral); iOptionWindowX = new OptionFloat("windowx", "WindowX", "Main window's x position", aScreenRect.Origin.X + (aScreenRect.Width - windowWidth) * 0.5f); AddOption(iOptionWindowX); iOptionWindowY = new OptionFloat("windowy", "WindowY", "Main window's y position", aScreenRect.Origin.Y + (aScreenRect.Height - windowHeight) * 0.5f); AddOption(iOptionWindowY); iOptionWindowWidth = new OptionFloat("windowwidth", "WindowWidth", "Main window's width", windowWidth); AddOption(iOptionWindowWidth); iOptionWindowHeight = new OptionFloat("windowheight", "WindowHeight", "Main window's height", windowHeight); AddOption(iOptionWindowHeight); iOptionSplitterFraction = new OptionFloat("splitterfraction", "SplitterFraction", "Splitter position in range [0, 1]", goldenRatio); AddOption(iOptionSplitterFraction); iOptionFullscreen = new OptionBool("fullscreen", "Fullscreen", "Fullscreen mode", false); AddOption(iOptionFullscreen); iOptionKompactMode = new OptionBool("kompactmode", "KompactMode", "Kompact mode", false); AddOption(iOptionKompactMode); iOptionContainerView = new OptionUint("containerview", "ContainerView", "Container View", 0); AddOption(iOptionContainerView); iOptionContainerSizeThumbs = new OptionFloat("containersizethumbs", "ContainerSizeThumbs", "Image size for browser thumbnail view", 0.3f); AddOption(iOptionContainerSizeThumbs); iOptionContainerSizeList = new OptionFloat("containersizelist", "ContainerSizeList", "Image size for browser list view", 0.3f); AddOption(iOptionContainerSizeList); iOptionPageUpdates = new OptionPageUpdates(this); AddOptionPage(iOptionPageUpdates); // check for valid window coordinates - reset to defaults if: // - the window width is greater than 1.5 times the screen width OR // - the window height is greater than 1.5 times the screen height OR // - the window rect does not intersect the screen rect if (iOptionWindowWidth.Native > 1.5f * aScreenRect.Width || iOptionWindowHeight.Native > 1.5f * aScreenRect.Height || !aScreenRect.Intersects(new Rect(iOptionWindowX.Native, iOptionWindowY.Native, iOptionWindowWidth.Native, iOptionWindowHeight.Native))) { iOptionWindowX.ResetToDefault(); iOptionWindowY.ResetToDefault(); iOptionWindowWidth.ResetToDefault(); iOptionWindowHeight.ResetToDefault(); } // check validity of other options if (iOptionSplitterFraction.Native < 0.0f || iOptionSplitterFraction.Native > 1.0f) { iOptionSplitterFraction.ResetToDefault(); } if (iOptionContainerSizeThumbs.Native < 0.0f || iOptionContainerSizeThumbs.Native > 1.0f) { iOptionContainerSizeThumbs.ResetToDefault(); } if (iOptionContainerSizeList.Native < 0.0f || iOptionContainerSizeList.Native > 1.0f) { iOptionContainerSizeList.ResetToDefault(); } }