PageRenderTime 13ms CodeModel.GetById 2ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/visualizations/XBMCProjectM/libprojectM/lvtoprojectM.h

http://github.com/xbmc/xbmc
C++ Header | 156 lines | 117 code | 6 blank | 33 comment | 3 complexity | 92ff36742ab5db7902dca5013f0e23d3 MD5 | raw file
  1/**
  2 * projectM -- Milkdrop-esque visualisation SDK
  3 * Copyright (C)2003-2007 projectM Team
  4 *
  5 * This library is free software; you can redistribute it and/or
  6 * modify it under the terms of the GNU Lesser General Public
  7 * License as published by the Free Software Foundation; either
  8 * version 2.1 of the License, or (at your option) any later version.
  9 *
 10 * This library is distributed in the hope that it will be useful,
 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13 * Lesser General Public License for more details.
 14 *
 15 * You should have received a copy of the GNU Lesser General Public
 16 * License along with this library; if not, write to the Free Software
 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18 * See 'LICENSE.txt' included within this release
 19 *
 20 */
 21/**
 22 * $Id: sdltoprojectM.hpp,v 1.1 2004/10/08 00:35:28 cvs Exp $
 23 *
 24 * Translates SDL -> projectM variables
 25 *
 26 * $Log: sdltoprojectM.hpp,v $
 27 * Revision 1.1  2004/10/08 00:35:28  cvs
 28 * Moved and imported
 29 *
 30 * Revision 1.1.1.1  2004/10/04 12:56:00  cvs
 31 * Imported
 32 *
 33 */
 34
 35#include <libvisual/libvisual.h>
 36
 37projectMEvent lv2pmEvent( VisEventType event ) { 
 38							
 39    switch ( event ) { 
 40        case VISUAL_EVENT_RESIZE:
 41            return PROJECTM_VIDEORESIZE; 
 42        case VISUAL_EVENT_KEYUP: 
 43            return PROJECTM_KEYUP; 
 44        case VISUAL_EVENT_KEYDOWN: 
 45            return PROJECTM_KEYDOWN;
 46        default:
 47            return PROJECTM_KEYUP; 
 48      } 
 49  } 
 50projectMKeycode lv2pmKeycode( VisKey keysym ) 
 51{ 
 52  switch ( keysym ) 
 53    { 
 54    case VKEY_F1: 
 55      return PROJECTM_K_F1; 
 56    case VKEY_F2: 
 57      return PROJECTM_K_F2; 
 58    case VKEY_F3:
 59      return PROJECTM_K_F3; 
 60    case VKEY_F4: 
 61      return PROJECTM_K_F4; 
 62    case VKEY_F5: 
 63      return PROJECTM_K_F5; 
 64    case VKEY_F6: 
 65      return PROJECTM_K_F6; 
 66    case VKEY_F7: 
 67      return PROJECTM_K_F7; 
 68    case VKEY_F8: 
 69      return PROJECTM_K_F8; 
 70    case VKEY_F9: 
 71      return PROJECTM_K_F9; 
 72    case VKEY_F10: 
 73      return PROJECTM_K_F10; 
 74    case VKEY_F11:
 75      return PROJECTM_K_F11; 
 76    case VKEY_F12: 
 77      return PROJECTM_K_F12; 
 78    case VKEY_ESCAPE: 
 79      return PROJECTM_K_ESCAPE; 
 80    case VKEY_a:
 81      return PROJECTM_K_a;
 82    case VKEY_b:
 83      return PROJECTM_K_b;
 84    case VKEY_c:  
 85      return PROJECTM_K_c;
 86    case VKEY_d: 
 87      return PROJECTM_K_d; 
 88    case VKEY_e:
 89      return PROJECTM_K_e; 
 90    case VKEY_f: 
 91      return PROJECTM_K_f; 
 92    case VKEY_g: 
 93      return PROJECTM_K_g; 
 94    case VKEY_h: 
 95      return PROJECTM_K_h; 
 96    case VKEY_i: 
 97      return PROJECTM_K_i; 
 98    case VKEY_j:
 99      return PROJECTM_K_j;
100    case VKEY_k:
101      return PROJECTM_K_k;
102    case VKEY_l:  
103      return PROJECTM_K_l;
104    case VKEY_m: 
105      return PROJECTM_K_m; 
106    case VKEY_n:
107      return PROJECTM_K_n; 
108    case VKEY_o: 
109      return PROJECTM_K_o; 
110    case VKEY_p: 
111      return PROJECTM_K_p; 
112    case VKEY_q: 
113      return PROJECTM_K_q; 
114    case VKEY_r: 
115      return PROJECTM_K_r; 
116    case VKEY_s: 
117      return PROJECTM_K_s; 
118    case VKEY_t:
119      return PROJECTM_K_t; 
120    case VKEY_u: 
121      return PROJECTM_K_u; 
122    case VKEY_v: 
123      return PROJECTM_K_v; 
124    case VKEY_w: 
125      return PROJECTM_K_w; 
126    case VKEY_x: 
127      return PROJECTM_K_x; 
128    case VKEY_y: 
129      return PROJECTM_K_y; 
130    case VKEY_z: 
131      return PROJECTM_K_z; 
132    case VKEY_UP:
133      return PROJECTM_K_UP;
134    case VKEY_RETURN:
135      return PROJECTM_K_RETURN;
136    case VKEY_RIGHT:
137      return PROJECTM_K_RIGHT;
138    case VKEY_LEFT:
139      return PROJECTM_K_LEFT;
140    case VKEY_DOWN:
141      return PROJECTM_K_DOWN;
142    case VKEY_PAGEUP:
143      return PROJECTM_K_PAGEUP;
144    case VKEY_PAGEDOWN:
145      return PROJECTM_K_PAGEDOWN;
146   
147
148    default:  
149      return PROJECTM_K_NONE;
150      break;
151    } 
152  } 
153
154projectMModifier lv2pmModifier( int mod ) { 
155    return mod && VKMOD_LSHIFT; 
156  }