Ticket #5477: toggleupmixer_v2_fixes_branch.diff
File toggleupmixer_v2_fixes_branch.diff, 7.8 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
3700 3700 audio_codec = ac; 3701 3701 } 3702 3702 3703 bool NuppelVideoPlayer::ToggleUpmixer() 3704 { 3705 if (audioOutput) 3706 { 3707 return audioOutput->ToggleUpmixer( audio_bits, audio_channels, 3708 audio_samplerate, audio_passthru, audio_codec); 3709 } 3710 return false; 3711 } 3712 3703 3713 void NuppelVideoPlayer::SetEffDsp(int dsprate) 3704 3714 { 3705 3715 if (audioOutput) -
libs/libmythtv/tv_play.h
223 223 // Used by EPG 224 224 void ChangeVolume(bool up); 225 225 void ToggleMute(void); 226 void ToggleUpmixer(void); 226 227 227 228 public slots: 228 229 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
348 348 REG_KEY("TV Playback", "VOLUMEDOWN", "Volume down", "[,{,F10,Volume Down"); 349 349 REG_KEY("TV Playback", "VOLUMEUP", "Volume up", "],},F11,Volume Up"); 350 350 REG_KEY("TV Playback", "MUTE", "Mute", "|,\\,F9,Volume Mute"); 351 REG_KEY("TV Playback", "TOGGLEUPMIXER", "Toggle Upmixer", "F12,Toggle Upmixer"); 351 352 REG_KEY("TV Playback", "TOGGLEPIPMODE", "Toggle Picture-in-Picture mode", 352 353 "V"); 353 354 REG_KEY("TV Playback", "TOGGLEPIPWINDOW", "Toggle active PiP window", "B"); … … 2710 2711 else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" || 2711 2712 action == "STRETCHINC" || action == "STRETCHDEC" || 2712 2713 action == "MUTE" || action == "TOGGLEASPECT" || 2713 action == "TOGGLEFILL" )2714 action == "TOGGLEFILL" || action == "TOGGLEUPMIXER") 2714 2715 { 2715 2716 passThru = 1; 2716 2717 handled = false; … … 2765 2766 else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" || 2766 2767 action == "STRETCHINC" || action == "STRETCHDEC" || 2767 2768 action == "MUTE" || action == "PAUSE" || 2768 action == "CLEAROSD" )2769 action == "CLEAROSD" || action == "TOGGLEUPMIXER") 2769 2770 { 2770 2771 passThru = 1; 2771 2772 handled = false; … … 3309 3310 ChangeVolume(true); 3310 3311 else if (action == "MUTE") 3311 3312 ToggleMute(); 3313 else if (action == "TOGGLEUPMIXER") 3314 ToggleUpmixer(); 3312 3315 else if (action == "STRETCHINC") 3313 3316 ChangeTimeStretch(1); 3314 3317 else if (action == "STRETCHDEC") … … 6131 6134 GetOSD()->SetSettingsText(text, 5); 6132 6135 } 6133 6136 6137 void TV::ToggleUpmixer(void) 6138 { 6139 bool state=nvp->ToggleUpmixer(); 6140 6141 QString text; 6142 6143 if(state) 6144 text = tr("Upmixer enabled"); 6145 else 6146 text = tr("Upmixer disabled"); 6147 6148 if (GetOSD() && !browsemode) 6149 GetOSD()->SetSettingsText(text, 5); 6150 } 6151 6134 6152 void TV::ToggleSleepTimer(void) 6135 6153 { 6136 6154 QString text; … … 7278 7296 7279 7297 if (HandleTrackAction(action)) 7280 7298 ; 7299 else if (action == "TOGGLEUPMIXER") 7300 ToggleUpmixer(); 7281 7301 else if (action == "TOGGLEMANUALZOOM") 7282 7302 SetManualZoom(true); 7283 7303 else if (action == "TOGGLESTRETCH") … … 7512 7532 QString("TOGGLEPICCONTROLS%1").arg(i)); 7513 7533 } 7514 7534 } 7535 new OSDGenericTree(treeMenu, tr("Toggle Upmixer"), "TOGGLEUPMIXER"); 7515 7536 7516 7537 item = new OSDGenericTree(treeMenu, tr("Manual Zoom Mode"), 7517 7538 "TOGGLEMANUALZOOM"); -
libs/libmyth/audiooutputbase.h
87 87 virtual void bufferOutputData(bool y){ buffer_output_data_for_use = y; } 88 88 virtual int readOutputData(unsigned char *read_buffer, int max_length); 89 89 90 virtual bool ToggleUpmixer( int audio_bits, 91 int audio_channels, 92 int audio_samplerate, 93 bool audio_passthru, 94 void *audio_codec = NULL); 90 95 protected: 91 96 92 97 // You need to implement the following functions … … 169 174 int source_audio_channels; 170 175 int source_audio_bytes_per_sample; 171 176 bool needs_upmix; 177 bool upmixer_enabled; 172 178 int surround_mode; 173 179 174 180 bool blocking; // do AddSamples calls block? -
libs/libmyth/audiooutputbase.cpp
57 57 source_audio_channels(-1), 58 58 source_audio_bytes_per_sample(0), 59 59 needs_upmix(false), 60 upmixer_enabled(false), 60 61 surround_mode(FreeSurround::SurroundModePassive), 61 62 62 63 blocking(false), … … 195 196 int lsource_audio_channels = laudio_channels; 196 197 bool lneeds_upmix = false; 197 198 199 if (!upmixer_enabled) 200 configured_audio_channels = laudio_channels; 201 else 202 configured_audio_channels = gContext->GetNumSetting("MaxChannels", 2); 203 198 204 if (laudio_codec) 199 205 { 200 206 lcodec_id = ((AVCodecContext*)laudio_codec)->codec_id; … … 846 852 return len; 847 853 } 848 854 855 bool AudioOutputBase::ToggleUpmixer(int laudio_bits, int laudio_channels, 856 int laudio_samplerate, bool laudio_passthru, 857 void *laudio_codec) 858 { 859 upmixer_enabled = !upmixer_enabled; 860 this->Reconfigure(laudio_bits, laudio_channels, 861 laudio_samplerate, laudio_passthru, laudio_codec); 862 return upmixer_enabled; 863 } 864 849 865 void AudioOutputBase::_AddSamples(void *buffer, bool interleaved, int samples, 850 866 long long timecode) 851 867 { -
libs/libmyth/audiooutput.h
74 74 virtual void bufferOutputData(bool y) = 0; 75 75 virtual int readOutputData(unsigned char *read_buffer, int max_length) = 0; 76 76 77 virtual bool ToggleUpmixer( int audio_bits, 78 int audio_channels, 79 int audio_samplerate, 80 bool audio_passthru, 81 void* audio_codec = NULL) = 0; 82 77 83 protected: 78 84 void Error(QString msg) 79 85 { -
programs/mythtranscode/transcode.cpp
166 166 // Do nothing 167 167 return; 168 168 } 169 virtual bool ToggleUpmixer( int audio_bits, 170 int audio_channels, 171 int audio_samplerate, 172 bool audio_passthru, 173 void* audio_codec = NULL) 174 { 175 return false; 176 }; 169 177 170 178 virtual int GetAudiotime(void) 171 179 {