changeset 1848:8ce1c088d05d

fix osd volume bar handling in gui
author pontscho
date Sun, 02 Sep 2001 21:49:21 +0000
parents 773ae4ba43f5
children 5f246fcc2971
files Gui/mplayer/mw.h mplayer.c
diffstat 2 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/mw.h	Sun Sep 02 21:26:51 2001 +0000
+++ b/Gui/mplayer/mw.h	Sun Sep 02 21:49:21 2001 +0000
@@ -435,7 +435,6 @@
                        mplMainRender=1;
                        SelectedButton=i;
                        boxMoved=0;
-                       if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) mplShMem->VolumeChanged=1;
                        msButton=itPotmeter;
                        itemtype=itPotmeter;
                       }
@@ -450,7 +449,6 @@
                        mplMainRender=1;
                        SelectedButton=i;
                        boxMoved=0;
-                       if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) mplShMem->VolumeChanged=1;
                        msButton=itHPotmeter;
                        itemtype=itHPotmeter;
                       }
@@ -478,7 +476,11 @@
 potihandled:
 		 if ( item->value > 100.0f ) item->value=100.0f;
 		 if ( item->value < 0.0f ) item->value=0.0f;
-//                 if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) 
+                 if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) 
+		  {
+		   mplShMem->VolumeChanged=1;
+		   mplShMem->Volume=item->value;
+		  }
 		 mplMsgHandle( item->msg,item->value );
                  mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
                  break;
@@ -500,6 +502,11 @@
             case itHPotmeter:
 		 item->used=0;
                  btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
+                 if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) 
+		  {
+		   mplShMem->VolumeChanged=1;
+		   mplShMem->Volume=item->value;
+		  }
 		 value=item->value;
                  break;
            }
--- a/mplayer.c	Sun Sep 02 21:26:51 2001 +0000
+++ b/mplayer.c	Sun Sep 02 21:49:21 2001 +0000
@@ -1792,6 +1792,16 @@
 //	printf("mplShMem->Playing=%d  \n",mplShMem->Playing);
 	if(mplShMem->Playing==0) break; // STOP
 	if(mplShMem->Playing==2) osd_function=OSD_PAUSE;
+#ifdef USE_OSD
+        if ( ( osd_level )&&( mplShMem->VolumeChanged ) )
+	 {
+          osd_visible=sh_video->fps; // 1 sec
+          vo_osd_progbar_type=OSD_VOLUME;
+          vo_osd_progbar_value=((mplShMem->Volume )*256.0)/100.0;
+         }
+#endif
+	mixer_setvolume( mplShMem->Volume,mplShMem->Volume );
+	mplShMem->VolumeChanged=0;
       }
 #endif