Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

src/net/threebit/jvr/DX_CST.java

Go to the documentation of this file.
00001 package net.threebit.jvr;
00002 
00003 /*
00004  * $Id: DX_CST.java,v 1.8 2004/07/02 18:11:37 kevino Exp $
00005  *
00006  * Copyright (c) 2003,2004 Kevin O'Donnell
00007  * 
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307,  USA.
00021  */
00022 
00023 /**
00024  * Java equivalent of the Dialogic DX_CST struct.
00025  */
00026 
00027 public class DX_CST extends JVRBaseClass {
00028 
00029   /** "unsigned short" becomes "int" */
00030   public int cst_event;
00031 
00032   /** "unsigned short" becomes "int" */
00033   public int cst_data;
00034 
00035   /**
00036    *
00037    */
00038   public String toString() {
00039     String s = "DX_CST{";
00040 
00041     if (cst_event == dx.DE_DIGITS) { s += "DE_DIGITS"; }
00042     else if (cst_event == dx.DE_LCOFF) { s += "DE_LCOFF"; }
00043     else if (cst_event == dx.DE_LCON) { s += "DE_LCON"; }
00044     else if (cst_event == dx.DE_LCREV) { s += "DE_LCREV"; }
00045     else if (cst_event == dx.DE_RINGS) { s += "DE_RINGS"; }
00046     else if (cst_event == dx.DE_RNGOFF) { s += "DE_RNGOFF"; }
00047     else if (cst_event == dx.DE_SILOFF) { s += "DE_SILOFF"; }
00048     else if (cst_event == dx.DE_SILON) { s += "DE_SILON"; }
00049     else if (cst_event == dx.DE_TONEOFF) { s += "DE_TONEOFF"; }
00050     else if (cst_event == dx.DE_TONEON) { s += "DE_TONEON"; }
00051     else if (cst_event == dx.DE_WINK) { s += "DE_WINK"; }
00052     else if (cst_event == dx.DX_OFFHOOK) { s += "DX_OFFHOOK"; }
00053     else if (cst_event == dx.DX_ONHOOK) { s += "DX_ONHOOK"; }
00054     else { s += cst_event; }
00055     s += ";";
00056 
00057     if (cst_event == dx.DE_WINK || cst_event == dx.DX_OFFHOOK || cst_event == dx.DX_ONHOOK) {
00058       s += "n/a";
00059     }
00060     else if (cst_event == dx.DE_DIGITS) {
00061       char digit = (char) ((cst_data<<8)>>8);
00062       s += "'"+digit+"'";
00063     }
00064     else if (cst_event == dx.DE_SILON || cst_event == dx.DE_SILOF) {
00065       s += cst_data;
00066       s += "ms";
00067     }
00068     else {
00069       s += cst_data;
00070     }
00071     s += "}";
00072     return s;
00073   }
00074 
00075 }
00076 

Generated on Sat Jul 16 03:47:34 2005 for JVR by doxygen 1.3.5