예제 #1
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        entry_address.ModifyBase(StateType.Normal, new Gdk.Color(255, 0, 0));
        led_matrix        = new LedMatrix("0.0.0.0");
        led_matrix_thread = new Thread(led_matrix.Runner);
        winamp            = new Winamp_httpQ();
        rss          = new RssPlugin();
        no_tray_icon = false;
        IPEndPoint mpc_endpoint;

        led_matrix.rss = rss;
        mpc_plugin     = new Mpc();

        mpd_timer          = new System.Timers.Timer();
        mpd_timer.Elapsed += new ElapsedEventHandler(mpd_timer_elapsed);
        mpd_timer.Interval = 1000;         //1s
        mpd_timer.Start();

        try
        {
            tray_icon = new StatusIcon(new Gdk.Pixbuf("icon.png"));
        }
        catch (Exception)
        {
            no_tray_icon = true;
        }
        if (no_tray_icon == false)
        {
            tray_icon.Visible   = true;
            tray_icon.Tooltip   = "LedMatrix Control";
            tray_icon.Activate += delegate { this.Visible = !this.Visible; };
        }


        loadConfig();
        led_matrix.connection_status_changed_handler += led_matrix_connection_changed;
        led_matrix_thread.Start();
        winamp.title_changed_handler      += led_matrix.setWinampPlaylisttitle;
        winamp.connection_changed_handler += winamp_connection_changed;
        try
        {
            //mpc_endpoint = new IPEndPoint(Dns.GetHostAddresses("dockstar-bo-hdd")[0], 6600);
            mpc_endpoint                      = new IPEndPoint(Dns.GetHostAddresses(entry_mpd.Text)[0], 6600);
            mpc_con                           = new MpcConnection(mpc_endpoint);
            mpc_plugin.Connection             = mpc_con;
            mpc_plugin.Connection.AutoConnect = true;
        }
        catch (Exception)
        {
        }
        user_lines_table = new userLinesTable(ref treeview2, ref led_matrix);
    }
예제 #2
0
    protected void on_entry_mpd_activated(object sender, System.EventArgs e)
    {
        IPEndPoint mpc_endpoint;

        try
        {
            mpc_endpoint          = new IPEndPoint(Dns.GetHostAddresses(entry_mpd.Text)[0], 6600);
            mpc_con               = new MpcConnection(mpc_endpoint);
            mpc_plugin.Connection = mpc_con;
        }
        catch (Exception)
        {
        }
    }
예제 #3
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        entry_address.ModifyBase(StateType.Normal, new Gdk.Color(255,0,0));
        led_matrix = new LedMatrix("0.0.0.0");
        led_matrix_thread = new Thread(led_matrix.Runner);
        winamp = new Winamp_httpQ();
        rss = new RssPlugin();
        no_tray_icon = false;
        IPEndPoint mpc_endpoint;
        led_matrix.rss = rss;
        mpc_plugin = new Mpc();

        mpd_timer = new System.Timers.Timer();
        mpd_timer.Elapsed += new ElapsedEventHandler(mpd_timer_elapsed);
        mpd_timer.Interval = 1000; //1s
        mpd_timer.Start();

        try
        {
            tray_icon = new StatusIcon(new Gdk.Pixbuf("icon.png"));
        }
        catch(Exception)
        {
            no_tray_icon = true;
        }
        if(no_tray_icon == false)
        {
            tray_icon.Visible = true;
            tray_icon.Tooltip = "LedMatrix Control";
            tray_icon.Activate += delegate { this.Visible = !this.Visible; };
        }

        loadConfig();
        led_matrix.connection_status_changed_handler += led_matrix_connection_changed;
        led_matrix_thread.Start();
        winamp.title_changed_handler += led_matrix.setWinampPlaylisttitle;
        winamp.connection_changed_handler += winamp_connection_changed;
        try
        {
            //mpc_endpoint = new IPEndPoint(Dns.GetHostAddresses("dockstar-bo-hdd")[0], 6600);
            mpc_endpoint = new IPEndPoint(Dns.GetHostAddresses(entry_mpd.Text)[0], 6600);
            mpc_con = new MpcConnection(mpc_endpoint);
            mpc_plugin.Connection = mpc_con;
            mpc_plugin.Connection.AutoConnect = true;
        }
        catch(Exception)
        {
        }
        user_lines_table = new userLinesTable(ref treeview2, ref led_matrix);
    }
예제 #4
0
 protected void on_entry_mpd_activated(object sender, System.EventArgs e)
 {
     IPEndPoint mpc_endpoint;
     try
     {
         mpc_endpoint = new IPEndPoint(Dns.GetHostAddresses(entry_mpd.Text)[0], 6600);
         mpc_con = new MpcConnection(mpc_endpoint);
         mpc_plugin.Connection = mpc_con;
     }
     catch(Exception)
     {
     }
 }