Ejemplo n.º 1
0
        void ConfigLoad(object sender, EventArgs e)
        {
            Config_File_Reader cfg_reader = new Config_File_Reader();

            if (cfg_reader.exists)
            {
                YRC_Config file_cfg = cfg_reader.get_cfg();
                this.TB_IP.Text = file_cfg.ip;
                this.TB_MV.Text = file_cfg.maximum_volume.ToString();
                this.TB_SP.Text = file_cfg.silent_preset.ToString();
                this.TB_MP.Text = file_cfg.medium_preset.ToString();
                this.TB_LP.Text = file_cfg.loud_preset.ToString();
            }
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            cfg_reader = new Config_File_Reader();
            Input_XML.ReadXml("input_list.xml");
            bindingSource1.DataSource = Input_XML.Tables[0];
            CB_Input.ValueMember      = "value";
            CB_Input.DisplayMember    = "name";
            if (cfg_reader.exists)
            {
                file_cfg                = cfg_reader.get_cfg();
                maximum_volume          = file_cfg.maximum_volume;
                TRB_Volume_Free.Maximum = maximum_volume;
                TB_MaxVol.Text          = maximum_volume.ToString();
                IP            = file_cfg.ip;
                sp            = file_cfg.silent_preset;
                mp            = file_cfg.medium_preset;
                lp            = file_cfg.loud_preset;
                update_looper = get_new_basic_updater();
                update_looper.Start();
            }
            else
            {
                MessageBox.Show("No config file detected - please setup YRGUI", "Missing Config-File", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                Config cfg_form = new Config();
                cfg_form.Show();
            }

            STST_Label_IP.Text = IP;
        }