From: <man...@us...> - 2013-07-06 22:27:16
|
Revision: 2510 http://sourceforge.net/p/modplug/code/2510 Author: manxorist Date: 2013-07-06 22:27:05 +0000 (Sat, 06 Jul 2013) Log Message: ----------- [Mod] libopenmpt: Merge up and down volume ramping settings into a single volume ramping strength setting with not exactly defined semantics (should roughly map to milliseconds though). More fine-grained settings will be added again later via the ctl interface. [Mod] xmp-openmpt / in_openmpt: Adjust settings dialog accordingly. [Mod] openmpt123: Replace --volrampin and --volrampout with --ramping. [Ref] openmpt123: --buffer command line argument is only meaningful when portaudio is available. Do not support it otherwise. [Ref] openmpt123: Project file cleanup. Modified Paths: -------------- trunk/OpenMPT/libopenmpt/SettingsForm.h trunk/OpenMPT/libopenmpt/libopenmpt.h trunk/OpenMPT/libopenmpt/libopenmpt.hpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/libopenmpt/libopenmpt_settings.cpp trunk/OpenMPT/libopenmpt/libopenmpt_settings.h trunk/OpenMPT/libopenmpt/libopenmpt_winamp.cpp trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp trunk/OpenMPT/openmpt123/openmpt123.cpp trunk/OpenMPT/openmpt123/openmpt123.hpp trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters Modified: trunk/OpenMPT/libopenmpt/SettingsForm.h =================================================================== --- trunk/OpenMPT/libopenmpt/SettingsForm.h 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/SettingsForm.h 2013-07-06 22:27:05 UTC (rev 2510) @@ -73,8 +73,7 @@ trackBarStereoSeparation->Value = settings->stereoseparation; - trackBarVolrampin->Value = settings->volrampinus; - trackBarVolrampout->Value = settings->volrampoutus; + trackBarVolramping->Value = settings->ramping; // //TODO: Add the constructor code here @@ -108,12 +107,14 @@ private: System::Windows::Forms::ComboBox^ comboBoxRepeat; private: System::Windows::Forms::Label^ labelStereoSeparation; private: System::Windows::Forms::TrackBar^ trackBarStereoSeparation; - private: System::Windows::Forms::Label^ labelVolrampin; - private: System::Windows::Forms::Label^ labelVolrampout; - private: System::Windows::Forms::TrackBar^ trackBarVolrampin; - private: System::Windows::Forms::TrackBar^ trackBarVolrampout; + private: System::Windows::Forms::Label^ labelVolramping; + private: System::Windows::Forms::TrackBar^ trackBarVolramping; + + + + protected: private: @@ -142,14 +143,11 @@ this->comboBoxRepeat = (gcnew System::Windows::Forms::ComboBox()); this->labelStereoSeparation = (gcnew System::Windows::Forms::Label()); this->trackBarStereoSeparation = (gcnew System::Windows::Forms::TrackBar()); - this->labelVolrampin = (gcnew System::Windows::Forms::Label()); - this->labelVolrampout = (gcnew System::Windows::Forms::Label()); - this->trackBarVolrampin = (gcnew System::Windows::Forms::TrackBar()); - this->trackBarVolrampout = (gcnew System::Windows::Forms::TrackBar()); + this->labelVolramping = (gcnew System::Windows::Forms::Label()); + this->trackBarVolramping = (gcnew System::Windows::Forms::TrackBar()); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarGain))->BeginInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarStereoSeparation))->BeginInit(); - (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampin))->BeginInit(); - (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampout))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolramping))->BeginInit(); this->SuspendLayout(); // // comboBoxSamplerate @@ -173,7 +171,7 @@ // // buttonOK // - this->buttonOK->Location = System::Drawing::Point(15, 309); + this->buttonOK->Location = System::Drawing::Point(15, 261); this->buttonOK->Name = L"buttonOK"; this->buttonOK->Size = System::Drawing::Size(212, 23); this->buttonOK->TabIndex = 2; @@ -287,50 +285,26 @@ this->trackBarStereoSeparation->Value = 100; this->trackBarStereoSeparation->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarStereoSeparation_Scroll); // - // labelVolrampin + // labelVolramping // - this->labelVolrampin->AutoSize = true; - this->labelVolrampin->Location = System::Drawing::Point(12, 226); - this->labelVolrampin->Name = L"labelVolrampin"; - this->labelVolrampin->Size = System::Drawing::Size(78, 13); - this->labelVolrampin->TabIndex = 15; - this->labelVolrampin->Text = L"volume ramp in"; + this->labelVolramping->AutoSize = true; + this->labelVolramping->Location = System::Drawing::Point(12, 226); + this->labelVolramping->Name = L"labelVolramping"; + this->labelVolramping->Size = System::Drawing::Size(81, 13); + this->labelVolramping->TabIndex = 15; + this->labelVolramping->Text = L"volume ramping"; // - // labelVolrampout + // trackBarVolramping // - this->labelVolrampout->AutoSize = true; - this->labelVolrampout->Location = System::Drawing::Point(12, 273); - this->labelVolrampout->Name = L"labelVolrampout"; - this->labelVolrampout->Size = System::Drawing::Size(85, 13); - this->labelVolrampout->TabIndex = 16; - this->labelVolrampout->Text = L"volume ramp out"; + this->trackBarVolramping->LargeChange = 1; + this->trackBarVolramping->Location = System::Drawing::Point(106, 213); + this->trackBarVolramping->Name = L"trackBarVolramping"; + this->trackBarVolramping->Size = System::Drawing::Size(121, 42); + this->trackBarVolramping->TabIndex = 17; + this->trackBarVolramping->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarVolramping->Value = 1; + this->trackBarVolramping->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarVolramping_Scroll); // - // trackBarVolrampin - // - this->trackBarVolrampin->LargeChange = 1000; - this->trackBarVolrampin->Location = System::Drawing::Point(106, 213); - this->trackBarVolrampin->Maximum = 10000; - this->trackBarVolrampin->Name = L"trackBarVolrampin"; - this->trackBarVolrampin->Size = System::Drawing::Size(121, 42); - this->trackBarVolrampin->TabIndex = 17; - this->trackBarVolrampin->TickFrequency = 1000; - this->trackBarVolrampin->TickStyle = System::Windows::Forms::TickStyle::Both; - this->trackBarVolrampin->Value = 363; - this->trackBarVolrampin->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarVolrampin_Scroll); - // - // trackBarVolrampout - // - this->trackBarVolrampout->LargeChange = 1000; - this->trackBarVolrampout->Location = System::Drawing::Point(106, 261); - this->trackBarVolrampout->Maximum = 10000; - this->trackBarVolrampout->Name = L"trackBarVolrampout"; - this->trackBarVolrampout->Size = System::Drawing::Size(121, 42); - this->trackBarVolrampout->TabIndex = 18; - this->trackBarVolrampout->TickFrequency = 1000; - this->trackBarVolrampout->TickStyle = System::Windows::Forms::TickStyle::Both; - this->trackBarVolrampout->Value = 952; - this->trackBarVolrampout->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarVolrampout_Scroll); - // // SettingsForm // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); @@ -338,10 +312,8 @@ this->AutoSize = true; this->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink; this->ClientSize = System::Drawing::Size(436, 477); - this->Controls->Add(this->trackBarVolrampout); - this->Controls->Add(this->trackBarVolrampin); - this->Controls->Add(this->labelVolrampout); - this->Controls->Add(this->labelVolrampin); + this->Controls->Add(this->trackBarVolramping); + this->Controls->Add(this->labelVolramping); this->Controls->Add(this->trackBarStereoSeparation); this->Controls->Add(this->labelStereoSeparation); this->Controls->Add(this->comboBoxRepeat); @@ -365,8 +337,7 @@ this->Text = L"SettingsForm"; (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarGain))->EndInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarStereoSeparation))->EndInit(); - (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampin))->EndInit(); - (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampout))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolramping))->EndInit(); this->ResumeLayout(false); this->PerformLayout(); @@ -427,13 +398,9 @@ settings->stereoseparation = (int)trackBarStereoSeparation->Value; settings->changed(); } -private: System::Void trackBarVolrampin_Scroll(System::Object^ sender, System::EventArgs^ e) { - settings->volrampinus = (int)trackBarVolrampin->Value; +private: System::Void trackBarVolramping_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->ramping = (int)trackBarVolramping->Value; settings->changed(); } -private: System::Void trackBarVolrampout_Scroll(System::Object^ sender, System::EventArgs^ e) { - settings->volrampoutus = (int)trackBarVolrampout->Value; - settings->changed(); - } }; } Modified: trunk/OpenMPT/libopenmpt/libopenmpt.h =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.h 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/libopenmpt.h 2013-07-06 22:27:05 UTC (rev 2510) @@ -67,8 +67,7 @@ #define OPENMPT_MODULE_RENDER_MASTERGAIN_MILLIBEL 1 #define OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT 2 #define OPENMPT_MODULE_RENDER_INTERPOLATION_FILTER_LENGTH 3 -#define OPENMPT_MODULE_RENDER_VOLUMERAMP_UP_MICROSECONDS 4 -#define OPENMPT_MODULE_RENDER_VOLUMERAMP_DOWN_MICROSECONDS 5 +#define OPENMPT_MODULE_RENDER_VOLUMERAMPING_STRENGTH 4 #define OPENMPT_MODULE_COMMAND_NOTE 0 #define OPENMPT_MODULE_COMMAND_INSTRUMENT 1 Modified: trunk/OpenMPT/libopenmpt/libopenmpt.hpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.hpp 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/libopenmpt.hpp 2013-07-06 22:27:05 UTC (rev 2510) @@ -77,8 +77,7 @@ RENDER_MASTERGAIN_MILLIBEL = 1, RENDER_STEREOSEPARATION_PERCENT = 2, RENDER_INTERPOLATION_FILTER_LENGTH = 3, - RENDER_VOLUMERAMP_UP_MICROSECONDS = 4, - RENDER_VOLUMERAMP_DOWN_MICROSECONDS = 5 + RENDER_VOLUMERAMPING_STRENGTH = 4, }; enum command_index { Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2013-07-06 22:27:05 UTC (rev 2510) @@ -129,6 +129,32 @@ } } +static void ramping_to_mixersettings( MixerSettings & settings, int ramping ) { + if ( ramping == -1 ) { + settings.SetVolumeRampUpMicroseconds( MixerSettings().GetVolumeRampUpMicroseconds() ); + settings.SetVolumeRampDownMicroseconds( MixerSettings().GetVolumeRampDownMicroseconds() ); + } else if ( ramping <= 0 ) { + settings.SetVolumeRampUpMicroseconds( 0 ); + settings.SetVolumeRampDownMicroseconds( 0 ); + } else { + settings.SetVolumeRampUpMicroseconds( ramping * 1000 ); + settings.SetVolumeRampDownMicroseconds( ramping * 1000 ); + } +} +static void mixersettings_to_ramping( int & ramping, const MixerSettings & settings ) { + std::int32_t ramp_us = std::max<std::int32_t>( settings.GetVolumeRampUpMicroseconds(), settings.GetVolumeRampDownMicroseconds() ); + if ( true + && settings.GetVolumeRampUpMicroseconds() == MixerSettings().GetVolumeRampUpMicroseconds() + && settings.GetVolumeRampDownMicroseconds() == MixerSettings().GetVolumeRampDownMicroseconds() + ) { + ramping = -1; + } else if ( ramp_us <= 0 ) { + ramping = 0; + } else { + ramping = ( ramp_us + 500 ) / 1000; + } +} + void module_impl::apply_mixer_settings( std::int32_t samplerate, int channels, bool format_float ) { SampleFormat format = ( format_float ? SampleFormatFloat32 : SampleFormatInt16 ); if ( @@ -327,12 +353,11 @@ case module::RENDER_INTERPOLATION_FILTER_LENGTH: { return resamplingmode_to_filterlength( m_sndFile->m_Resampler.m_Settings.SrcMode ); } break; - case module::RENDER_VOLUMERAMP_UP_MICROSECONDS: { - return m_sndFile->m_MixerSettings.GetVolumeRampUpMicroseconds(); + case module::RENDER_VOLUMERAMPING_STRENGTH: { + int ramping = 0; + mixersettings_to_ramping( ramping, m_sndFile->m_MixerSettings ); + return ramping; } break; - case module::RENDER_VOLUMERAMP_DOWN_MICROSECONDS: { - return m_sndFile->m_MixerSettings.GetVolumeRampDownMicroseconds(); - } break; default: throw openmpt::exception("unknown render param"); break; } return 0; @@ -362,20 +387,13 @@ m_sndFile->SetResamplerSettings( newsettings ); } } break; - case module::RENDER_VOLUMERAMP_UP_MICROSECONDS: { + case module::RENDER_VOLUMERAMPING_STRENGTH: { MixerSettings newsettings = m_sndFile->m_MixerSettings; - newsettings.SetVolumeRampUpMicroseconds( value ); - if ( m_sndFile->m_MixerSettings.glVolumeRampUpSamples != newsettings.glVolumeRampUpSamples ) { + ramping_to_mixersettings( newsettings, value ); + if ( m_sndFile->m_MixerSettings.glVolumeRampUpSamples != newsettings.glVolumeRampUpSamples || m_sndFile->m_MixerSettings.glVolumeRampDownSamples != newsettings.glVolumeRampDownSamples ) { m_sndFile->SetMixerSettings( newsettings ); } } break; - case module::RENDER_VOLUMERAMP_DOWN_MICROSECONDS: { - MixerSettings newsettings = m_sndFile->m_MixerSettings; - newsettings.SetVolumeRampDownMicroseconds( value ); - if ( m_sndFile->m_MixerSettings.glVolumeRampDownSamples != newsettings.glVolumeRampDownSamples ) { - m_sndFile->SetMixerSettings( newsettings ); - } - } break; default: throw openmpt::exception("unknown render param"); break; } } Modified: trunk/OpenMPT/libopenmpt/libopenmpt_settings.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_settings.cpp 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/libopenmpt_settings.cpp 2013-07-06 22:27:05 UTC (rev 2510) @@ -15,7 +15,7 @@ namespace openmpt { namespace settings { - + static void read_setting( const char * subkey, const char * key, int & val ) { System::String ^ net_root = "HKEY_CURRENT_USER\\Software\\libopenmpt\\"; System::String ^ net_path = gcnew System::String( subkey ); @@ -42,8 +42,7 @@ read_setting( subkey, "SeteroSeparation_Percent", s.stereoseparation ); read_setting( subkey, "RepeatCount", s.repeatcount ); read_setting( subkey, "InterpolationFilterLength", s.interpolationfilterlength ); - read_setting( subkey, "VolumeRampingIn_microseconds", s.volrampinus ); - read_setting( subkey, "VolumeRampingOut_microseconds", s.volrampoutus ); + read_setting( subkey, "VolumeRampingStrength", s.ramping ); } void save( const settings & s, const char * subkey ) { @@ -53,8 +52,7 @@ write_setting( subkey, "SeteroSeparation_Percent", s.stereoseparation ); write_setting( subkey, "RepeatCount", s.repeatcount ); write_setting( subkey, "InterpolationFilterLength", s.interpolationfilterlength ); - write_setting( subkey, "VolumeRampingIn_microseconds", s.volrampinus ); - write_setting( subkey, "VolumeRampingOut_microseconds", s.volrampoutus ); + write_setting( subkey, "VolumeRampingStrength", s.ramping ); } void edit( settings & s, HWND parent, const char * title ) { @@ -63,4 +61,5 @@ form->Show(w); } + } } // namespace openmpt::settings Modified: trunk/OpenMPT/libopenmpt/libopenmpt_settings.h =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_settings.h 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/libopenmpt_settings.h 2013-07-06 22:27:05 UTC (rev 2510) @@ -38,8 +38,7 @@ int stereoseparation; int repeatcount; int interpolationfilterlength; - int volrampinus; - int volrampoutus; + int ramping; changed_func changed; }; @@ -51,8 +50,7 @@ s.stereoseparation = 100; s.repeatcount = 0; s.interpolationfilterlength = 8; - s.volrampinus = 363; - s.volrampoutus = 952; + s.ramping = 1; s.changed = 0; } Modified: trunk/OpenMPT/libopenmpt/libopenmpt_winamp.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_winamp.cpp 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/libopenmpt_winamp.cpp 2013-07-06 22:27:05 UTC (rev 2510) @@ -100,8 +100,7 @@ self->mod->set_render_param( openmpt::module::RENDER_MASTERGAIN_MILLIBEL, self->settings.mastergain_millibel ); self->mod->set_render_param( openmpt::module::RENDER_STEREOSEPARATION_PERCENT, self->settings.stereoseparation ); self->mod->set_render_param( openmpt::module::RENDER_INTERPOLATION_FILTER_LENGTH, self->settings.interpolationfilterlength ); - self->mod->set_render_param( openmpt::module::RENDER_VOLUMERAMP_UP_MICROSECONDS, self->settings.volrampinus ); - self->mod->set_render_param( openmpt::module::RENDER_VOLUMERAMP_DOWN_MICROSECONDS, self->settings.volrampoutus ); + self->mod->set_render_param( openmpt::module::RENDER_VOLUMERAMPING_STRENGTH, self->settings.ramping ); } if ( settings_dll ) { openmpt::settings::save( self->settings, SHORT_TITLE ); Modified: trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp 2013-07-06 22:27:05 UTC (rev 2510) @@ -84,8 +84,7 @@ result[ "SeteroSeparation_Percent" ] = s.stereoseparation; result[ "RepeatCount" ] = s.repeatcount; result[ "InterpolationFilterLength" ] = s.interpolationfilterlength; - result[ "VolumeRampingIn_microseconds" ] = s.volrampinus; - result[ "VolumeRampingOut_microseconds" ] = s.volrampoutus; + result[ "VolumeRampingStrength" ] = s.ramping; } static inline void load_map_setting( const std::map<std::string,int> & map, const std::string & key, int & val ) { @@ -102,8 +101,7 @@ load_map_setting( map, "SeteroSeparation_Percent", s.stereoseparation ); load_map_setting( map, "RepeatCount", s.repeatcount ); load_map_setting( map, "InterpolationFilterLength", s.interpolationfilterlength ); - load_map_setting( map, "VolumeRampingIn_microseconds", s.volrampinus ); - load_map_setting( map, "VolumeRampingOut_microseconds", s.volrampoutus ); + load_map_setting( map, "VolumeRampingStrength", s.ramping ); } static void load_settings_from_xml( openmpt::settings::settings & s, const std::string & xml ) { @@ -136,8 +134,7 @@ self->mod->set_render_param( openmpt::module::RENDER_MASTERGAIN_MILLIBEL, self->settings.mastergain_millibel ); self->mod->set_render_param( openmpt::module::RENDER_STEREOSEPARATION_PERCENT, self->settings.stereoseparation ); self->mod->set_render_param( openmpt::module::RENDER_INTERPOLATION_FILTER_LENGTH, self->settings.interpolationfilterlength ); - self->mod->set_render_param( openmpt::module::RENDER_VOLUMERAMP_UP_MICROSECONDS, self->settings.volrampinus ); - self->mod->set_render_param( openmpt::module::RENDER_VOLUMERAMP_DOWN_MICROSECONDS, self->settings.volrampoutus ); + self->mod->set_render_param( openmpt::module::RENDER_VOLUMERAMPING_STRENGTH, self->settings.ramping ); } } Modified: trunk/OpenMPT/openmpt123/openmpt123.cpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.cpp 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/openmpt123/openmpt123.cpp 2013-07-06 22:27:05 UTC (rev 2510) @@ -93,13 +93,14 @@ s << "Show progress: " << flags.show_progress << std::endl; #ifdef MPT_WITH_PORTAUDIO s << "Device: " << flags.device << std::endl; + s << "Buffer: " << flags.buffer << std::endl; #endif s << "Channels: " << flags.channels << std::endl; - s << "Buffer: " << flags.buffer << std::endl; s << "Repeat count: " << flags.repeatcount << std::endl; s << "Sample rate: " << flags.samplerate << std::endl; s << "Gain: " << flags.gain / 100.0 << std::endl; s << "Filter taps: " << flags.filtertaps << std::endl; + s << "Volume ramping strength: " << flags.ramping << std::endl; s << "Seek target: " << flags.seek_target << std::endl; s << "Float: " << flags.use_float << std::endl; s << "Standard output: " << flags.use_stdout << std::endl; @@ -218,6 +219,7 @@ #ifdef MPT_WITH_PORTAUDIO std::clog << " --device n Set output device [default: " << get_device_string( commandlineflags().device ) << "]," << std::endl; std::clog << " use --device help to show available devices" << std::endl; + std::clog << " --buffer n Set output buffer size to n ms [default: " << commandlineflags().buffer << "]" << std::endl; #endif std::clog << " --stdout Write raw audio data to stdout [default: " << commandlineflags().use_stdout << "]" << std::endl; #if defined(MPT_WITH_FLAC) || defined(MPT_WITH_MMIO) || defined(MPT_WITH_SNDFILE) @@ -226,14 +228,12 @@ #endif std::clog << " --channels n use n [1,2,4] output channels [default: " << commandlineflags().channels << "]" << std::endl; std::clog << " --[no]-float Output 32bit floating point instead of 16bit integer [default: " << commandlineflags().use_float << "]" << std::endl; - std::clog << " --buffer n Set output buffer size to n ms [default: " << commandlineflags().buffer << "]," << std::endl; std::clog << " --samplerate n Set samplerate to n Hz [default: " << commandlineflags().samplerate << "]" << std::endl; std::clog << " --gain n Set output gain to n dB [default: " << commandlineflags().gain / 100.0 << "]" << std::endl; std::clog << " --repeat n Repeat song n times (-1 means forever) [default: " << commandlineflags().repeatcount << "]" << std::endl; std::clog << " --filtertaps n Set interpolation filter taps to n % [default: " << commandlineflags().filtertaps << "]" << std::endl; std::clog << " --seek n Seek to n seconds on start [default: " << commandlineflags().seek_target << "]" << std::endl; - std::clog << " --volrampup n Use n microseconds volume ramping up [default: " << commandlineflags().rampupus << "]" << std::endl; - std::clog << " --volrampdown n Use n microseconds volume ramping down [default: " << commandlineflags().rampdownus << "]" << std::endl; + std::clog << " --ramping n Set volume ramping strength n [0..5] [default: " << commandlineflags().ramping << "]" << std::endl; std::clog << std::endl; std::clog << " -- Interpret further arguments as filenames" << std::endl; std::clog << std::endl; @@ -475,8 +475,7 @@ mod.set_render_param( openmpt::module::RENDER_INTERPOLATION_FILTER_LENGTH, flags.filtertaps ); mod.set_render_param( openmpt::module::RENDER_MASTERGAIN_MILLIBEL, flags.gain ); - mod.set_render_param( openmpt::module::RENDER_VOLUMERAMP_UP_MICROSECONDS, flags.rampupus ); - mod.set_render_param( openmpt::module::RENDER_VOLUMERAMP_DOWN_MICROSECONDS, flags.rampdownus ); + mod.set_render_param( openmpt::module::RENDER_VOLUMERAMPING_STRENGTH, flags.ramping ); render_mod_file( flags, filename, mod, log, audio_stream ); @@ -599,6 +598,12 @@ #endif } ++i; +#ifdef MPT_WITH_PORTAUDIO + } else if ( arg == "--buffer" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.buffer; + ++i; +#endif } else if ( arg == "--stdout" ) { flags.use_stdout = true; #if defined(MPT_WITH_FLAC) || defined(MPT_WITH_MMIO) || defined(MPT_WITH_SNDFILE) @@ -616,10 +621,6 @@ flags.use_float = true; } else if ( arg == "--no-float" ) { flags.use_float = false; - } else if ( arg == "--buffer" && nextarg != "" ) { - std::istringstream istr( nextarg ); - istr >> flags.buffer; - ++i; } else if ( arg == "--samplerate" && nextarg != "" ) { std::istringstream istr( nextarg ); istr >> flags.samplerate; @@ -642,14 +643,10 @@ std::istringstream istr( nextarg ); istr >> flags.seek_target; ++i; - } else if ( arg == "--volrampup" && nextarg != "" ) { + } else if ( arg == "--ramping" && nextarg != "" ) { std::istringstream istr( nextarg ); - istr >> flags.rampupus; + istr >> flags.ramping; ++i; - } else if ( arg == "--volrampdown" && nextarg != "" ) { - std::istringstream istr( nextarg ); - istr >> flags.rampdownus; - ++i; } else if ( arg == "--runtests" ) { flags.run_tests = true; } else if ( arg.size() > 0 && arg.substr( 0, 1 ) == "-" ) { Modified: trunk/OpenMPT/openmpt123/openmpt123.hpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.hpp 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/openmpt123/openmpt123.hpp 2013-07-06 22:27:05 UTC (rev 2510) @@ -62,16 +62,15 @@ bool modplug123; #ifdef MPT_WITH_PORTAUDIO int device; + std::int32_t buffer; #endif std::int32_t channels; - std::int32_t buffer; std::int32_t repeatcount; std::int32_t samplerate; std::int32_t gain; std::int32_t quality; std::int32_t filtertaps; - std::int32_t rampupus; - std::int32_t rampdownus; + int ramping; // ramping strength : -1:default 0:off 1 2 3 4 5 // roughly milliseconds bool quiet; bool verbose; bool use_ui; @@ -91,16 +90,15 @@ modplug123 = false; #ifdef MPT_WITH_PORTAUDIO device = -1; + buffer = 250; #endif channels = 2; - buffer = 250; repeatcount = 0; samplerate = 48000; gain = 0; quality = 100; filtertaps = 8; - rampupus = ( 16 * 1000000 + ( 44100 / 2 ) ) / 44100; // openmpt defaults at 44KHz, rounded - rampdownus = ( 42 * 1000000 + ( 44100 / 2 ) ) / 44100; // openmpt defaults at 44KHz, rounded + ramping = -1; quiet = false; verbose = false; show_info = true; Modified: trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters 2013-07-06 18:35:25 UTC (rev 2509) +++ trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters 2013-07-06 22:27:05 UTC (rev 2510) @@ -9,10 +9,6 @@ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> </Filter> - <Filter Include="Resource Files"> - <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> - </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="openmpt123.cpp"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |