Ticket #5477: toggleupmixer_v2.diff
File toggleupmixer_v2.diff, 7.6 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
3724 3730 audio_codec = ac; 3725 3731 } 3726 3732 3733 bool NuppelVideoPlayer::ToggleUpmixer() 3734 { 3735 if (audioOutput) 3736 { 3737 const AudioSettings settings( 3738 audio_bits, audio_channels, audio_samplerate, 3739 audio_passthru, audio_codec); 3740 return audioOutput->ToggleUpmixer(settings); 3741 } 3742 return false; 3743 } 3744 3727 3745 void NuppelVideoPlayer::SetEffDsp(int dsprate) 3728 3746 { 3729 3747 if (audioOutput) -
libs/libmythtv/tv_play.h
239 239 // Used by EPG 240 240 void ChangeVolume(bool up); 241 241 void ToggleMute(void); 242 void ToggleUpmixer(void); 242 243 243 244 public slots: 244 245 void HandleOSDClosed(int osdType); -
libs/libmythtv/NuppelVideoPlayer.h
128 128 void SetAudioParams(int bits, int channels, int samplerate, bool passthru); 129 129 void SetEffDsp(int dsprate); 130 130 void SetAudioCodec(void *ac); 131 bool ToggleUpmixer(); 131 132 132 133 // Sets 133 134 void SetParentWidget(QWidget *widget) { parentWidget = widget; } -
libs/libmythtv/tv_play.cpp
380 381 REG_KEY("TV Playback", "VOLUMEDOWN", "Volume down", "[,{,F10,Volume Down"); 381 382 REG_KEY("TV Playback", "VOLUMEUP", "Volume up", "],},F11,Volume Up"); 382 383 REG_KEY("TV Playback", "MUTE", "Mute", "|,\\,F9,Volume Mute"); 384 REG_KEY("TV Playback", "TOGGLEUPMIXER", "Toggle Upmixer", "F12,Toggle Upmixer"); 383 385 REG_KEY("TV Playback", "TOGGLEPIPMODE", "Toggle Picture-in-Picture mode", 384 386 "V"); 385 387 REG_KEY("TV Playback", "TOGGLEPIPWINDOW", "Toggle active PiP window", "B"); … … 2743 2745 else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" || 2744 2746 action == "STRETCHINC" || action == "STRETCHDEC" || 2745 2747 action == "MUTE" || action == "TOGGLEASPECT" || 2746 action == "TOGGLEFILL" )2748 action == "TOGGLEFILL" || action == "TOGGLEUPMIXER") 2747 2749 { 2748 2750 passThru = 1; 2749 2751 handled = false; … … 2798 2800 else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" || 2799 2801 action == "STRETCHINC" || action == "STRETCHDEC" || 2800 2802 action == "MUTE" || action == "PAUSE" || 2801 action == "CLEAROSD" )2803 action == "CLEAROSD" || action == "TOGGLEUPMIXER") 2802 2804 { 2803 2805 passThru = 1; 2804 2806 handled = false; … … 3365 3367 ChangeVolume(true); 3366 3368 else if (action == "MUTE") 3367 3369 ToggleMute(); 3370 else if (action == "TOGGLEUPMIXER") 3371 ToggleUpmixer(); 3368 3372 else if (action == "STRETCHINC") 3369 3373 ChangeTimeStretch(1); 3370 3374 else if (action == "STRETCHDEC") … … 6144 6150 GetOSD()->SetSettingsText(text, 5); 6145 6151 } 6146 6152 6153 void TV::ToggleUpmixer(void) 6154 { 6155 bool state=nvp->ToggleUpmixer(); 6156 6157 QString text; 6158 6159 if(state) 6160 text = tr("Upmixer enabled"); 6161 else 6162 text = tr("Upmixer disabled"); 6163 6164 if (GetOSD() && !browsemode) 6165 GetOSD()->SetSettingsText(text, 5); 6166 } 6167 6147 6168 void TV::ToggleSleepTimer(void) 6148 6169 { 6149 6170 QString text; … … 7318 7339 7319 7340 if (HandleTrackAction(action)) 7320 7341 ; 7342 else if (action == "TOGGLEUPMIXER") 7343 ToggleUpmixer(); 7321 7344 else if (action == "TOGGLEMANUALZOOM") 7322 7345 SetManualZoom(true); 7323 7346 else if (action == "TOGGLESTRETCH") … … 7558 7586 QString("TOGGLEPICCONTROLS%1").arg(i)); 7559 7587 } 7560 7588 } 7589 new OSDGenericTree(treeMenu, tr("Toggle Upmixer"), "TOGGLEUPMIXER"); 7561 7590 7562 7591 new OSDGenericTree(treeMenu, tr("Manual Zoom Mode"), "TOGGLEMANUALZOOM"); 7563 7592 -
libs/libmyth/audiooutputbase.h
77 77 /// Audio Buffer Size -- should be divisible by 12,10,8,6,4,2.. 78 78 static const uint kAudioRingBufferSize = 1536000; 79 79 80 virtual bool ToggleUpmixer(const AudioSettings&); 80 81 protected: 81 82 // You need to implement the following functions 82 83 virtual bool OpenDevice(void) = 0; … … 157 158 int source_audio_channels; 158 159 int source_audio_bytes_per_sample; 159 160 bool needs_upmix; 161 bool upmixer_enabled; 160 162 int surround_mode; 161 163 162 164 bool blocking; // do AddSamples calls block? -
libs/libmyth/audiooutputbase.cpp
50 50 source_audio_channels(-1), 51 51 source_audio_bytes_per_sample(0), 52 52 needs_upmix(false), 53 upmixer_enabled(false), 53 54 surround_mode(FreeSurround::SurroundModePassive), 54 55 55 56 blocking(false), … … 194 195 int lsource_audio_channels = settings.channels; 195 196 bool lneeds_upmix = false; 196 197 198 if (!upmixer_enabled) 199 configured_audio_channels = settings.channels; 200 else 201 configured_audio_channels = gContext->GetNumSetting("MaxChannels", 2); 202 197 203 if (settings.codec) 198 204 { 199 205 lcodec_id = ((AVCodecContext*)settings.codec)->codec_id; … … 818 824 return len; 819 825 } 820 826 827 bool AudioOutputBase::ToggleUpmixer(const AudioSettings& settings) 828 { 829 upmixer_enabled = !upmixer_enabled; 830 this->Reconfigure(settings); 831 return upmixer_enabled; 832 } 833 821 834 void AudioOutputBase::_AddSamples(void *buffer, bool interleaved, int samples, 822 835 long long timecode) 823 836 { … … 834 847 835 848 VERBOSE(VB_AUDIO+VB_TIMESTAMP, 836 849 LOC + QString("_AddSamples samples=%1 bytes=%2, used=%3, " 837 "free=%4, timecode=%5 needsupmix %6 ")850 "free=%4, timecode=%5 needsupmix %6 upmixer enabled %7") 838 851 .arg(samples) 839 852 .arg(samples * abps) 840 853 .arg(kAudioRingBufferSize-afree).arg(afree).arg(timecode) 841 .arg(needs_upmix) );854 .arg(needs_upmix).arg(upmixer_enabled)); 842 855 843 856 if (upmixer && needs_upmix) 844 857 { -
libs/libmyth/audiooutput.h
69 69 virtual void bufferOutputData(bool y) = 0; 70 70 virtual int readOutputData(unsigned char *read_buffer, int max_length) = 0; 71 71 72 virtual bool ToggleUpmixer(const AudioSettings&) = 0; 73 72 74 protected: 73 75 void Error(const QString &msg); 74 76 void Warn(const QString &msg); -
programs/mythtranscode/transcode.cpp
166 166 // Do nothing 167 167 return; 168 168 } 169 virtual bool ToggleUpmixer(const AudioSettings&) 170 { 171 return false; 172 }; 169 173 170 174 virtual int GetAudiotime(void) 171 175 {