Ticket #5477: toggleupmixer_v2_trunk@18320.diff
File toggleupmixer_v2_trunk@18320.diff, 8.0 KB (added by , 16 years ago) |
---|
-
mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
3753 3753 audio_codec = ac; 3754 3754 } 3755 3755 3756 bool NuppelVideoPlayer::ToggleUpmixer() 3757 { 3758 if (audioOutput) 3759 { 3760 const AudioSettings settings( 3761 audio_bits, audio_channels, audio_samplerate, 3762 audio_passthru, audio_codec); 3763 return audioOutput->ToggleUpmixer(settings); 3764 } 3765 return false; 3766 } 3767 3756 3768 void NuppelVideoPlayer::SetEffDsp(int dsprate) 3757 3769 { 3758 3770 if (audioOutput) -
mythtv/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 // Used for UDPNotify 244 245 bool HasUDPNotifyEvent(void) const; -
mythtv/libs/libmythtv/tv_play.cpp
380 380 REG_KEY("TV Playback", "VOLUMEDOWN", "Volume down", "[,{,F10,Volume Down"); 381 381 REG_KEY("TV Playback", "VOLUMEUP", "Volume up", "],},F11,Volume Up"); 382 382 REG_KEY("TV Playback", "MUTE", "Mute", "|,\\,F9,Volume Mute"); 383 REG_KEY("TV Playback", "TOGGLEUPMIXER", "Toggle Upmixer", "F12,Toggle Upmixer"); 383 384 REG_KEY("TV Playback", "TOGGLEPIPMODE", "Toggle Picture-in-Picture mode", 384 385 "V"); 385 386 REG_KEY("TV Playback", "TOGGLEPIPWINDOW", "Toggle active PiP window", "B"); … … 2768 2769 else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" || 2769 2770 action == "STRETCHINC" || action == "STRETCHDEC" || 2770 2771 action == "MUTE" || action == "TOGGLEASPECT" || 2771 action == "TOGGLEFILL" )2772 action == "TOGGLEFILL" || action == "TOGGLEUPMIXER") 2772 2773 { 2773 2774 passThru = 1; 2774 2775 handled = false; … … 2823 2824 else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" || 2824 2825 action == "STRETCHINC" || action == "STRETCHDEC" || 2825 2826 action == "MUTE" || action == "PAUSE" || 2826 action == "CLEAROSD" )2827 action == "CLEAROSD" || action == "TOGGLEUPMIXER") 2827 2828 { 2828 2829 passThru = 1; 2829 2830 handled = false; … … 3390 3391 ChangeVolume(true); 3391 3392 else if (action == "MUTE") 3392 3393 ToggleMute(); 3394 else if (action == "TOGGLEUPMIXER") 3395 ToggleUpmixer(); 3393 3396 else if (action == "STRETCHINC") 3394 3397 ChangeTimeStretch(1); 3395 3398 else if (action == "STRETCHDEC") … … 6177 6180 GetOSD()->SetSettingsText(text, 5); 6178 6181 } 6179 6182 6183 void TV::ToggleUpmixer(void) 6184 { 6185 bool state=nvp->ToggleUpmixer(); 6186 6187 QString text; 6188 6189 if(state) 6190 text = tr("Upmixer enabled"); 6191 else 6192 text = tr("Upmixer disabled"); 6193 6194 if (GetOSD() && !browsemode) 6195 GetOSD()->SetSettingsText(text, 5); 6196 } 6197 6180 6198 void TV::ToggleSleepTimer(void) 6181 6199 { 6182 6200 QString text; … … 7394 7412 7395 7413 if (HandleTrackAction(action)) 7396 7414 ; 7415 else if (action == "TOGGLEUPMIXER") 7416 ToggleUpmixer(); 7397 7417 else if (action == "TOGGLEMANUALZOOM") 7398 7418 SetManualZoom(true); 7399 7419 else if (action == "TOGGLESTRETCH") … … 7634 7654 QString("TOGGLEPICCONTROLS%1").arg(i)); 7635 7655 } 7636 7656 } 7657 new OSDGenericTree(treeMenu, tr("Toggle Upmixer"), "TOGGLEUPMIXER"); 7637 7658 7638 7659 new OSDGenericTree(treeMenu, tr("Manual Zoom Mode"), "TOGGLEMANUALZOOM"); 7639 7660 -
mythtv/libs/libmythtv/NuppelVideoPlayer.h
127 127 void SetAudioParams(int bits, int channels, int samplerate, bool passthru); 128 128 void SetEffDsp(int dsprate); 129 129 void SetAudioCodec(void *ac); 130 bool ToggleUpmixer(); 130 131 131 132 // Sets 132 133 void SetParentWidget(QWidget *widget) { parentWidget = widget; } -
mythtv/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? -
mythtv/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 { -
mythtv/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); -
mythtv/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 {