diff mplayer.c @ 12672:9709ce101949

New 'Mixer API' with ability to change volume through libaf (this part was written by Reimar Doffinger) and lesser global variables
author alex
date Sat, 26 Jun 2004 09:14:20 +0000
parents 733c9d9882d1
children 6d815f12e3e5
line wrap: on
line diff
--- a/mplayer.c	Sat Jun 26 07:07:19 2004 +0000
+++ b/mplayer.c	Sat Jun 26 09:14:20 2004 +0000
@@ -524,6 +524,8 @@
 extern void mp_input_register_options(m_config_t* cfg);
 
 #include "mixer.h"
+static mixer_t mixer;
+
 #include "cfg-mplayer.h"
 
 void parse_cfgfiles( m_config_t* conf )
@@ -1902,6 +1904,9 @@
     }
 #endif
   }
+  mixer.audio_out = audio_out;
+  mixer.afilter = sh_audio->afilter;
+  mixer.volstep = 3;
 }
 
 current_module="av_init";
@@ -2488,7 +2493,7 @@
        edl_decision = 1;
        next_edl_record = next_edl_record->next;
      } else if( next_edl_record->action == EDL_MUTE ) {
-       mixer_mute();
+       mixer_mute(&mixer);
 #ifdef DEBUG_EDL
        printf( "\nEDL_MUTE: [%f]\n", next_edl_record->start_sec );
 #endif
@@ -2657,25 +2662,27 @@
 		
 		if( abs )
 		{
-			mixer_setvolume( (float)v, (float)v );
+			mixer_setvolume(&mixer, (float)v, (float)v );
 		} else {
       if(v > 0)
-	mixer_incvolume();
+	mixer_incvolume(&mixer);
       else
-	mixer_decvolume();
+	mixer_decvolume(&mixer);
 		}
 	  
 #ifdef USE_OSD
       if(osd_level && sh_video){
+        float vol;
 	osd_visible=sh_video->fps; // 1 sec
 	vo_osd_progbar_type=OSD_VOLUME;
-	vo_osd_progbar_value=(mixer_getbothvolume()*256.0)/100.0;
+	mixer_getbothvolume(&mixer, &vol);
+	vo_osd_progbar_value=(vol*256.0)/100.0;
 	vo_osd_changed(OSDTYPE_PROGBAR);
       }
 #endif
     } break;
     case MP_CMD_MUTE:
-      mixer_mute();
+      mixer_mute(&mixer);
       break;
     case MP_CMD_LOADFILE : {
       play_tree_t* e = play_tree_new();