/* scivi - visualization plugin for XMMS * Copyright (C) 2003 Vitaly V. Bursov * * 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 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. * * 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 */ #ifndef SCIVI_H #define SCIVI_H #include #include #include #include "glstuff.h" enum { SCIVI_CTRL_NONE, SCIVI_CTRL_RETURN_TO_WINDOW_MODE, SCIVI_CTRL_PRESETS_RELOAD, SCIVI_CTRL_PRESETS_PREVIOUS, SCIVI_CTRL_PRESETS_NEXT, }; typedef struct { gint (*disable_func)(gpointer data); gint (*contols_spawn_func)(gpointer data); int plugin_ctrl_message; int plugin_ok; int thread_quit_flag; struct { int force_old_glx; int glx_errorBase, glx_eventBase; Display *dpy; Window win; Atom wm_delete; GLXDrawable glxw; GLXDrawable glxr; GLXDrawable glxp; GLXDrawable draw; GLXContext ctxw; GLXContext ctxp; } X; /* * 0 for windowed * 1 for root window rendering * 2 for fullscreen (TODO) */ int visual_mode; int pbuf_want_w; int pbuf_want_h; int pbuf_w; int pbuf_h; #define XDPY (scivi->X.dpy) #define XWIN (scivi->X.win) #define XCTXW (scivi->X.ctxw) #define XGLXW (scivi->X.glxw) #define XGLXR (scivi->X.glxr) #define XCTXP (scivi->X.ctxp) #define XGLXP (scivi->X.glxp) /* double buffering :) */ float plugin_pcm_fdata[2][2][512]; int plugin_pcm_fdata_buffer; int plugin_pcm_fdata_count; float plugin_freq_fdata[2][2][256]; int plugin_freq_fdata_buffer; int plugin_freq_fdata_count; int plugin_toggle_fullscreen; int mutexes_initok; pthread_mutex_t thread_mutex; pthread_mutex_t thread_config_mutex; float aspect; int width; int height; float rootaspect; int rootwidth; int rootheight; char **preset_dirs; char *font_filename; int fps_limit_method; int max_fps; int vsync_enable; } Scivi; #define SCIVI_LOCK() pthread_mutex_lock(&scivi->thread_mutex) #define SCIVI_UNLOCK() pthread_mutex_unlock(&scivi->thread_mutex) #define SCIVICFG_LOCK() pthread_mutex_lock(&scivi->thread_config_mutex) #define SCIVICFG_UNLOCK() pthread_mutex_unlock(&scivi->thread_config_mutex) void *scivi_plugin_thread(void *p); #endif /* SCIVI_H */