aconnectgui-0.9.0rc2-1.orig/0040755000076400007640000000000007530700232013345 5ustar rjrjaconnectgui-0.9.0rc2-1.orig/AUTHORS0100644000076400007640000000004507466514352014427 0ustar rjrjMaarten de Boer aconnectgui-0.9.0rc2-1.orig/ChangeLog0100644000076400007640000000016607466514352015135 0ustar rjrj0.9rc1-2 - Applied patch from tvignaud@mandrakesoft.com to fix compilation on Mandrake (Fl/FL includes) aconnectgui-0.9.0rc2-1.orig/INSTALL0100644000076400007640000000010507523747401014402 0ustar rjrjaclocal automake -a --foreign autoconf ./configure make make install aconnectgui-0.9.0rc2-1.orig/Makefile.am0100644000076400007640000000001507466560740015412 0ustar rjrjSUBDIRS=src aconnectgui-0.9.0rc2-1.orig/NEWS0100644000076400007640000000000007466514352014045 0ustar rjrjaconnectgui-0.9.0rc2-1.orig/README0100644000076400007640000000044307466514352014241 0ustar rjrjaconnectgui is a FLTK based frontend for aconnect. It is written directly on top of the alsamixer source, leaving the original source intact, only adding a couple of ifdefs, and some calls to the gui part, so it provides exactly the same functionality, but with a graphical userinterface. aconnectgui-0.9.0rc2-1.orig/configure.in0100644000076400007640000000107607523750156015673 0ustar rjrjdnl Process this file with autoconf to produce a configure script. AC_INIT(src/aconnect.cxx) AM_INIT_AUTOMAKE(aconnectgui, 0.9.0rc2-1) AC_PREFIX_DEFAULT(/usr) AM_CONFIG_HEADER(src/config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S dnl Checks for libraries. AC_CHECK_LIB(fltk,numericsort,, AC_CHECK_LIB(fltk,fl_numericsort,, AC_MSG_ERROR("missing fltk")) ) AM_PATH_ALSA(0.9.0) dnl Checks for header files. AC_HEADER_STDC AC_HAVE_HEADERS(stdio.h string.h stdlib.h getopt.h alsa/asoundlib.h FL/Fl.H) AC_OUTPUT(Makefile src/Makefile) aconnectgui-0.9.0rc2-1.orig/debian/0040755000076400007640000000000007530700232014567 5ustar rjrjaconnectgui-0.9.0rc2-1.orig/debian/aconnectgui.sgml0100644000076400007640000000571407466561510017772 0ustar rjrjRobert"> Jordens"> Mai 9, 2002"> 1"> rjo@gmx.de"> ACONNECTGUI"> Debian"> GNU"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2002 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; FLTK based frontend for aconnect &dhpackage; DESCRIPTION This manual page documents briefly the &dhpackage; commands. This manual page was written for the &debian; distribution because the original program does not have a manual page. &dhpackage; is a FLTK based frontend for aconnect. It is written directly on top of the alsamixer source, leaving the original source intact, only adding a couple of ifdefs, and some calls to the gui part, so it provides exactly the same functionality, but with a graphical userinterface. OPTIONS Options given are ignored. Everything that aconnect has options for is done via the GUI. SEE ALSO aconnect (1), aseqnet(1), aseqview(1). AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.
aconnectgui-0.9.0rc2-1.orig/debian/changelog0100644000076400007640000000146507523767571016471 0ustar rjrjaconnectgui (0.9.0rc2-1-1) unstable; urgency=low * Upstream changes. * Corrected the fiddling with "prefix" in debian/rules now adhering to the recommended way. -- Robert Jordens Tue, 6 Aug 2002 17:21:25 +0200 aconnectgui (0.9.0rc1-2-1) unstable; urgency=low * Initial Release, closes: Bug#146369 * wrote manpage * zeroed DISTCLEANFILES in Makefile.in and .am to make it usable as a rules-target and to minimize the .diff * corrected debian/control to not look too similar to alsamixergui ;-] * now native debian. debian/ tree in cvs; keeping the Debian revision though * don't build-depend automake, autoconf. Bad idea. * found that I can have two dashes in the version * added url to debian/control -- Robert Jordens Thu, 9 May 2002 13:16:30 +0200 aconnectgui-0.9.0rc2-1.orig/debian/control0100644000076400007640000000131007467205773016205 0ustar rjrjSource: aconnectgui Section: sound Priority: optional Maintainer: Robert Jordens Build-Depends: debhelper (>> 3.0.0), libfltk1-dev, libasound2-dev (>= 0.9.0), docbook-to-man Standards-Version: 3.5.2 Package: aconnectgui Architecture: any Depends: ${shlibs:Depends} Description: FLTK based frontend for aconnect aconnectgui is a FLTK based frontend for aconnect. It is written directly on top of the aconnect source, leaving the original source intact, only adding a couple of ifdefs, and some calls to the gui part, so it provides exactly the same functionality, but with a graphical userinterface. . Further information can be found at http://www.iua.upf.es/~mdeboer/projects/aconnectgui/ aconnectgui-0.9.0rc2-1.orig/debian/copyright0100644000076400007640000000202507466561510016532 0ustar rjrjThis package was debianized by Robert Jordens on Thu, 9 May 2002 13:16:30 +0200. It was downloaded from ftp://www.iua.upf.es/pub/mdeboer/projects/aconnectgui Upstream Author: Maarten de Boer Copyright: This program 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. This program is distributed in the hope that it will be useful, but WITHOUTANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 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. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL file. aconnectgui-0.9.0rc2-1.orig/debian/dirs0100644000076400007640000000001007466561510015453 0ustar rjrjusr/bin aconnectgui-0.9.0rc2-1.orig/debian/docs0100644000076400007640000000000707466561510015450 0ustar rjrjREADME aconnectgui-0.9.0rc2-1.orig/debian/menu0100644000076400007640000000015107466561510015464 0ustar rjrj?package(aconnectgui):needs=X11 section=Apps/Sound\ title="aconnectgui" command="/usr/bin/aconnectgui" aconnectgui-0.9.0rc2-1.orig/debian/rules0100755000076400007640000000427607523766574015704 0ustar rjrj#!/usr/bin/make -f # rules # # Robert Jordens # # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. # # $Id: rules,v 1.4 2002/08/06 15:38:36 rjordens Exp $ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. export DH_COMPAT=3 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure: Makefile.am -rm -f aclocal.m4 INSTALL COPYING install-sh Makefile.in configure \ missing mkinstalldirs src/config.h.in src/Makefile.in \ src/stamp-h.in config.h.in aclocal automake --add-missing --copy autoheader autoconf config.status: configure dh_testdir ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info build: build-stamp build-stamp: config.status dh_testdir $(MAKE) /usr/bin/docbook-to-man debian/aconnectgui.sgml > debian/aconnectgui.1 touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp debian/aconnectgui.1 -$(MAKE) distclean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) install prefix=$(CURDIR)/debian/aconnectgui/usr # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu dh_installman debian/aconnectgui.1 dh_installinfo # dh_undocumented dh_installchangelogs ChangeLog dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install aconnectgui-0.9.0rc2-1.orig/src/0040755000076400007640000000000007530700233014135 5ustar rjrjaconnectgui-0.9.0rc2-1.orig/src/Client.cxx0100644000076400007640000001063207523746512016112 0ustar rjrj#include "Window.hxx" #include "Client.hxx" #include "Connection.hxx" #include "Port.hxx" #include "Layout.hxx" #include Client::Client(int X,int Y,int W,int H,char* L,int C) :FrameGroup(X,Y,W,H,L) { labelsize(10); mPorts = new Fl_Group(X+2,Y+14,W-7,0); mPorts->end(); mPorts->resizable(0); end(); resizable(0); mClientId = C; } Port* Client::FindPort(int clientId,int portId) { if (mClientId!=clientId) return 0; int n = mPorts->children(); for (int i=0;ichild(i)); if (p->PortId()==portId) { return p; } } return 0; } Connector* Client::FindInput(int clientId,int portId) { if (mClientId!=clientId) return 0; int n = mPorts->children(); for (int i=0;ichild(i)); if (p->PortId()==portId && p->Input()) { return p->Input(); } } return 0; } Connector* Client::FindOutput(int clientId,int portId) { if (mClientId!=clientId) return 0; int n = mPorts->children(); for (int i=0;ichild(i)); if (p->PortId()==portId && p->Output()) { return p->Output(); } } return 0; } Connector* Client::FindConnector(int ix,int iy) { if (ix>=x() && ix<=x()+w() && iy>=y() && iy<=y()+h()) { int n = mPorts->children(); for (int i=0;ichild(i)); Connector* c = p->FindConnector(ix,iy); if (c) return c; } } return 0; } Clients::Clients(int X,int Y,int W,int H):Fl_Group(X,Y,W,H) { resizable(0); end(); } Port* Clients::FindPort(int clientId,int portId) { int n = children(); for (int i=0;iFindPort(clientId,portId); if (p) return p; } return 0; } Connector* Clients::FindInput(int clientId,int portId) { int n = children(); for (int i=0;iFindInput(clientId,portId); if (r) return r; } return 0; } Connector* Clients::FindOutput(int clientId,int portId) { int n = children(); for (int i=0;iFindOutput(clientId,portId); if (r) return r; } return 0; } Client* Clients::FindClient(int clientId) { int n = children(); for (int i=0;iClientId()==clientId) return c; } return 0; } Connector* Clients::FindConnector(int ix,int iy) { int n = children(); for (int i=0;iFindConnector(ix,iy); if (con) return con; } return 0; } Port* Client::AddPort(char* il,int portId,ConnectorType t) { Port* port; int ph=0; if (t&kInput) { ph+=CONNECTOR_DISTANCE; } if (t&kOutput) { ph+=CONNECTOR_DISTANCE; } ph+=PORT_EXTRA; port = new Port(mPorts->x(),mPorts->y()+mPorts->h(),mPorts->w(),ph,il,portId,t); mPorts->size(mPorts->w(),port->y()+port->h()-mPorts->y()); mPorts->add(port); size(w(),mPorts->y()+mPorts->h()-y()+4); mPorts->color(FL_RED); mPorts->redraw(); return port; } int Clients::handle(int e) { static Connector* a,*b,*prev; static Connection* c=0; Window* patchbay = ((Window*)parent()); Connections* connections = patchbay->GetConnections(); if (e==FL_PUSH && patchbay->IsConnecting()) { a = 0; b = 0; c = 0; prev = 0; a = FindConnector(Fl::event_x(),Fl::event_y()); if (a) { a->Select(); a->redraw(); } } if (e==FL_DRAG && a) { b = FindConnector(Fl::event_x(),Fl::event_y()); if (prev!=b && a!=b) { if (prev) { prev->Unselect(); prev->redraw(); } if (b) { if (a!=b) { if (!connections->Exists(a,b)) { if (patchbay->IsLegal(a,b)) { c= new Connection( connections->x(),connections->y(), connections->w(),connections->h() ); b->Select(); b->redraw(); c->Set(a,b); connections->add(c); connections->redraw(); } } } }else{ if (c) { connections->remove(c); delete c; c = 0; connections->redraw(); } } prev=b; } } if (e==FL_RELEASE) { if (c) { connections->remove(c); delete c; c = 0; } if (a && b) { bool flag = 0; if (a->Type()==kOutput) { flag = patchbay->HandleConnect(a,b); }else{ flag = patchbay->HandleConnect(b,a); } if (!flag) { a->Unselect(); a->redraw(); b->Unselect(); b->redraw(); } }else{ if (a) { a->Unselect(); a->redraw(); } } } return 1; } aconnectgui-0.9.0rc2-1.orig/src/Client.hxx0100644000076400007640000000214307523746512016115 0ustar rjrj#ifndef __Client__ #define __Client__ #include #include "FrameGroup.hxx" #include "ConnectorType.hxx" #include class Port; class Connector; class Client:public FrameGroup { private: Fl_Group* mPorts; int mClientId; public: Client(int X,int Y,int W,int H,char* L,int C); Port* AddPort(char* il,int portId,ConnectorType t); const char* Name(void) { return label(); } int ClientId(void) { return mClientId; } Port* FindPort(int clientId,int portId); Connector* FindInput(int clientId,int portId); Connector* FindOutput(int clientId,int portId); Connector* FindConnector(int ix,int iy); void draw(void) { FrameGroup::draw(); } }; class Clients:public Fl_Group { public: Clients(int X,int Y,int W,int H); Client* FindClient(int clientId); Port* FindPort(int clientId,int portId); Connector* FindInput(int clientId,int portId); Connector* FindOutput(int clientId,int portId); Connector* FindConnector(int ix,int iy); int handle(int e); void draw(void) { for (int i=0;idraw(); } Fl_Group::draw(); } }; #endif aconnectgui-0.9.0rc2-1.orig/src/Connection.cxx0100644000076400007640000001171707523746512017000 0ustar rjrj#include "Connection.hxx" #include "Connector.hxx" #include "Port.hxx" #include "Window.hxx" #include #include Connection::Connection(int X,int Y,int W,int H) :Fl_Widget(X,Y,W,H) { mFrom=0; mTo=0; mLevel=0; mState=false; } void Connection::Set(Connector* a, Connector* b) { mFrom = a; mTo = b; mLower = mUpper = 0; } int Connection::handle(int e) { Window* window = (Window*) parent()->parent(); if (e==FL_PUSH) { if (window->IsDisconnecting()) { int Y1 = mFrom->y()/*-parent()->y()*/+4+CONNECTOR_OFFSET, X2 = x()+mLevel*10+10, Y2 = mTo->y()/*-parent()->y()*/+4+CONNECTOR_OFFSET; if (Y1>Y2) { int tmp = Y1; Y1 = Y2; Y2 = tmp; } if (Fl::event_x()>X2-3 && Fl::event_x()=Y1 && Fl::event_y()<=Y2) { mState = true; parent()->redraw(); return 1; } } } if (e==FL_RELEASE) { int Y1 = mFrom->y()/*-parent()->y()*/+4+CONNECTOR_OFFSET, X2 = x()+mLevel*10+10, Y2 = mTo->y()/*-parent()->y()*/+4+CONNECTOR_OFFSET; if (Y1>Y2) { int tmp = Y1; Y1 = Y2; Y2 = tmp; } if (Fl::event_x()>X2-3 && Fl::event_x()=Y1 && Fl::event_y()<=Y2) { if (window->IsDisconnecting()) { window->HandleDisconnect(this); return 1; } mState = false; return 1; }else{ mState = false; window->GetConnections()->redraw(); } } return 0; } void Connection::draw(void) { int draw_phase = ((Connections*)parent())->DrawPhase(); int X1 = x(), Y1 = mFrom->y()/*-parent()->y()*/+4+CONNECTOR_OFFSET, X2 = x()+mLevel*10+10, Y2 = mTo->y()/*-parent()->y()*/+4+CONNECTOR_OFFSET; if (Y1>Y2) { int tmp = Y1; Y1 = Y2; Y2 = tmp; } if (draw_phase==1) { if (mState==1) { fl_color(FL_DARK3); }else{ fl_color(FL_BLACK); } fl_xyline(X1,Y1,X2-5); fl_xyline(X2-4,Y1+1,X2-3); fl_xyline(X2-2,Y1+2,X2-2); fl_yxline(X2-1,Y1+3,Y1+4); fl_yxline(X2-1,Y2-4,Y2-3); fl_xyline(X2-2,Y2-2,X2-2); fl_xyline(X2-4,Y2-1,X2-3); fl_xyline(X1,Y2,X2-5); fl_yxline(X2,Y1+5,Y2-5); } else { fl_color(color()); fl_yxline(X2-2,Y1+5,Y2-5); fl_yxline(X2-1,Y1+5,Y2-5); fl_yxline(X2+1,Y1+5,Y2-5); fl_yxline(X2+2,Y1+5,Y2-5); } } void Connections::draw(void) { fl_color(color()); fl_rectf(x(),y(),w(),h()); mDrawPhase = 1; Fl_Group::draw(); mDrawPhase = 0; Fl_Group::draw(); } void Connections::ConflictTest(int i) { Connection** connections = (Connection**) array(); int nconnections = children(); for (int j=0;jmLevel >= connections[j]->mLevel) { if ( connections[i]->mUpper->y() > connections[j]->mUpper->y() || (connections[i]->mUpper->y() == connections[j]->mUpper->y() && connections[i]->mLower->y() < connections[j]->mLower->y()) ) { if (connections[i]->mUpper->y() < connections[j]->mLower->y()) { connections[j]->mLevel=connections[i]->mLevel+1; ConflictTest(j); } } } } } } void Connections::Unclutter(void) { Connection** connections = (Connection**) array(); int nconnections = children(); for (int i=0;imLevel = 1; if (connections[i]->mFrom->y() > connections[i]->mTo->y()) { connections[i]->mLower= connections[i]->mFrom; connections[i]->mUpper= connections[i]->mTo; }else{ connections[i]->mUpper= connections[i]->mFrom; connections[i]->mLower= connections[i]->mTo; } } for (int i=0;imFrom== a && connections[i]->mTo== b || connections[i]->mFrom== b && connections[i]->mTo== a) { return 1; } } return 0; } Connection* Connections::Find( int fromClientId,int fromPortId, int toClientId,int toPortId) { int nconnections = children(); for (int i=0;imFrom->Owner()->ClientId() == fromClientId && ((Connection*)child(i))->mFrom->Owner()->PortId() == fromPortId && ((Connection*)child(i))->mFrom->Owner()->Output() && ((Connection*)child(i))->mTo->Owner()->ClientId() == toClientId && ((Connection*)child(i))->mTo->Owner()->PortId() == toPortId && ((Connection*)child(i))->mTo->Owner()->Input()) return (Connection*)child(i); } return 0; } void Connections::RemoveClient(int id) { int nconnections = children(); printf("remove_client %d / %d\n",id,children()); for (int i=0;imFrom->Owner()->ClientId(), ((Connection*)child(i))->mTo->Owner()->ClientId() ); if ( ((Connection*)child(i))->mFrom->Owner()->ClientId() == id || ((Connection*)child(i))->mTo->Owner()->ClientId() == id) { printf("removing now\n"); ((Connection*)child(i))->mFrom->Disconnect(); ((Connection*)child(i))->mTo->Disconnect(); remove(child(i)); }else { i++; } } } aconnectgui-0.9.0rc2-1.orig/src/Connection.hxx0100644000076400007640000000202007523746512016770 0ustar rjrj#ifndef __Connection__ #define __Connection__ #include #include class Connector; class Connection:public Fl_Widget { friend class Connections; protected: Connector *mFrom; Connector *mTo; Connector *mUpper; //used for unclutter Connector *mLower; int mLevel; bool mState; public: Connector *From(void) { return mFrom; } Connector *To(void) { return mTo; } Connection(int X,int Y,int W,int H); void Set(Connector* a, Connector* b); void draw(void); int handle(int e); }; class Connections:public Fl_Group { public: Connections(int X,int Y,int W,int H):Fl_Group(X,Y,W,H) { mIsRemoving = false; end(); } void draw(void); int IsRemoving() { return mIsRemoving; } int Exists(Connector* a,Connector* b); Connection* Find( int fromClientId,int fromPortId,int toClientId,int toPortId); void RemoveClient(int id); void Unclutter(void); int DrawPhase(void) { return mDrawPhase; } private: void ConflictTest(int i); private: int mDrawPhase; int mIsRemoving; }; #endif aconnectgui-0.9.0rc2-1.orig/src/Connector.cxx0100644000076400007640000000212707523746512016626 0ustar rjrj#include "Connection.hxx" #include "Connector.hxx" #include Connector::Connector(int ix,int iy,ConnectorType t) :Fl_Widget(ix,iy,8,CONNECTOR_DISTANCE) { mType=t; mConnectedCount=0; mIsSelected=false; } void Connector::draw() { int cx=x(),cy=y()+CONNECTOR_OFFSET; if (mType==kOutput) { fl_color(FL_BLACK); fl_yxline(cx,cy,cy+8); fl_line(cx+1,cy,cx+5,cy+4); fl_line(cx+5,cy+4,cx+1,cy+8); if (IsSelected()) fl_color(FL_DARK1); else if (Connected()) fl_color(FL_BLACK); else fl_color(FL_WHITE); for (int k=0;k<4;k++) { fl_xyline(cx+1,cy+k+1,cx+1+k); fl_xyline(cx+1,cy+7-k,cx+1+k); } }else{ fl_color(FL_BLACK); fl_yxline(cx+5,cy,cy+8); fl_line(cx+4,cy,cx,cy+4); fl_line(cx,cy+4,cx+4,cy+8); if (IsSelected()) fl_color(FL_DARK1); else if (Connected()) fl_color(FL_BLACK); else fl_color(FL_WHITE); for (int k=0;k<4;k++) { fl_xyline(cx+4-k,cy+k+1,cx+4); fl_xyline(cx+4-k,cy+7-k,cx+4); } } } bool Connector::Contains(int ix,int iy) { return (ix>=x() && ix<=x()+w() && iy>=y() && iy<=y()+h()); } aconnectgui-0.9.0rc2-1.orig/src/Connector.hxx0100644000076400007640000000143407523746512016633 0ustar rjrj#ifndef __Connector__ #define __Connector__ #include #include "ConnectorType.hxx" #include "Layout.hxx" class Connection; class Port; class Connector:public Fl_Widget { private: unsigned char mConnectedCount; unsigned char mIsSelected; ConnectorType mType; public: Connector(int ix,int iy,ConnectorType t); void draw(void); void Select() { mIsSelected = true; } void Unselect() { mIsSelected = false; } unsigned char IsSelected(void) { return mIsSelected; } void Connect() { mConnectedCount++; } void Disconnect() { if (mConnectedCount) mConnectedCount--; } unsigned char Connected(void) { return mConnectedCount; } ConnectorType Type(void) { return mType; } Port* Owner(void) { return (Port*) parent(); } bool Contains(int ix,int iy); }; #endif aconnectgui-0.9.0rc2-1.orig/src/ConnectorType.hxx0100644000076400007640000000020707523746410017467 0ustar rjrj#ifndef __ConnectorType__ #define __ConnectorType__ enum ConnectorType { kNone = 0, kInput = 1, kOutput = 2, kBoth = 3 }; #endif aconnectgui-0.9.0rc2-1.orig/src/FrameGroup.hxx0100644000076400007640000000102407523721260016734 0ustar rjrj#ifndef __Fl_FrameGroup__ #define __Fl_FrameGroup__ #include #include class FrameGroup:public Fl_Group { public: FrameGroup(int X,int Y,int W,int H,char* L): Fl_Group(X,Y,W,H,L) { labeltype(FL_NO_LABEL); } void draw(void) { fl_draw_box(FL_ENGRAVED_FRAME,x(),y()+5,w(),h()-5,FL_BLACK); fl_color(color()); fl_font(labelfont(),labelsize()); fl_rectf(x()+10,y(),int(fl_width(label()))+4,10); fl_color(labelcolor()); fl_draw(label(),x()+12,y()+10); Fl_Group::draw(); } }; #endif aconnectgui-0.9.0rc2-1.orig/src/Layout.H0100644000076400007640000000030607466514352015534 0ustar rjrj#ifndef __LAYOUT__ #define __LAYOUT__ #define CONNECTOR_DISTANCE 9 #define CONNECTOR_OFFSET 0 #define PORT_EXTRA 2 #define PORTS_OFFSET 12 #define PORTS_EXTRA 6 #define CLIENT_SPACING 3 #endif aconnectgui-0.9.0rc2-1.orig/src/Layout.hxx0100644000076400007640000000030607523721260016144 0ustar rjrj#ifndef __LAYOUT__ #define __LAYOUT__ #define CONNECTOR_DISTANCE 9 #define CONNECTOR_OFFSET 0 #define PORT_EXTRA 2 #define PORTS_OFFSET 12 #define PORTS_EXTRA 6 #define CLIENT_SPACING 3 #endif aconnectgui-0.9.0rc2-1.orig/src/Makefile.am0100644000076400007640000000047107523750265016204 0ustar rjrjbin_PROGRAMS = aconnectgui EXTRA_DIST=images aconnectgui_SOURCES = \ FrameGroup.hxx \ Client.hxx \ Client.cxx \ Connection.hxx \ Connection.cxx \ Connector.hxx \ Connector.cxx \ ConnectorType.hxx \ Port.hxx \ Port.cxx \ Window.hxx \ Window.cxx \ Layout.hxx \ aconnect.cxx aconnectgui_LDADD = @LIBS@ @ALSA_LIBS@ aconnectgui-0.9.0rc2-1.orig/src/Port.cxx0100644000076400007640000000162407523746512015621 0ustar rjrj#include "Port.hxx" #include "Connector.hxx" #include Port::Port(int ix,int iy,int iw,int ih,char* il,int portId,ConnectorType t) :Fl_Group(ix,iy,iw,ih) { mLabelBox = new Fl_Box( x(),y()+CONNECTOR_OFFSET, w()-8,h()-CONNECTOR_OFFSET-PORT_EXTRA ); mLabelBox->box(FL_FLAT_BOX); mLabelBox->label(il); mLabelBox->labelsize(10); mLabelBox->align(FL_ALIGN_INSIDE|FL_ALIGN_RIGHT); mPortId = portId; int cy=y(); mInput = 0; mOutput = 0; if (t&kInput) { add(mInput = new Connector(x()+w()-5,cy,kInput)); cy+=CONNECTOR_DISTANCE; } if (t&kOutput) { add(mOutput = new Connector(x()+w()-5,cy,kOutput)); } resizable(0); } Connector* Port::FindConnector(int ix,int iy) { if (ix>=x() && ix<=x()+w() && iy>=y() && iy<=y()+h()) { if (mInput && mInput->Contains(ix,iy)) { return mInput; } if (mOutput && mOutput->Contains(ix,iy)) { return mOutput; } } return 0; } aconnectgui-0.9.0rc2-1.orig/src/Port.hxx0100644000076400007640000000141007523746512015617 0ustar rjrj#ifndef __Port__ #define __Port__ #include #include "Connector.hxx" #include "Client.hxx" #include class Connector; #include class Port:public Fl_Group { protected: Fl_Box* mLabelBox; Connector* mInput; Connector* mOutput; int mPortId; public: void draw(void) { Fl_Group::draw(); } Port(int ix,int iy,int iw,int ih,char* il,int portId,ConnectorType t); const char* Name(void) { return mLabelBox->label(); } int PortId(void) { return mPortId; } int ClientId(void) { return Owner()->ClientId(); } Connector* Input(void) { return mInput; } Connector* Output(void) { return mOutput; } Client* Owner(void) { return (Client*) parent()->parent(); } Connector* FindConnector(int ix,int iy); }; #endif aconnectgui-0.9.0rc2-1.orig/src/Window.cxx0100644000076400007640000002077607523746512016155 0ustar rjrj#include "Window.hxx" #include "Connector.hxx" #include "Port.hxx" #include #include #include "images/scicors.xpm" #include "images/connect.xpm" #include "images/question.xpm" #include "images/alsalogo.xpm" static Fl_Pixmap pixmap_scicors(scicors_xpm); static Fl_Pixmap pixmap_connect(connect_xpm); static Fl_Pixmap pixmap_question(question_xpm); static Fl_Pixmap pixmap_alsalogo(alsalogo_xpm); int aconnect_main(int argc,char** argv); void Window::Connect(int client,int port,int clientB,int portB) { Connector *a = 0,*b = 0; a = mClients->FindOutput(client,port); b = mClients->FindInput(clientB,portB); // if (a==0) printf("%d %d does not have an output\n",client,port); // if (b==0) printf("%d %d does not have an input\n",clientB,portB); if (a!=0 && b!=0) { Connect(a,b); } } void Window::Disconnect( int fromClientId,int fromPortId,int toClientId,int toPortId) { Connection* c = mConnections->Find( fromClientId,fromPortId,toClientId,toPortId); /* if (!c) printf("could not find connection between %d:%d %d:%d\n", client,port,clientB,portB); */ if (c) { Disconnect(c); } } void Window::Disconnect(Connection* c) { mConnections->remove(c); mConnections->redraw(); c->From()->Disconnect(); c->To()->Disconnect(); c->From()->redraw(); c->To()->redraw(); delete c; mConnections->Unclutter(); mConnections->redraw(); } void Window::Connect(Connector* a,Connector* b) { a->Unselect(); b->Unselect(); Connection* c= new Connection( mConnections->x(),mConnections->y(), mConnections->w(),mConnections->h() ); c->Set(a,b); a->Connect(); b->Connect(); a->redraw(); b->redraw(); mConnections->add(c); mConnections->Unclutter(); } int Window::IsLegal(Connector* a,Connector* b) { return a->Type()!=b->Type(); } Client* Window::AddClient(snd_seq_client_info_t* cinfo) { // some of this code should be in Window Client* c= mClients->FindClient(snd_seq_client_info_get_client(cinfo)); if (c) { mCurClient = c; }else{ mCurClient = new Client( mClients->x(),mClients->y()+mClients->h(),mClients->w(),20, strdup(snd_seq_client_info_get_name(cinfo)), snd_seq_client_info_get_client(cinfo) ); int newh = mCurClient->y()+mCurClient->h()-mClients->y(); mClients->size(mClients->w(),newh); mConnections->size(mConnections->w(),newh); mClients->add(mCurClient); size(w(),newh+33); } return mCurClient; } Port* Window::AddPort(snd_seq_port_info_t* pinfo) { // some of this code should be in Window int dy = mCurClient->y()+mCurClient->h(); mCurPort = mCurClient->AddPort( strdup(snd_seq_port_info_get_name(pinfo)), snd_seq_port_info_get_port(pinfo), mCurType); dy = mCurClient->y()+mCurClient->h()-dy; for (int i = mClients->find(mCurClient)+1;ichildren();i++) { mClients->child(i)->position(mClients->x(),mClients->child(i)->y()+dy); } int newh = mClients->child(mClients->children()-1)->y()+ mClients->child(mClients->children()-1)->h()- mClients->y(); mClients->size(mClients->w(),newh); mConnections->size(mConnections->w(),newh); size(w(),newh+33); return mCurPort; } bool Window::HandleConnect(Connector* a,Connector* b) { int argc; char* argv[16]; char from[16]; char to[16]; sprintf(from,"%d:%d",a->Owner()->ClientId(),a->Owner()->PortId()); sprintf(to,"%d:%d",b->Owner()->ClientId(),b->Owner()->PortId()); argc = 0; argv[argc++] = "aconnect"; argv[argc++] = from; argv[argc++] = to; return (aconnect_main(argc,argv)==0); } bool Window::HandleDisconnect(Connection* c) { int argc; char* argv[16]; char from[16]; char to[16]; Connector* a = c->From(); Connector* b = c->To(); sprintf(from,"%d:%d",a->Owner()->ClientId(),a->Owner()->PortId()); sprintf(to,"%d:%d",b->Owner()->ClientId(),b->Owner()->PortId()); argc = 0; argv[argc++] = "aconnect"; argv[argc++] = "-d"; argv[argc++] = from; argv[argc++] = to; return (aconnect_main(argc,argv)==0); } Window::Window():Fl_Window(300,33,"ALSA Sequencer") { mClients = new Clients(0,33,140,0); mConnections = new Connections(140,33,160,0); int cx = 0; Fl_Group* g = new Fl_Group(0,0,300,24); { Fl_Radio_Button* b = new Fl_Radio_Button(cx,0,24,24); b->box(FL_THIN_UP_BOX); b->down_box(FL_FLAT_BOX); pixmap_scicors.label(b); mCutButton = b; cx+=24; } { Fl_Radio_Button* b = new Fl_Radio_Button(cx,0,24,24); b->box(FL_THIN_UP_BOX); b->down_box(FL_FLAT_BOX); pixmap_connect.label(b); mConnectButton = b; cx+=24; } if (0) { Fl_Radio_Button* b = new Fl_Radio_Button(cx,0,24,24); b->box(FL_THIN_UP_BOX); b->down_box(FL_FLAT_BOX); pixmap_question.label(b); mInfoButton = b; cx+=24; } { Fl_Box* b = new Fl_Box(cx,0,300-cx,24); b->box(FL_THIN_UP_BOX); b->align(FL_ALIGN_INSIDE|FL_ALIGN_RIGHT); pixmap_alsalogo.label(b); cx+=24; } { Fl_Box* b = new Fl_Box(0,24,300,1); b->color(FL_WHITE); b->box(FL_FLAT_BOX); } g->end(); mCurClient = 0; mCurPort = 0; mCurType = kNone; mHandle = 0; if (snd_seq_open(&mHandle,"hw",SND_SEQ_OPEN_INPUT,0)<0) { fl_alert("Error opening sequencer\n"); exit(-1); } mClientId = snd_seq_client_id(mHandle); if(mClientId<0) { fl_alert("Error opening sequencer\n"); exit(-1); } snd_seq_set_client_name(mHandle,"aconnectgui"); unsigned int caps = SND_SEQ_PORT_CAP_WRITE; int port = snd_seq_create_simple_port(mHandle, "Notify", caps, SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION); if (port<0) { fl_alert("Error creating port\n"); exit(-1); } int err; if ((err=snd_seq_connect_from(mHandle,port,0,1))<0) { fl_alert("Error subscribing to System::Announce port [%d]\n",err); exit(-1); } mPollMax = snd_seq_poll_descriptors_count(mHandle,POLLIN); mPollFds = (struct pollfd *) calloc(mPollMax, sizeof(struct pollfd)); snd_seq_nonblock(mHandle, 1); } Window::~Window() { snd_seq_close(mHandle); } void Window::Timeout(void) { int count; snd_seq_event_t *ev; do { snd_seq_event_input(mHandle, &ev); if (ev) { snd_seq_free_event(ev); if (ev->type==SND_SEQ_EVENT_PORT_SUBSCRIBED) { if ( ev->data.connect.sender.client!=mClientId && ev->data.connect.dest.client!=mClientId) { Connect( ev->data.connect.sender.client, ev->data.connect.sender.port, ev->data.connect.dest.client, ev->data.connect.dest.port); mConnections->redraw(); } } if (ev->type==SND_SEQ_EVENT_PORT_UNSUBSCRIBED) { if ( ev->data.connect.sender.client!=mClientId && ev->data.connect.dest.client!=mClientId) { Disconnect( ev->data.connect.sender.client, ev->data.connect.sender.port, ev->data.connect.dest.client, ev->data.connect.dest.port); mConnections->redraw(); } } if (ev->type==SND_SEQ_EVENT_CLIENT_START) { if (ev->data.addr.client != snd_seq_client_id(mHandle)) { snd_seq_client_info_t *cinfo; snd_seq_port_info_t *pinfo; snd_seq_client_info_alloca(&cinfo); snd_seq_port_info_alloca(&pinfo); if (snd_seq_get_any_client_info(mHandle, ev->data.addr.client, cinfo) >= 0) { AddClient(cinfo); /* reset query info */ count = 0; if (snd_seq_get_any_port_info(mHandle, ev->data.addr.client, ev->data.addr.port, pinfo) >= 0) { if (snd_seq_port_info_get_capability(pinfo) & (SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE)) { mCurType = kInput; AddPort(pinfo); } if (snd_seq_port_info_get_capability(pinfo) & (SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ)) { mCurType = kOutput; AddPort(pinfo); } } } fflush(stdout); } } if (ev->type==SND_SEQ_EVENT_CLIENT_EXIT) { Client* c= mClients->FindClient(ev->data.addr.client); int newh = mClients->h()-c->h(); mConnections->RemoveClient(ev->data.addr.client); mConnections->size(mConnections->w(),newh); mClients->remove(c); mClients->size(mClients->w(),newh); size(w(),newh+33); } snd_seq_free_event(ev); } } while (ev); Fl::add_timeout(0.1,Window::TimeoutStatic,this); } Window* patchbay = 0; main() { int argc; char* argv[16]; Fl::get_system_colors(); patchbay = new Window; /* NB the concept of input of aconnect and the classes is reverse... */ patchbay->SetCurType(kOutput); argc = 0; argv[argc++] = "aconnect"; argv[argc++] = "-i"; argv[argc++] = "-l"; aconnect_main(argc,argv); patchbay->SetCurType(kInput); argc = 0; argv[argc++] = "aconnect"; argv[argc++] = "-o"; argv[argc++] = "-l"; aconnect_main(argc,argv); patchbay->show(); Fl::add_timeout(0.1,Window::TimeoutStatic,patchbay); Fl::run(); } aconnectgui-0.9.0rc2-1.orig/src/Window.hxx0100644000076400007640000000330707523746512016151 0ustar rjrj#ifndef __Window__ #define __Window__ #include #include #include #include #include "Connection.hxx" #include "Port.hxx" #include "Client.hxx" #include class Window:public Fl_Window { private: Connections* mConnections; Clients* mClients; Fl_Radio_Button *mCutButton; Fl_Radio_Button *mInfoButton; Fl_Radio_Button *mConnectButton; Client* mCurClient; Port* mCurPort; ConnectorType mCurType; struct pollfd *mPollFds; int mPollMax; snd_seq_t* mHandle; // handle and client for system notification events int mClientId; public: Window(); ~Window(); Connections* GetConnections(void) { return mConnections; } bool IsConnecting(void) { return mConnectButton->value(); } bool IsDisconnecting(void) { return mCutButton->value(); } void Connect(int client,int port,int clientB,int portB); void Disconnect(int client,int port,int clientB,int portB); void Connect(Connector* a,Connector* b); void Disconnect(Connection* c); Client* AddClient(snd_seq_client_info_t* cinfo); Port* AddPort(snd_seq_port_info_t* pinfo); void SetCurType(ConnectorType t) { mCurType = t; } ConnectorType GetCurType(void) { return mCurType; } Client* GetCurClient(void) { return mCurClient; } Port* GetCurPort(void) { return mCurPort; } snd_seq_t* GetHandle(void) { return mHandle; } Connector* FindOutput(int clientId,int portId) { mClients->FindOutput(clientId,portId); } bool HandleConnect(Connector* a,Connector* b); bool HandleDisconnect(Connection* c); int IsLegal(Connector* a,Connector* b); static void TimeoutStatic(void* ptr) { ((Window*)ptr)->Timeout(); } void Timeout(void); }; #endif aconnectgui-0.9.0rc2-1.orig/src/aconnect.cxx0100644000076400007640000003130407523746512016465 0ustar rjrj/* * connect / disconnect two subscriber ports * ver.0.1.3 * * Copyright (C) 1999 Takashi Iwai * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 more details. * */ #define ACONNECT_GUI #include #include #include #include #include #include #include #include #include #include #ifdef ACONNECT_GUI #include "Window.hxx" extern Window* patchbay; #endif static void error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...) { va_list arg; if (err == ENOENT) /* Ignore those misleading "warnings" */ return; va_start(arg, fmt); fprintf(stderr, "ALSA lib %s:%i:(%s) ", file, line, function); vfprintf(stderr, fmt, arg); if (err) fprintf(stderr, ": %s", snd_strerror(err)); putc('\n', stderr); va_end(arg); } static void usage(void) { fprintf(stderr, "aconnect - ALSA sequencer connection manager\n"); fprintf(stderr, "Copyright (C) 1999-2000 Takashi Iwai\n"); fprintf(stderr, "Usage:\n"); fprintf(stderr, " * Connection/disconnection betwen two ports\n"); fprintf(stderr, " aconnect [-options] sender receiver\n"); fprintf(stderr, " sender, receiver = client:port pair\n"); fprintf(stderr, " -d,--disconnect disconnect\n"); fprintf(stderr, " -e,--exclusive exclusive connection\n"); fprintf(stderr, " -r,--real # convert real-time-stamp on queue\n"); fprintf(stderr, " -t,--tick # convert tick-time-stamp on queue\n"); fprintf(stderr, " * List connected ports (no subscription action)\n"); fprintf(stderr, " aconnect -i|-o [-options]\n"); fprintf(stderr, " -i,--input list input (readable) ports\n"); fprintf(stderr, " -o,--output list output (writable) ports\n"); fprintf(stderr, " -l,--list list current connections of each port\n"); fprintf(stderr, " * Remove all exported connections\n"); fprintf(stderr, " -x, --removeall\n"); } /* * check permission (capability) of specified port */ #define LIST_INPUT 1 #define LIST_OUTPUT 2 #define perm_ok(pinfo,bits) ((snd_seq_port_info_get_capability(pinfo) & (bits)) == (bits)) static int check_permission(snd_seq_port_info_t *pinfo, int perm) { if (perm) { if (perm & LIST_INPUT) { if (perm_ok(pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ)) goto __ok; } if (perm & LIST_OUTPUT) { if (perm_ok(pinfo, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE)) goto __ok; } return 0; } __ok: if (snd_seq_port_info_get_capability(pinfo) & SND_SEQ_PORT_CAP_NO_EXPORT) return 0; return 1; } /* * list subscribers of specified type */ static void list_each_subs(snd_seq_t *seq, snd_seq_query_subscribe_t *subs, int type, const char *msg) { int count = 0; #ifdef ACONNECT_GUI snd_seq_query_subscribe_set_type(subs, (snd_seq_query_subs_type_t) type); #else snd_seq_query_subscribe_set_type(subs, type); #endif snd_seq_query_subscribe_set_index(subs, 0); while (snd_seq_query_port_subscribers(seq, subs) >= 0) { const snd_seq_addr_t *addr; #ifndef ACONNECT_GUI if (count++ == 0) printf("\t%s: ", msg); else printf(", "); #endif addr = snd_seq_query_subscribe_get_addr(subs); #ifdef ACONNECT_GUI if (patchbay->GetCurType()==kInput && type==SND_SEQ_QUERY_SUBS_WRITE && patchbay->GetCurPort()) { Connector* output = patchbay->FindOutput(addr->client, addr->port); if (output) { patchbay->Window::Connect(output,patchbay->GetCurPort()->Input()); } } #else printf("%d:%d", addr->client, addr->port); #endif #ifndef ACONNECT_GUI if (snd_seq_query_subscribe_get_exclusive(subs)) printf("[ex]"); if (snd_seq_query_subscribe_get_time_update(subs)) printf("[%s:%d]", (snd_seq_query_subscribe_get_time_real(subs) ? "real" : "tick"), snd_seq_query_subscribe_get_queue(subs)); #endif snd_seq_query_subscribe_set_index(subs, snd_seq_query_subscribe_get_index(subs) + 1); } #ifndef ACONNECT_GUI if (count > 0) printf("\n"); #endif } /* * list subscribers */ static void list_subscribers(snd_seq_t *seq, const snd_seq_addr_t *addr) { snd_seq_query_subscribe_t *subs; snd_seq_query_subscribe_alloca(&subs); snd_seq_query_subscribe_set_root(subs, addr); list_each_subs(seq, subs, SND_SEQ_QUERY_SUBS_READ, "Connecting To"); list_each_subs(seq, subs, SND_SEQ_QUERY_SUBS_WRITE, "Connected From"); } /* * search all ports */ typedef void (*action_func_t)(snd_seq_t *seq, snd_seq_client_info_t *cinfo, snd_seq_port_info_t *pinfo, int count); static void do_search_port(snd_seq_t *seq, int perm, action_func_t do_action) { snd_seq_client_info_t *cinfo; snd_seq_port_info_t *pinfo; int count; snd_seq_client_info_alloca(&cinfo); snd_seq_port_info_alloca(&pinfo); snd_seq_client_info_set_client(cinfo, -1); while (snd_seq_query_next_client(seq, cinfo) >= 0) { /* reset query info */ snd_seq_port_info_set_client(pinfo, snd_seq_client_info_get_client(cinfo)); snd_seq_port_info_set_port(pinfo, -1); count = 0; while (snd_seq_query_next_port(seq, pinfo) >= 0) { if (check_permission(pinfo, perm)) { do_action(seq, cinfo, pinfo, count); count++; } } } } static void print_port(snd_seq_t *seq, snd_seq_client_info_t *cinfo, snd_seq_port_info_t *pinfo, int count) { if (! count) { #ifdef ACONNECT_GUI patchbay->AddClient(cinfo); #else printf("client %d: '%s' [type=%s]\n", snd_seq_client_info_get_client(cinfo), snd_seq_client_info_get_name(cinfo), (snd_seq_client_info_get_type(cinfo) == SND_SEQ_USER_CLIENT ? "user" : "kernel")); #endif } #ifdef ACONNECT_GUI patchbay->AddPort(pinfo); #else printf(" %3d '%-16s' %d\n", snd_seq_port_info_get_port(pinfo), snd_seq_port_info_get_name(pinfo), snd_seq_port_info_get_type(pinfo) ); printf(" %3d '%-16s'\n", snd_seq_port_info_get_port(pinfo), snd_seq_port_info_get_name(pinfo)); #endif } static void print_port_and_subs(snd_seq_t *seq, snd_seq_client_info_t *cinfo, snd_seq_port_info_t *pinfo, int count) { print_port(seq, cinfo, pinfo, count); list_subscribers(seq, snd_seq_port_info_get_addr(pinfo)); } /* * remove all (exported) connections */ static void remove_connection(snd_seq_t *seq, snd_seq_client_info_t *cinfo, snd_seq_port_info_t *pinfo, int count) { snd_seq_query_subscribe_t *query; snd_seq_query_subscribe_alloca(&query); snd_seq_query_subscribe_set_root(query, snd_seq_port_info_get_addr(pinfo)); snd_seq_query_subscribe_set_type(query, SND_SEQ_QUERY_SUBS_READ); snd_seq_query_subscribe_set_index(query, 0); for (; snd_seq_query_port_subscribers(seq, query) >= 0; snd_seq_query_subscribe_set_index(query, snd_seq_query_subscribe_get_index(query) + 1)) { snd_seq_port_info_t *port; snd_seq_port_subscribe_t *subs; const snd_seq_addr_t *sender = snd_seq_query_subscribe_get_root(query); const snd_seq_addr_t *dest = snd_seq_query_subscribe_get_addr(query); snd_seq_port_info_alloca(&port); if (snd_seq_get_any_port_info(seq, dest->client, dest->port, port) < 0) continue; if (!(snd_seq_port_info_get_capability(port) & SND_SEQ_PORT_CAP_SUBS_WRITE)) continue; if (snd_seq_port_info_get_capability(port) & SND_SEQ_PORT_CAP_NO_EXPORT) continue; snd_seq_port_subscribe_alloca(&subs); snd_seq_port_subscribe_set_queue(subs, snd_seq_query_subscribe_get_queue(query)); snd_seq_port_subscribe_set_sender(subs, sender); snd_seq_port_subscribe_set_dest(subs, dest); snd_seq_unsubscribe_port(seq, subs); } snd_seq_query_subscribe_set_type(query, SND_SEQ_QUERY_SUBS_WRITE); snd_seq_query_subscribe_set_index(query, 0); for (; snd_seq_query_port_subscribers(seq, query) >= 0; snd_seq_query_subscribe_set_index(query, snd_seq_query_subscribe_get_index(query) + 1)) { snd_seq_port_info_t *port; snd_seq_port_subscribe_t *subs; const snd_seq_addr_t *dest = snd_seq_query_subscribe_get_root(query); const snd_seq_addr_t *sender = snd_seq_query_subscribe_get_addr(query); snd_seq_port_info_alloca(&port); if (snd_seq_get_any_port_info(seq, sender->client, sender->port, port) < 0) continue; if (!(snd_seq_port_info_get_capability(port) & SND_SEQ_PORT_CAP_SUBS_READ)) continue; if (snd_seq_port_info_get_capability(port) & SND_SEQ_PORT_CAP_NO_EXPORT) continue; snd_seq_port_subscribe_alloca(&subs); snd_seq_port_subscribe_set_queue(subs, snd_seq_query_subscribe_get_queue(query)); snd_seq_port_subscribe_set_sender(subs, sender); snd_seq_port_subscribe_set_dest(subs, dest); snd_seq_unsubscribe_port(seq, subs); } } static void remove_all_connections(snd_seq_t *seq) { do_search_port(seq, 0, remove_connection); } /* * main.. */ enum { SUBSCRIBE, UNSUBSCRIBE, LIST, REMOVE_ALL }; static struct option long_option[] = { {"disconnect", 0, NULL, 'd'}, {"input", 0, NULL, 'i'}, {"output", 0, NULL, 'o'}, {"real", 1, NULL, 'r'}, {"tick", 1, NULL, 't'}, {"exclusive", 0, NULL, 'e'}, {"list", 0, NULL, 'l'}, {"removeall", 0, NULL, 'x'}, {NULL, 0, NULL, 0}, }; #ifdef ACONNECT_GUI int aconnect_main(int argc, char **argv) #else int main(int argc, char **argv) #endif { int c; snd_seq_t *seq; int queue = 0, convert_time = 0, convert_real = 0, exclusive = 0; int command = SUBSCRIBE; int list_perm = 0; int client; int list_subs = 0; snd_seq_port_subscribe_t *subs; snd_seq_addr_t sender, dest; optind = 0; while ((c = getopt_long(argc, argv, "dior:t:elx", long_option, NULL)) != -1) { switch (c) { case 'd': command = UNSUBSCRIBE; break; case 'i': command = LIST; list_perm |= LIST_INPUT; break; case 'o': command = LIST; list_perm |= LIST_OUTPUT; break; case 'e': exclusive = 1; break; case 'r': queue = atoi(optarg); convert_time = 1; convert_real = 1; break; case 't': queue = atoi(optarg); convert_time = 1; convert_real = 0; break; case 'l': list_subs = 1; break; case 'x': command = REMOVE_ALL; break; default: usage(); exit(1); } } #ifdef ACONNECT_GUI seq = patchbay->GetHandle(); #else if (snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0) < 0) { fprintf(stderr, "can't open sequencer\n"); return 1; } #endif snd_lib_error_set_handler(error_handler); switch (command) { case LIST: do_search_port(seq, list_perm, list_subs ? print_port_and_subs : print_port); #ifndef ACONNECT_GUI snd_seq_close(seq); #endif return 0; case REMOVE_ALL: remove_all_connections(seq); #ifndef ACONNECT_GUI snd_seq_close(seq); #endif return 0; } /* connection or disconnection */ if (optind + 2 > argc) { #ifndef ACONNECT_GUI snd_seq_close(seq); #endif usage(); exit(1); } if ((client = snd_seq_client_id(seq)) < 0) { #ifndef ACONNECT_GUI snd_seq_close(seq); #endif fprintf(stderr, "can't get client id\n"); return 1; } /* set client info */ if (snd_seq_set_client_name(seq, "ALSA Connector") < 0) { #ifndef ACONNECT_GUI snd_seq_close(seq); #endif fprintf(stderr, "can't set client info\n"); return 1; } /* set subscription */ if (snd_seq_parse_address(seq, &sender, argv[optind]) < 0) { fprintf(stderr, "invalid sender address %s\n", argv[optind]); return 1; } if (snd_seq_parse_address(seq, &dest, argv[optind + 1]) < 0) { fprintf(stderr, "invalid destination address %s\n", argv[optind + 1]); return 1; } snd_seq_port_subscribe_alloca(&subs); snd_seq_port_subscribe_set_sender(subs, &sender); snd_seq_port_subscribe_set_dest(subs, &dest); snd_seq_port_subscribe_set_queue(subs, queue); snd_seq_port_subscribe_set_exclusive(subs, exclusive); snd_seq_port_subscribe_set_time_update(subs, convert_time); snd_seq_port_subscribe_set_time_real(subs, convert_real); if (command == UNSUBSCRIBE) { if (snd_seq_get_port_subscription(seq, subs) < 0) { #ifndef ACONNECT_GUI snd_seq_close(seq); #endif fprintf(stderr, "No subscription is found\n"); return 1; } if (snd_seq_unsubscribe_port(seq, subs) < 0) { #ifndef ACONNECT_GUI snd_seq_close(seq); #endif fprintf(stderr, "Disconnection failed (%s)\n", snd_strerror(errno)); return 1; } } else { if (snd_seq_get_port_subscription(seq, subs) == 0) { #ifndef ACONNECT_GUI snd_seq_close(seq); #endif fprintf(stderr, "Connection is already subscribed\n"); return 1; } if (snd_seq_subscribe_port(seq, subs) < 0) { #ifndef ACONNECT_GUI snd_seq_close(seq); #endif fprintf(stderr, "Connection failed (%s)\n", snd_strerror(errno)); return 1; } } #ifndef ACONNECT_GUI snd_seq_close(seq); #endif return 0; } aconnectgui-0.9.0rc2-1.orig/src/config.h.in0100644000076400007640000000154407523746512016175 0ustar rjrj/* src/config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you have the header file. */ #undef HAVE_FL_FL_H /* Define if you have the header file. */ #undef HAVE_ALSA_ASOUNDLIB_H /* Define if you have the header file. */ #undef HAVE_GETOPT_H /* Define if you have the header file. */ #undef HAVE_STDIO_H /* Define if you have the header file. */ #undef HAVE_STDLIB_H /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the asound library (-lasound). */ #undef HAVE_LIBASOUND /* Define if you have the fltk library (-lfltk). */ #undef HAVE_LIBFLTK /* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION aconnectgui-0.9.0rc2-1.orig/src/images/0040755000076400007640000000000007530700233015402 5ustar rjrjaconnectgui-0.9.0rc2-1.orig/src/images/alsalogo.xpm0100644000076400007640000000210507466514352017741 0ustar rjrj/* XPM */ static char *alsalogo_xpm[] = { /* width height ncolors chars_per_pixel */ "40 20 6 1", /* colors */ " c #000000", ". c #C7D9C5", "X c #737A72", "o c #262926", "O c #B7C5B6", "+ c None", /* pixels */ "++++++++++++OXXoo ooXXO++++++++++++", "++++++++.Xo oX.++++++++", "++++++Xo oXXXOO.....OOXXXo oX++++++", "++++O oXO...................OXo O++++", "+++o XO.. ... .....X .... ....OXo+++", "++o X..... ... ....X .... .......X++", "+o O.....X X.. .... .....X X.......O+", "X o....... .. ....X ..... .......OX", "o O....... .. ..... X.... ........o", " X.......X . X. ..... ...X . X......O ", " O....... . . ...... X.. . ......X ", "o........ . . ...... .. . .....O o", "XO....... . ....... X. .....o X", "+O....... . ....... . ...O o+", "++X...... . . . X. . ..X o++", "+++oXO... . . . X.. . X o+++", "++++O oXO...................OXo O++++", "++++++Xo oXXXOO.....OOXXXo oX++++++", "++++++++.Xo oX.++++++++", "++++++++++++OXXoo ooXXO++++++++++++" }; aconnectgui-0.9.0rc2-1.orig/src/images/connect.xpm0100644000076400007640000000112107466514352017566 0ustar rjrj/* XPM */ static char * connect_xpm[] = { "20 20 4 1", " c None", ". c #FFFFFF", "X c #000000", "o c #303030", " ....... ", " .....XXXXXXXo ", " .XXXXXXXXXXXXoo ", " .XX.X..XXXXXXXXXo ", " oXXXXXXXXXXXXXXXo ", " oooooXXXXXXXooXXo", " ooooooo..XXo", " .XXXXo", " .XXXoo ", " .XXoo ", " .XX.. ", " oXXXoo ", " oXXXXo", " .......ooXXo", " .....XXXXXXX..XXo", " .XXXXXXXXXXXXXXXo ", " .XX.X..XXXXXXXXXo ", " oXXXXXXXXXXXXoo ", " oooooXXXXXXXo ", " ooooooo "}; aconnectgui-0.9.0rc2-1.orig/src/images/question.xpm0100644000076400007640000000112307466514352020006 0ustar rjrj/* XPM */ static char * question_xpm[] = { "20 20 4 1", " c #None", ". c #FFFFFF", "X c #000000", "o c #303030", " ...... ", " ..XXXXXX.. ", " ..XXXXXXXXXX.. ", " .XXXXXXXXXXXXXX. ", " .XXXXXooooXXXXXo ", " .XXXXoo ooXXXXo ", " .XXXo oXXXo ", " .XXXo .XXXo ", " ooo .XXXXo ", " ..XXXXo ", " ...XXXXXXo ", " .XXXXXXXXo ", " .XXXXXXoo ", " .XXXXoo ", " oooo ", " .... ", " .XXXXo ", " .XXXXo ", " .XXXXo ", " oooo "}; aconnectgui-0.9.0rc2-1.orig/src/images/scicors.xpm0100644000076400007640000000112107466514352017602 0ustar rjrj/* XPM */ static char * scicors_xpm[] = { "20 20 4 1", " c None", ". c #FFFFFF", "X c #000000", "o c #303030", " ", " ... ", " .XXXo ", " .XXXXXo ..... ", ".XXoooXXo ..XXXXXo", ".XXo .XXo .XXXXXXXo", ".XXo..XXo .XXXXXXoo ", " oXXXXXXo.XXXXXoo ", " oXXXXXX.XXXoo ", " oooooXXXoo ", " .....XXX.. ", " .XXXXXXoXXX.. ", " .XXXXXXooXXXXX.. ", ".XXoooXXo oXXXXXX.. ", ".XXo .XXo oXXXXXXXo", ".XXo..XXo ooXXXXXo", " oXXXXXo ooooo ", " oXXXo ", " ooo ", " "};