[4] | 1 | /****************************************************************************** |
---|
| 2 | * SAGE - Scalable Adaptive Graphics Environment |
---|
| 3 | * |
---|
| 4 | * Module: tileConfig.h |
---|
| 5 | * Author : Byungil Jeong |
---|
| 6 | * |
---|
| 7 | * Copyright (C) 2004 Electronic Visualization Laboratory, |
---|
| 8 | * University of Illinois at Chicago |
---|
| 9 | * |
---|
| 10 | * All rights reserved. |
---|
| 11 | * |
---|
| 12 | * Redistribution and use in source and binary forms, with or without |
---|
| 13 | * modification, are permitted provided that the following conditions are met: |
---|
| 14 | * |
---|
| 15 | * * Redistributions of source code must retain the above copyright |
---|
| 16 | * notice, this list of conditions and the following disclaimer. |
---|
| 17 | * * Redistributions in binary form must reproduce the above |
---|
| 18 | * copyright notice, this list of conditions and the following disclaimer |
---|
| 19 | * in the documentation and/or other materials provided with the distribution. |
---|
| 20 | * * Neither the name of the University of Illinois at Chicago nor |
---|
| 21 | * the names of its contributors may be used to endorse or promote |
---|
| 22 | * products derived from this software without specific prior written permission. |
---|
| 23 | * |
---|
| 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
| 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
| 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
| 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
---|
| 28 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
---|
| 29 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
| 30 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
| 31 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
| 32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
| 33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
| 34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 35 | * |
---|
| 36 | * Direct questions, comments etc about SAGE to sage_users@listserv.uic.edu or |
---|
| 37 | * http://www.evl.uic.edu/cavern/forum/ |
---|
| 38 | * |
---|
| 39 | *****************************************************************************/ |
---|
| 40 | |
---|
| 41 | #ifndef SAGE_TILE_CONFIG_H |
---|
| 42 | #define SAGE_TILE_CONFIG_H |
---|
| 43 | |
---|
| 44 | #include "sageBase.h" |
---|
| 45 | |
---|
| 46 | // width : horizontal screen resolution |
---|
| 47 | // height : vertical screen resolution |
---|
| 48 | // left : left mullion width |
---|
| 49 | // right : left mullion width |
---|
| 50 | // bottom : left mullion width |
---|
| 51 | // top : left mullion width |
---|
| 52 | |
---|
| 53 | #define XID_LEN 5 |
---|
| 54 | |
---|
| 55 | class displayType : public sageRect { |
---|
| 56 | public: |
---|
| 57 | char name[SAGE_NAME_LEN]; |
---|
| 58 | int PPI; //pixel per inch |
---|
| 59 | |
---|
| 60 | displayType() : PPI(0) {} |
---|
| 61 | }; |
---|
| 62 | |
---|
| 63 | // x, y : lower left corner coordinates in pixels |
---|
| 64 | // width, height : screen resolution |
---|
| 65 | // left, right, bottom, top : relative coordinates (0.0 - 1.0) |
---|
| 66 | class tileInfo : public sageRect { |
---|
| 67 | public: |
---|
| 68 | displayType *tileType; |
---|
| 69 | int nodeID, tileID; |
---|
| 70 | int xIndex, yIndex; |
---|
| 71 | int offsetX, offsetY; |
---|
| 72 | |
---|
| 73 | tileInfo() : tileType(NULL), nodeID(0), tileID(0), offsetX(0), offsetY(0), |
---|
| 74 | xIndex(0), yIndex(0) {} |
---|
| 75 | }; |
---|
| 76 | |
---|
| 77 | class displayNode { |
---|
| 78 | public: |
---|
| 79 | char ip[SAGE_IP_LEN]; // IP address of the computer the holds pixels to display |
---|
| 80 | char forwardIP[SAGE_IP_LEN]; // IP address of the host which forwards external traffic to the display node |
---|
| 81 | std::vector<tileInfo*> tiles; // tile ID attached to this display node |
---|
| 82 | int dimX, dimY; |
---|
| 83 | int winX, winY; |
---|
| 84 | int port, forwardPort; |
---|
| 85 | char Xdisp[XID_LEN]; |
---|
| 86 | |
---|
| 87 | displayNode(); |
---|
| 88 | ~displayNode(); |
---|
| 89 | int computeDimension(); |
---|
| 90 | }; |
---|
| 91 | |
---|
| 92 | |
---|
| 93 | class audioNode { |
---|
| 94 | public: |
---|
| 95 | char ip[SAGE_IP_LEN]; //ip address of the computer the holds pixels to display |
---|
| 96 | std::vector<char*> streamIPs; // optional parameters to receive streams through separate IPs |
---|
| 97 | |
---|
| 98 | // ????????????? |
---|
| 99 | //int audioDeviceNum; |
---|
| 100 | sageSampleFmt sampleFmt; |
---|
| 101 | long samplingRate; |
---|
| 102 | int channels; |
---|
| 103 | int framePerBuffer; |
---|
| 104 | int deviceId; |
---|
| 105 | |
---|
| 106 | audioNode(); |
---|
| 107 | ~audioNode(); |
---|
| 108 | }; |
---|
| 109 | |
---|
| 110 | class virtualDesktop; |
---|
| 111 | class appInExec; |
---|
| 112 | |
---|
| 113 | class displayConnection { |
---|
| 114 | public: |
---|
| 115 | virtualDesktop *displays[2]; |
---|
| 116 | int edges[2]; |
---|
| 117 | int offset; |
---|
| 118 | }; |
---|
| 119 | |
---|
| 120 | // x, y : lower left corner coordinates in pixels on global desktop |
---|
| 121 | // width, height : virtual desktop resolution |
---|
| 122 | class virtualDesktop : public sageRect { |
---|
| 123 | public: |
---|
| 124 | std::vector<tileInfo*> tileList; |
---|
| 125 | std::vector<displayNode*> displayCluster; |
---|
| 126 | std::vector<audioNode*> audioCluster; |
---|
| 127 | std::vector<displayConnection *> connectionList; |
---|
| 128 | |
---|
| 129 | int dimX, dimY; |
---|
| 130 | char masterIP[SAGE_IP_LEN]; |
---|
| 131 | displayType globalType; |
---|
| 132 | int displayID; |
---|
| 133 | bool table; |
---|
| 134 | char audioDir[TOKEN_LEN]; |
---|
| 135 | bool audioServer; |
---|
| 136 | |
---|
| 137 | virtualDesktop(); |
---|
| 138 | bool parseConfigfile(FILE *fp, bool configBegin = false); |
---|
| 139 | int parseAudioConfigfile(FILE *fp, bool configBegin = false); |
---|
| 140 | void locateApp(appInExec *app, displayConnection *connection, int idx = 0); |
---|
| 141 | int updateDesktop(); |
---|
| 142 | }; |
---|
| 143 | |
---|
| 144 | #endif |
---|