Пример #1
0
 public PageMain(Helper aHelper, OptionPagePrivacy aOptionPagePrivacy, HelperAutoUpdate aHelperAutoUpdate, IStartAtLoginOption aStartAtLoginOption)
     : base()
 {
     iTracker            = new OpenHome.Xapp.Tracker(TrackerConfiguration.TrackerAccount(aHelper), this);
     iOptionPagePrivacy  = aOptionPagePrivacy;
     iHelperAutoUpdate   = aHelperAutoUpdate;
     iStartAtLoginOption = aStartAtLoginOption;
     iOptionPagePrivacy.EventUsageDataChanged += HandleEventUsageDataChanged;
 }
Пример #2
0
        private void ApplicationStartup(object sender, StartupEventArgs e)
        {
            // this prevents the UI framework from handling unhandled exceptions so that they are let throught
            // to be handled by the Linn code
            System.Windows.Forms.Application.SetUnhandledExceptionMode(System.Windows.Forms.UnhandledExceptionMode.ThrowException);

            // create the app helper
            iHelper = new Helper(Environment.GetCommandLineArgs());
            OptionPagePrivacy optionPagePrivacy = new OptionPagePrivacy(iHelper);

            iHelper.AddOptionPage(optionPagePrivacy);
            iHelper.ProcessOptionsFileAndCommandLine();

            // create crash log dumper
            ICrashLogDumper d = new CrashLogDumperWindow(Songbox.Properties.Resources.Icon, iHelper.Title, iHelper.Product, iHelper.Version);

            iHelper.AddCrashLogDumper(d);

            // create view and helper for auto updates
            iViewAutoUpdate = new Toolkit.Wpf.ViewAutoUpdateStandard(Songbox.Properties.Resources.Icon, Songbox.Properties.Resources.Image106x106);
            iViewAutoUpdate.EventButtonUpdateClicked += EventButtonUpdateClicked;
            iHelperAutoUpdate = new HelperAutoUpdate(iHelper, iViewAutoUpdate, new Invoker(this.Dispatcher));
            iHelperAutoUpdate.OptionPageUpdates.BetaVersions = iHelper.BuildType == EBuildType.Beta;
            iHelperAutoUpdate.Start();

            iPageMain = new Linn.Songbox.PageMain(iHelper, optionPagePrivacy, iHelperAutoUpdate, new StartAtLoginOption(iHelper.Title));

            IconInfo iconInfo = new IconInfo("logo.png", "image/png", 106, 106, 32);

            try
            {
                // create the media server
                iServer = new Server("git://github.com/linnoss/MediaApps.git", iHelper.Company, "http://www.linn.co.uk", iHelper.Title, "http://www.linn.co.uk", new Presentation(iPageMain), iconInfo);
            }
            catch (ApplicationException)
            {
                Shutdown(-1);
            }

            // create the configuration window
            iWindow          = new ConfigurationWindow(Songbox.Properties.Resources.Icon, iHelper.Title, iServer);
            iWindow.Closing += EventWindowClosing;

            // create and show the sys tray icon
            iFormSysTray = new FormSysTray(this);
        }
Пример #3
0
        public override void FinishedLaunching(NSObject notification)
        {
            // load images for the status item and windows
            NSImage sysTrayImage = new NSImage(NSBundle.MainBundle.PathForImageResource("SysTrayIcon.png"));
            NSImage largeImage   = new NSImage(NSBundle.MainBundle.PathForImageResource("Icon106x106.png"));

            // creating the status item with a length of -2 is equivalent to the call
            // [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]
            iStatusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(-2);
            iStatusItem.HighlightMode = true;
            iStatusItem.Menu          = StatusMenu;
            iStatusItem.Image         = sysTrayImage;

            // create the app helper
            iHelper = new Helper(Environment.GetCommandLineArgs());
            OptionPagePrivacy optionPagePrivacy = new OptionPagePrivacy(iHelper);

            iHelper.AddOptionPage(optionPagePrivacy);
            iHelper.ProcessOptionsFileAndCommandLine();

            // create window for crash logging
            CrashLogDumperWindowController d = new CrashLogDumperWindowController(largeImage, iHelper.Title, iHelper.Product, iHelper.Version);

            d.LoadWindow();
            iHelper.AddCrashLogDumper(d);

            // create view and helper for the auto updates - hardcode check for beta versions for now
            IViewAutoUpdate autoUpdateView = new Linn.Toolkit.Mac.ViewAutoUpdateStandard(largeImage);

            iHelperAutoUpdate = new HelperAutoUpdate(iHelper, autoUpdateView, new Invoker());
            iHelperAutoUpdate.OptionPageUpdates.BetaVersions = iHelper.BuildType == EBuildType.Beta;
            iHelperAutoUpdate.Start();

            iPageMain = new Linn.Songbox.PageMain(iHelper, optionPagePrivacy, iHelperAutoUpdate, new StartAtLoginOption());

            IconInfo iconInfo = new IconInfo("logo.png", "image/png", 106, 106, 32);

            // create the media server
            iServer = new Server("git://github.com/linnoss/MediaApps.git", iHelper.Company, "http://www.linn.co.uk", iHelper.Title, "http://www.linn.co.uk", new Presentation(iPageMain), iconInfo);

            // create the main configuration window
            iWindow = new ConfigurationWindowController(iServer, iPageMain);
            iWindow.LoadWindow();
        }
Пример #4
0
        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;
            }
        }
Пример #5
0
        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;
            }
        }