Mercurial > mplayer.hg
annotate Gui/app.c @ 6030:fab518e0cbb8
sometime source files have other frame rates than for vcd's and svcd's, so
you have to set manually the frame rate with "-vfr".
This patch introduce the option "-vfr".
by Juergen Hammelmann <juergen.hammelmann@gmx.de>
author | jaf |
---|---|
date | Thu, 09 May 2002 10:27:36 +0000 |
parents | 3e7f39c4110c |
children | 8cfddba867b4 |
rev | line source |
---|---|
1693 | 1 |
2 #include <stdlib.h> | |
3 #include <stdio.h> | |
4 #include <string.h> | |
5 | |
3586 | 6 #include "../config.h" |
7 #include "../mp_msg.h" | |
8 #include "../help_mp.h" | |
9 | |
1693 | 10 #include "app.h" |
11 #include "wm/wskeys.h" | |
12 #include "skin/skin.h" | |
13 #include "mplayer/mplayer.h" | |
4979 | 14 #include "interface.h" |
1693 | 15 |
16 listItems appMPlayer; | |
17 | |
18 char * skinDirInHome=NULL; | |
19 char * skinMPlayerDir=NULL; | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
20 char * skinName = NULL; |
1693 | 21 |
22 void appClearItem( wItem * item ) | |
23 { | |
24 item->type=0; | |
25 // --- | |
26 item->x=0; item->y=0; item->width=0; item->height=0; | |
27 // --- | |
28 item->px=0; item->py=0; item->psx=0; item->psy=0; | |
29 // --- | |
30 item->msg=0; item->msg2=0; | |
4979 | 31 item->pressed=btnReleased; |
1693 | 32 item->tmp=0; |
33 item->key=0; item->key2=0; | |
34 item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0; | |
4979 | 35 if ( item->Bitmap.Image ) free( item->Bitmap.Image ); |
36 item->Bitmap.Image=NULL; | |
1693 | 37 // --- |
38 item->fontid=0; | |
39 if ( item->label ) free( item->label ); item->label=NULL; | |
40 item->event=0; | |
41 } | |
42 | |
43 void appCopy( listItems * dest,listItems * source ) | |
44 { | |
45 dest->NumberOfItems=source->NumberOfItems; | |
46 memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) ); | |
47 | |
48 dest->NumberOfMenuItems=source->NumberOfMenuItems; | |
49 memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) ); | |
50 | |
51 memcpy( &dest->main,&source->main,sizeof( wItem ) ); | |
52 memcpy( &dest->sub,&source->sub,sizeof( wItem ) ); | |
53 memcpy( &dest->eq,&source->eq,sizeof( wItem ) ); | |
54 memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) ); | |
55 memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) ); | |
56 } | |
57 | |
58 void appInitStruct( listItems * item ) | |
59 { | |
60 int i; | |
61 for ( i=0;i<item->NumberOfItems;i++ ) | |
62 appClearItem( &item->Items[i] ); | |
63 for ( i=0;i<item->NumberOfMenuItems;i++ ) | |
64 appClearItem( &item->MenuItems[i] ); | |
65 | |
66 item->NumberOfItems=-1; | |
67 memset( item->Items,0,128 * sizeof( wItem ) ); | |
68 item->NumberOfMenuItems=-1; | |
69 memset( item->MenuItems,0,32 * sizeof( wItem ) ); | |
70 | |
71 appClearItem( &item->main ); | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
72 item->mainDecoration=0; |
1693 | 73 appClearItem( &item->sub ); |
1823 | 74 item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384; |
75 item->sub.width=384; item->sub.height=384; | |
76 item->sub.x=-1; item->sub.y=-1; | |
1693 | 77 appClearItem( &item->menuBase ); |
78 appClearItem( &item->menuSelected ); | |
79 item->subR=0; | |
80 item->subG=0; | |
81 item->subB=0; | |
82 } | |
83 | |
84 int appFindKey( unsigned char * name ) | |
85 { | |
86 int i; | |
87 for ( i=0;i<wsKeyNumber;i++ ) | |
88 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code; | |
89 return -1; | |
90 } | |
91 | |
92 int appFindMessage( unsigned char * str ) | |
93 { | |
94 int i; | |
95 for ( i=0;i<evBoxs;i++ ) | |
96 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg; | |
97 return -1; | |
98 } | |
99 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
100 void appInit( int argc,char* argv[], char *envp[], void* disp ) |
1693 | 101 { |
1707 | 102 skinDirInHome=get_path("Skin"); |
103 skinMPlayerDir=DATADIR "/Skin"; | |
104 printf("SKIN dir 1: '%s'\n",skinDirInHome); | |
105 printf("SKIN dir 2: '%s'\n",skinMPlayerDir); | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
106 if ( !skinName ) |
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
107 { |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3586
diff
changeset
|
108 if ( ( skinName=(char *)calloc( 1,7 ) ) == NULL ) { mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[config] Not enough memory.\n" ); exit( 1 ); } |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
109 strcpy( skinName,"default" ); |
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
110 } |
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
111 switch ( skinRead( skinName ) ) |
1823 | 112 { |
3586 | 113 case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 ); |
114 case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 ); | |
1823 | 115 } |
116 mplInit( argc,argv,envp,disp ); // does gtk & ws initialization, create windows | |
1693 | 117 } |