00001 00002 /****************** <SYN heading BEGIN do not edit this line> ***************** 00003 * 00004 * subsynth - modular audio synthesizer 00005 * subsynth is (C) Copyright 2001-2002 by Kevin Meinert 00006 * 00007 * Original Author: Kevin Meinert 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Library General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2 of the License, or (at your option) any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Library General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Library General Public 00020 * License along with this library; if not, write to the 00021 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00022 * Boston, MA 02111-1307, USA. 00023 * 00024 * ----------------------------------------------------------------- 00025 * File: $RCSfile: Connection.h,v $ 00026 * Date modified: $Date: 2002/04/15 01:55:54 $ 00027 * Version: $Revision: 1.4 $ 00028 * ----------------------------------------------------------------- 00029 * 00030 ****************** <SYN heading END do not edit this line> ******************/ 00031 00032 #ifndef SUBSYNTH_TERMINAL_CONNECTION 00033 #define SUBSYNTH_TERMINAL_CONNECTION 00034 00035 #include <syn/Core/SampleBufferQueue.h> 00036 #include <syn/Core/TerminalPtr.h> 00037 #include <syn/Core/ConnectionPtr.h> 00038 00039 namespace syn 00040 { 00044 class Connection 00045 { 00046 public: 00048 Connection(); 00049 00053 const SampleBufferQueue& queue() const { return mQueue; } 00054 00058 SampleBufferQueue& queue() { return mQueue; } 00059 00061 unsigned int size() 00062 { 00063 unsigned int b = 0; 00064 if (mIn.get() != NULL) ++b; 00065 if (mOut.get() != NULL) ++b; 00066 return b; 00067 } 00068 00073 TerminalPtr getOther( TerminalPtr term ); 00074 00075 private: 00080 void connect( TerminalPtr& in, TerminalPtr& out ); 00081 00082 friend class Terminal; 00084 /*# SampleBufferQueue mFor_together_diagram2; */ 00085 SampleBufferQueue mQueue; 00086 TerminalPtr mIn, mOut; 00087 }; 00088 00089 } // end namespace syn 00090 00091 #endif