Logo Search packages:      
Sourcecode: patchage version File versions  Download package

Connection.h

/* This file is part of Om.  Copyright (C) 2005 Dave Robillard.
 * 
 * Om is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 * 
 * Om is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


#ifndef CONNECTION_H
#define CONNECTION_H

#include <libgnomecanvasmm.h>
#include <list>
#include "Port.h"

using std::list;

namespace PatchBay {
      

/** A connection line on the canvas.
 *
 * \ingroup Canvas
 */
00034 class Connection : public Gnome::Canvas::Line
{
public:
      Connection(Gnome::Canvas::Group* parent, Port* source_port, Port* dest_port);
      virtual ~Connection() {}
      
      void update_location();
      void disconnect();
      void hilite(bool b);
      
      void        source_port(Port* p) { m_source_port = p; }
      const Port* source_port() const  { return m_source_port; }
      void        dest_port(Port* p)   { m_dest_port = p; }
      const Port* dest_port() const    { return m_dest_port; }

private:
      Port* m_source_port;
      Port* m_dest_port;
      int   m_color;
};

typedef list<Connection*> ConnectionList;


} // namespace PatchBay

#endif // CONNECTION_H

Generated by  Doxygen 1.6.0   Back to index