Пример #1
0
 public ClientsPage(SnapcastClient client)
 {
     InitializeComponent();
     m_Client = client;
     m_Client.OnServerUpdated += Client_OnServerUpdated;
     GroupsRefreshView.Command = new AsyncCommand(_ReloadAsync);
 }
Пример #2
0
        public Group(SnapcastClient snapcastClient, SnapDotNet.ControlClient.JsonRpcData.Group group)
        {
            InitializeComponent();
            m_Group          = group;
            m_SnapcastClient = snapcastClient;

            foreach (SnapDotNet.ControlClient.JsonRpcData.Client client in m_Group.clients)
            {
                Client c = new Client(client, m_SnapcastClient.ServerData.server.snapserver);
                //c.HorizontalAlignment = HorizontalAlignment.Stretch;
                //c.HorizontalContentAlignment = HorizontalAlignment.Center;
                slClients.Children.Add(c);
            }

            m_Group.SERVER_OnGroupUpdated += () =>
            {
                MainThread.BeginInvokeOnMainThread(_OnGroupUpdated);
            };

            m_Group.CLIENT_OnVolumeUpdated += () =>
            {
                MainThread.BeginInvokeOnMainThread(_OnGroupUpdated);
            };

            vcGroup.OnMuteToggled       += VcGroup_OnMuteToggled;
            vcGroup.OnVolumeChanged     += VcGroup_OnVolumeChanged;
            vcGroup.OnVolumeChangeStart += VcGroup_OnVolumeChangeStart;
            vcGroup.OnSettingsTapped    += VcGroup_OnSettingsTapped;
            _OnGroupUpdated();
        }
Пример #3
0
 public App()
 {
     InitializeComponent();
     Instance                     = this;
     m_SnapcastClient             = new SnapcastClient();
     SnapcastClient.AutoReconnect = true;
     MainPage                     = new MainPage(m_SnapcastClient);
 }
Пример #4
0
        public MainPage(SnapcastClient client)
        {
            m_Client = client;
            InitializeComponent();

            MasterBehavior = MasterBehavior.Popover;
            Detail         = new NavigationPage(new ClientsPage(m_Client));
            MenuPages.Add((int)MenuItemType.Clients, (NavigationPage)Detail);

            //NavPage.RootPage = new ClientsPage(m_Client);
        }
Пример #5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            _ConfigureLogger();
            AttachConsole(-1);   // attach to console if we were launched via command line
            Console.WriteLine(); // send a newline
            SnapSettings.Init();
            SnapcastClient.AutoReconnect = SnapSettings.AutoReconnect;
            HookEvents = Hook.GlobalEvents();

            ThemeManager.ChangeAppStyle(this, ThemeManager.GetAccent(SnapSettings.Accent), ThemeManager.GetAppTheme(SnapSettings.Theme));

            Assembly assembly = Assembly.GetExecutingAssembly();

            Version = assembly.GetName().Version;
            var list = assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), true);

            if (list != null)
            {
                if (list.Length > 0)
                {
                    ProductName = (list[0] as AssemblyProductAttribute).Product;
                }
            }
            Logger.Info("Application started: {0} {1}", ProductName, Version);

            TaskbarIcon = (TaskbarIcon)FindResource("NotifyIcon");
            TaskbarIcon.NoLeftClickDelay = true;
            m_SnapcastClient             = new SnapcastClient();

            Instance  = this;
            Player    = new Player.Player();
            Broadcast = new Broadcast.Broadcast();
            Broadcast.BroadcastStateChanged += _OnBroadcastStateChanged;
            if (string.IsNullOrEmpty(SnapSettings.Server) == false)
            {
                Connect();
            }
            else
            {
                SnapDotNet.Windows.Settings settings = new Windows.Settings();
                settings.ShowDialog();
            }
        }