1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
|
/* gap_player_main.h
*
* This module handles GAP video playback
* based on thumbnail files
*/
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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.
*/
/* revision history:
* version 1.3.26d; 2004/01/28 hof: mtrace_mode
* version 1.3.20d; 2003/10/06 hof: new gpp struct members for resize behaviour
* version 1.3.19a; 2003/09/07 hof: audiosupport (based on wavplay, for UNIX only),
* version 1.3.15a; 2003/06/21 hof: created
*/
#ifndef _GAP_PLAYER_MAIN_H
#define _GAP_PLAYER_MAIN_H
#include "libgimp/gimp.h"
#include "gap_lib.h"
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "gap_pview_da.h"
#include "gap_story_file.h"
#include "gap_player_cache.h"
#include "gap_story_render_types.h"
#include "gap_drawable_vref_parasite.h"
#ifdef GAP_ENABLE_VIDEOAPI_SUPPORT
#include "gap_vid_api.h"
#else
#ifndef GAP_STUBTYPE_GVA_HANDLE
typedef gpointer t_GVA_Handle;
#define GAP_STUBTYPE_GVA_HANDLE
#endif
#endif
#define MAX_AUDIOFILE_LEN 1024
typedef enum {
GAP_PLAYER_MTRACE_OFF
,GAP_PLAYER_MTRACE_IMG_SIZE
,GAP_PLAYER_MTRACE_PV_SIZE
} GapPlayerMtraceType;
typedef struct GapPlayerAddClip {
gpointer user_data_ptr; /* sgpp */
GapAnimInfo *ainfo_ptr;
gint32 range_from;
gint32 range_to;
} GapPlayerAddClip;
/* Function Typedefs */
typedef void (*GapPlayerSetRangeFptr)(GapPlayerAddClip *plac_ptr);
#define GAP_PLAYER_DONT_FORCE_ASPECT 0.0
typedef struct GapPlayerMainGlobalParams {
gboolean standalone_mode;
GimpRunMode run_mode;
gint32 image_id;
gchar *imagename;
gint32 imagewidth;
gint32 imageheight;
gdouble aspect_ratio; /* 0.0 use original size, else force aspect */
GapAnimInfo *ainfo_ptr;
GapStoryBoard *stb_ptr;
t_GVA_Handle *gvahand;
gchar *gva_videofile;
gint32 mtrace_image_id; /* multilayer image trace image id */
GapPlayerMtraceType mtrace_mode; /* Init GAP_PLAYER_MTRACE_OFF */
GapPlayerSetRangeFptr fptr_set_range; /* procedure to callback at set range */
gpointer user_data_ptr; /* userdata for the callback procedure */
gboolean autostart;
gboolean caller_range_linked; /* propagate range selection immediate to the caller */
gboolean use_thumbnails;
gboolean exact_timing; /* TRUE: allow drop frames fro exact timing, FALSE: disable drop */
gboolean play_is_active;
gboolean play_selection_only;
gboolean play_loop;
gboolean play_pingpong;
gboolean play_backward;
gboolean request_cancel_video_api;
gboolean cancel_video_api;
gboolean gva_lock;
gint32 play_timertag;
gint32 begin_frame;
gint32 end_frame;
gint32 play_current_framenr;
gint32 pb_stepsize;
gdouble speed; /* playback speed fps */
gdouble original_speed; /* playback speed fps */
gdouble prev_speed; /* previous playback speed fps */
gint32 pv_pixelsize; /* 32 upto 512 */
gint32 pv_width;
gint32 pv_height;
/* lockflags */
gboolean in_feedback;
gboolean in_timer_playback;
gboolean in_resize; /* for disable resize while initial startup */
gint32 go_job_framenr;
gint32 go_timertag;
gint32 go_base_framenr;
gint32 go_base;
gint32 pingpong_count;
/* GUI widget pointers */
GapPView *pv_ptr;
GtkWidget *shell_window;
GtkWidget *docking_container; /* NULL if not docked, or vbox to contain player */
GtkWidget *frame_with_name;
GtkObject *from_spinbutton_adj;
GtkObject *to_spinbutton_adj;
GtkWidget *framenr_scale;
GtkObject *framenr_spinbutton_adj;
GtkObject *speed_spinbutton_adj;
GtkObject *size_spinbutton_adj;
GtkWidget *from_button;
GtkWidget *to_button;
GtkWidget *progress_bar;
GtkWidget *status_label;
GtkWidget *timepos_label;
GtkWidget *resize_box;
GtkWidget *size_spinbutton;
GtkWidget *use_thumb_checkbutton;
GtkWidget *exact_timing_checkbutton;
GtkWidget *pinpong_checkbutton;
GtkWidget *selonly_checkbutton;
GtkWidget *loop_checkbutton;
GTimer *gtimer;
gdouble cycle_time_secs;
gdouble rest_secs;
gdouble delay_secs;
gdouble framecnt;
gint32 seltrack;
gdouble delace;
gchar *preferred_decoder;
gboolean force_open_as_video;
gboolean have_progress_bar;
gchar *progress_bar_idle_txt;
gint32 resize_handler_id;
gint32 old_resize_width;
gint32 old_resize_height;
gboolean startup;
gint32 shell_initial_width;
gint32 shell_initial_height;
/* audio stuff */
gboolean audio_enable;
gint32 audio_resync; /* force audio brak for n frames and sync restart */
gchar audio_filename[MAX_AUDIOFILE_LEN];
gchar audio_wavfile_tmp[MAX_AUDIOFILE_LEN];
gint32 audio_frame_offset;
guint32 audio_samplerate;
guint32 audio_required_samplerate;
guint32 audio_bits;
guint32 audio_channels;
guint32 audio_samples;
gint32 audio_status;
gdouble audio_volume; /* 0.0 upto 1.0 */
gint32 audio_tmp_samplerate;
gint32 audio_tmp_samples;
gboolean audio_tmp_resample;
gboolean audio_tmp_dialog_is_open;
GtkWidget *audio_filename_entry;
GtkWidget *audio_offset_time_label;
GtkWidget *audio_total_time_label;
GtkWidget *audio_total_frames_label;
GtkWidget *audio_samples_label;
GtkWidget *audio_samplerate_label;
GtkWidget *audio_bits_label;
GtkWidget *audio_channels_label;
GtkObject *audio_volume_spinbutton_adj;
GtkObject *audio_frame_offset_spinbutton_adj;
GtkWidget *audio_filesel;
GtkWidget *audio_table;
GtkWidget *audio_status_label;
GtkWidget *video_total_time_label;
GtkWidget *video_total_frames_label;
gboolean vindex_creation_is_running;
GtkWidget *play_n_stop_hbox;
GtkWidget *cancel_vindex_button;
const char *help_id;
gboolean onion_delete;
/* player cache settings */
GtkObject *cache_size_spinbutton_adj;
GtkWidget *label_current_cache_values;
GtkWidget *progress_bar_cache_usage;
gint32 max_player_cache; /* max bytesize to use for caching frames
* (at pview widget size)
* a value of 0 turns cahing OFF
*/
GapPlayerCacheCompressionType cache_compression;
gdouble cache_jpeg_quality;
/* layout options */
gboolean show_go_buttons;
gboolean show_position_scale;
GtkWidget *show_go_buttons_checkbutton;
GtkWidget *show_position_scale_checkbutton;
GtkWidget *gobutton_hbox;
GtkWidget *frame_scale_hbox;
/* flags to trigger built in transformations */
gint32 flip_request;
gint32 flip_status;
gint32 stb_in_track;
/* for playback of storyboard composite video */
gint32 stb_parttype;
gint32 stb_unique_id;
GapStoryRenderVidHandle *stb_comp_vidhand;
/* audio otone extract stuff */
gboolean audio_auto_offset_by_framenr;
gint32 audio_otone_atrack;
GtkWidget *audio_auto_offset_by_framenr_checkbutton;
GtkWidget *audio_otone_extract_button;
GtkWidget *audio_otone_atrack_spinbutton;
GtkObject *audio_otone_atrack_spinbutton_adj;
GtkWidget *progress_bar_audio;
GtkWidget *audio_enable_checkbutton;
GapDrawableVideoRef *dvref_ptr;
} GapPlayerMainGlobalParams;
#define GAP_PLAYER_MAIN_AUSTAT_UNCHECKED -1
#define GAP_PLAYER_MAIN_AUSTAT_NONE 0
#define GAP_PLAYER_MAIN_AUSTAT_SERVER_STARTED 1
#define GAP_PLAYER_MAIN_AUSTAT_FILENAME_SET 2
#define GAP_PLAYER_MAIN_AUSTAT_PLAYING 3
#define GAP_PLAYER_MAIN_MIN_SAMPLERATE 1000
#define GAP_PLAYER_MAIN_MAX_SAMPLERATE 48000
#endif
|